Skip to content

automation subcommand --help can execute mutations #2323

Description

@Danielalnajjar

Attempted workflow

Inspect command-specific help for an existing automation update before changing its configuration.

Actual result

--help is recognized only when it occupies the command token itself. When supplied after the update subcommand, it is parsed as an ordinary flag and the update executes. During a read-only review this replaced an automation prompt before the captured prior value was immediately restored.

Source evidence:

  • plugins/automations/src/cli.ts returns help only when parsed.command is help, --help, or -h.
  • The update branch then calls service.update(...) without rejecting or honoring a trailing help flag.

Expected result

bb automation <subcommand> --help and -h print that subcommand's usage and perform no read or write side effect. Unknown flags should fail rather than being silently ignored.

Acceptance criteria

  • Every automation subcommand treats --help and -h as side-effect-free help regardless of flag position.
  • Mutating subcommands never call their service method on a help request.
  • Unknown flags return a non-zero usage error.
  • Tests cover create, update, pause, resume, run, and delete with trailing help flags and assert zero mutations/runs.

AGENT GENERATED: by GPT-5.6 Sol

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions