v2.14.0 5e11a00

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

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

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