feat(cli): add --json output flag to doctor, models, route, run, and analytics (#13)

- Adds optional `--json` / `-j` flag to CLI commands for scriptable output
- Redirects non-JSON logging messages to stderr under JSON mode
- Adds test suite for CLI JSON serialization in backend/tests/test_cli.py
- Updates documentation in README.md
This commit is contained in:
Sanaullah Turab
2026-09-11 19:15:22 +05:30
committed by GitHub
parent e6d9640112
commit 077b3e2af4
3 changed files with 206 additions and 90 deletions
+2 -1
View File
@@ -179,7 +179,8 @@ npm run dev
## CLI Usage
The built-in Typer CLI provides terminal commands for inspection, diagnostics, and testing (use `modelrouter` if installed via pip, or `python backend/app/cli/main.py` from source):
The built-in Typer CLI provides terminal commands for inspection, diagnostics, and testing (use `modelrouter` if installed via pip, or `python backend/app/cli/main.py` from source).
You can append `--json` or `-j` to most commands to output raw, pipeable JSON instead of Rich formatted tables:
```bash
# Launch the AI Traffic Control Room Web UI and API Gateway