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_q_cli_unit.py -v -k "test_initialization"Unit tests are fast (< 1 second) and use mocked dependencies:
# Run all unit tests
uv run pytest test/providers/test_q_cli_unit.py -v
# Run with coverage report
uv run pytest test/providers/test_q_cli_unit.py --cov=src/cli_agent_orchestrator/providers/q_cli.py --cov-report=term-missing -v
# Run specific test class
uv run pytest test/providers/test_q_cli_unit.py::TestQCliProviderStatusDetection -v
# Run specific test
uv run pytest test/providers/test_q_cli_unit.py::TestQCliProviderStatusDetection::test_get_status_idle -vIntegration tests require Q CLI to be installed and authenticated:
# Run all integration tests (requires Q CLI setup)
uv run pytest test/providers/test_q_cli_integration.py -v
# Skip integration tests
uv run pytest test/providers/ -m "not integration" -vRequirements for Integration Tests:
- Q CLI must be installed (
qcommand available) - Q CLI must be authenticated (AWS credentials configured)
- tmux 3.2+ must be installed
# 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 -vgit checkout -b feature/your-feature-nameEdit code in src/cli_agent_orchestrator/
Add or update tests in test/
# Run unit tests (fast)
uv run pytest test/providers/test_q_cli_unit.py -v
# Run all tests
uv run pytest -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/CD will automatically run tests.
If Q CLI output format changes:
uv run python test/providers/fixtures/generate_fixtures.py# Ensure Q CLI is available
which q
# Ensure Q CLI is authenticated
q status
# Run integration tests
uv run pytest test/providers/test_q_cli_integration.py -vIf 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 (Q CLI, Claude Code)
│ ├── services/ # Business logic services
│ └── utils/ # Utility functions
├── test/ # Test suite
│ └── providers/ # Provider tests
│ ├── fixtures/ # Test fixtures
│ ├── test_q_cli_unit.py # Unit tests
│ └── test_q_cli_integration.py # Integration tests
├── docs/ # Documentation
├── examples/ # Example workflows
├── pyproject.toml # Project configuration
└── uv.lock # Locked dependencies