v2.3.0 fc65046

commands.md RawHistoryFolder

CLI Commands

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

Commands Overview

Command Description
gordon serve Start the Gordon server
gordon reload Reload configuration and sync containers
gordon deploy Manually deploy or redeploy a specific route
gordon logs Display Gordon process logs
gordon version Print version information
gordon auth Manage registry authentication
gordon routes Manage routes (local or remote)
gordon secrets Manage secrets (remote only)
gordon remotes Manage saved remote Gordon instances

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

# View logs
gordon logs
gordon logs -f
gordon logs -n 100

# Check version
gordon version

# 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

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

Remote Targeting

The CLI can target remote Gordon instances using the --remote flag or GORDON_REMOTE environment variable.

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.

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

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

gordon serve

Start the Gordon server with registry and proxy components.

Synopsis

gordon serve [options]

Options

Option Short Default Description
--config -c Auto-detected Path to configuration file

Description

Starts the Gordon server, which includes:

  • Container Registry - Receives image pushes on the registry port
  • HTTP Proxy - Routes traffic to containers on the proxy port
  • Event Bus - Coordinates deployments and updates
  • Config Watcher - Monitors configuration file for changes

Configuration File Detection

Gordon looks for configuration in this order:

  1. Path specified with --config
  2. /etc/gordon/gordon.toml
  3. ~/.config/gordon/gordon.toml
  4. ./gordon.toml

First Run

On first run without a config file, Gordon creates a default configuration at ~/.config/gordon/gordon.toml.

# First run - creates default config
gordon serve
# Edit the config, then restart

Examples

# Basic start
gordon serve

# With custom config
gordon serve --config /path/to/gordon.toml
gordon serve -c ./my-config.toml

# With environment override
GORDON_SERVER_PORT=8080 gordon serve
GORDON_LOGGING_LEVEL=debug gordon serve

Signals

Gordon responds to these signals:

Signal Action
SIGTERM Graceful shutdown
SIGINT Graceful shutdown (Ctrl+C)
SIGUSR1 Reload configuration
SIGUSR2 Manual deploy (used by gordon deploy)

Running with systemd

# Create user service
mkdir -p ~/.config/systemd/user
cat > ~/.config/systemd/user/gordon.service <<EOF
[Unit]
Description=Gordon Container Platform

[Service]
Type=simple
Restart=always
ExecStart=/usr/local/bin/gordon serve

[Install]
WantedBy=default.target
EOF

# Enable and start
systemctl --user daemon-reload
systemctl --user enable --now gordon
sudo loginctl enable-linger $USER

Startup Sequence

  1. Load configuration
  2. Initialize logger
  3. Create PID file
  4. Connect to Docker/Podman runtime
  5. Create storage directories
  6. Initialize services (registry, proxy, auth)
  7. Register event handlers
  8. Start config file watcher
  9. Sync existing containers
  10. Start HTTP servers

Shutdown Sequence

  1. Receive shutdown signal
  2. Stop accepting new requests
  3. Complete in-flight requests
  4. Stop managed containers (if configured)
  5. Remove PID file
  6. Exit

gordon reload

Reload configuration and sync containers to match.

Synopsis

gordon reload

Description

Sends SIGUSR1 to the running Gordon process, triggering:

  • Configuration file reload
  • Route synchronization
  • Deployment of containers for routes missing containers
  • Attachment deployment

Example

# After editing gordon.toml, apply changes without restart
vim ~/.config/gordon/gordon.toml
gordon reload

gordon deploy

Manually deploy or redeploy a specific route.

Synopsis

gordon deploy <domain>

Arguments

Argument Description
<domain> The domain name of the route to deploy (required)

Description

Sends SIGUSR2 to the Gordon process with the specified domain, triggering:

  • Fresh image pull (always pulls latest, ignoring cache)
  • Container redeployment for the specified route

Examples

gordon deploy myapp.example.com
gordon deploy api.example.com

Use Cases

  • Recover from a failed deployment
  • Force redeploy without pushing a new image
  • Manual deployment when automatic deploy didn't trigger

gordon logs

Display Gordon process logs.

Synopsis

gordon logs [options]

Options

Option Short Default Description
--config -c Auto Path to config file
--follow -f false Follow log output (like tail -f)
--lines -n 50 Number of lines to show

Examples

gordon logs              # Last 50 lines
gordon logs -f           # Follow logs
gordon logs -n 100       # Last 100 lines
gordon logs -f -n 200    # Follow, starting from last 200 lines

