Skip to main content

Development Commands

Build, test, and iterate on your Erdo agents with powerful development tools.

erdo dev

Start a development server with hot reload for rapid agent development.

Basic Usage

# Start development mode
erdo dev

# Specify custom port
erdo dev --port 8080

# Development with verbose logging
erdo dev --verbose

# Development with custom config
erdo dev --config ./custom-config.yaml

Advanced Options

OptionDescriptionExample
--portDevelopment server porterdo dev --port 3000
--hostServer host bindingerdo dev --host 0.0.0.0
--watchFile patterns to watcherdo dev --watch "*.py,*.yaml"
--no-reloadDisable hot reloaderdo dev --no-reload
--debugEnable debug modeerdo dev --debug
--envEnvironment fileerdo dev --env .env.development
--timeoutRequest timeouterdo dev --timeout 60

Development Features

# Auto-reload on file changes
erdo dev --watch "src/**/*.py"

# Watch specific patterns
erdo dev --watch "*.py,*.yaml,*.json"

# Exclude patterns
erdo dev --watch "*.py" --exclude "__pycache__,*.pyc"

Development Workflow

1

Initialize Project

bash erdo init my-agent cd my-agent
2

Start Development

bash erdo dev --port 3000 --watch "*.py"
3

Live Testing

bash # In another terminal erdo test --agent my-agent --watch
4

Deploy When Ready

bash erdo sync erdo deploy my-agent

erdo test

Run comprehensive tests for your agents with various testing modes.

Basic Testing

# Test all agents
erdo test

# Test specific agent
erdo test --agent data-processor

# Test with custom input
erdo test --agent email-classifier --input "Hello world"

# Test with input file
erdo test --agent document-parser --input-file ./test-data.json

Test Types

# Run unit tests for individual steps
erdo test --type unit --agent my-agent

# Test specific step
erdo test --type unit --agent my-agent --step analyze_data

# Test with mock data
erdo test --type unit --mock-llm --mock-tools
# Full integration testing
erdo test --type integration --agent my-agent

# Test agent interactions
erdo test --type integration --agents agent1,agent2

# Test with real services
erdo test --type integration --no-mocks
# Complete workflow testing
erdo test --type e2e --agent my-agent

# Test multiple scenarios
erdo test --type e2e --scenarios ./test-scenarios/

# Production-like testing
erdo test --type e2e --env production-test

Test Configuration

# Test with custom configuration
erdo test --config ./test-config.yaml

# Test with specific model
erdo test --model claude-sonnet-4 --agent my-agent

# Test with resource limits
erdo test --memory-limit 1GB --timeout 300

# Parallel testing
erdo test --parallel 4 --agents agent1,agent2,agent3

Test Reports

# Verbose test output
erdo test --verbose --agent my-agent

# Quiet mode (errors only)
erdo test --quiet --agent my-agent

# JSON output
erdo test --format json --agent my-agent

erdo init

Create new agent projects with templates and scaffolding.

Project Creation

# Basic agent creation
erdo init my-agent

# Create with template
erdo init data-processor --template data-analysis

# Initialize in current directory
erdo init . --name current-project

# Create with custom configuration
erdo init my-agent --config ./agent-template.yaml

Available Templates

Data Analysis

bash erdo init data-agent --template data-analysis For data processing and analytics workflows

Business Automation

bash erdo init automation-agent --template business-automation For process automation and workflow management

Research Assistant

bash erdo init research-agent --template research For information gathering and analysis

Content Processing

bash erdo init content-agent --template content-processing For document analysis and content generation

Template Options

# List available templates
erdo init --list-templates

# Create custom template
erdo init my-agent --template custom --template-path ./my-template/

# Template with dependencies
erdo init my-agent --template data-analysis --include-deps

# Template with example data
erdo init my-agent --template research --include-examples

Project Structure

my-agent/
├── agent.py              # Main agent definition
├── steps/                # Individual step implementations
│   ├── __init__.py
│   ├── data_processing.py
│   └── analysis.py
├── tests/               # Test files
│   ├── test_agent.py
│   └── test_steps.py
├── config/              # Configuration files
│   ├── development.yaml
│   └── production.yaml
├── data/               # Sample data and examples
│   └── sample_input.json
├── requirements.txt    # Python dependencies
├── .erdo/             # Erdo configuration
│   └── config.yaml
└── README.md          # Project documentation

erdo introspect

Analyze and understand agent structure and dependencies.

Basic Introspection

# Inspect agent structure
erdo introspect my-agent

# Show step dependencies
erdo introspect my-agent --dependencies

# Analyze data flow
erdo introspect my-agent --data-flow

# Show resource usage
erdo introspect my-agent --resources

Advanced Analysis

# Export agent schema
erdo introspect my-agent --schema --output schema.json

# Validate schema
erdo introspect my-agent --validate-schema

# Compare schemas
erdo introspect my-agent --compare-schema ./baseline-schema.json

Output Formats

# JSON output
erdo introspect my-agent --format json

# YAML output
erdo introspect my-agent --format yaml

# Markdown documentation
erdo introspect my-agent --format markdown --output ./docs/

# Visual diagram
erdo introspect my-agent --diagram --output ./agent-diagram.svg

erdo gen-client

Generate client code and documentation for your agents.

Client Generation

# Generate Python client
erdo gen-client --language python --output ./client/

# Generate TypeScript client
erdo gen-client --language typescript --output ./client/

# Generate Go client
erdo gen-client --language go --output ./client/

Generation Options

OptionDescriptionExample
--languageTarget language--language python
--outputOutput directory--output ./generated/
--agentsSpecific agents--agents agent1,agent2
--include-testsGenerate test files--include-tests
--package-namePackage name--package-name my-erdo-client
--versionClient version--version 1.0.0

Documentation Generation

# Generate API documentation
erdo gen-client --docs --format openapi --output ./docs/

# Generate SDK documentation
erdo gen-client --docs --format markdown --output ./docs/

# Generate interactive docs
erdo gen-client --docs --format interactive --output ./docs/

Development Best Practices

Fast Iteration

  • Use erdo dev with hot reload - Write tests early and often - Use mock data for faster testing - Monitor resource usage during development

Testing Strategy

  • Unit test individual steps - Integration test agent workflows - End-to-end test complete scenarios - Use CI/CD for automated testing

Code Quality

  • Use introspection for analysis - Follow naming conventions - Document agent purpose and usage - Regular security audits

Performance

  • Profile agent execution - Optimize step dependencies - Use parallel execution where possible - Monitor production metrics

Common Development Workflows

Feature Development

# 1. Create feature branch
git checkout -b feature/new-analysis-step

# 2. Start development server
erdo dev --watch "*.py" --auto-test

# 3. Implement and test
# Edit agent.py, add new step...

# 4. Run comprehensive tests
erdo test --agent my-agent --type integration

# 5. Deploy to staging
erdo sync --env staging
erdo deploy my-agent --env staging

Debug Workflow

# 1. Enable debug mode
erdo dev --debug --verbose

# 2. Run with tracing
erdo test --agent my-agent --trace --verbose

# 3. Analyze logs
erdo logs --agent my-agent --level debug

# 4. Introspect for issues
erdo introspect my-agent --performance --bottlenecks

Production Deployment

# 1. Final testing
erdo test --type e2e --env production-test

# 2. Generate documentation
erdo gen-client --docs --format openapi

# 3. Security audit
erdo introspect my-agent --security

# 4. Deploy to production
erdo sync --env production
erdo deploy my-agent --env production