v2.10.2 705579a

remotes.md RawHistoryFolder

Remotes Commands

Manage saved remote Gordon instances for easier CLI usage.

gordon remotes

Subcommands

Subcommand Description
list List saved remotes
add Add a new remote
remove Remove a saved remote
use Set active remote
set-token Set or update token for a remote

gordon remotes list

List all saved remotes.

gordon remotes list

Output

Saved Remotes

Name            URL                                    Token           Status
-------------------------------------------------------------------------------
prod            https://gordon.mydomain.com            $PROD_TOKEN     active
staging         https://staging.mydomain.com           set
dev             https://dev.mydomain.com               none

gordon remotes add

Add a new remote.

gordon remotes add <name> <url> [options]

Arguments

Argument Description
<name> Name for the remote (e.g., prod, staging)
<url> Gordon URL (the gordon_domain from remote config)

Options

Option Description
--token Store token directly in config
--token-env Store environment variable name (token resolved at runtime)

Examples

# Basic (no token)
gordon remotes add prod https://gordon.mydomain.com

# With direct token
gordon remotes add prod https://gordon.mydomain.com --token eyJ...

# With environment variable reference (recommended)
gordon remotes add prod https://gordon.mydomain.com --token-env PROD_TOKEN

Token Security

Option 1: Environment Variable Reference (Recommended)

gordon remotes add prod https://gordon.mydomain.com --token-env PROD_TOKEN

The remotes.toml stores only the variable name:

[remotes.prod]
url = "https://gordon.mydomain.com"
token_env = "PROD_TOKEN"

At runtime, Gordon reads $PROD_TOKEN from the environment.

Option 2: Direct Token Storage

gordon remotes add prod https://gordon.mydomain.com --token eyJ...

The token is stored directly in ~/.config/gordon/remotes.toml. Ensure restricted permissions:

chmod 600 ~/.config/gordon/remotes.toml

gordon remotes remove

Remove a saved remote.

gordon remotes remove <name>
gordon remotes remove <name> --force  # Skip confirmation

Arguments

Argument Description
<name> Name of the remote to remove

Options

Option Description
--force Skip confirmation prompt

Example

gordon remotes remove staging

gordon remotes use

Set the active remote.

gordon remotes use <name>

Arguments

Argument Description
<name> Name of the remote to set as active

Description

When a remote is active, it's used automatically for all remote-capable commands without needing to specify --remote and --token:

gordon remotes use prod
gordon routes list              # Uses prod remote automatically
gordon secrets list app.com     # Uses prod remote automatically

Example

gordon remotes use prod

gordon remotes set-token

Set or update the authentication token for a saved remote.

gordon remotes set-token <name> <token>

Arguments

Argument Description
<name> Name of the remote
<token> The JWT token to set

Description

This command is useful when:

  • The server uses token-based authentication (not password auth)
  • You have a pre-generated token from gordon auth token generate
  • You want to update an expired token

For servers with password authentication, use gordon auth login instead.

Examples

# Set token for prod remote
gordon remotes set-token prod eyJhbGciOiJIUzI1NiIs...

# Set token from file
gordon remotes set-token staging $(cat token.txt)

# Set token from environment variable
gordon remotes set-token prod "$GORDON_TOKEN"

Output

✓ Token updated for remote 'prod'

Configuration File

Remotes are stored in ~/.config/gordon/remotes.toml:

active = "prod"

[remotes.prod]
url = "https://gordon.mydomain.com"
token_env = "PROD_TOKEN"

[remotes.staging]
url = "https://staging.mydomain.com"
token = "eyJ..."

Resolution Precedence

When multiple sources specify remote or token, the CLI uses this priority:

Remote URL:

  1. --remote flag
  2. GORDON_REMOTE environment variable
  3. Active remote from remotes.toml

Token:

  1. --token flag
  2. GORDON_TOKEN environment variable
  3. Token from active remote in remotes.toml

This allows overriding specific values while keeping defaults:

# Active remote is prod, but use different token
gordon routes list --token $TEMPORARY_TOKEN

Workflow Examples

Multi-Environment Setup