Log Locations

# Using gordon logs
gordon logs -f

# Direct file access
tail -f ~/.gordon/logs/gordon.log

# With systemd
journalctl --user -u gordon -f

gordon version

Print version information.

Synopsis

gordon version

Output

Gordon v2.0.0
Commit: abc1234
Build Date: 2024-01-15

gordon auth

Manage registry authentication tokens and passwords.

Subcommands

Subcommand Description
token generate Generate a new JWT token
token list List all stored tokens
token revoke Revoke a token by ID
password hash Generate bcrypt password hash
internal Show internal registry credentials

gordon auth token generate

Generate a new JWT authentication token for registry access.

gordon auth token generate --subject <name> [options]

Options:

Option Default Description
--subject (required) Username/subject for the token
--scopes push,pull Comma-separated scopes
--expiry 720h Duration until expiry (0 = never)
-c, --config Auto Path to config file

Examples:

# CI token that never expires
gordon auth token generate --subject github-actions --expiry 0

# Read-only token
gordon auth token generate --subject reader --scopes pull --expiry 720h

# Push-only token for build system
gordon auth token generate --subject builder --scopes push --expiry 0

# Temporary token (24 hours)
gordon auth token generate --subject temp --expiry 24h

Output:

Token generated successfully!
Subject: github-actions
Scopes: push, pull
Expiry: never

Token (use as password with docker login):
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...

Usage: docker login -u github-actions -p <token> <registry>

gordon auth token list

List all stored authentication tokens.

gordon auth token list [options]

Output:

ID                                    Subject               Expires               Revoked
------------------------------------------------------------------------------------------
a1b2c3d4-e5f6-7890-abcd-ef1234567890  github-actions        never                 no
b2c3d4e5-f6a7-8901-bcde-f12345678901  deploy-bot            2024-02-15 10:30      no
c3d4e5f6-a7b8-9012-cdef-123456789012  old-token             2024-01-01 00:00      yes

gordon auth token revoke

Revoke a token by its ID.

gordon auth token revoke <token-id> [options]

Example:

gordon auth token revoke a1b2c3d4-e5f6-7890-abcd-ef1234567890

Output:

Token a1b2c3d4-e5f6-7890-abcd-ef1234567890 has been revoked.

gordon auth password hash

Generate a bcrypt hash for password authentication.

gordon auth password hash

Interactively prompts for a password and outputs the bcrypt hash.

Output:

Enter password: ********

Bcrypt hash (store in your secrets backend):
$2a$10$N9qo8uLOickgx2ZMRZoMye...

Then reference the path in your config:
  [registry_auth]
  type = "password"
  password_hash = "gordon/registry/password_hash"

gordon auth internal

Display the auto-generated internal registry credentials.

gordon auth internal

Gordon generates temporary credentials for internal communication with its local registry. These credentials are useful for manual recovery when debugging deployment issues.

Output:

Internal Registry Credentials
==============================
Username: gordon-internal
Password: 8f3a2b1c4d5e6f7a8b9c0d1e2f3a4b5c...

Usage:
  docker login localhost:5000 -u gordon-internal -p 8f3a2b1c4d5e6f7a8b9c0d1e2f3a4b5c...

Notes:

  • Credentials are regenerated each time Gordon starts
  • Only available while Gordon is running
  • Used for manual docker pull from the local registry during debugging

Use cases:

  • Debugging image pull failures
  • Manual recovery after deployment issues
  • Inspecting images in the local registry

Token Scopes

Scope Permission
push Push images to registry
pull Pull images from registry
push,pull Both push and pull (default)

Token Expiry Formats

Format Duration
0 Never expires
24h 24 hours
720h 30 days
8760h 1 year

Workflow Examples

CI/CD Setup

# Generate token for CI
gordon auth token generate --subject ci-bot --scopes push,pull --expiry 0

# Save token as CI secret
# GitHub: Settings → Secrets → New repository secret
# GitLab: Settings → CI/CD → Variables

Docker Login

# Using generated token
docker login -u ci-bot -p <token> registry.mydomain.com

# In CI/CD
echo "$GORDON_TOKEN" | docker login -u ci-bot --password-stdin registry.mydomain.com

Token Rotation

# Generate new token
gordon auth token generate --subject ci-bot --expiry 0

# Update CI secrets with new token

# Revoke old token
gordon auth token revoke <old-token-id>

Password Setup

# Generate hash
gordon auth password hash
# Enter: mypassword

# Store in pass
pass insert gordon/registry/password_hash
# Paste: $2a$10$...

