detached 123c169

fix(cli): use --remote flag in help text and error messages

commit
123c1697c17d13d6ebb2f7a04051eb0696ef5b13
author
bnema · · 2026-01-16 21:11 UTC
parent
01f1113
signature
unsigned
2 files · +12 -12
M internal/adapters/in/cli/routes.go +6 -6
@@ -50,7 +50,7 @@ func newRoutesCmd() *cobra.Command {
5050 Short: "Manage routes",
5151 Long: `Manage Gordon routes. Routes map domains to container images.
5252
53-When targeting a remote Gordon instance (via --target flag or GORDON_TARGET env var),
53+When targeting a remote Gordon instance (via --remote flag or GORDON_REMOTE env var),
5454 these commands operate on the remote server. Otherwise, they require access to
5555 the local Gordon configuration.`,
5656 }
@@ -72,7 +72,7 @@ func newRoutesListCmd() *cobra.Command {
7272
7373 client, isRemote := GetRemoteClient()
7474 if !isRemote {
75- fmt.Println(styles.RenderError("routes command requires --target flag or GORDON_TARGET env var"))
75+ fmt.Println(styles.RenderError("routes command requires --remote flag or GORDON_REMOTE env var"))
7676 fmt.Println(styles.Theme.Muted.Render("Local route management is not yet supported. Use the config file directly."))
7777 return nil
7878 }
@@ -137,7 +137,7 @@ func newRoutesAddCmd() *cobra.Command {
137137
138138 Examples:
139139 gordon routes add app.mydomain.com --image myapp:latest
140- gordon --target https://gordon.mydomain.com routes add api.mydomain.com --image api:v2`,
140+ gordon --remote https://gordon.mydomain.com routes add api.mydomain.com --image api:v2`,
141141 Args: cobra.ExactArgs(1),
142142 RunE: func(cmd *cobra.Command, args []string) error {
143143 ctx := context.Background()
@@ -145,7 +145,7 @@ Examples:
145145
146146 client, isRemote := GetRemoteClient()
147147 if !isRemote {
148- fmt.Println(styles.RenderError("routes command requires --target flag or GORDON_TARGET env var"))
148+ fmt.Println(styles.RenderError("routes command requires --remote flag or GORDON_REMOTE env var"))
149149 return nil
150150 }
151151
@@ -193,7 +193,7 @@ Examples:
193193
194194 client, isRemote := GetRemoteClient()
195195 if !isRemote {
196- fmt.Println(styles.RenderError("routes command requires --target flag or GORDON_TARGET env var"))
196+ fmt.Println(styles.RenderError("routes command requires --remote flag or GORDON_REMOTE env var"))
197197 return nil
198198 }
199199
@@ -236,7 +236,7 @@ func newStatusCmd() *cobra.Command {
236236
237237 client, isRemote := GetRemoteClient()
238238 if !isRemote {
239- fmt.Println(styles.RenderError("status command requires --target flag or GORDON_TARGET env var"))
239+ fmt.Println(styles.RenderError("status command requires --remote flag or GORDON_REMOTE env var"))
240240 os.Exit(1)
241241 }
242242
@@ -50,7 +50,7 @@ func newRoutesCmd() *cobra.Command {
50 Short: "Manage routes",50 Short: "Manage routes",
51 Long: `Manage Gordon routes. Routes map domains to container images.51 Long: `Manage Gordon routes. Routes map domains to container images.
52 52
53-When targeting a remote Gordon instance (via --target flag or GORDON_TARGET env var),53+When targeting a remote Gordon instance (via --remote flag or GORDON_REMOTE env var),
54 these commands operate on the remote server. Otherwise, they require access to54 these commands operate on the remote server. Otherwise, they require access to
55 the local Gordon configuration.`,55 the local Gordon configuration.`,
56 }56 }
@@ -72,7 +72,7 @@ func newRoutesListCmd() *cobra.Command {
72 72
73 client, isRemote := GetRemoteClient()73 client, isRemote := GetRemoteClient()
74 if !isRemote {74 if !isRemote {
75- fmt.Println(styles.RenderError("routes command requires --target flag or GORDON_TARGET env var"))75+ fmt.Println(styles.RenderError("routes command requires --remote flag or GORDON_REMOTE env var"))
76 fmt.Println(styles.Theme.Muted.Render("Local route management is not yet supported. Use the config file directly."))76 fmt.Println(styles.Theme.Muted.Render("Local route management is not yet supported. Use the config file directly."))
77 return nil77 return nil
78 }78 }
@@ -137,7 +137,7 @@ func newRoutesAddCmd() *cobra.Command {
137 137
138 Examples:138 Examples:
139 gordon routes add app.mydomain.com --image myapp:latest139 gordon routes add app.mydomain.com --image myapp:latest
140- gordon --target https://gordon.mydomain.com routes add api.mydomain.com --image api:v2`,140+ gordon --remote https://gordon.mydomain.com routes add api.mydomain.com --image api:v2`,
141 Args: cobra.ExactArgs(1),141 Args: cobra.ExactArgs(1),
142 RunE: func(cmd *cobra.Command, args []string) error {142 RunE: func(cmd *cobra.Command, args []string) error {
143 ctx := context.Background()143 ctx := context.Background()
@@ -145,7 +145,7 @@ Examples:
145 145
146 client, isRemote := GetRemoteClient()146 client, isRemote := GetRemoteClient()
147 if !isRemote {147 if !isRemote {
148- fmt.Println(styles.RenderError("routes command requires --target flag or GORDON_TARGET env var"))148+ fmt.Println(styles.RenderError("routes command requires --remote flag or GORDON_REMOTE env var"))
149 return nil149 return nil
150 }150 }
151 151
@@ -193,7 +193,7 @@ Examples:
193 193
194 client, isRemote := GetRemoteClient()194 client, isRemote := GetRemoteClient()
195 if !isRemote {195 if !isRemote {
196- fmt.Println(styles.RenderError("routes command requires --target flag or GORDON_TARGET env var"))196+ fmt.Println(styles.RenderError("routes command requires --remote flag or GORDON_REMOTE env var"))
197 return nil197 return nil
198 }198 }
199 199
@@ -236,7 +236,7 @@ func newStatusCmd() *cobra.Command {
236 236
237 client, isRemote := GetRemoteClient()237 client, isRemote := GetRemoteClient()
238 if !isRemote {238 if !isRemote {
239- fmt.Println(styles.RenderError("status command requires --target flag or GORDON_TARGET env var"))239+ fmt.Println(styles.RenderError("status command requires --remote flag or GORDON_REMOTE env var"))
240 os.Exit(1)240 os.Exit(1)
241 }241 }
242 242
M internal/adapters/in/cli/secrets.go +6 -6
@@ -20,7 +20,7 @@ func newSecretsCmd() *cobra.Command {
2020
2121 Secrets are stored per-domain and injected into containers as environment variables.
2222
23-When targeting a remote Gordon instance (via --target flag or GORDON_TARGET env var),
23+When targeting a remote Gordon instance (via --remote flag or GORDON_REMOTE env var),
2424 these commands operate on the remote server.`,
2525 }
2626
@@ -42,7 +42,7 @@ Note: Only secret keys are shown, not values (for security).
4242
4343 Examples:
4444 gordon secrets list app.mydomain.com
45- gordon --target https://gordon.mydomain.com secrets list api.mydomain.com`,
45+ gordon --remote https://gordon.mydomain.com secrets list api.mydomain.com`,
4646 Args: cobra.ExactArgs(1),
4747 RunE: func(cmd *cobra.Command, args []string) error {
4848 ctx := context.Background()
@@ -50,7 +50,7 @@ Examples:
5050
5151 client, isRemote := GetRemoteClient()
5252 if !isRemote {
53- fmt.Println(styles.RenderError("secrets command requires --target flag or GORDON_TARGET env var"))
53+ fmt.Println(styles.RenderError("secrets command requires --remote flag or GORDON_REMOTE env var"))
5454 fmt.Println(styles.Theme.Muted.Render("Local secret management is not yet supported."))
5555 return nil
5656 }
@@ -102,7 +102,7 @@ Secrets are specified as KEY=value pairs. Multiple secrets can be set at once.
102102 Examples:
103103 gordon secrets set app.mydomain.com DATABASE_URL=postgres://localhost/db
104104 gordon secrets set app.mydomain.com API_KEY=secret123 DEBUG=false
105- gordon --target https://gordon.mydomain.com secrets set api.mydomain.com TOKEN=abc`,
105+ gordon --remote https://gordon.mydomain.com secrets set api.mydomain.com TOKEN=abc`,
106106 Args: cobra.MinimumNArgs(2),
107107 RunE: func(cmd *cobra.Command, args []string) error {
108108 ctx := context.Background()
@@ -111,7 +111,7 @@ Examples:
111111
112112 client, isRemote := GetRemoteClient()
113113 if !isRemote {
114- fmt.Println(styles.RenderError("secrets command requires --target flag or GORDON_TARGET env var"))
114+ fmt.Println(styles.RenderError("secrets command requires --remote flag or GORDON_REMOTE env var"))
115115 return nil
116116 }
117117
@@ -163,7 +163,7 @@ Examples:
163163
164164 client, isRemote := GetRemoteClient()
165165 if !isRemote {
166- fmt.Println(styles.RenderError("secrets command requires --target flag or GORDON_TARGET env var"))
166+ fmt.Println(styles.RenderError("secrets command requires --remote flag or GORDON_REMOTE env var"))
167167 return nil
168168 }
169169
@@ -20,7 +20,7 @@ func newSecretsCmd() *cobra.Command {
20 20
21 Secrets are stored per-domain and injected into containers as environment variables.21 Secrets are stored per-domain and injected into containers as environment variables.
22 22
23-When targeting a remote Gordon instance (via --target flag or GORDON_TARGET env var),23+When targeting a remote Gordon instance (via --remote flag or GORDON_REMOTE env var),
24 these commands operate on the remote server.`,24 these commands operate on the remote server.`,
25 }25 }
26 26
@@ -42,7 +42,7 @@ Note: Only secret keys are shown, not values (for security).
42 42
43 Examples:43 Examples:
44 gordon secrets list app.mydomain.com44 gordon secrets list app.mydomain.com
45- gordon --target https://gordon.mydomain.com secrets list api.mydomain.com`,45+ gordon --remote https://gordon.mydomain.com secrets list api.mydomain.com`,
46 Args: cobra.ExactArgs(1),46 Args: cobra.ExactArgs(1),
47 RunE: func(cmd *cobra.Command, args []string) error {47 RunE: func(cmd *cobra.Command, args []string) error {
48 ctx := context.Background()48 ctx := context.Background()
@@ -50,7 +50,7 @@ Examples:
50 50
51 client, isRemote := GetRemoteClient()51 client, isRemote := GetRemoteClient()
52 if !isRemote {52 if !isRemote {
53- fmt.Println(styles.RenderError("secrets command requires --target flag or GORDON_TARGET env var"))53+ fmt.Println(styles.RenderError("secrets command requires --remote flag or GORDON_REMOTE env var"))
54 fmt.Println(styles.Theme.Muted.Render("Local secret management is not yet supported."))54 fmt.Println(styles.Theme.Muted.Render("Local secret management is not yet supported."))
55 return nil55 return nil
56 }56 }
@@ -102,7 +102,7 @@ Secrets are specified as KEY=value pairs. Multiple secrets can be set at once.
102 Examples:102 Examples:
103 gordon secrets set app.mydomain.com DATABASE_URL=postgres://localhost/db103 gordon secrets set app.mydomain.com DATABASE_URL=postgres://localhost/db
104 gordon secrets set app.mydomain.com API_KEY=secret123 DEBUG=false104 gordon secrets set app.mydomain.com API_KEY=secret123 DEBUG=false
105- gordon --target https://gordon.mydomain.com secrets set api.mydomain.com TOKEN=abc`,105+ gordon --remote https://gordon.mydomain.com secrets set api.mydomain.com TOKEN=abc`,
106 Args: cobra.MinimumNArgs(2),106 Args: cobra.MinimumNArgs(2),
107 RunE: func(cmd *cobra.Command, args []string) error {107 RunE: func(cmd *cobra.Command, args []string) error {
108 ctx := context.Background()108 ctx := context.Background()
@@ -111,7 +111,7 @@ Examples:
111 111
112 client, isRemote := GetRemoteClient()112 client, isRemote := GetRemoteClient()
113 if !isRemote {113 if !isRemote {
114- fmt.Println(styles.RenderError("secrets command requires --target flag or GORDON_TARGET env var"))114+ fmt.Println(styles.RenderError("secrets command requires --remote flag or GORDON_REMOTE env var"))
115 return nil115 return nil
116 }116 }
117 117
@@ -163,7 +163,7 @@ Examples:
163 163
164 client, isRemote := GetRemoteClient()164 client, isRemote := GetRemoteClient()
165 if !isRemote {165 if !isRemote {
166- fmt.Println(styles.RenderError("secrets command requires --target flag or GORDON_TARGET env var"))166+ fmt.Println(styles.RenderError("secrets command requires --remote flag or GORDON_REMOTE env var"))
167 return nil167 return nil
168 }168 }
169 169

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