This guide covers setting up your development environment and running tests for the CLI Agent Orchestrator project.
- Python 3.10 or higher
- uv - Fast Python package installer and resolver
- Git
- tmux 3.2+ (for running the orchestrator and integration tests)
git clone https://github.com/awslabs/cli-agent-orchestrator.git
cd cli-agent-orchestrator/The project uses uv for package management. Install all dependencies including development packages:
uv syncThis command:
- Creates a virtual environment (if one doesn't exist)
- Installs all project dependencies
- Installs development dependencies (pytest, coverage tools, linters, etc.)
# Check that the CLI is available
uv run cao --help
# Run a quick test to ensure everything is working
uv run pytest test/providers/test_kiro_cli_unit.py -v -k "test_initialization"If you prefer a pre-configured cloud environment, the project runs end-to-end inside a GitHub Codespace. See docs/codespaces.md for the server start command, port forwarding, and troubleshooting tips.
The web UI is a React + Vite + Tailwind app in web/.
# Install frontend dependencies
cd web/
npm install
# Start dev server (hot-reloads on file changes)
npm run dev # http://localhost:5173
# Build for production (outputs to src/cli_agent_orchestrator/web_ui/)
npm run buildImportant: The build step is required before installing the package with
uv tool install .. Skipping it leavesweb_ui/empty and causescao-serverto return404 Not Foundon every request to the web UI. Runnpm run buildfromweb/first, then reinstall:cd web && npm run build uv tool install --reinstall .
The Vite dev server proxies API calls to the backend at localhost:9889. Make sure cao-server is running before starting the frontend.
Recording test fixtures? Provider fixtures are captured from live CLI output and can embed secrets/PII (including in ANSI escape streams). Record on a synthetic account and scrub identity/banner lines before committing — see CONTRIBUTING.md. A gitleaks scan gates every PR; run it locally with
scripts/security-scan.sh gitleaks.
Unit tests are fast and use mocked dependencies:
# Run all unit tests (excludes E2E and integration tests)
uv run pytest test/ --ignore=test/e2e -m "not integration" -v
# Run with coverage report
uv run pytest test/ --ignore=test/e2e -m "not integration" --cov=src --cov-report=term-missing -v
# Run specific test file
uv run pytest test/providers/test_claude_code_unit.py -v
# Run specific test class
uv run pytest test/providers/test_codex_provider_unit.py::TestCodexBuildCommand -vIntegration tests require the provider CLI to be installed and authenticated:
# Run integration tests for a specific provider (example: Kiro CLI)
uv run pytest test/providers/test_kiro_cli_integration.py -v
# Skip integration tests
uv run pytest test/providers/ -m "not integration" -vE2E tests require a running CAO server, authenticated CLI tools, and tmux:
# Run all E2E tests
uv run pytest -m e2e test/e2e/ -v
# Run E2E tests for a specific provider
uv run pytest -m e2e test/e2e/ -v -k codex# Run all tests
uv run pytest -v
# Run tests with coverage for all modules
uv run pytest --cov=src --cov-report=term-missing -v
# Run tests in parallel (faster)
uv run pytest -n autoTests are organized with pytest markers:
# Run only integration tests
uv run pytest -m integration -v
# Skip slow tests
uv run pytest -m "not slow" -v
# Run only async tests
uv run pytest -m asyncio -vThe project uses black for code formatting:
# Format all Python files
uv run black src/ test/
# Check formatting without making changes
uv run black --check src/ test/The project uses isort for organizing imports:
# Sort imports
uv run isort src/ test/
# Check import sorting without making changes
uv run isort --check-only src/ test/The project uses mypy for static type checking:
# Run type checker
uv run mypy src/# Format, sort imports, type check, and run tests
uv run black src/ test/
uv run isort src/ test/
uv run mypy src/
uv run pytest -vValidate maintained local Markdown paths and heading fragments:
uv run python scripts/validate_markdown_links.pygit checkout -b feature/your-feature-nameEdit code in src/cli_agent_orchestrator/
Add or update tests in test/
# Run unit tests (fast, excludes E2E and integration)
uv run pytest test/ --ignore=test/e2e -m "not integration" -v
# Run all tests with coverage
uv run pytest test/ --ignore=test/e2e --cov=src --cov-report=term-missing -vuv run black src/ test/
uv run isort src/ test/
uv run mypy src/git add .
git commit -m "Add feature: description"
git push origin feature/your-feature-nameCreate a pull request on GitHub. CI will automatically run tests and code quality checks.
Runs on all pushes to main and all PRs targeting main:
- Unit tests: Python 3.10, 3.11, 3.12 matrix with coverage
- Code quality: black, isort, mypy
- Security scan: Trivy filesystem scan — fails on a finding of any severity (see SECURITY.md for why the workflow's
CRITICAL,HIGHinput is ignored) - Dependency review: License and vulnerability checks on PRs
Each provider has a dedicated workflow that runs only when its files change:
| Workflow | Tests | Trigger Paths |
|---|---|---|
test-codex-provider.yml |
test_codex_provider_unit.py |
providers/codex.py, test/providers/** |
test-claude-code-provider.yml |
test_claude_code_unit.py |
providers/claude_code.py, test/providers/** |
test-kiro-cli-provider.yml |
test_kiro_cli_unit.py |
providers/kiro_cli.py, test/providers/** |
Each includes unit tests (Python 3.10/3.11/3.12) and code quality checks (black, isort, mypy).
Builds the Docusaurus site (docusaurus/) on every PR and push to main for a
build signal, but only deploys to GitHub Pages on the upstream repo
(awslabs/cli-agent-orchestrator) by default — forks don't have Pages enabled,
so actions/deploy-pages would otherwise fail with a 404. Fork maintainers can
opt in by enabling GitHub Pages in their fork and setting the DEPLOY_DOCS_PAGES
repository variable to true; see docusaurus/README.md
for the full steps.
Integration tests exercise a real provider binary, so the CLI must be installed and authenticated before they can run. Using Kiro CLI as an example:
# Ensure the provider CLI is on PATH
which kiro
# Ensure it is authenticated (provider-specific; see docs/<provider>.md)
kiro --help
# Run that provider's integration tests
uv run pytest test/providers/test_kiro_cli_integration.py -vThe same pattern applies to every provider that ships an <provider>_integration.py file — substitute the binary and the test filename.
The web UI assets are not committed to the repository — they are a build artifact.
If cao-server starts successfully but the browser shows {"detail":"Not Found"},
the web_ui/ bundle is missing from the installed package.
# 1. Build the frontend
cd web && npm install && npm run build
# 2. Reinstall the package so the built assets are picked up
cd ..
uv tool install --reinstall .If you encounter import errors when running tests:
# Re-sync dependencies
uv sync
# If that doesn't work, remove the virtual environment and start fresh
rm -rf .venv
uv sync# Run with verbose output
uv run pytest -vv
# Run a specific failing test
uv run pytest test/path/to/test.py::test_name -vv
# Show print statements
uv run pytest -s# Generate detailed coverage report
uv run pytest --cov=src --cov-report=html
# Open htmlcov/index.html in your browser
# Show missing lines
uv run pytest --cov=src --cov-report=term-missing# Add a new runtime dependency
uv add package-name
# Add with version constraint
uv add "package-name>=1.0.0"# Add a new development dependency
uv add --dev package-namecli-agent-orchestrator/
├── src/
│ └── cli_agent_orchestrator/ # Main source code
│ ├── api/ # FastAPI server
│ ├── cli/ # CLI commands
│ ├── clients/ # Database and tmux clients
│ ├── mcp_server/ # MCP server implementation
│ ├── models/ # Data models
│ ├── providers/ # Agent providers (Kiro CLI, Claude Code, Codex, Antigravity, Kimi, Copilot, OpenCode, Cursor)
│ ├── services/ # Business logic services
│ └── utils/ # Utility functions
├── test/ # Test suite (511 tests, 84% coverage)
│ ├── api/ # API endpoint tests
│ ├── cli/ # CLI command tests
│ ├── clients/ # Client tests (database, tmux)
│ ├── e2e/ # End-to-end tests (require running CAO server)
│ ├── mcp_server/ # MCP server tests
│ ├── models/ # Data model tests
│ ├── providers/ # Provider tests (unit + integration)
│ ├── services/ # Service layer tests
│ └── utils/ # Utility tests
├── docs/ # Documentation
├── examples/ # Example workflows
├── pyproject.toml # Project configuration
└── uv.lock # Locked dependencies