Skip to content

porch subcommands execute instead of showing help when passed --help (porch done --help ran the build-complete flow and committed) #1259

Description

@waleedkadous

Problem

porch done --help does not print help — it EXECUTES porch done: auto-detects the project from cwd, runs checks, prints BUILD COMPLETE, and calls writeStateAndCommit (dist/commands/porch/index.js ~line 345-347), producing a real commit.

Observed 2026-07-26 (shannon workspace): an agent ran porch done --help intending to check syntax before a bookkeeping operation; porch executed, committed a two-line status.yaml change, and (via a second bug, filed separately) landed that commit on the wrong branch of a closed lane, which had to be corrected in a report already delivered to the project owner.

A state-mutating CLI command that runs when asked for its own help text converts the safest possible user action (reading the docs) into an unintended write. --help should be handled before any subcommand side effect, for every subcommand.

Ask

Parse --help/-h at the subcommand level (or globally) before project auto-detection and execution, for all porch subcommands — especially the state-mutating ones (done, approve, run, next).

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