# Add all environments
gordon remotes add prod https://gordon.example.com --token-env PROD_TOKEN
gordon remotes add staging https://gordon.staging.example.com --token-env STAGING_TOKEN
gordon remotes add dev https://gordon.dev.example.com --token-env DEV_TOKEN

# Work with prod
gordon remotes use prod
gordon routes list
gordon secrets list myapp.example.com

# Switch to staging
gordon remotes use staging
gordon routes list

CI/CD Pipeline

# GitHub Actions example
env:
  GORDON_REMOTE: ${{ secrets.GORDON_URL }}
  GORDON_TOKEN: ${{ secrets.GORDON_TOKEN }}

steps:
  - name: Deploy to Gordon
    run: |
      gordon routes deploy myapp.example.com

Compare Environments

# Compare routes across environments
gordon routes list --remote https://gordon.example.com --token $PROD_TOKEN
gordon routes list --remote https://gordon.staging.example.com --token $STAGING_TOKEN

# Or switch between active remotes
gordon remotes use prod && gordon routes list
gordon remotes use staging && gordon routes list
source
1# Remotes Commands
2
3Manage saved remote Gordon instances for easier CLI usage.
4
5## gordon remotes
6
7### Subcommands
8
9| Subcommand | Description |
10|------------|-------------|
11| `list` | List saved remotes |
12| `add` | Add a new remote |
13| `remove` | Remove a saved remote |
14| `use` | Set active remote |
15| `set-token` | Set or update token for a remote |
16
17---
18
19## gordon remotes list
20
21List all saved remotes.
22
23```bash
24gordon remotes list
25```
26
27### Output
28
29```
30Saved Remotes
31
32Name            URL                                    Token           Status
33-------------------------------------------------------------------------------
34prod            https://gordon.mydomain.com            $PROD_TOKEN     active
35staging         https://staging.mydomain.com           set
36dev             https://dev.mydomain.com               none
37```
38
39---
40
41## gordon remotes add
42
43Add a new remote.
44
45```bash
46gordon remotes add <name> <url> [options]
47```
48
49### Arguments
50
51| Argument | Description |
52|----------|-------------|
53| `<name>` | Name for the remote (e.g., `prod`, `staging`) |
54| `<url>` | Gordon URL (the `gordon_domain` from remote config) |
55
56### Options
57
58| Option | Description |
59|--------|-------------|
60| `--token` | Store token directly in config |
61| `--token-env` | Store environment variable name (token resolved at runtime) |
62
63### Examples
64
65```bash
66# Basic (no token)
67gordon remotes add prod https://gordon.mydomain.com
68
69# With direct token
70gordon remotes add prod https://gordon.mydomain.com --token eyJ...
71
72# With environment variable reference (recommended)
73gordon remotes add prod https://gordon.mydomain.com --token-env PROD_TOKEN
74```
75
76### Token Security
77
78**Option 1: Environment Variable Reference (Recommended)**
79
80```bash
81gordon remotes add prod https://gordon.mydomain.com --token-env PROD_TOKEN
82```
83
84The `remotes.toml` stores only the variable name:
85
86```toml
87[remotes.prod]
88url = "https://gordon.mydomain.com"
89token_env = "PROD_TOKEN"
90```
91
92At runtime, Gordon reads `$PROD_TOKEN` from the environment.
93
94**Option 2: Direct Token Storage**
95
96```bash
97gordon remotes add prod https://gordon.mydomain.com --token eyJ...
98```
99
100The token is stored directly in `~/.config/gordon/remotes.toml`. Ensure restricted permissions:
101
102```bash
103chmod 600 ~/.config/gordon/remotes.toml
104```
105
106---
107
108## gordon remotes remove
109
110Remove a saved remote.
111
112```bash
113gordon remotes remove <name>
114gordon remotes remove <name> --force  # Skip confirmation
115```
116
117### Arguments
118
119| Argument | Description |
120|----------|-------------|
121| `<name>` | Name of the remote to remove |
122
123### Options
124
125| Option | Description |
126|--------|-------------|
127| `--force` | Skip confirmation prompt |
128
129### Example
130
131```bash
132gordon remotes remove staging
133```
134
135---
136
137## gordon remotes use
138
139Set the active remote.
140
141```bash
142gordon remotes use <name>
143```
144
145### Arguments
146
147| Argument | Description |
148|----------|-------------|
149| `<name>` | Name of the remote to set as active |
150
151### Description
152
153When a remote is active, it's used automatically for all remote-capable commands without needing to specify `--remote` and `--token`:
154
155```bash
156gordon remotes use prod
157gordon routes list              # Uses prod remote automatically
158gordon secrets list app.com     # Uses prod remote automatically
159```
160
161### Example
162
163```bash
164gordon remotes use prod
165```
166
167---
168
169## gordon remotes set-token
170
171Set or update the authentication token for a saved remote.
172
173```bash
174gordon remotes set-token <name> <token>
175```
176
177### Arguments
178
179| Argument | Description |
180|----------|-------------|
181| `<name>` | Name of the remote |
182| `<token>` | The JWT token to set |
183
184### Description
185
186This command is useful when:
187
188- The server uses token-based authentication (not password auth)
189- You have a pre-generated token from `gordon auth token generate`
190- You want to update an expired token
191
192For servers with password authentication, use `gordon auth login` instead.
193
194### Examples
195
196```bash
197# Set token for prod remote
198gordon remotes set-token prod eyJhbGciOiJIUzI1NiIs...
199
200# Set token from file
201gordon remotes set-token staging $(cat token.txt)
202
203# Set token from environment variable
204gordon remotes set-token prod "$GORDON_TOKEN"
205```
206
207### Output
208
209```
210✓ Token updated for remote 'prod'
211```
212
213---
214
215## Configuration File
216
217Remotes are stored in `~/.config/gordon/remotes.toml`:
218
219```toml
220active = "prod"
221
222[remotes.prod]
223url = "https://gordon.mydomain.com"
224token_env = "PROD_TOKEN"
225
226[remotes.staging]
227url = "https://staging.mydomain.com"
228token = "eyJ..."
229```
230
231## Resolution Precedence
232
233When multiple sources specify remote or token, the CLI uses this priority:
234
235**Remote URL:**
2361. `--remote` flag
2372. `GORDON_REMOTE` environment variable
2383. Active remote from `remotes.toml`
239
240**Token:**
2411. `--token` flag
2422. `GORDON_TOKEN` environment variable
2433. Token from active remote in `remotes.toml`
244
245This allows overriding specific values while keeping defaults:
246
247```bash
248# Active remote is prod, but use different token
249gordon routes list --token $TEMPORARY_TOKEN
250```
251
252---
253
254## Workflow Examples
255
256### Multi-Environment Setup
257
258```bash
259# Add all environments
260gordon remotes add prod https://gordon.example.com --token-env PROD_TOKEN
261gordon remotes add staging https://gordon.staging.example.com --token-env STAGING_TOKEN
262gordon remotes add dev https://gordon.dev.example.com --token-env DEV_TOKEN
263
264# Work with prod
265gordon remotes use prod
266gordon routes list
267gordon secrets list myapp.example.com
268
269# Switch to staging
270gordon remotes use staging
271gordon routes list
272```
273
274### CI/CD Pipeline
275
276```yaml
277# GitHub Actions example
278env:
279  GORDON_REMOTE: ${{ secrets.GORDON_URL }}
280  GORDON_TOKEN: ${{ secrets.GORDON_TOKEN }}
281
282steps:
283  - name: Deploy to Gordon
284    run: |
285      gordon routes deploy myapp.example.com
286```
287
288### Compare Environments
289
290```bash
291# Compare routes across environments
292gordon routes list --remote https://gordon.example.com --token $PROD_TOKEN
293gordon routes list --remote https://gordon.staging.example.com --token $STAGING_TOKEN
294
295# Or switch between active remotes
296gordon remotes use prod && gordon routes list
297gordon remotes use staging && gordon routes list
298```
299
300## Related
301
302- [CLI Overview](./index.md)
303- [Remote CLI Guide](/wiki/guides/remote-cli.md)

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 7

Tags 106

↑↓ moveenter openesc close