Skip to content

feat!(flags): rename CLI flag names and add flag builder#714

Merged
skevetter merged 7 commits into
mainfrom
feat/flag-system-refactor
Jul 22, 2026
Merged

feat!(flags): rename CLI flag names and add flag builder#714
skevetter merged 7 commits into
mainfrom
feat/flag-system-refactor

Conversation

@skevetter

@skevetter skevetter commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Centralizes every devsy-owned CLI flag name into pkg/flags/names as the single source of truth, and adds a pkg/flags builder for uniform flag registration. Flag names become compile-checked constants instead of raw strings scattered across command definitions and self-invocation sites — so renaming a flag is a single edit the compiler propagates everywhere, and a mistyped flag fails to build rather than breaking silently at runtime.

What changed

  • pkg/flags/names — dependency-light leaf (imports only fmt) holding all flag-name constants plus Flag/FlagValue/FlagTrue/FlagFalse helpers. Importable from both cmd/ and pkg/ self-invocation builders without pulling in cobra. names_test.go pins every constant to its literal wire string, so an accidental value change fails CI rather than silently altering the CLI contract or devsy self-invocation command lines.
  • pkg/flags builderString/Bool/Int/Int64/Duration/StringSlice/StringArray/Value constructors with chainable .Shorthand()/.Hidden(), registered via Add/AddPersistent.
  • Converted all cmd/ and pkg/ flag registrations, error messages, and devsy self-invocation command lines to the constants.
  • Extracted GPG signing helpers into pkg/gpg/signing.go.

Breaking changes

Backward compatibility is intentionally not preserved. Several flags are renamed for consistency and the hidden legacy up aliases are removed:

Old New
--additional-features --features
--configure-ssh --ssh-configure
--default-user-env-probe --user-env-probe
--extra-devcontainer-path --devcontainer-overlay
--git-clone-recursive-submodules --git-recurse-submodules
--gpg-agent-forwarding --ssh-gpg-forwarding
--prebuild-repository --prebuild-repo
--ssh-tunnel-mode --ssh-tunnel
--update-remote-user-uid-default --update-remote-user-uid

Removed aliases: --config, --override-config, --dotfiles-repository, --remove-existing-container — use the canonical flag names.

Other wire names are unchanged; devsy self-invocation command lines were verified byte-identical to main.

@netlify

netlify Bot commented Jul 22, 2026

Copy link
Copy Markdown

Deploy Preview for images-devsy-sh canceled.

Name Link
🔨 Latest commit dc84f9b
🔍 Latest deploy log https://app.netlify.com/projects/images-devsy-sh/deploys/6a610fee31d9f900088bdb98

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Important

Review skipped

Too many files!

This PR contains 182 files, which is 82 over the limit of 100.

To get a review, narrow the scope:
• coderabbit review --committed # exclude uncommitted changes
• coderabbit review --dir # limit to a subdirectory
• coderabbit review --base # compare against a closer base

Upgrade to a paid plan to raise the limit.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b562c8cc-7582-41d2-9767-4b891f260a8e

📥 Commits

Reviewing files that changed from the base of the PR and between 0da0cf9 and dc84f9b.