# Configure gordon.toml
[registry_auth]
enabled = true
type = "password"
username = "deploy"
password_hash = "gordon/registry/password_hash"

gordon routes

Manage routes on local or remote Gordon instances.

Subcommands

Subcommand Description
list List all routes
add Add a new route
remove Remove a route
deploy Deploy a specific route

gordon routes list

List all configured routes.

gordon routes list
gordon routes list --remote https://gordon.mydomain.com --token $TOKEN

gordon routes add

Add a new route.

gordon routes add <domain> <image>
gordon routes add myapp.example.com myapp:latest

gordon routes remove

Remove a route.

gordon routes remove <domain>
gordon routes remove myapp.example.com

gordon routes deploy

Deploy or redeploy a specific route.

gordon routes deploy <domain>
gordon routes deploy myapp.example.com

gordon secrets

Manage secrets on remote Gordon instances. Requires remote targeting.

Subcommands

Subcommand Description
list List all secrets
get Get a secret value
set Set a secret value
delete Delete a secret

Examples

# List secrets
gordon secrets list --remote https://gordon.mydomain.com --token $TOKEN

# Set a secret
gordon secrets set DATABASE_URL "postgres://..." --remote ... --token ...

# Get a secret
gordon secrets get DATABASE_URL --remote ... --token ...

# Delete a secret
gordon secrets delete DATABASE_URL --remote ... --token ...

gordon remotes

Manage saved remote Gordon instances for easier CLI usage.

Subcommands

Subcommand Description
list List saved remotes
add Add a new remote
remove Remove a saved remote
use Set active remote

Examples

# Add a remote
gordon remotes add prod https://gordon.mydomain.com --token $TOKEN

# List saved remotes
gordon remotes list

# Set active remote
gordon remotes use prod

