The build command with --type cli generates a complete, pip-installable CLI tool from a command graph JSON.
dist/myapi/
├── pyproject.toml # pip-installable with entry point
├── src/myapi/
│ ├── __init__.py
│ ├── cli.py # Typer CLI with all commands
│ ├── client.py # requests HTTP client with auth + errors
│ └── _graph.json # Embedded command graph
myapi get-user abc123 # not --user-id abc123
myapi delete-user abc123
myapi get-project p1myapi create-user --name "John" --email "john@test.com"
myapi create-project --name "Alpha" --owner-id u1--body bypasses individual flags and sends raw JSON:
myapi create-user --body '{"name": "John", "email": "john@test.com", "role": "admin"}'myapi list-users --pretty # Rich-formatted JSON
myapi list-users # Raw JSON (pipeable to jq)export MYAPI_BASE_URL=https://staging.api.com
myapi list-users # Hits staging instead of default| HTTP Status | CLI Message |
|---|---|
| 401 | Authentication failed. Set MYAPI_TOKEN environment variable. |
| 403 | Permission denied. |
| 404 | Resource not found. |
| 422 | Validation error: {details} |
| 429 | Rate limited. Try again later. |
| 5xx | API error {status}: {body} |
Generated CLI packages depend on:
typer>=0.9.0rich>=13.0.0requests>=2.31.0