A Python CLI wrapper for the Tavus API that provides an interactive command-line interface for managing replicas, personas, and videos.
- Interactive CLI: Easy-to-use command-line interface with state machine navigation
- Replica Management: Create, list, rename, and delete replicas
- Persona Management: Create, list, and delete personas
- Video Generation: Generate videos using replicas and scripts
- Video Management: List, rename, and delete videos
- API Key Management: Secure API key handling with file-based storage
- Paginated Lists: Easy navigation through large lists of replicas, personas, and videos
- Filtering: Filter replicas and personas by type (user vs system)
- Interactive Selection: Choose replicas and personas from interactive lists
(the API key is invalid)
- Clone the repository:
git clone <repository-url>
cd tavus-python- Install dependencies:
pip install -r requirements.txtRun the CLI tool:
python src/main.pyThe tool supports API key configuration in two ways:
- File-based (Recommended): Create a
.tavus_api_keyfile in your project directory:
echo "your-tavus-api-key-here" > .tavus_api_key- Custom path: Specify a custom path for your API key file:
python src/main.py --api-key-file /path/to/your/api_key.txt- Interactive prompt: If no API key file is found, the tool will prompt you to enter your API key interactively.
--api-key-file,-f: Path to file containing the Tavus API key (default:.tavus_api_key)
- List all replicas
- Create new replicas
- Rename existing replicas
- Delete replicas
- View replica details
- List system and user personas with filtering
- Create new personas with custom system prompts and context
- Delete user personas
- View detailed persona information
- Generate videos using replicas and custom scripts
- List all videos
- Rename videos
- Delete videos
- View video details and status
tavus-python/
├── src/
│ ├── main.py # Main CLI entry point
│ ├── api_client.py # Tavus API client implementation
│ ├── state_machine_modular.py # Interactive state machine with modular architecture
│ ├── paginated_list.py # Paginated list display utilities
│ ├── paginated_bullet.py # Paginated bullet point selection
│ ├── paginated_replica_list.py # Specialized replica list pagination
│ ├── models/
│ │ ├── __init__.py
│ │ ├── persona.py # Persona data models
│ │ ├── replica.py # Replica data models
│ │ └── video.py # Video data models
│ ├── modules/
│ │ ├── __init__.py # Module registry and initialization
│ │ ├── api_key_module.py # API key management module
│ │ ├── persona_module.py # Persona management operations
│ │ ├── replica_module.py # Replica management operations
│ │ └── video_module.py # Video management operations
│ └── .tavus_api_key # API key file (create this)
├── img/
│ └── demo.gif # Demo animation
├── MODULAR_ARCHITECTURE.md # Documentation of modular design
├── README.md
└── requirements.txt # Python dependencies
- Store your API key in a
.tavus_api_keyfile (default) - The file should contain only your API key, no additional formatting
- Ensure the file has appropriate permissions (readable only by you)
- Add
.tavus_api_keyto your.gitignoreto prevent accidental commits
- Python 3.7+
click- Command line interface creation kitbullet- Interactive promptsyaspin- Terminal spinner for loading statesrequests- HTTP library for API calls
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
[Add your license information here]
For issues and questions:
- Create an issue in this repository
- Contact Tavus support for API-related questions