⛔ Files ignored due to path filters (1)
  • sites/docs-devsy-sh/yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (182)
  • cmd/completion/suggestions.go
  • cmd/config/apply.go
  • cmd/config/read.go
  • cmd/context/create.go
  • cmd/context/set_options.go
  • cmd/context/use.go
  • cmd/env_flags_test.go
  • cmd/feature/generatedocs.go
  • cmd/feature/info.go
  • cmd/feature/info_test.go
  • cmd/feature/outdated.go
  • cmd/feature/package.go
  • cmd/feature/package_test.go
  • cmd/feature/publish.go
  • cmd/feature/publish_test.go
  • cmd/feature/resolvedeps.go
  • cmd/feature/test.go
  • cmd/feature/test_test.go
  • cmd/feature/upgrade.go
  • cmd/feature/upgrade_test.go
  • cmd/flag_aliases_test.go
  • cmd/flags/flags.go
  • cmd/ide/set.go
  • cmd/ide/use.go
  • cmd/internal/agent_daemon.go
  • cmd/internal/agent_docker_credentials.go
  • cmd/internal/agentcontainer/browser_async.go
  • cmd/internal/agentcontainer/credentials_server.go
  • cmd/internal/agentcontainer/daemon.go
  • cmd/internal/agentcontainer/deferred_hooks.go
  • cmd/internal/agentcontainer/post_attach.go
  • cmd/internal/agentcontainer/setup.go
  • cmd/internal/agentcontainer/ssh_server.go
  • cmd/internal/agentcontainer/vscode_async.go
  • cmd/internal/agentworkspace/build.go
  • cmd/internal/agentworkspace/clean.go
  • cmd/internal/agentworkspace/delete.go
  • cmd/internal/agentworkspace/install_dotfiles.go
  • cmd/internal/agentworkspace/logs.go
  • cmd/internal/agentworkspace/logs_daemon.go
  • cmd/internal/agentworkspace/setup_gpg.go
  • cmd/internal/agentworkspace/status.go
  • cmd/internal/agentworkspace/stop.go
  • cmd/internal/agentworkspace/up.go
  • cmd/internal/agentworkspace/update_config.go
  • cmd/internal/browser_tunnel.go
  • cmd/internal/browser_tunnel_test.go
  • cmd/internal/container_tunnel.go
  • cmd/internal/fleet_server.go
  • cmd/internal/get.go
  • cmd/internal/get_workspace_config.go
  • cmd/internal/git_credentials.go
  • cmd/internal/request.go
  • cmd/internal/runusercommands.go
  • cmd/internal/runusercommands_test.go
  • cmd/internal/sh.go
  • cmd/internal/ssh_client.go
  • cmd/internal/ssh_git_clone.go
  • cmd/internal/ssh_server.go
  • cmd/machine/create.go
  • cmd/machine/delete.go
  • cmd/machine/ssh.go
  • cmd/mcp/serve.go
  • cmd/minor_flags_test.go
  • cmd/pro/check_update.go
  • cmd/pro/cluster/add.go
  • cmd/pro/cluster/list.go
  • cmd/pro/daemon/netcheck.go
  • cmd/pro/daemon/start.go
  • cmd/pro/daemon/status.go
  • cmd/pro/flags/flags.go
  • cmd/pro/health.go
  • cmd/pro/list.go
  • cmd/pro/login.go
  • cmd/pro/logout.go
  • cmd/pro/project/list.go
  • cmd/pro/provider/rebuild.go
  • cmd/pro/self.go
  • cmd/pro/start.go
  • cmd/pro/template/list.go
  • cmd/pro/update_provider.go
  • cmd/pro/user/reset_password.go
  • cmd/pro/version.go
  • cmd/pro/workspace/create.go
  • cmd/pro/workspace/import.go
  • cmd/pro/workspace/list.go
  • cmd/pro/workspace/rebuild.go
  • cmd/pro/workspace/sleep.go
  • cmd/pro/workspace/update.go
  • cmd/pro/workspace/wakeup.go
  • cmd/pro/workspace/watch.go
  • cmd/provider/add.go
  • cmd/provider/delete.go
  • cmd/provider/get.go
  • cmd/provider/init.go
  • cmd/provider/list.go
  • cmd/provider/set.go
  • cmd/provider/set_source.go
  • cmd/provider/versions.go
  • cmd/root.go
  • cmd/self/update.go
  • cmd/self/update_test.go
  • cmd/template/apply.go
  • cmd/template/generate_docs.go
  • cmd/template/metadata.go
  • cmd/template/publish.go
  • cmd/workspace/build.go
  • cmd/workspace/build_test.go
  • cmd/workspace/delete.go
  • cmd/workspace/describe.go
  • cmd/workspace/exec.go
  • cmd/workspace/exec_test.go
  • cmd/workspace/export.go
  • cmd/workspace/import.go
  • cmd/workspace/list.go
  • cmd/workspace/logs.go
  • cmd/workspace/ping.go
  • cmd/workspace/set_ide.go
  • cmd/workspace/ssh.go
  • cmd/workspace/status.go
  • cmd/workspace/stop.go
  • cmd/workspace/troubleshoot.go
  • cmd/workspace/up/configure.go
  • cmd/workspace/up/up.go
  • cmd/workspace/up/up_client.go
  • cmd/workspace/up/up_devcontainer_source_test.go
  • cmd/workspace/up/up_flags.go
  • cmd/workspace/up/up_test.go
  • cmd/workspace/up/up_update_remote_user_uid_test.go
  • cmd/workspace/up/up_validate.go
  • desktop/src/main/ipc.ts
  • desktop/src/renderer/src/lib/components/workspace/WorkspaceWizard.svelte
  • desktop/src/renderer/src/lib/components/workspace/WorkspaceWizard.test.ts
  • desktop/src/renderer/src/lib/ipc/commands.test.ts
  • desktop/src/renderer/src/lib/ipc/commands.ts
  • desktop/src/renderer/src/lib/utils/workspace-source.test.ts
  • desktop/src/renderer/src/lib/utils/workspace-source.ts
  • e2e/framework/command.go
  • e2e/tests/configread/configread.go
  • e2e/tests/exec/exec.go
  • e2e/tests/feature/features_test_cmd.go
  • e2e/tests/ide/browser_returns.go
  • e2e/tests/ssh/ssh.go
  • e2e/tests/ssh/ssh_tunnel_mode_test.go
  • e2e/tests/template/template.go
  • e2e/tests/up-docker-compose/build.go
  • e2e/tests/up-features/up_features.go
  • e2e/tests/up/dockerfile_build.go
  • e2e/tests/up/provider_docker.go
  • e2e/tests/up/provider_podman.go
  • e2e/tests/up/up_behaviors.go
  • pkg/agent/delivery/workspace_seed.go
  • pkg/config/config.go
  • pkg/daemon/agent/daemon.go
  • pkg/devcontainer/compose.go
  • pkg/devcontainer/config.go
  • pkg/devcontainer/config/build.go
  • pkg/devcontainer/config/result.go
  • pkg/devcontainer/config_test.go
  • pkg/devcontainer/setup.go
  • pkg/devcontainer/source.go
  • pkg/devcontainer/source_test.go
  • pkg/dotfiles/dotfiles.go
  • pkg/flags/builder.go
  • pkg/flags/devcontainer.go
  • pkg/flags/names/names.go
  • pkg/flags/names/names_test.go
  • pkg/gpg/forward.go
  • pkg/gpg/forward_test.go
  • pkg/gpg/signing.go
  • pkg/gpg/signing_test.go
  • pkg/ide/opener/browser_tunnel.go
  • pkg/ide/opener/browser_tunnel_unix.go
  • pkg/ide/opener/opener.go
  • pkg/options/options.go
  • pkg/ssh/config.go
  • pkg/ssh/config_test.go
  • pkg/tunnel/browser.go
  • pkg/tunnel/dial.go
  • sites/docs-devsy-sh/package.json
  • sites/docs-devsy-sh/pages/developing-in-workspaces/credentials.mdx
  • sites/docs-devsy-sh/pages/developing-in-workspaces/prebuild-a-workspace.mdx

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Review on demand using usage pricing

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@netlify