# Now use without --remote flag
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
5## Commands Overview
6
7| Command | Description |
8|---------|-------------|
9| `gordon serve` | Start the Gordon server |
10| `gordon reload` | Reload configuration and sync containers |
11| `gordon deploy` | Manually deploy or redeploy a specific route |
12| `gordon logs` | Display Gordon process logs |
13| `gordon version` | Print version information |
14| `gordon auth` | Manage registry authentication |
15| `gordon routes` | Manage routes (local or remote) |
16| `gordon secrets` | Manage secrets (remote only) |
17| `gordon remotes` | Manage saved remote Gordon instances |
18
19## Quick Reference
20
21```bash
22# Start Gordon
23gordon serve
24gordon serve --config /path/to/config.toml
25
26# Reload configuration
27gordon reload
28
29# Deploy a specific route
30gordon deploy myapp.example.com
31
32# View logs
33gordon logs
34gordon logs -f
35gordon logs -n 100
36
37# Check version
38gordon version
39
40# Authentication
41gordon auth token generate --subject ci-bot --expiry 0
42gordon auth token list
43gordon auth token revoke <token-id>
44gordon auth password hash
45gordon auth internal
46```
47
48## Global Options
49
50| Option | Description |
51|--------|-------------|
52| `-c, --config` | Path to configuration file |
53| `--remote` | Remote Gordon URL (e.g., `https://gordon.mydomain.com`) |
54| `--token` | Authentication token for remote |
55
56### Remote Targeting
57
58The CLI can target remote Gordon instances using the `--remote` flag or `GORDON_REMOTE` environment variable.
59
60**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.
61
62```bash
63# Using flags (use the gordon_domain from remote Gordon config)
64gordon routes list --remote https://gordon.mydomain.com --token $TOKEN
65
66# Using environment variables
67export GORDON_REMOTE=https://gordon.mydomain.com
68export GORDON_TOKEN=$TOKEN
69gordon routes list
70```
71
72---
73
74## gordon serve
75
76Start the Gordon server with registry and proxy components.
77
78### Synopsis
79
80```bash
81gordon serve [options]
82```
83
84### Options
85
86| Option | Short | Default | Description |
87|--------|-------|---------|-------------|
88| `--config` | `-c` | Auto-detected | Path to configuration file |
89
90### Description
91
92Starts the Gordon server, which includes:
93
94- **Container Registry** - Receives image pushes on the registry port
95- **HTTP Proxy** - Routes traffic to containers on the proxy port
96- **Event Bus** - Coordinates deployments and updates
97- **Config Watcher** - Monitors configuration file for changes
98
99### Configuration File Detection
100
101Gordon looks for configuration in this order:
102
1031. Path specified with `--config`
1042. `/etc/gordon/gordon.toml`
1053. `~/.config/gordon/gordon.toml`
1064. `./gordon.toml`
107
108### First Run
109
110On first run without a config file, Gordon creates a default configuration at `~/.config/gordon/gordon.toml`.
111
112```bash
113# First run - creates default config
114gordon serve
115# Edit the config, then restart
116```
117
118### Examples
119
120```bash
121# Basic start
122gordon serve
123
124# With custom config
125gordon serve --config /path/to/gordon.toml
126gordon serve -c ./my-config.toml
127
128# With environment override
129GORDON_SERVER_PORT=8080 gordon serve
130GORDON_LOGGING_LEVEL=debug gordon serve
131```
132
133### Signals
134
135Gordon responds to these signals:
136
137| Signal | Action |
138|--------|--------|
139| `SIGTERM` | Graceful shutdown |
140| `SIGINT` | Graceful shutdown (Ctrl+C) |
141| `SIGUSR1` | Reload configuration |
142| `SIGUSR2` | Manual deploy (used by `gordon deploy`) |
143
144### Running with systemd
145
146```bash
147# Create user service
148mkdir -p ~/.config/systemd/user
149cat > ~/.config/systemd/user/gordon.service <<EOF
150[Unit]
151Description=Gordon Container Platform
152
153[Service]
154Type=simple
155Restart=always
156ExecStart=/usr/local/bin/gordon serve
157
158[Install]
159WantedBy=default.target
160EOF
161
162# Enable and start
163systemctl --user daemon-reload
164systemctl --user enable --now gordon
165sudo loginctl enable-linger $USER
166```
167
168### Startup Sequence
169
1701. Load configuration
1712. Initialize logger
1723. Create PID file
1734. Connect to Docker/Podman runtime
1745. Create storage directories
1756. Initialize services (registry, proxy, auth)
1767. Register event handlers
1778. Start config file watcher
1789. Sync existing containers
17910. Start HTTP servers
180
181### Shutdown Sequence
182
1831. Receive shutdown signal
1842. Stop accepting new requests
1853. Complete in-flight requests
1864. Stop managed containers (if configured)
1875. Remove PID file
1886. Exit
189
190---
191
192## gordon reload
193
194Reload configuration and sync containers to match.
195
196### Synopsis
197
198```bash
199gordon reload
200```
201
202### Description
203
204Sends `SIGUSR1` to the running Gordon process, triggering:
205
206- Configuration file reload
207- Route synchronization
208- Deployment of containers for routes missing containers
209- Attachment deployment
210
211### Example
212
213```bash
214# After editing gordon.toml, apply changes without restart
215vim ~/.config/gordon/gordon.toml
216gordon reload
217```
218
219---
220
221## gordon deploy
222
223Manually deploy or redeploy a specific route.
224
225### Synopsis
226
227```bash
228gordon deploy <domain>
229```
230
231### Arguments
232
233| Argument | Description |
234|----------|-------------|
235| `<domain>` | The domain name of the route to deploy (required) |
236
237### Description
238
239Sends `SIGUSR2` to the Gordon process with the specified domain, triggering:
240
241- Fresh image pull (always pulls latest, ignoring cache)
242- Container redeployment for the specified route
243
244### Examples
245
246```bash
247gordon deploy myapp.example.com
248gordon deploy api.example.com
249```
250
251### Use Cases
252
253- Recover from a failed deployment
254- Force redeploy without pushing a new image
255- Manual deployment when automatic deploy didn't trigger
256
257---
258
259## gordon logs
260
261Display Gordon process logs.
262
263### Synopsis
264
265```bash
266gordon logs [options]
267```
268
269### Options
270
271| Option | Short | Default | Description |
272|--------|-------|---------|-------------|
273| `--config` | `-c` | Auto | Path to config file |
274| `--follow` | `-f` | false | Follow log output (like `tail -f`) |
275| `--lines` | `-n` | 50 | Number of lines to show |
276
277### Examples
278
279```bash
280gordon logs              # Last 50 lines
281gordon logs -f           # Follow logs
282gordon logs -n 100       # Last 100 lines
283gordon logs -f -n 200    # Follow, starting from last 200 lines
284```
285
286### Log Locations
287
288```bash
289# Using gordon logs
290gordon logs -f
291
292# Direct file access
293tail -f ~/.gordon/logs/gordon.log
294
295# With systemd
296journalctl --user -u gordon -f
297```
298
299---
300
301## gordon version
302
303Print version information.
304
305### Synopsis
306
307```bash
308gordon version
309```
310
311### Output
312
313```
314Gordon v2.0.0
315Commit: abc1234
316Build Date: 2024-01-15
317```
318
319---
320
321## gordon auth
322
323Manage registry authentication tokens and passwords.
324
325### Subcommands
326
327| Subcommand | Description |
328|------------|-------------|
329| `token generate` | Generate a new JWT token |
330| `token list` | List all stored tokens |
331| `token revoke` | Revoke a token by ID |
332| `password hash` | Generate bcrypt password hash |
333| `internal` | Show internal registry credentials |
334
335### gordon auth token generate
336
337Generate a new JWT authentication token for registry access.
338
339```bash
340gordon auth token generate --subject <name> [options]
341```
342
343**Options:**
344
345| Option | Default | Description |
346|--------|---------|-------------|
347| `--subject` | (required) | Username/subject for the token |
348| `--scopes` | `push,pull` | Comma-separated scopes |
349| `--expiry` | `720h` | Duration until expiry (0 = never) |
350| `-c, --config` | Auto | Path to config file |
351
352**Examples:**
353
354```bash
355# CI token that never expires
356gordon auth token generate --subject github-actions --expiry 0
357
358# Read-only token
359gordon auth token generate --subject reader --scopes pull --expiry 720h
360
361# Push-only token for build system
362gordon auth token generate --subject builder --scopes push --expiry 0
363
364# Temporary token (24 hours)
365gordon auth token generate --subject temp --expiry 24h
366```
367
368**Output:**
369
370```
371Token generated successfully!
372Subject: github-actions
373Scopes: push, pull
374Expiry: never
375
376Token (use as password with docker login):
377eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
378
379Usage: docker login -u github-actions -p <token> <registry>
380```
381
382### gordon auth token list
383
384List all stored authentication tokens.
385
386```bash
387gordon auth token list [options]
388```
389
390**Output:**
391
392```
393ID                                    Subject               Expires               Revoked
394------------------------------------------------------------------------------------------
395a1b2c3d4-e5f6-7890-abcd-ef1234567890  github-actions        never                 no
396b2c3d4e5-f6a7-8901-bcde-f12345678901  deploy-bot            2024-02-15 10:30      no
397c3d4e5f6-a7b8-9012-cdef-123456789012  old-token             2024-01-01 00:00      yes
398```
399
400### gordon auth token revoke
401
402Revoke a token by its ID.
403
404```bash
405gordon auth token revoke <token-id> [options]
406```
407
408**Example:**
409
410```bash
411gordon auth token revoke a1b2c3d4-e5f6-7890-abcd-ef1234567890
412```
413
414**Output:**
415
416```
417Token a1b2c3d4-e5f6-7890-abcd-ef1234567890 has been revoked.
418```
419
420### gordon auth password hash
421
422Generate a bcrypt hash for password authentication.
423
424```bash
425gordon auth password hash
426```
427
428Interactively prompts for a password and outputs the bcrypt hash.
429
430**Output:**
431
432```
433Enter password: ********
434
435Bcrypt hash (store in your secrets backend):
436$2a$10$N9qo8uLOickgx2ZMRZoMye...
437
438Then reference the path in your config:
439  [registry_auth]
440  type = "password"
441  password_hash = "gordon/registry/password_hash"
442```
443
444### gordon auth internal
445
446Display the auto-generated internal registry credentials.
447
448```bash
449gordon auth internal
450```
451
452Gordon generates temporary credentials for internal communication with its local registry. These credentials are useful for manual recovery when debugging deployment issues.
453
454**Output:**
455
456```
457Internal Registry Credentials
458==============================
459Username: gordon-internal
460Password: 8f3a2b1c4d5e6f7a8b9c0d1e2f3a4b5c...
461
462Usage:
463  docker login localhost:5000 -u gordon-internal -p 8f3a2b1c4d5e6f7a8b9c0d1e2f3a4b5c...
464```
465
466**Notes:**
467- Credentials are regenerated each time Gordon starts
468- Only available while Gordon is running
469- Used for manual `docker pull` from the local registry during debugging
470
471**Use cases:**
472- Debugging image pull failures
473- Manual recovery after deployment issues
474- Inspecting images in the local registry
475
476---
477
478## Token Scopes
479
480| Scope | Permission |
481|-------|------------|
482| `push` | Push images to registry |
483| `pull` | Pull images from registry |
484| `push,pull` | Both push and pull (default) |
485
486## Token Expiry Formats
487
488| Format | Duration |
489|--------|----------|
490| `0` | Never expires |
491| `24h` | 24 hours |
492| `720h` | 30 days |
493| `8760h` | 1 year |
494
495---
496
497## Workflow Examples
498
499### CI/CD Setup
500
501```bash
502# Generate token for CI
503gordon auth token generate --subject ci-bot --scopes push,pull --expiry 0
504
505# Save token as CI secret
506# GitHub: Settings → Secrets → New repository secret
507# GitLab: Settings → CI/CD → Variables
508```
509
510### Docker Login
511
512```bash
513# Using generated token
514docker login -u ci-bot -p <token> registry.mydomain.com
515
516# In CI/CD
517echo "$GORDON_TOKEN" | docker login -u ci-bot --password-stdin registry.mydomain.com
518```
519
520### Token Rotation
521
522```bash
523# Generate new token
524gordon auth token generate --subject ci-bot --expiry 0
525
526# Update CI secrets with new token
527
528# Revoke old token
529gordon auth token revoke <old-token-id>
530```
531
532### Password Setup
533
534```bash
535# Generate hash
536gordon auth password hash
537# Enter: mypassword
538
539# Store in pass
540pass insert gordon/registry/password_hash
541# Paste: $2a$10$...
542
543# Configure gordon.toml
544[registry_auth]
545enabled = true
546type = "password"
547username = "deploy"
548password_hash = "gordon/registry/password_hash"
549```
550
551---
552
553## gordon routes
554
555Manage routes on local or remote Gordon instances.
556
557### Subcommands
558
559| Subcommand | Description |
560|------------|-------------|
561| `list` | List all routes |
562| `add` | Add a new route |
563| `remove` | Remove a route |
564| `deploy` | Deploy a specific route |
565
566### gordon routes list
567
568List all configured routes.
569
570```bash
571gordon routes list
572gordon routes list --remote https://gordon.mydomain.com --token $TOKEN
573```
574
575### gordon routes add
576
577Add a new route.
578
579```bash
580gordon routes add <domain> <image>
581gordon routes add myapp.example.com myapp:latest
582```
583
584### gordon routes remove
585
586Remove a route.
587
588```bash
589gordon routes remove <domain>
590gordon routes remove myapp.example.com
591```
592
593### gordon routes deploy
594
595Deploy or redeploy a specific route.
596
597```bash
598gordon routes deploy <domain>
599gordon routes deploy myapp.example.com
600```
601
602---
603
604## gordon secrets
605
606Manage secrets on remote Gordon instances. Requires remote targeting.
607
608### Subcommands
609
610| Subcommand | Description |
611|------------|-------------|
612| `list` | List all secrets |
613| `get` | Get a secret value |
614| `set` | Set a secret value |
615| `delete` | Delete a secret |
616
617### Examples
618
619```bash
620# List secrets
621gordon secrets list --remote https://gordon.mydomain.com --token $TOKEN
622
623# Set a secret
624gordon secrets set DATABASE_URL "postgres://..." --remote ... --token ...
625
626# Get a secret
627gordon secrets get DATABASE_URL --remote ... --token ...
628
629# Delete a secret
630gordon secrets delete DATABASE_URL --remote ... --token ...
631```
632
633---
634
635## gordon remotes
636
637Manage saved remote Gordon instances for easier CLI usage.
638
639### Subcommands
640
641| Subcommand | Description |
642|------------|-------------|
643| `list` | List saved remotes |
644| `add` | Add a new remote |
645| `remove` | Remove a saved remote |
646| `use` | Set active remote |
647
648### Examples
649
650```bash
651# Add a remote
652gordon remotes add prod https://gordon.mydomain.com --token $TOKEN
653
654# List saved remotes
655gordon remotes list
656
657# Set active remote
658gordon remotes use prod
659
660# Now use without --remote flag
661gordon routes list
662```
663
664---
665
666## Exit Codes
667
668| Code | Meaning |
669|------|---------|
670| 0 | Success |
671| 1 | General error |
672| 2 | Configuration error |
673
674## Environment Variables
675
676Gordon reads configuration from environment variables:
677
678```bash
679GORDON_SERVER_PORT=8080 gordon serve
680GORDON_LOGGING_LEVEL=debug gordon serve
681```
682
683Pattern: `GORDON_SECTION_KEY` (uppercase, underscores)
684
685## Related
686
687- [Core Concepts](../concepts.md)
688- [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