v2.15.0 cf76057

index.md RawHistoryFolder

CLI Commands

Gordon provides a command-line interface for server management, deployment, and authentication.

Commands are organized by where they run:

  • Server Commands - Must run on the machine hosting Gordon
  • Management Commands - Work locally or remotely
  • Client Commands - CLI utilities that don't require a running Gordon server

Server Commands (local only)

Command Description Documentation
gordon serve Start the Gordon server serve
gordon auth Manage Gordon server authentication auth

Management Commands (local or remote)

Command Description Documentation
gordon routes Manage routes routes
gordon attachments Manage container attachments attachments
gordon secrets Manage secrets secrets
gordon deploy Manually deploy or redeploy a route serve
gordon restart Restart a running container restart
gordon push Tag, push, and optionally deploy an image push
gordon rollback Roll back to a previous image tag rollback
gordon reload Reload configuration and sync containers serve
gordon logs Display Gordon process or container logs serve
gordon status Show Gordon server status status
gordon backup Manage database backups backup
gordon images List and prune images images

Client Commands

Command Description Documentation
gordon remotes Manage saved remote Gordon instances remotes
gordon version Print version information serve
gordon completion Generate shell autocompletion scripts -

Quick Reference

# Start Gordon
gordon serve
gordon serve --config /path/to/config.toml

# Reload configuration
gordon reload

# Deploy a specific route
gordon deploy myapp.example.com

# Restart a running container
gordon restart myapp.example.com

# Push an image and deploy
gordon push myapp.example.com --build

# Push and deploy without confirmation
gordon push myapp.example.com --no-confirm

# Roll back to a previous tag
gordon rollback myapp.example.com

# View logs
gordon logs                          # Gordon process logs
gordon logs -f                       # Follow process logs
gordon logs -n 100                   # Last 100 lines
gordon logs myapp.local              # Container logs for myapp.local
gordon logs myapp.local -f           # Follow container logs

# Check version
gordon version

# Backups
gordon backup list
gordon backup run app.example.com
gordon backup detect app.example.com
gordon backup status

# Images
gordon images list
gordon images prune --runtime-only
gordon images prune --keep 3

# Authentication
gordon auth token generate --subject ci-bot --expiry 0
gordon auth token list
gordon auth token revoke <token-id>
gordon auth password hash
gordon auth internal

# Routes
gordon routes list
gordon routes add myapp.example.com myapp:latest
gordon routes remove myapp.example.com
gordon routes deploy myapp.example.com

# Attachments
gordon attachments list
gordon attachments add app.example.com postgres:18
gordon attachments remove app.example.com postgres:18

# Secrets
gordon secrets list myapp.local
gordon secrets set myapp.local DATABASE_URL "postgres://..."
gordon secrets remove myapp.local DATABASE_URL

# Remotes
gordon remotes add prod https://gordon.mydomain.com --token $TOKEN
gordon remotes list
gordon remotes use prod

Global Options

