v2.16.0 ebd2ab3

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)

Management commands run locally through in-process services by default. Add --remote to target another Gordon instance.

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