Skip to content

Global --dry-run is silently ignored by most mutating commands, including bulk and relations #48

Description

@philipbjorge

--dry-run is accepted as a global flag on every subcommand, but only some command modules act on it. On the rest it parses cleanly, prints a result that looks like a preview, and performs the mutation anyway.

I hit this on relations add:

$ linear-cli relations add --relation blocked-by ENG-843 ENG-899 --dry-run -o json
{
  "issueRelation": {
    "id": "bfd68e80-...",
    "issue": { "identifier": "ENG-899" },
    "relatedIssue": { "identifier": "ENG-843" },
    "type": "blocks"
  },
  "success": true
}

The relation was real. Querying it back gave a createdAt matching the moment I ran the command, and I had to relations remove it. Nothing in the output distinguishes this from a genuine preview — "success": true and a populated id read as confirmation either way.

grep -rl dry_run src/commands/ shows which modules handle it:

Handles it: milestones roadmaps documents import issues sync views webhooks projects statuses initiatives templates cycles

Contains mutations but never reads dry_run: relations bulk comments labels attachments teams time triage project_updates favorites notifications sprint api interactive

bulk is the one I would prioritize — it is the command where a user is most likely to reach for --dry-run first, and it is the one where being wrong is most expensive.

Two options, either of which closes the trap:

  1. Implement --dry-run in the remaining modules.
  2. Cheaper and safer in the meantime: reject --dry-run with a clear error on any command that does not implement it. A loud "not supported for this command" is strictly better than a silent mutation, and it makes the gap self-documenting.

Happy to send a PR for (2) if you would like it — it is a small change and it stops the bleeding while (1) gets filled in per module.

Reported from an agent harness where --dry-run is exactly the guard we lean on before letting automation touch a workspace.

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