Option Description
-c, --config Path to configuration file
--remote Remote Gordon URL (e.g., https://gordon.mydomain.com)
--token Authentication token for remote
--insecure Skip TLS certificate verification for remote HTTPS endpoints

Remote Targeting

The CLI can target remote Gordon instances using client config, an active remote, --remote, or GORDON_REMOTE environment variable. Use --remote and --token as global overrides when you want to bypass your saved configuration.

Important: The remote URL must be the gordon_domain configured on the remote Gordon instance. This is the domain that serves both the container registry and the Admin API.

Use --insecure when the remote endpoint uses a self-signed or otherwise untrusted TLS certificate. You can make this persistent with insecure_tls = true in [client] of ~/.config/gordon/gordon.toml or in a specific entry in ~/.config/gordon/remotes.toml. For Tailscale setups, you can also avoid --insecure by using the machine *.ts.net name with Tailscale-issued TLS certs in Gordon server config. Your public app domains can still use wildcard DNS and normal reverse-proxy routing.

# Using flags (use the gordon_domain from remote Gordon config)
gordon routes list --remote https://gordon.example.com --token $TOKEN

# Against self-signed/private CA endpoint
gordon --remote https://gordon.example.com --token $TOKEN --insecure status

# Using environment variables
export GORDON_REMOTE=https://gordon.example.com
export GORDON_TOKEN=$TOKEN
export GORDON_INSECURE=true
gordon routes list

Exit Codes

Code Meaning
0 Success
1 General error
2 Configuration error

Environment Variables

Gordon reads configuration from environment variables:

GORDON_SERVER_PORT=8080 gordon serve
GORDON_LOGGING_LEVEL=debug gordon serve

Pattern: GORDON_SECTION_KEY (uppercase, underscores)

source
1# CLI Commands
2
3Gordon provides a command-line interface for server management, deployment, and authentication.
4
5Commands are organized by where they run:
6
7- **Server Commands** - Must run on the machine hosting Gordon
8- **Management Commands** - Work locally or remotely
9- **Client Commands** - CLI utilities that don't require a running Gordon server
10
11## Server Commands (local only)
12
13| Command | Description | Documentation |
14|---------|-------------|---------------|
15| `gordon serve` | Start the Gordon server | [serve](./serve.md) |
16| `gordon auth` | Manage Gordon server authentication | [auth](./auth.md) |
17
18## Management Commands (local or remote)
19
20| Command | Description | Documentation |
21|---------|-------------|---------------|
22| `gordon routes` | Manage routes | [routes](./routes.md) |
23| `gordon attachments` | Manage container attachments | [attachments](./attachments.md) |
24| `gordon secrets` | Manage secrets | [secrets](./secrets.md) |
25| `gordon deploy` | Manually deploy or redeploy a route | [serve](./serve.md#gordon-deploy) |
26| `gordon restart` | Restart a running container | [restart](./restart.md) |
27| `gordon push` | Tag, push, and optionally deploy an image | [push](./push.md) |
28| `gordon rollback` | Roll back to a previous image tag | [rollback](./rollback.md) |
29| `gordon reload` | Reload configuration and sync containers | [serve](./serve.md#gordon-reload) |
30| `gordon logs` | Display Gordon process or container logs | [serve](./serve.md#gordon-logs) |
31| `gordon status` | Show Gordon server status | [status](./status.md) |
32| `gordon backup` | Manage database backups | [backup](./backup.md) |
33| `gordon images` | List and prune images | [images](./images.md) |
34
35## Client Commands
36
37| Command | Description | Documentation |
38|---------|-------------|---------------|
39| `gordon remotes` | Manage saved remote Gordon instances | [remotes](./remotes.md) |
40| `gordon version` | Print version information | [serve](./serve.md#gordon-version) |
41| `gordon completion` | Generate shell autocompletion scripts | - |
42
43## Quick Reference
44
45```bash
46# Start Gordon
47gordon serve
48gordon serve --config /path/to/config.toml
49
50# Reload configuration
51gordon reload
52
53# Deploy a specific route
54gordon deploy myapp.example.com
55
56# Restart a running container
57gordon restart myapp.example.com
58
59# Push an image and deploy
60gordon push myapp.example.com --build
61
62# Push and deploy without confirmation
63gordon push myapp.example.com --no-confirm
64
65# Roll back to a previous tag
66gordon rollback myapp.example.com
67
68# View logs
69gordon logs                          # Gordon process logs
70gordon logs -f                       # Follow process logs
71gordon logs -n 100                   # Last 100 lines
72gordon logs myapp.local              # Container logs for myapp.local
73gordon logs myapp.local -f           # Follow container logs
74
75# Check version
76gordon version
77
78# Backups
79gordon backup list
80gordon backup run app.example.com
81gordon backup detect app.example.com
82gordon backup status
83
84# Images
85gordon images list
86gordon images prune --runtime-only
87gordon images prune --keep 3
88
89# Authentication
90gordon auth token generate --subject ci-bot --expiry 0
91gordon auth token list
92gordon auth token revoke <token-id>
93gordon auth password hash
94gordon auth internal
95
96# Routes
97gordon routes list
98gordon routes add myapp.example.com myapp:latest
99gordon routes remove myapp.example.com
100gordon routes deploy myapp.example.com
101
102# Attachments
103gordon attachments list
104gordon attachments add app.example.com postgres:18
105gordon attachments remove app.example.com postgres:18
106
107# Secrets
108gordon secrets list myapp.local
109gordon secrets set myapp.local DATABASE_URL "postgres://..."
110gordon secrets remove myapp.local DATABASE_URL
111
112# Remotes
113gordon remotes add prod https://gordon.mydomain.com --token $TOKEN
114gordon remotes list
115gordon remotes use prod
116```
117
118## Global Options
119
120| Option | Description |
121|--------|-------------|
122| `-c, --config` | Path to configuration file |
123| `--remote` | Remote Gordon URL (e.g., `https://gordon.mydomain.com`) |
124| `--token` | Authentication token for remote |
125| `--insecure` | Skip TLS certificate verification for remote HTTPS endpoints |
126
127### Remote Targeting
128
129The CLI can target remote Gordon instances using client config, an active remote, `--remote`,
130or `GORDON_REMOTE` environment variable. Use `--remote` and `--token` as global overrides
131when you want to bypass your saved configuration.
132
133**Important:** The remote URL must be the `gordon_domain` configured on the remote Gordon instance. This is the domain that serves both the container registry and the Admin API.
134
135Use `--insecure` when the remote endpoint uses a self-signed or otherwise untrusted TLS certificate.
136You can make this persistent with `insecure_tls = true` in `[client]` of `~/.config/gordon/gordon.toml`
137or in a specific entry in `~/.config/gordon/remotes.toml`.
138For Tailscale setups, you can also avoid `--insecure` by using the machine `*.ts.net` name with Tailscale-issued TLS certs in Gordon server config.
139Your public app domains can still use wildcard DNS and normal reverse-proxy routing.
140
141```bash
142# Using flags (use the gordon_domain from remote Gordon config)
143gordon routes list --remote https://gordon.example.com --token $TOKEN
144
145# Against self-signed/private CA endpoint
146gordon --remote https://gordon.example.com --token $TOKEN --insecure status
147
148# Using environment variables
149export GORDON_REMOTE=https://gordon.example.com
150export GORDON_TOKEN=$TOKEN
151export GORDON_INSECURE=true
152gordon routes list
153```
154
155## Exit Codes
156
157| Code | Meaning |
158|------|---------|
159| 0 | Success |
160| 1 | General error |
161| 2 | Configuration error |
162
163## Environment Variables
164
165Gordon reads configuration from environment variables:
166
167```bash
168GORDON_SERVER_PORT=8080 gordon serve
169GORDON_LOGGING_LEVEL=debug gordon serve
170```
171
172Pattern: `GORDON_SECTION_KEY` (uppercase, underscores)
173
174## Related
175
176- [Core Concepts](../concepts.md)
177- [Configuration Reference](../config/index.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