netlify Bot commented Jul 22, 2026

Copy link
Copy Markdown

Deploy Preview for devsydev canceled.

Name Link
🔨 Latest commit dc84f9b
🔍 Latest deploy log https://app.netlify.com/projects/devsydev/deploys/6a610feea61cb80008d5c593

@skevetter
skevetter force-pushed the feat/flag-system-refactor branch from 34631a3 to 44b2cea Compare July 22, 2026 06:41
@skevetter
skevetter marked this pull request as ready for review July 22, 2026 06:51
@skevetter

Copy link
Copy Markdown
Contributor Author

@CodeRabbit review --committed

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

@skevetter I’ll review the committed changes in #714.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@skevetter

Copy link
Copy Markdown
Contributor Author

@CodeRabbit review --base

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

@skevetter I’ll review the full PR diff against its base branch.

✅ Action performed

Full review finished.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors devsy’s CLI flag handling by centralizing flag wire names into a shared pkg/flags/names package and introducing a small flag-registration builder to standardize cobra/pflag usage across commands and internal self-invocation call sites.

Changes:

  • Replaced scattered raw flag strings with compile-checked constants and helper renderers (names.Flag*) across cmd/, pkg/, and e2e tests.
  • Introduced shared flag registration helpers (builder + shared devcontainer modifier flag registration).
  • Extracted GPG signing-key detection into pkg/gpg/signing.go and added supporting tests.

