Skip to content

stack: stack destroy should accept a list of stack ids #6964

Description

@avallete

Affected area

Local development

Problem to solve

stack destroy takes one target. --stack-id is a single string (apps/cli/src/commands/experimental/stack/destroy/destroy.command.ts), and so is --stack.

stack list often shows several stacks (old dogfood scratches, temp projects, one project with more than one name). Cleaning a chosen subset means one destroy invocation per id, each with its own confirmation. There is no --all on destroy (stop has --all). --all would also be the wrong tool when only some of the listed ids should go.

Proposed solution

Accept more than one id in one destroy:

supabase stack destroy --stack-id <id> --stack-id <id> --yes

Repeatable --stack-id. One confirmation for the whole set, listing every resolved id. --yes skips that prompt once, as it does today for a single id.

If one id fails, report that failure and keep going through the rest, then exit non-zero. Do not stop the batch on the first miss.

--stack and --stack-id stay mutually exclusive, including when several ids are passed.

Alternatives considered

  • A shell loop of stack destroy --stack-id … --yes. Works, and repeats startup and confirmation once per id.
  • --all, matching stack stop --all. That destroys every readable stack, not a chosen subset.
  • A comma-separated --stack-id a,b. Repeatable flags match the rest of the CLI better and do not need a new delimiter.

Additional context

Related: #6961. Text stack list currently prints an 8-character id that --stack-id rejects, so a batch flag is only usable with the full ids from --output-format json until that is fixed.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions