Skip to content

fix(cli): CLI-MCP-8/9/11 — --env passthrough, deploy stub label, resource unauth exit 3#17

Merged
mastermanas805 merged 1 commit into
masterfrom
fix/cli-hygiene-env-passthrough
May 29, 2026
Merged

fix(cli): CLI-MCP-8/9/11 — --env passthrough, deploy stub label, resource unauth exit 3#17
mastermanas805 merged 1 commit into
masterfrom
fix/cli-hygiene-env-passthrough

Conversation

@mastermanas805
Copy link
Copy Markdown
Member

Closes three QA-found CLI gaps from BugBash round 2 (see `/tmp/qa-session/shared/BACKLOG.md`).

CLI-MCP-8 — `--env` passthrough on all provisioning verbs (P1)

Before: every `instant new` command dropped the `env` parameter on the floor. The API has honored `env` since migration 026 (default `development`, CLAUDE.md rule 11), but agents had no surface to choose a non-default env without falling back to curl.

After: `db / cache / nosql / queue / storage / webhook / vector` each accept `--env `. Empty == server default; non-empty forwards verbatim in the request body. Output prints the resolved `env` and, when the server downgrades the request, `env_override_reason` so the user sees WHY their requested env didn't stick.

CLI-MCP-9 — deploy parent help labels as stub (P1)

`instant deploy` parent `cobra.Short` is now `[stub — current MCP/API path: POST /deploy/new or create_deploy via MCP. CLI deploy verbs not yet implemented]`. That one-liner is what surfaces in `instant --help`, so an agent's first contact with the deploy surface carries the canonical pointer.

CLI-MCP-11 — resource detail/delete exit 3 on unauth (P2)

`instant resource ` and `instant resource delete ` now short-circuit with `errAuthRequired` (exit 3) when the caller is unauthenticated, BEFORE any side effects. Matches the contract `instant resources` (list) already honors.

README

Adds a Multi-service stacks pointer (MCP `create_stack` / `POST /stacks/new`) plus `--env` usage examples.

Tests

  • `cmd/cli_mcp_gaps_test.go` (new) — five regression tests covering `--env` forwarding (single + table across all seven verbs), the empty-env fallback path, the `env_override_reason` surface line, the deploy stub label, and unauth exit 3 on both resource verbs.
  • Existing `TestExtras_Resource*` tests updated to call `authSetupForTest()` so the auth gate fires before the unrelated assertion.
  • `resetProvisionFlags()` clears the new `resourceEnv` global between cases and now covers all seven provisioning groups.

Verification

  • `make ci` green (build + vet + race-tested hermetic suite)
  • Project coverage 95.2% (≥95% floor)
  • diff-cover: 100% on patch (cmd/extras.go 100%, cmd/monitor.go 100%)

🤖 Generated with Claude Code

…urce unauth exit 3

Closes three CLI gaps surfaced by BugBash QA round 2 (see backlog
`fix/cli-hygiene-env-passthrough`):

CLI-MCP-8 — all seven provisioning verbs (db / cache / nosql / queue /
storage / webhook / vector) now accept `--env <name>`. Empty == server
default (development, CLAUDE.md rule 11); a non-empty value is forwarded
verbatim in the request body. The human output surfaces the resolved env
plus, when present, the server's env_override_reason so a downgrade
(e.g. anon caller asking for production demoted to development) is
visible.

CLI-MCP-9 — `instant deploy` parent cobra.Short is now explicitly
labeled as a stub and points at the canonical alternative
(MCP `create_deploy` / POST /deploy/new) so the root command list row
carries the pointer.

CLI-MCP-11 — `instant resource <token>` and `instant resource delete
<token>` short-circuit with errAuthRequired (exit 3) when the caller is
unauthenticated, BEFORE any side effects. Matches the contract that
`instant resources` (list) already honors. Tests updated to set up auth
where they previously relied on the anonymous path-token bypass.

README — adds a Multi-service stacks pointer (MCP `create_stack` /
POST /stacks/new) plus `--env` usage examples.

Tests:
  * cmd/cli_mcp_gaps_test.go — 3 new regression test groups covering
    env-flag forwarding (per verb, table-driven across all seven),
    deploy stub Short label, and unauth exit code on both resource verbs.
  * Existing TestExtras_Resource* tests updated to call authSetupForTest()
    so the auth gate fires before the unrelated assertion.
  * resetProvisionFlags() clears the new resourceEnv global between cases
    and now covers all seven provisioning groups.

`make ci` green; coverage 95.2% (above 95% floor).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@mastermanas805 mastermanas805 merged commit 67af56f into master May 29, 2026
10 checks passed
@mastermanas805 mastermanas805 deleted the fix/cli-hygiene-env-passthrough branch May 29, 2026 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant