-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
Context
Split from #33 (CLI meta-issue). This is the first CLI issue — it establishes the entry point and the simplest command.
What to do
1. Create CLI entry point
Create chainweaver/cli.py using argparse (stdlib, no extra dependency):
def main() -> None:
parser = argparse.ArgumentParser(prog="chainweaver", description="ChainWeaver CLI")
subparsers = parser.add_subparsers(dest="command")
# inspect command
inspect_parser = subparsers.add_parser("inspect", help="Show flow structure")
inspect_parser.add_argument("flow_name", help="Name of the flow to inspect")
inspect_parser.add_argument("--format", choices=["table", "json"], default="table")
args = parser.parse_args()
# dispatch...2. Register entry point in pyproject.toml
[project.scripts]
chainweaver = "chainweaver.cli:main"3. Implement inspect command
chainweaver inspect <flow_name> prints flow structure:
- Flow name, description, deterministic flag
- Steps table: index, tool_name, input_mapping
--format jsonoutputs machine-readable JSON
Files to create/modify
chainweaver/cli.py— new CLI modulepyproject.toml— add[project.scripts]entrytests/test_cli.py— new test file
Acceptance Criteria
-
chainweaverCLI entry point is registered and callable afterpip install -e . -
chainweaver inspect <flow_name>prints flow structure (steps, mappings, metadata) -
--format jsonproduces valid JSON output -
--format tableis the default and produces human-readable table output - Exit codes: 0 = success, 1 = error
- At least 3 test cases: inspect valid flow, inspect missing flow, JSON output format
Out of Scope
validate,checkcommands (→ separate issue)vizcommand (→ separate issue)execute,suggestcommands (deferred)
Dependencies
None — uses in-memory registry and flows.
Part of CLI split from #33. See also: validate/check CLI, viz CLI.
Reactions are currently unavailable