fix: honor logged-in env for api-url, stop live menu leak, fix --env docs#18
Merged
Conversation
…docs Fixes three issues found during a full feature sweep of v5.0.0: - #15: `dcd live <subcommand>` printed the parent "Live Session Commands" menu after every subcommand, because citty invokes a parent command's `run` after dispatching to a subcommand. `liveCommand.run` now returns early when the first positional matches a subcommand name (same rule citty uses to dispatch). Also fixes the systemic doubled error wording ("Failed to execute test failed: ...") in ApiGateway.handleApiError. - #16: session commands defaulted --api-url to prod and ignored the api_url stored by `dcd login`, so a dev/staging Bearer token was sent to prod and rejected as "Invalid or expired JWT". Added resolveApiUrl() (explicit flag > stored config.api_url > prod) and routed cloud, upload, list, status, artifacts and live through it. switch-org now uses the shared helper instead of a hand-rolled copy. - #17: --env was described as "environment variable files" (valueHint: path) but actually parses KEY=VALUE pairs. Corrected the description and valueHint. Adds 6 unit tests covering resolveApiUrl precedence and the live menu behavior. Full suite: 128 passing. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jun 16, 2026
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
The `pnpm audit --audit-level moderate` CI step flagged three advisories in transitive/direct deps (unrelated to the feature fixes): - ws <8.21.0 (high, GHSA-96hv-2xvq-fx4p) via @supabase/realtime-js - tar <=7.5.15 (moderate, GHSA-vmf3-w455-68vh) - js-yaml <=4.1.1 (moderate, GHSA-h67p-54hq-rp68) Extend the existing pnpm.overrides pattern to force patched versions: ws 8.21.0, tar 7.5.16, js-yaml 4.2.0. `pnpm audit` is now clean; full suite still 128 passing. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #15, #16, #17 — found during a full feature sweep of v5.0.0 against the dev environment.
Changes
#16 — session commands ignored the env stored by
dcd logincloud/upload/list/status/artifacts/livedefaulted--api-urlto prod and ignored theapi_urlstored at login, so a dev/staging Bearer token was sent to prod and rejected with a misleading "Invalid or expired JWT".switch-orgalready guarded against this with a hand-rolled fallback.resolveApiUrl(flag)inutils/config-store.tswith precedence explicit flag → storedconfig.api_url→ prod.defaultfromapiFlags['api-url']so explicit-vs-default is distinguishable.switch-orgnow uses it too (dedupes its copy).#15 —
dcd live <subcommand>printed the parent menu afterwardscitty invokes a parent command's
runafter dispatching to a subcommand, andliveCommanddefines bothsubCommandsand arunthat prints the menu.runnow returns early when the first positional inrawArgsis a subcommand name (the same "first non-flag arg" rule citty uses to dispatch, so it can't disagree with what citty actually ran).Also fixes the systemic doubled wording in
ApiGateway.handleApiError— operation strings are phrased"Failed to …"while the default branch appended" failed:", yielding e.g.Failed to execute test failed: …. NowFailed to execute test: ….#17 —
--envdocumented as a file pathThe flag parses
KEY=VALUEpairs but was described as "environment variable files" withvalueHint: 'path'. Corrected the description andvalueHinttoKEY=VALUE.Tests
resolveApiUrl precedencesuite (explicit > stored > prod, blank flag handling).live command menusuite (bareliveshows the menu; every subcommand suppresses it).🤖 Generated with Claude Code