fix(cli): use --remote flag in help text and error messages
- commit
- 1b2bc7babb565ad9d1dbd5479677b66311fb99a2
- author
- bnema · · 2026-01-16 21:11 UTC
- parent
- 1a3d40a
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
2 files · +12 -12
M internal/adapters/in/cli/routes.go +6 -6
| @@ -50,7 +50,7 @@ func newRoutesCmd() *cobra.Command { | |||
| 50 | 50 | Short: "Manage routes", | |
| 51 | 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 | 54 | these commands operate on the remote server. Otherwise, they require access to | |
| 55 | 55 | the local Gordon configuration.`, | |
| 56 | 56 | } | |
| @@ -72,7 +72,7 @@ func newRoutesListCmd() *cobra.Command { | |||
| 72 | 72 | ||
| 73 | 73 | client, isRemote := GetRemoteClient() | |
| 74 | 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 | 76 | fmt.Println(styles.Theme.Muted.Render("Local route management is not yet supported. Use the config file directly.")) | |
| 77 | 77 | return nil | |
| 78 | 78 | } | |
| @@ -137,7 +137,7 @@ func newRoutesAddCmd() *cobra.Command { | |||
| 137 | 137 | ||
| 138 | 138 | Examples: | |
| 139 | 139 | 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 | 141 | Args: cobra.ExactArgs(1), | |
| 142 | 142 | RunE: func(cmd *cobra.Command, args []string) error { | |
| 143 | 143 | ctx := context.Background() | |
| @@ -145,7 +145,7 @@ Examples: | |||
| 145 | 145 | ||
| 146 | 146 | client, isRemote := GetRemoteClient() | |
| 147 | 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 | 149 | return nil | |
| 150 | 150 | } | |
| 151 | 151 | ||
| @@ -193,7 +193,7 @@ Examples: | |||
| 193 | 193 | ||
| 194 | 194 | client, isRemote := GetRemoteClient() | |
| 195 | 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 | 197 | return nil | |
| 198 | 198 | } | |
| 199 | 199 | ||
| @@ -236,7 +236,7 @@ func newStatusCmd() *cobra.Command { | |||
| 236 | 236 | ||
| 237 | 237 | client, isRemote := GetRemoteClient() | |
| 238 | 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 | 240 | os.Exit(1) | |
| 241 | 241 | } | |
| 242 | 242 | ||
| @@ -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 to | 54 | 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 nil | 77 | 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:latest | 139 | 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 nil | 149 | 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 nil | 197 | 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 { | |||
| 20 | 20 | ||
| 21 | 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 | 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 | 43 | Examples: | |
| 44 | 44 | 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 | 46 | Args: cobra.ExactArgs(1), | |
| 47 | 47 | RunE: func(cmd *cobra.Command, args []string) error { | |
| 48 | 48 | ctx := context.Background() | |
| @@ -50,7 +50,7 @@ Examples: | |||
| 50 | 50 | ||
| 51 | 51 | client, isRemote := GetRemoteClient() | |
| 52 | 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 | 54 | fmt.Println(styles.Theme.Muted.Render("Local secret management is not yet supported.")) | |
| 55 | 55 | return nil | |
| 56 | 56 | } | |
| @@ -102,7 +102,7 @@ Secrets are specified as KEY=value pairs. Multiple secrets can be set at once. | |||
| 102 | 102 | Examples: | |
| 103 | 103 | gordon secrets set app.mydomain.com DATABASE_URL=postgres://localhost/db | |
| 104 | 104 | 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 | 106 | Args: cobra.MinimumNArgs(2), | |
| 107 | 107 | RunE: func(cmd *cobra.Command, args []string) error { | |
| 108 | 108 | ctx := context.Background() | |
| @@ -111,7 +111,7 @@ Examples: | |||
| 111 | 111 | ||
| 112 | 112 | client, isRemote := GetRemoteClient() | |
| 113 | 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 | 115 | return nil | |
| 116 | 116 | } | |
| 117 | 117 | ||
| @@ -163,7 +163,7 @@ Examples: | |||
| 163 | 163 | ||
| 164 | 164 | client, isRemote := GetRemoteClient() | |
| 165 | 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 | 167 | return nil | |
| 168 | 168 | } | |
| 169 | 169 | ||
| @@ -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.com | 44 | 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 nil | 55 | 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/db | 103 | gordon secrets set app.mydomain.com DATABASE_URL=postgres://localhost/db | ||
| 104 | gordon secrets set app.mydomain.com API_KEY=secret123 DEBUG=false | 104 | 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 nil | 115 | 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 nil | 167 | return nil | ||
| 168 | } | 168 | } | ||
| 169 | 169 | ||||