This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Pipecat CLI (pipecat / pc) is a code generation and scaffolding tool for building, deploying, and monitoring Pipecat AI voice agents. The main command is pipecat init, which generates complete project skeletons from Jinja2 templates. It supports both interactive (Questionary prompts) and non-interactive (CLI flags / JSON config) modes.
uv sync --all-extras --dev # Install all dependencies
uv run pytest # Run all tests
uv run pytest tests/test_service_registry.py # Run a single test file
uv run pytest -k "test_name" # Run a specific test
uv run pytest -m "not slow" # Skip slow tests
uv run ruff check src/ # Lint
uv run ruff format src/ # Format
uv run scripts/update_registry.py # Regenerate _imports.py and _configs.py
uv run scripts/check_registry.py # Validate registry completeness- Typer app in
src/pipecat_cli/main.py— registers theinitcommand directly, then discovers external commands (cloud,tail) via thepipecat_cli.extensionsentry point group. - Entry points: both
pipecatandpcmap topipecat_cli.main:app.
Three-layer pattern with strict ownership:
service_metadata.py— SOURCE OF TRUTH. AllServiceDefinitionentries for transports, STT, LLM, TTS, realtime, and video services live here. Also containsFEATURE_DEFINITIONSandMANUAL_SERVICE_CONFIGS. Edit this file when adding/changing services.service_loader.py— Query and validation logic. Static methods for finding services, getting imports, resolving extras. All operations on registry data go here._configs.py/_imports.py— AUTO-GENERATED. Never edit directly. Regenerate withuv run scripts/update_registry.pyafter changingservice_metadata.py.
- Add a
ServiceDefinitionto the appropriate list inservice_metadata.py - Run
uv run scripts/update_registry.py - Run tests to verify:
uv run pytest tests/test_service_registry.py
project.pyorchestrates file creation using Jinja2 templates fromsrc/pipecat_cli/templates/.- Templates are organized:
server/(bot.py, server.py, pyproject.toml, etc.),client/(vanilla-js-vite, react-vite, react-nextjs),_readme_blocks/. - Generated Python files are auto-formatted with Ruff post-generation.
- Interactive:
questions.pydrives a Questionary-based prompt flow, producing aProjectConfigdataclass. - Non-interactive: Triggered by
--nameor--configflags.config_validator.pyhandles validation, collecting all errors before raising (not fail-fast). Supports--dry-runto output resolved config as JSON.
- Ruff with line-length 100. Only import sorting rules (
select = ["I"]). - Pre-commit hooks:
ruff --fixandruff-format. - Tests are excluded from Ruff linting.