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

@skevetterskevetter 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:

OldNew
--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

netlifyBot commented Jul 22, 2026

Copy link
Copy Markdown

Deploy Preview for images-devsy-sh canceled.

NameLink
🔨 Latest commitdc84f9b
🔍 Latest deploy loghttps://app.netlify.com/projects/images-devsy-sh/deploys/6a610fee31d9f900088bdb98

@coderabbitai

coderabbitaiBot 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

netlifyBot commented Jul 22, 2026

Copy link
Copy Markdown

Deploy Preview for devsydev canceled.

NameLink
🔨 Latest commitdc84f9b
🔍 Latest deploy loghttps://app.netlify.com/projects/devsydev/deploys/6a610feea61cb80008d5c593

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

Copy link
Copy Markdown
ContributorAuthor

@CodeRabbit review --committed

@coderabbitai

coderabbitaiBot 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
ContributorAuthor

@CodeRabbit review --base

@coderabbitai

coderabbitaiBot 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.

CopilotAI 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
FileDescription
pkg/tunnel/dial.goUse centralized flag constants in tunnel self-invocation args
pkg/tunnel/browser.goUse centralized flag constants in SSH tunnel command args
pkg/ssh/config.goBuild ProxyCommand using centralized flag constants
pkg/ssh/config_test.goUpdate SSH config expectations for new flag tokens
pkg/options/options.goExport git identity env var allowlist for reuse
pkg/ide/opener/opener.goUse centralized --command flag token
pkg/ide/opener/browser_tunnel.goUse centralized flags for internal browser-tunnel invocation
pkg/ide/opener/browser_tunnel_unix.goUse centralized flag token for inherited listener args
pkg/gpg/signing.goAdd extracted GPG signing helpers
pkg/gpg/signing_test.goUpdate tests to new gpg package + exported API
pkg/gpg/forward.goUse centralized flags for GPG agent forwarding SSH args
pkg/gpg/forward_test.goUpdate forwarding arg expectations
pkg/flags/devcontainer.goAdd shared devcontainer modifier flag registration helper
pkg/dotfiles/dotfiles.goUse centralized flags in dotfiles helper invocations
pkg/devcontainer/source.goExtend devcontainer source parsing (id/path/image/none) + flag name in errors
pkg/devcontainer/source_test.goUpdate/extend ParseSourceSpec test cases
pkg/devcontainer/setup.goUse centralized flags in container setup self-invocation
pkg/devcontainer/config/result.goAdd GetContainerID helper for result envelope
pkg/devcontainer/config/build.goUse centralized flag token in validation errors
pkg/devcontainer/config.goUse centralized flag token in JSON parse errors
pkg/devcontainer/config_test.goUpdate error-string expectations for renamed flag token
pkg/devcontainer/compose.goUse centralized flag token in recreate log message
pkg/daemon/agent/daemon.goUse centralized flags in daemon self-invocation args
pkg/config/config.goAdd ContextOptionBool helper
pkg/agent/delivery/workspace_seed.goUse centralized flag token in reset warning message
e2e/tests/up/up_behaviors.goUpdate up behavior tests to centralized flags
e2e/tests/up/provider_podman.goUpdate podman provider e2e arg construction to centralized flags
e2e/tests/up/provider_docker.goUpdate docker provider e2e arg construction to centralized flags
e2e/tests/up/dockerfile_build.goUpdate recreate invocation to centralized flag token
e2e/tests/up-docker-compose/build.goUpdate recreate invocation to centralized flag token
e2e/tests/template/template.goUse centralized --features flag token in template tests
e2e/tests/ssh/ssh.goUpdate GPG forwarding flag token used by e2e
e2e/tests/ssh/ssh_tunnel_mode_test.goUpdate SSH tunnel mode flag token used by e2e
e2e/tests/ide/browser_returns.goUpdate recreate arg mention + invocation to centralized flag token
e2e/tests/feature/features_test_cmd.goUse centralized --features flag token in feature tests
e2e/tests/exec/exec.goUpdate env probe flag token used by exec e2e
e2e/framework/command.goCentralize e2e framework flag tokens via names
cmd/workspace/up/up.goAdjust up command behavior + use names constants in flag plumbing
cmd/workspace/up/up_validate.goMove/extend devcontainer source validation + update error tokens
cmd/workspace/up/up_update_remote_user_uid_test.goUpdate tests for renamed update-remote-user-uid flag token
cmd/workspace/up/up_test.goUpdate flag lookups/parsing to use names constants
cmd/workspace/up/up_devcontainer_source_test.goAdd unit tests for devcontainer source resolution
cmd/workspace/up/up_client.goReuse shared git identity env var list
cmd/workspace/up/configure.goUse ContextOptionBool helper for config-driven bools
cmd/workspace/troubleshoot.goUpdate command short description text
cmd/workspace/stop.goUpdate command short description text
cmd/workspace/status.goSwitch to shared flag builder + centralized flag names
cmd/workspace/set_ide.goSwitch to shared flag builder + centralized flag names
cmd/workspace/ping.goRename parameter + update short description text
cmd/workspace/logs.goRename parameter + update short description text
cmd/workspace/list.goSwitch to shared flag builder + centralized flag names
cmd/workspace/import.goSwitch to shared flag builder + centralized flag names
cmd/workspace/export.goRename parameter + update short description text
cmd/workspace/exec.goSwitch to shared flag builder + shared devcontainer modifier flags
cmd/workspace/exec_test.goUpdate tests for centralized flag names
cmd/workspace/describe.goSwitch to shared flag builder + centralized flag names
cmd/workspace/delete.goSwitch to shared flag builder + centralized flag names
cmd/workspace/build_test.goUpdate build cmd tests for centralized flag names
cmd/template/publish.goSwitch to shared flag builder + centralized flag names
cmd/template/metadata.goSwitch to shared flag builder + centralized flag names
cmd/template/generate_docs.goSwitch to shared flag builder + centralized flag names
cmd/template/apply.goSwitch to shared flag builder + centralized flag names
cmd/self/update.goSwitch to shared flag builder + centralized flag names
cmd/self/update_test.goUpdate tests for centralized flag names
cmd/root.goUse centralized names for log-output/log-format tokens
cmd/provider/versions.goSwitch to shared flag builder + centralized flag names
cmd/provider/set.goSwitch to shared flag builder + centralized flag names
cmd/provider/set_source.goSwitch to shared flag builder + centralized flag names
cmd/provider/list.goSwitch to shared flag builder + centralized flag names
cmd/provider/init.goSwitch to shared flag builder + hidden flag via builder
cmd/provider/get.goSwitch to shared flag builder + centralized flag names
cmd/provider/delete.goSwitch to shared flag builder + centralized flag names
cmd/provider/add.goSwitch to shared flag builder + centralized flag names
cmd/pro/workspace/watch.goSwitch to shared flag builder + centralized flag names
cmd/pro/workspace/wakeup.goSwitch to shared flag builder + centralized flag names
cmd/pro/workspace/update.goSwitch to shared flag builder + centralized flag names
cmd/pro/workspace/sleep.goSwitch to shared flag builder + centralized flag names
cmd/pro/workspace/rebuild.goSwitch to shared flag builder + centralized flag names
cmd/pro/workspace/list.goSwitch to shared flag builder + centralized flag names
cmd/pro/workspace/import.goSwitch to shared flag builder + centralized flag names
cmd/pro/workspace/create.goSwitch to shared flag builder + centralized flag names
cmd/pro/version.goSwitch to shared flag builder + centralized flag names
cmd/pro/user/reset_password.goSwitch to shared flag builder + centralized flag names
cmd/pro/update_provider.goSwitch to shared flag builder + centralized flag names
cmd/pro/template/list.goSwitch to shared flag builder + centralized flag names
cmd/pro/start.goSwitch to shared flag builder + centralized flag names
cmd/pro/self.goSwitch to shared flag builder + centralized flag names
cmd/pro/provider/rebuild.goSwitch to shared flag builder + centralized flag names
cmd/pro/project/list.goSwitch to shared flag builder + centralized flag names
cmd/pro/logout.goSwitch to shared flag builder + centralized flag names
cmd/pro/login.goSwitch to shared flag builder + centralized flag names
cmd/pro/list.goSwitch to shared flag builder + centralized flag names
cmd/pro/health.goSwitch to shared flag builder + centralized flag names
cmd/pro/flags/flags.goUse centralized config flag name
cmd/pro/daemon/status.goSwitch to shared flag builder + centralized flag names
cmd/pro/daemon/start.goSwitch to shared flag builder + centralized flag names
cmd/pro/daemon/netcheck.goSwitch to shared flag builder + centralized flag names
cmd/pro/cluster/list.goSwitch to shared flag builder + centralized flag names
cmd/pro/cluster/add.goSwitch to shared flag builder + centralized flag names
cmd/pro/check_update.goSwitch to shared flag builder + centralized flag names
cmd/mcp/serve.goSwitch to shared flag builder + centralized flag names
cmd/machine/ssh.goSwitch to shared flag builder + centralized flag names
cmd/machine/delete.goSwitch to shared flag builder + centralized flag names
cmd/machine/create.goSwitch to shared flag builder + centralized flag names
cmd/internal/ssh_server.goUse centralized names for internal ssh-server flags
cmd/internal/ssh_git_clone.goSwitch to shared flag builder + centralized flag names
cmd/internal/ssh_client.goSwitch to shared flag builder + centralized flag names
cmd/internal/sh.goSwitch to shared flag builder + centralized flag names
cmd/internal/runusercommands.goSwitch to shared flag builder + update error/log tokens
cmd/internal/runusercommands_test.goUpdate tests for centralized flag names
cmd/internal/request.goSwitch to shared flag builder + centralized flag names
cmd/internal/git_credentials.goSwitch to shared flag builder + centralized flag names
cmd/internal/get.goSwitch to shared flag builder + centralized flag names
cmd/internal/get_workspace_config.goSwitch to shared flag builder + use ContextOptionBool
cmd/internal/fleet_server.goSwitch to shared flag builder + centralized flag names
cmd/internal/container_tunnel.goSwitch to shared flag builder + centralized flag names
cmd/internal/browser_tunnel.goSwitch to shared flag builder + centralized flag names
cmd/internal/browser_tunnel_test.goUpdate tests for centralized flag names
cmd/internal/agentworkspace/update_config.goSwitch to shared flag builder + centralized flag names
cmd/internal/agentworkspace/up.goSwitch to shared flag builder + centralized flag names
cmd/internal/agentworkspace/stop.goSwitch to shared flag builder + centralized flag names
cmd/internal/agentworkspace/status.goSwitch to shared flag builder + centralized flag names
cmd/internal/agentworkspace/setup_gpg.goSwitch to shared flag builder + centralized flag names
cmd/internal/agentworkspace/logs.goSwitch to shared flag builder + centralized flag names
cmd/internal/agentworkspace/logs_daemon.goSwitch to shared flag builder + centralized flag names
cmd/internal/agentworkspace/install_dotfiles.goSwitch to shared flag builder + centralized flag names
cmd/internal/agentworkspace/delete.goSwitch to shared flag builder + centralized flag names
cmd/internal/agentworkspace/clean.goSwitch to shared flag builder + centralized flag names
cmd/internal/agentworkspace/build.goSwitch to shared flag builder + centralized flag names
cmd/internal/agentcontainer/vscode_async.goSwitch to shared flag builder + centralized flag names
cmd/internal/agentcontainer/ssh_server.goSwitch to shared flag builder + centralized flag names
cmd/internal/agentcontainer/setup.goSwitch to shared flag builder + centralized flag names
cmd/internal/agentcontainer/post_attach.goSwitch to shared flag builder + centralized flag names
cmd/internal/agentcontainer/deferred_hooks.goSwitch to shared flag builder + centralized flag names
cmd/internal/agentcontainer/daemon.goSwitch to shared flag builder + centralized flag names
cmd/internal/agentcontainer/credentials_server.goSwitch to shared flag builder + centralized flag names
cmd/internal/agentcontainer/browser_async.goSwitch to shared flag builder + centralized flag names
cmd/internal/agent_docker_credentials.goSwitch to shared flag builder + centralized flag names
cmd/internal/agent_daemon.goSwitch to shared flag builder + centralized flag names
cmd/ide/use.goSwitch to shared flag builder + centralized flag names
cmd/ide/set.goSwitch to shared flag builder + centralized flag names
cmd/flags/flags.goCentralize global flag names + bind env using constants
cmd/flag_aliases_test.goRemove tests for removed hidden legacy aliases; keep log-format alias test
cmd/feature/upgrade.goSwitch to shared flag builder + centralized flag names
cmd/feature/upgrade_test.goUpdate tests for centralized flag names
cmd/feature/test.goSwitch to shared flag builder + centralized flag names
cmd/feature/test_test.goUpdate tests for centralized flag names
cmd/feature/resolvedeps.goSwitch to shared flag builder + centralized flag names
cmd/feature/publish.goSwitch to shared flag builder + centralized flag names
cmd/feature/publish_test.goUpdate tests for centralized flag names
cmd/feature/package.goSwitch to shared flag builder + centralized flag names
cmd/feature/package_test.goUpdate tests for centralized flag names
cmd/feature/outdated.goSwitch to shared flag builder + centralized flag names
cmd/feature/info.goSwitch to shared flag builder + centralized flag names
cmd/feature/info_test.goUpdate tests for centralized flag names
cmd/feature/generatedocs.goSwitch to shared flag builder + centralized flag names
cmd/env_flags_test.goUpdate env flag tests to centralized flag names
cmd/context/use.goSwitch to shared flag builder + centralized flag names
cmd/context/set_options.goSwitch to shared flag builder + centralized flag names
cmd/context/create.goSwitch to shared flag builder + centralized flag names
cmd/config/read.goSwitch to shared flag builder + centralized flag names
cmd/config/apply.goSwitch to shared flag builder for apply flags
cmd/completion/suggestions.goRegister 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 threadpkg/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
skevetterforce-pushed the feat/flag-system-refactor branch 2 times, most recently from c906976 to 776baa9CompareJuly 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
skevetterforce-pushed the feat/flag-system-refactor branch from 061745a to fa2773bCompareJuly 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`.
@skevetterskevetter changed the title refactor(flags): centralize CLI flag names and introduce a flag builderfeat!(flags): rename CLI flag names and add flag builderJul 22, 2026
@skevetter
skevetter merged commit bd6c326 into mainJul 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 freeto 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

@skevetter