CLI Overview
The Daita CLI provides a powerful, git-like interface for building, testing, and deploying AI agents. With simple commands and sensible defaults, you can go from idea to production quickly and efficiently.
Overview
The Daita CLI is designed around familiar git-like commands that make AI agent development feel natural for developers. Whether you're initializing a new project, creating agents, or deploying to the cloud, the CLI provides a consistent and intuitive interface.
Installation
Install the Daita CLI with all dependencies:
pip install daita-agents[cli]
Verify your installation:
daita --version
# Output: Daita CLI v0.1.0
Quick Start
Get started with a new project in under a minute:
# Create a new project
daita init my-agent --type analysis
cd my-agent
# Set your API key
export OPENAI_API_KEY="your-key-here"
# Create your first agent
daita create agent data_processor
# Test it locally
daita test
# Deploy to production (requires DAITA_API_KEY)
daita push
Command Structure
All Daita CLI commands follow a consistent pattern:
daita [GLOBAL_OPTIONS] COMMAND [ARGUMENTS] [COMMAND_OPTIONS]
Global Options
These options work with all commands:
| Option | Short | Description |
|---|---|---|
--verbose | -v | Enable detailed output for debugging |
--quiet | -q | Suppress non-error messages |
--help | -h | Show help information |
Example usage:
daita --verbose test my_agent
daita -v push production --force
Core Commands
Project Management
Development
create- Generate agents, workflows, and componentstest- Test agents and workflows with live reload
Deployment
Utilities
utilities- Version information and documentation access
Environment Setup
Required Environment Variables
Configure these environment variables for full CLI functionality:
# LLM Provider Keys (choose your provider)
export OPENAI_API_KEY="sk-your-openai-key"
export ANTHROPIC_API_KEY="sk-ant-your-anthropic-key"
export GOOGLE_API_KEY="your-google-key"
export XAI_API_KEY="xai-your-grok-key"
# Daita Platform (for cloud deployment features)
export DAITA_API_KEY="your-daita-api-key"
Optional Configuration
Customize CLI behavior with these optional variables:
# API endpoint (usually not needed)
export DAITA_API_ENDPOINT="https://api.daita-tech.io"
# Log level
export DAITA_LOG_LEVEL="INFO" # DEBUG, INFO, WARNING, ERROR
Project Context
Most CLI commands require you to be inside a Daita project directory. A Daita project is identified by the presence of a .daita/ folder and daita-project.yaml configuration file.
Commands that require project context:
create- Create agents and workflowstest- Run tests locallypush- Deploy to cloud (requires DAITA_API_KEY)status- Show project statuslogs- View deployment logs (requires DAITA_API_KEY)run- Execute agents/workflows remotely (requires DAITA_API_KEY)deployments- Manage deployments (requires DAITA_API_KEY)webhook- Webhook management (requires DAITA_API_KEY)
Commands that work anywhere:
init- Initialize new projectsversion- Show version infodocs- Open documentation
If you run a project-context command outside a Daita project, you'll see:
❌ Not in a Daita project directory.
Run 'daita init' to create a new project.
Project Structure
A typical Daita project created by daita init looks like:
my-project/
├── .daita/ # Daita metadata and cache
│ ├── cache/ # Local cache files
│ └── deployments.json # Deployment history
├── agents/ # AI agent definitions
│ ├── __init__.py
│ └── example_agent.py
├── workflows/ # Multi-agent workflows
│ ├── __init__.py
│ └── example_workflow.py
├── data/ # Data files and samples
├── tests/ # Test files
│ ├── __init__.py
│ ├── test_agents.py
│ └── test_workflows.py
├── daita-project.yaml # Project configuration
├── requirements.txt # Python dependencies
├── .gitignore # Git ignore rules
└── README.md # Project documentation
Configuration File
The daita-project.yaml file controls your project settings:
name: my-project
version: 1.0.0
description: My AI agent project
created_at: '2025-01-15T10:00:00'
# Agent Definitions
agents:
- name: data_processor
display_name: "Data Processor"
type: substrate
created_at: '2025-01-15T10:00:00'
# Optional: Retry configuration
enable_retry: true
retry_policy:
max_retries: 3
base_delay: 1.0
max_delay: 60.0
strategy: exponential
# Workflow Definitions
workflows:
- name: data_pipeline
display_name: "Data Pipeline"
type: basic
created_at: '2025-01-15T10:00:00'
# Webhook Configuration (optional)
agents:
- name: github_agent
webhooks:
- slug: "github-push"
field_mapping:
"repository.name": "repo_name"
"commits[0].message": "commit_message"
# Schedule Configuration (optional)
schedules:
agents:
data_processor:
cron: "0 */6 * * *"
enabled: true
timezone: "UTC"
Common Workflows
Development Workflow
# 1. Start a new project
daita init my-project --type analysis
cd my-project
# 2. Create components
daita create agent data_processor
daita create workflow data_pipeline
# 3. Develop with live testing
daita test --watch
# 4. Test specific components
daita test data_processor
Deployment Workflow
# 1. Ensure tests pass locally
daita test
# 2. Check project status
daita status
# 3. Deploy to production (requires DAITA_API_KEY)
daita push
# 4. Monitor deployment
daita logs --follow
# 5. Execute agent remotely
daita run data_processor --data input.json
Debugging Workflow
# 1. Run tests with verbose output
daita test --verbose
# 2. Check detailed status
daita status --verbose
# 3. Examine logs
daita logs --lines 100
# 4. Test with custom data
daita test my_agent --data debug_data.json
# 5. View execution history
daita executions --limit 20
Error Handling
The CLI provides clear error messages and appropriate exit codes for automation:
Exit Codes
0- Success1- General error2- Invalid command usage3- Project context error4- Configuration error5- Deployment error
Common Error Messages
Missing Dependencies:
❌ Missing CLI dependencies. Install with:
pip install PyYAML watchdog
Or install all CLI dependencies with:
pip install daita-agents[cli]
Invalid Project Configuration:
❌ Error: Invalid project configuration
Check your daita-project.yaml file for syntax errors
API Connection Issues:
❌ Failed to fetch deployments: Network error
Check your DAITA_API_KEY and network connection
Dependencies
The CLI requires these Python packages (installed automatically):
Core Dependencies
click- Command line interface frameworkpydantic- Configuration validationasyncio- Asynchronous operations
Optional Dependencies (CLI extras)
PyYAML- YAML configuration parsingwatchdog- File watching for developmentaiohttp- HTTP client for API calls
Install all dependencies:
pip install daita-agents[cli]
Getting Help
Command Help
Get help for any command:
daita --help # General help
daita init --help # Command-specific help
daita create agent --help # Subcommand help
Verbose Output
Enable detailed output for debugging:
daita --verbose test my_agent
daita -v push production
Documentation
- CLI Reference: Each command has detailed documentation
- Online Docs:
daita docsopens docs.daita-tech.io - Support: Get your DAITA_API_KEY at daita-tech.io
Next Steps
- Initialize a Project - Create your first Daita project
- Create Components - Generate agents and workflows
- Testing Guide - Test and debug your agents
- Deployment Guide - Deploy to production environments
- Monitoring Guide - Monitor deployments and debug issues
- Utilities - Version and documentation utilities
Tips and Best Practices
Development Tips
- Use watch mode: Develop with
daita test --watchfor immediate feedback - Start small: Begin with basic agents before building complex workflows
- Test frequently: Run tests after each significant change
- Use verbose mode: Enable
--verbosefor debugging issues
Project Organization
- Clear naming: Use descriptive names for agents and workflows
- Modular design: Keep agents focused on single responsibilities
- Documentation: Document your agents and workflows thoroughly
- Version control: Use git for tracking changes and collaboration
Deployment Best Practices
- Test locally first: Always test with
daita testbefore deploying - Monitor deployments: Watch logs during and after deployment with
daita logs --follow - Use dry-run: Preview deployment changes with
daita push --dry-run - Track deployments: Review deployment history with
daita deployments list
Troubleshooting
Common Issues
Command not found
# Ensure CLI is installed
pip install daita-agents[cli]
Permission denied
# Check file permissions
ls -la daita-project.yaml
API key issues
# Verify API key is set
echo $OPENAI_API_KEY
Getting Support
- Documentation: Use
daita docsfor comprehensive guides - GitHub Issues: Report bugs and request features
- Community: Join discussions and get support from other users