Reviewed changes

Copilot reviewed 170 out of 170 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pkg/tunnel/dial.go Use centralized flag constants in tunnel self-invocation args
pkg/tunnel/browser.go Use centralized flag constants in SSH tunnel command args
pkg/ssh/config.go Build ProxyCommand using centralized flag constants
pkg/ssh/config_test.go Update SSH config expectations for new flag tokens
pkg/options/options.go Export git identity env var allowlist for reuse
pkg/ide/opener/opener.go Use centralized --command flag token
pkg/ide/opener/browser_tunnel.go Use centralized flags for internal browser-tunnel invocation
pkg/ide/opener/browser_tunnel_unix.go Use centralized flag token for inherited listener args
pkg/gpg/signing.go Add extracted GPG signing helpers
pkg/gpg/signing_test.go Update tests to new gpg package + exported API
pkg/gpg/forward.go Use centralized flags for GPG agent forwarding SSH args
pkg/gpg/forward_test.go Update forwarding arg expectations
pkg/flags/devcontainer.go Add shared devcontainer modifier flag registration helper
pkg/dotfiles/dotfiles.go Use centralized flags in dotfiles helper invocations
pkg/devcontainer/source.go Extend devcontainer source parsing (id/path/image/none) + flag name in errors
pkg/devcontainer/source_test.go Update/extend ParseSourceSpec test cases
pkg/devcontainer/setup.go Use centralized flags in container setup self-invocation
pkg/devcontainer/config/result.go Add GetContainerID helper for result envelope
pkg/devcontainer/config/build.go Use centralized flag token in validation errors
pkg/devcontainer/config.go Use centralized flag token in JSON parse errors
pkg/devcontainer/config_test.go Update error-string expectations for renamed flag token
pkg/devcontainer/compose.go Use centralized flag token in recreate log message
pkg/daemon/agent/daemon.go Use centralized flags in daemon self-invocation args
pkg/config/config.go Add ContextOptionBool helper
pkg/agent/delivery/workspace_seed.go Use centralized flag token in reset warning message
e2e/tests/up/up_behaviors.go Update up behavior tests to centralized flags
e2e/tests/up/provider_podman.go Update podman provider e2e arg construction to centralized flags
e2e/tests/up/provider_docker.go Update docker provider e2e arg construction to centralized flags
e2e/tests/up/dockerfile_build.go Update recreate invocation to centralized flag token
e2e/tests/up-docker-compose/build.go Update recreate invocation to centralized flag token
e2e/tests/template/template.go Use centralized --features flag token in template tests
e2e/tests/ssh/ssh.go Update GPG forwarding flag token used by e2e
e2e/tests/ssh/ssh_tunnel_mode_test.go Update SSH tunnel mode flag token used by e2e
e2e/tests/ide/browser_returns.go Update recreate arg mention + invocation to centralized flag token
e2e/tests/feature/features_test_cmd.go Use centralized --features flag token in feature tests
e2e/tests/exec/exec.go Update env probe flag token used by exec e2e
e2e/framework/command.go Centralize e2e framework flag tokens via names
cmd/workspace/up/up.go Adjust up command behavior + use names constants in flag plumbing
cmd/workspace/up/up_validate.go Move/extend devcontainer source validation + update error tokens
cmd/workspace/up/up_update_remote_user_uid_test.go Update tests for renamed update-remote-user-uid flag token
cmd/workspace/up/up_test.go Update flag lookups/parsing to use names constants
cmd/workspace/up/up_devcontainer_source_test.go Add unit tests for devcontainer source resolution
cmd/workspace/up/up_client.go Reuse shared git identity env var list
cmd/workspace/up/configure.go Use ContextOptionBool helper for config-driven bools
cmd/workspace/troubleshoot.go Update command short description text
cmd/workspace/stop.go Update command short description text
cmd/workspace/status.go Switch to shared flag builder + centralized flag names
cmd/workspace/set_ide.go Switch to shared flag builder + centralized flag names
cmd/workspace/ping.go Rename parameter + update short description text
cmd/workspace/logs.go Rename parameter + update short description text
cmd/workspace/list.go Switch to shared flag builder + centralized flag names
cmd/workspace/import.go Switch to shared flag builder + centralized flag names
cmd/workspace/export.go Rename parameter + update short description text
cmd/workspace/exec.go Switch to shared flag builder + shared devcontainer modifier flags
cmd/workspace/exec_test.go Update tests for centralized flag names
cmd/workspace/describe.go Switch to shared flag builder + centralized flag names
cmd/workspace/delete.go Switch to shared flag builder + centralized flag names
cmd/workspace/build_test.go Update build cmd tests for centralized flag names
cmd/template/publish.go Switch to shared flag builder + centralized flag names
cmd/template/metadata.go Switch to shared flag builder + centralized flag names
cmd/template/generate_docs.go Switch to shared flag builder + centralized flag names
cmd/template/apply.go Switch to shared flag builder + centralized flag names
cmd/self/update.go Switch to shared flag builder + centralized flag names
cmd/self/update_test.go Update tests for centralized flag names
cmd/root.go Use centralized names for log-output/log-format tokens
cmd/provider/versions.go Switch to shared flag builder + centralized flag names
cmd/provider/set.go Switch to shared flag builder + centralized flag names
cmd/provider/set_source.go Switch to shared flag builder + centralized flag names
cmd/provider/list.go Switch to shared flag builder + centralized flag names
cmd/provider/init.go Switch to shared flag builder + hidden flag via builder
cmd/provider/get.go Switch to shared flag builder + centralized flag names
cmd/provider/delete.go Switch to shared flag builder + centralized flag names
cmd/provider/add.go Switch to shared flag builder + centralized flag names
cmd/pro/workspace/watch.go Switch to shared flag builder + centralized flag names
cmd/pro/workspace/wakeup.go Switch to shared flag builder + centralized flag names
cmd/pro/workspace/update.go Switch to shared flag builder + centralized flag names
cmd/pro/workspace/sleep.go Switch to shared flag builder + centralized flag names
cmd/pro/workspace/rebuild.go Switch to shared flag builder + centralized flag names
cmd/pro/workspace/list.go Switch to shared flag builder + centralized flag names
cmd/pro/workspace/import.go Switch to shared flag builder + centralized flag names
cmd/pro/workspace/create.go Switch to shared flag builder + centralized flag names
cmd/pro/version.go Switch to shared flag builder + centralized flag names
cmd/pro/user/reset_password.go Switch to shared flag builder + centralized flag names
cmd/pro/update_provider.go Switch to shared flag builder + centralized flag names
cmd/pro/template/list.go Switch to shared flag builder + centralized flag names
cmd/pro/start.go Switch to shared flag builder + centralized flag names
cmd/pro/self.go Switch to shared flag builder + centralized flag names
cmd/pro/provider/rebuild.go Switch to shared flag builder + centralized flag names
cmd/pro/project/list.go Switch to shared flag builder + centralized flag names
cmd/pro/logout.go Switch to shared flag builder + centralized flag names
cmd/pro/login.go Switch to shared flag builder + centralized flag names
cmd/pro/list.go Switch to shared flag builder + centralized flag names
cmd/pro/health.go Switch to shared flag builder + centralized flag names
cmd/pro/flags/flags.go Use centralized config flag name
cmd/pro/daemon/status.go Switch to shared flag builder + centralized flag names
cmd/pro/daemon/start.go Switch to shared flag builder + centralized flag names
cmd/pro/daemon/netcheck.go Switch to shared flag builder + centralized flag names
cmd/pro/cluster/list.go Switch to shared flag builder + centralized flag names
cmd/pro/cluster/add.go Switch to shared flag builder + centralized flag names
cmd/pro/check_update.go Switch to shared flag builder + centralized flag names
cmd/mcp/serve.go Switch to shared flag builder + centralized flag names
cmd/machine/ssh.go Switch to shared flag builder + centralized flag names
cmd/machine/delete.go Switch to shared flag builder + centralized flag names
cmd/machine/create.go Switch to shared flag builder + centralized flag names
cmd/internal/ssh_server.go Use centralized names for internal ssh-server flags
cmd/internal/ssh_git_clone.go Switch to shared flag builder + centralized flag names
cmd/internal/ssh_client.go Switch to shared flag builder + centralized flag names
cmd/internal/sh.go Switch to shared flag builder + centralized flag names
cmd/internal/runusercommands.go Switch to shared flag builder + update error/log tokens
cmd/internal/runusercommands_test.go Update tests for centralized flag names
cmd/internal/request.go Switch to shared flag builder + centralized flag names
cmd/internal/git_credentials.go Switch to shared flag builder + centralized flag names
cmd/internal/get.go Switch to shared flag builder + centralized flag names
cmd/internal/get_workspace_config.go Switch to shared flag builder + use ContextOptionBool
cmd/internal/fleet_server.go Switch to shared flag builder + centralized flag names
cmd/internal/container_tunnel.go Switch to shared flag builder + centralized flag names
cmd/internal/browser_tunnel.go Switch to shared flag builder + centralized flag names
cmd/internal/browser_tunnel_test.go Update tests for centralized flag names
cmd/internal/agentworkspace/update_config.go Switch to shared flag builder + centralized flag names
cmd/internal/agentworkspace/up.go Switch to shared flag builder + centralized flag names
cmd/internal/agentworkspace/stop.go Switch to shared flag builder + centralized flag names
cmd/internal/agentworkspace/status.go Switch to shared flag builder + centralized flag names
cmd/internal/agentworkspace/setup_gpg.go Switch to shared flag builder + centralized flag names
cmd/internal/agentworkspace/logs.go Switch to shared flag builder + centralized flag names
cmd/internal/agentworkspace/logs_daemon.go Switch to shared flag builder + centralized flag names
cmd/internal/agentworkspace/install_dotfiles.go Switch to shared flag builder + centralized flag names
cmd/internal/agentworkspace/delete.go Switch to shared flag builder + centralized flag names
cmd/internal/agentworkspace/clean.go Switch to shared flag builder + centralized flag names
cmd/internal/agentworkspace/build.go Switch to shared flag builder + centralized flag names
cmd/internal/agentcontainer/vscode_async.go Switch to shared flag builder + centralized flag names
cmd/internal/agentcontainer/ssh_server.go Switch to shared flag builder + centralized flag names
cmd/internal/agentcontainer/setup.go Switch to shared flag builder + centralized flag names
cmd/internal/agentcontainer/post_attach.go Switch to shared flag builder + centralized flag names
cmd/internal/agentcontainer/deferred_hooks.go Switch to shared flag builder + centralized flag names
cmd/internal/agentcontainer/daemon.go Switch to shared flag builder + centralized flag names
cmd/internal/agentcontainer/credentials_server.go Switch to shared flag builder + centralized flag names
cmd/internal/agentcontainer/browser_async.go Switch to shared flag builder + centralized flag names
cmd/internal/agent_docker_credentials.go Switch to shared flag builder + centralized flag names
cmd/internal/agent_daemon.go Switch to shared flag builder + centralized flag names
cmd/ide/use.go Switch to shared flag builder + centralized flag names
cmd/ide/set.go Switch to shared flag builder + centralized flag names
cmd/flags/flags.go Centralize global flag names + bind env using constants
cmd/flag_aliases_test.go Remove tests for removed hidden legacy aliases; keep log-format alias test
cmd/feature/upgrade.go Switch to shared flag builder + centralized flag names
cmd/feature/upgrade_test.go Update tests for centralized flag names
cmd/feature/test.go Switch to shared flag builder + centralized flag names
cmd/feature/test_test.go Update tests for centralized flag names
cmd/feature/resolvedeps.go Switch to shared flag builder + centralized flag names
cmd/feature/publish.go Switch to shared flag builder + centralized flag names
cmd/feature/publish_test.go Update tests for centralized flag names
cmd/feature/package.go Switch to shared flag builder + centralized flag names
cmd/feature/package_test.go Update tests for centralized flag names
cmd/feature/outdated.go Switch to shared flag builder + centralized flag names
cmd/feature/info.go Switch to shared flag builder + centralized flag names
cmd/feature/info_test.go Update tests for centralized flag names
cmd/feature/generatedocs.go Switch to shared flag builder + centralized flag names
cmd/env_flags_test.go Update env flag tests to centralized flag names
cmd/context/use.go Switch to shared flag builder + centralized flag names
cmd/context/set_options.go Switch to shared flag builder + centralized flag names
cmd/context/create.go Switch to shared flag builder + centralized flag names
cmd/config/read.go Switch to shared flag builder + centralized flag names
cmd/config/apply.go Switch to shared flag builder for apply flags
cmd/completion/suggestions.go Register completions using centralized flag names

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +33 to +36
{names.SSHConfigure, "ssh-configure"},
{names.SSHGPGForwarding, "ssh-gpg-forwarding"},
{names.SSHConfig, "ssh-config"},
{names.SSHTunnel, "ssh-tunnel"},
Comment thread pkg/devcontainer/config/result.go Outdated
Comment on lines +70 to +74
// Per DevContainer specification (https://containers.dev/implementors/json_reference/):
// "remoteUser: Overrides the user that devcontainer.json supporting services tools / runs as in the container...
// Defaults to the user the container as a whole is running as (often root).".
// GetContainerID returns the container ID from a result, or "" when absent.
func GetContainerID(result *Result) string {
@skevetter
skevetter force-pushed the feat/flag-system-refactor branch 2 times, most recently from c906976 to 776baa9 Compare July 22, 2026 13:58
Introduce pkg/flags/names as the single source of truth for every
devsy-owned CLI flag name, and pkg/flags builder for uniform flag
registration. Flag names are now compile-checked constants rather than
raw strings scattered across command definitions and self-invocation
sites, so a rename is a single edit the compiler propagates everywhere.

- pkg/flags/names: dependency-light leaf (imports only fmt) holding all
  flag-name constants plus Flag/FlagValue/FlagTrue/FlagFalse helpers,
  usable from both cmd/ and pkg/ self-invocation builders without cobra.
  names_test.go pins every constant to its literal wire string so an
  accidental value change fails the build rather than silently altering
  the CLI contract.
- pkg/flags builder: String/Bool/Int/Int64/Duration/StringSlice/
  StringArray/Value constructors with chainable Shorthand()/Hidden(),
  registered via Add/AddPersistent.
- Convert all cmd/ and pkg/ flag registrations and devsy self-invocation
  command lines to the constants; extract GPG signing helpers into
  pkg/gpg/signing.go.

BREAKING CHANGE: renames several flags for consistency (ignoring backward
compatibility) and removes hidden legacy aliases on `up`:

  additional-features            -> features
  configure-ssh                  -> ssh-configure
  default-user-env-probe         -> user-env-probe
  extra-devcontainer-path        -> devcontainer-overlay
  git-clone-recursive-submodules -> git-recurse-submodules
  gpg-agent-forwarding           -> ssh-gpg-forwarding
  prebuild-repository            -> prebuild-repo
  ssh-tunnel-mode                -> ssh-tunnel
  update-remote-user-uid-default -> update-remote-user-uid

  removed aliases: --config, --override-config, --dotfiles-repository,
  --remove-existing-container (use the canonical flag names).

Other wire names are unchanged; devsy self-invocation command lines were
verified byte-identical.
@skevetter
skevetter force-pushed the feat/flag-system-refactor branch from 061745a to fa2773b Compare July 22, 2026 14:52
The docs site declared @docusaurus/core/preset-classic at ^3.5.2 while
react/react-dom are at ^19. Docusaurus gained official React 19 support
in 3.6; pin the range to ^3.10.2 (already the resolved version) so the
declared dependency honestly reflects React 19 support rather than
relying on the caret range happening to resolve high. Verified with a
clean `yarn install --frozen-lockfile && yarn build`.
The flag refactor renames several flags; update the non-Go consumers
that reference them by literal string:

- desktop/src/main/ipc.ts: --prebuild-repository -> --prebuild-repo
  (the desktop app shells out to the devsy CLI; the old name would fail
  with "unknown flag" whenever a prebuild repository was set).
- docs: --prebuild-repository -> --prebuild-repo and
  --gpg-agent-forwarding -> --ssh-gpg-forwarding in the workspace guides.
Wire the CLI's --devcontainer flag into the workspace wizard. The
Advanced section's single "Dev container config" path field becomes a
"Dev container source" mode selector that maps 1:1 to the flag forms:

  Auto-detect (default) -> flag omitted (project discovery)
  Config file path      -> --devcontainer <path>
  Container image       -> --devcontainer image:<ref>
  Named profile         -> --devcontainer id:<name>
  Ignore project config -> --devcontainer none

The value input only appears for modes that need one, and blank values
for path/image/id fall back to omitting the flag so an invalid
"image:"/"id:" token is never emitted. buildDevcontainerArg centralizes
the mode->flag mapping and is covered by unit tests; the IPC layer now
forwards a single `devcontainer` string instead of `devcontainerPath`.
@skevetter skevetter changed the title refactor(flags): centralize CLI flag names and introduce a flag builder feat!(flags): rename CLI flag names and add flag builder Jul 22, 2026
@skevetter
skevetter merged commit bd6c326 into main Jul 22, 2026
66 checks passed
@skevetter
skevetter deleted the feat/flag-system-refactor branch July 22, 2026 19:35
skevetter added a commit that referenced this pull request Jul 22, 2026
Migrate the ci command's flag registration to the pkg/flags builder + names
constants introduced in #714, matching build/up/exec. Flag renames that follow
from the new convention:
- --env            -> --remote-env      (names.RemoteEnv, matches exec)
- --additional-features -> --features    (shared devcontainer modifier flag)
- --git-clone-recursive-submodules -> --git-recurse-submodules
- drop --config alias and --devcontainer-id (removed repo-wide in #714)

Update ci e2e/unit tests and docs to the new names.
skevetter added a commit that referenced this pull request Jul 22, 2026
Replace ci's --devcontainer-path with the unified --devcontainer selector
(none | image:<ref> | id:<name> | path), matching devsy up after #714.
Restores the ability to target a named .devcontainer/<name> profile — the
former --devcontainer-id — which was dropped in the flag-builder migration.

Parse the selector into the CLIOptions image/id/path fields before resolving
the workspace so it flows through RunHeadless to the agent. Adds a unit test
and docs.
skevetter added a commit that referenced this pull request Jul 22, 2026
Migrate the ci command's flag registration to the pkg/flags builder + names
constants introduced in #714, matching build/up/exec. Flag renames that follow
from the new convention:
- --env            -> --remote-env      (names.RemoteEnv, matches exec)
- --additional-features -> --features    (shared devcontainer modifier flag)
- --git-clone-recursive-submodules -> --git-recurse-submodules
- drop --config alias and --devcontainer-id (removed repo-wide in #714)

Update ci e2e/unit tests and docs to the new names.
skevetter added a commit that referenced this pull request Jul 22, 2026
Replace ci's --devcontainer-path with the unified --devcontainer selector
(none | image:<ref> | id:<name> | path), matching devsy up after #714.
Restores the ability to target a named .devcontainer/<name> profile — the
former --devcontainer-id — which was dropped in the flag-builder migration.

Parse the selector into the CLIOptions image/id/path fields before resolving
the workspace so it flows through RunHeadless to the agent. Adds a unit test
and docs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants