Skip to content

Add validate and check CLI commands #45

@dgenio

Description

@dgenio

Context

Split from #33 (CLI meta-issue). This issue adds flow validation commands to the CLI established in #44.

What to do

1. validate command

chainweaver validate <file> validates a flow definition file (YAML/JSON):

chainweaver validate flows/my_flow.flow.yaml

2. check command

chainweaver check <directory> validates all .flow.yaml / .flow.json files in a directory:

chainweaver check flows/
  • Scans directory for flow files
  • Validates each one
  • Summary output: N valid, M invalid
  • --quiet flag for CI (exit code only)

3. Output formatting

  • --format json for machine-readable output (list of validation results)
  • --format table for human-readable table (default)

Files to modify

  • chainweaver/cli.py — add validate and check subcommands
  • tests/test_cli.py — add validation command tests

Acceptance Criteria

  • chainweaver validate <file> validates a flow file and reports errors
  • chainweaver check <dir> validates all flow files in a directory
  • Invalid flows produce clear error messages with details
  • Exit codes: 0 = all valid, 1 = validation errors, 2 = file/dir not found
  • --format json produces machine-readable output
  • --quiet suppresses output (exit code only)
  • At least 4 test cases: validate valid flow, validate invalid flow, check directory, file not found

Out of Scope

Dependencies


Part of CLI split from #33. See also: #44 (CLI entry + inspect), viz CLI.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions