Skip to main content

CLI Commands

Complete reference for all Erdo CLI commands and their options.

Global Options

Available for all commands:
  • --help, -h: Show help information
  • --version, -v: Show version information
  • --config: Specify config file path
  • --verbose: Enable verbose output

Authentication Commands

erdo login

Authenticate with Erdo services.
erdo login
Options:
  • --token: Login with API token
  • --org: Specify organization
Examples:
# Interactive login
erdo login

# Login with token
erdo login --token your_api_token

erdo logout

Sign out of current session.
erdo logout

Project Commands

erdo init

Initialize a new Erdo project.
erdo init [project-name]
Options:
  • --template: Use project template
  • --python-version: Specify Python version
Examples:
# Create new project
erdo init my-project

# Use template
erdo init my-project --template data-analysis

erdo dev

Start development server.
erdo dev
Options:
  • --port: Specify port (default: 3000)
  • --host: Specify host (default: localhost)
  • --watch: Enable file watching

erdo build

Build project for deployment.
erdo build
Options:
  • --output: Output directory
  • --production: Production build

Agent Commands

erdo agent create

Create a new agent.
erdo agent create <name>
Options:
  • --template: Agent template
  • --description: Agent description
Examples:
# Create basic agent
erdo agent create data-analyzer

# Use template
erdo agent create sales-bot --template customer-service

erdo agent list

List all agents.
erdo agent list
Options:
  • --status: Filter by status
  • --tag: Filter by tag

erdo agent run

Run an agent.
erdo agent run <agent-name>
Options:
  • --input: Input data file
  • --params: Parameters JSON
  • --async: Run asynchronously
Examples:
# Run agent with input
erdo agent run data-analyzer --input data.csv

# Run with parameters
erdo agent run sales-bot --params '{"customer_id": "123"}'

erdo agent-test

Run agent tests with parallel execution.
erdo agent-test <test_file.py>
Description: The agent-test command discovers all agent_test_* functions in your Python test files and runs them in parallel for fast execution. Tests use the invoke() function with mode="replay" for fast, free testing. Options:
  • -v, --verbose: Show detailed error traces
  • -j, --jobs <N>: Number of parallel jobs (default: auto)
  • -r, --refresh: Force refresh cached responses in replay mode
Examples:
# Run all tests in a file
erdo agent-test tests/test_my_agent.py

# Verbose output (show full error traces)
erdo agent-test tests/test_my_agent.py --verbose

# Limit parallel jobs
erdo agent-test tests/test_my_agent.py -j 4

# Refresh cached responses (bypass cache in replay mode)
erdo agent-test tests/test_my_agent.py --refresh
Test Pattern: Write test functions with the agent_test_* prefix:
from erdo import invoke
from erdo.test import text_contains

def agent_test_basic_query():
    """Test basic agent invocation."""
    response = invoke(
        "my-agent",
        messages=[{"role": "user", "content": "Hello"}],
        mode="replay",  # Free after first run!
    )

    assert response.success
    assert text_contains(str(response.result), "expected text")
Output Example:
Discovering tests in tests/test_my_agent.py...
Found 15 tests

Running tests in parallel...

======================================================================
AGENT TEST RESULTS
======================================================================

✅ agent_test_csv_sales_total (0.45s)
✅ agent_test_csv_product_breakdown (0.52s)
❌ agent_test_invalid_dataset (0.21s)

----------------------------------------------------------------------
Total: 15 | Passed: 14 | Failed: 1 | Duration: 2.3s
----------------------------------------------------------------------
See Also:

erdo export-bot

Export agents for backup, sharing, migration, or local development.
erdo export-bot <agent-name>
Basic Usage:
# Export to stdout (standalone Python file)
erdo export-bot "file analyzer"

# Export to file (standalone Python file)
erdo export-bot "file analyzer" > my-agent.py

# Export with separate code files (-o flag)
erdo export-bot "file analyzer" -o my-agent-with-files.py
Export Formats:
# Creates a single Python file with all code embedded
erdo export-bot "file analyzer" > standalone-agent.py
Features:
  • Single file contains complete agent definition
  • All Python code files are embedded with fixed imports
  • Ready for syncing back with erdo sync
  • Common.py classes are moved to the top of the file
  • Relative imports are commented out with explanatory notes
Options:
OptionDescriptionExample
-o, --outputExport with separate code fileserdo export-bot "my-agent" -o agent.py
--formatExport format (python, json, yaml)erdo export-bot "my-agent" --format json
--include-depsInclude dependencieserdo export-bot "my-agent" --include-deps
Examples:
# Export for backup
erdo export-bot "data-processor" > backups/data-processor-$(date +%Y%m%d).py

# Export for local development
erdo export-bot "file-analyzer" -o local-development.py
cd file_analyzer_analyze_file_files/
python analyze_file.py  # Run individual files

# Export for sharing
erdo export-bot "security-checker" --format json > agent-config.json

# Export multiple agents
for agent in "file analyzer" "data analyst" "security checker"; do
  erdo export-bot "$agent" > "exports/${agent// /-}.py"
done
Syncing Exported Agents:
# Sync standalone export back to platform
erdo sync exported-agent.py --name-suffix="_imported"

# Sync package structure export (use main file)
erdo sync agent-with-files.py --name-suffix="_from_package"

# The separate code files directory is for local development only

erdo sync

erdo invoke

Invoke an agent from the command line.
erdo invoke <agent-name> [options]
Description: Execute an agent with messages and parameters directly from the CLI. Returns structured results following the executor pattern with clean separation of result, messages, steps, and events. Options:
  • -m, --message <text>: User message to send to the agent
  • -p, --parameters <json>: Parameters as JSON string
  • -d, --datasets <list>: Comma-separated dataset slugs
  • --mode <mode>: Invocation mode (live, replay, manual)
  • --json: Output full structured JSON result
  • -v, --verbose: Show detailed steps during execution
  • --stream: Stream output in real-time
Examples:
# Simple invocation
erdo invoke data-question-answerer -m "What were Q4 sales?"

# With datasets
erdo invoke data-analyzer -m "Analyze trends" -d sales-2024,customers

# With parameters
erdo invoke file-processor -m "Process files" -p '{"format": "csv"}'

# Verbose output (shows steps)
erdo invoke data-question-answerer -m "Hello" --verbose

# JSON output (full structured result)
erdo invoke data-analyzer -m "Analyze" --json

# Using replay mode (cached responses)
erdo invoke my-agent -m "Test" --mode replay
Output Formats: By default, erdo invoke outputs the agent’s text response:
$ erdo invoke data-question-answerer -m "Hello"
Hello! I'm ready to help answer questions about your data.
With --verbose, it shows steps before the output:
$ erdo invoke data-question-answerer -m "Hello" --verbose
Steps:
 parse_input (utils.parse_json)
 generate_response (llm.message)
 format_output (utils.echo)

Hello! I'm ready to help answer questions about your data.
With --json, it returns the complete structured result:
$ erdo invoke data-analyzer -m "Test" --json
{
  "success": true,
  "bot_id": "data-analyzer",
  "invocation_id": "inv_abc123",
  "result": {
    "status": "success",
    "parameters": {},
    "output": {
      "content": [
        {"content_type": "text", "content": "Analysis complete..."}
      ]
    },
    "message": null,
    "error": null
  },
  "messages": [
    {"role": "assistant", "content": "Analysis complete..."}
  ],
  "steps": [
    {"key": "analyze", "action": "llm.message", "status": "completed"}
  ],
  "error": null
}
Result Structure: The invoke command follows the executor pattern with clean separation:
  • result: The types.Result object with status/parameters/output/message/error
  • messages: All messages from all steps (including sub-agents)
  • steps: Information about executed steps
  • events: Complete raw event stream (only in JSON mode)
See Also:

Integration Commands

erdo integration add

Add a new integration.
erdo integration add <type>
Options:
  • --name: Integration name
  • --config: Configuration file
Examples:
# Add database integration
erdo integration add postgresql --name prod-db

# Add with config file
erdo integration add salesforce --config sf-config.json

erdo integration list

List all integrations.
erdo integration list
Options:
  • --type: Filter by type
  • --status: Filter by status

erdo integration test

Test integration connection.
erdo integration test <integration-name>

erdo integration remove

Remove an integration.
erdo integration remove <integration-name>
Options:
  • --force: Force removal without confirmation

Deployment Commands

erdo deploy

Deploy project to Erdo cloud.
erdo deploy
Options:
  • --env: Target environment
  • --tag: Deployment tag
  • --dry-run: Preview deployment
Examples:
# Deploy to production
erdo deploy --env production

# Dry run
erdo deploy --dry-run

erdo status

Check deployment status.
erdo status
Options:
  • --env: Environment to check
  • --detailed: Show detailed status

Data Commands

erdo data import

Import data from external sources.
erdo data import <source>
Options:
  • --format: Data format (csv, json, etc.)
  • --destination: Target dataset
Examples:
# Import CSV file
erdo data import data.csv --format csv

# Import to specific dataset
erdo data import data.json --destination my-dataset

erdo data export

Export data to external formats.
erdo data export <dataset>
Options:
  • --format: Export format
  • --output: Output file path

erdo data list

List available datasets.
erdo data list
Options:
  • --type: Filter by data type
  • --size: Filter by size

Configuration Commands

erdo config get

Get configuration value.
erdo config get <key>

erdo config set

Set configuration value.
erdo config set <key> <value>
Examples:
# Set API endpoint
erdo config set api.endpoint https://api.erdo.ai

# Set default model
erdo config set llm.default_model claude-sonnet-4

erdo config list

List all configuration values.
erdo config list

Monitoring Commands

erdo logs

View application logs.
erdo logs
Options:
  • --follow: Follow log output
  • --lines: Number of lines to show
  • --level: Filter by log level
Examples:
# View recent logs
erdo logs --lines 100

# Follow logs
erdo logs --follow

erdo metrics

View performance metrics.
erdo metrics
Options:
  • --agent: Filter by agent
  • --time-range: Time range for metrics

Utility Commands

erdo version

Show version information.
erdo version

erdo help

Show help information.
erdo help [command]

erdo update

Update Erdo CLI to latest version.
erdo update
Options:
  • --pre-release: Include pre-release versions

Environment Variables

Configure Erdo CLI behavior:
  • ERDO_API_TOKEN: API authentication token
  • ERDO_API_ENDPOINT: API endpoint URL
  • ERDO_CONFIG_PATH: Configuration file path
  • ERDO_LOG_LEVEL: Logging level (debug, info, warn, error)

Configuration File

Default configuration file (~/.erdo/config.yaml):
api:
  endpoint: https://api.erdo.ai
  token: your_api_token

defaults:
  model: claude-sonnet-4
  timeout: 30s

logging:
  level: info
  format: json

Exit Codes

  • 0: Success
  • 1: General error
  • 2: Authentication error
  • 3: Configuration error
  • 4: Network error
  • 5: Validation error
For detailed help on any command, use erdo help <command> or erdo <command> --help.