Skip to content

Add --dry-run flag for mutating CLI commands #9

@gmoon

Description

@gmoon

Requirement

REQ-CLI-022 — Dry-run mode for mutating CLI operations

Summary

Mutating commands (add, edit, resolve, refine) should support a --dry-run flag that validates input and prints what would be created or modified without writing to disk. This provides a safety net for agent operations.

Lower priority than schema introspection and skill auto-generation since lattice mutations are local files with git undo available.

Motivation

Inspired by gws --dry-run from gws which validates requests before execution. Their CONTEXT.md instructs agents to always use dry-run for mutating operations first. See SRC-GWS-CLI in the lattice.

Example

$ lattice add requirement --id REQ-NEW-001 --title "Test" --body "Body" \
    --priority P1 --category TEST --dry-run
Would create requirement: REQ-NEW-001
  Title: Test
  Priority: P1
  Category: TEST
  File: .lattice/requirements/test/001-test.yaml
  (dry run — no files written)

Acceptance Criteria

  • --dry-run flag accepted on add, edit, resolve, refine commands
  • Validates all input (ID format, required fields, edge targets exist)
  • Prints what would be created/modified without writing
  • --format json works with dry-run for structured preview
  • Exit code 0 on valid input, non-zero on validation failure

Lattice

  • Derives from: THX-AGENT-NATIVE-TOOLS
  • Source: SRC-GWS-CLI
  • Priority: P2

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions