Skip to main content

CLI vs SDK Comparison

Choose the approach that best fits your development workflow. The Erdo platform supports both command-line and programmatic Python interfaces.

Quick Comparison

Best for: Command-line workflows, CI/CD pipelines, shell scriptingPros:
  • Quick installation with Homebrew
  • Familiar command-line interface
  • Great for scripts and automation
  • Works with any editor
Cons:
  • Requires separate Go binary installation
  • Less IDE integration
  • Context switching between Python and CLI

Installation & Setup

# Install CLI
brew install erdoai/tap/erdo

# Authenticate
erdo login

# Verify
erdo whoami

Core Operations

Agent Synchronization

# Sync all agents in current directory
erdo sync

# Sync specific agent file
erdo sync my_agent.py

# Sync with options
erdo sync --agent my-agent --env production --dry-run

# Sync from directory
erdo sync --exclude "*.log,temp/*"

Agent Invocation

# Invoke agent with message
erdo invoke my-agent --message "analyze data"

# With datasets and parameters
erdo invoke my-agent \
  --message "Query" \
  --dataset sales-2024 \
  --parameter key=value

# Test modes
erdo invoke my-agent --message "Test" --mode replay  # Free

# Output formats
erdo invoke my-agent --message "Query" --output text
erdo invoke my-agent --message "Query" --output json

# Streaming
erdo invoke my-agent --message "Long task" --stream --verbose

Testing & Validation

# Run agent tests (parallel execution)
erdo agent-test tests/test_my_agent.py

# Verbose output
erdo agent-test tests/test_my_agent.py --verbose

# Local validation (static checks)
erdo test my_agent.py

# Test with simulation
erdo test --data test_data.json

Agent Management

# List agents
erdo agent list

# Agent details
erdo agent show my-agent

# Export agent
erdo export-bot my-agent --output ./exported_agent.py

# Deploy agent
erdo deploy my-agent --env production

Development Workflows

CLI-First Workflow

# 1. Setup
erdo init my-project
cd my-project

# 2. Development
erdo dev  # Start development server

# 3. Test & Deploy
erdo sync
erdo test my-agent
erdo deploy my-agent --env production

SDK-First Workflow

# 1. Create agent in Python
from erdo import Agent
from erdo.actions import llm
from erdo.sync import Sync
from erdo.invoke import Invoke

agent = Agent(name="my_agent")
# ... define steps ...

# 2. Sync to platform
result = Sync(agent)
print(f"Agent deployed: {result.agent_key}")

# 3. Test immediately
test_result = Invoke.by_key(
    result.agent_key,
    parameters={"test": "data"}
)
print(f"Test result: {test_result.data}")

Mixed Workflow

You can combine both approaches:
# Use CLI for project setup
erdo init my-project
erdo login
# Use SDK for development and testing
from erdo import Agent
from erdo.sync import Sync
from erdo.invoke import Invoke

# Create agent
agent = Agent(name="my_agent")
# ... define agent ...

# Sync and test with SDK
sync_result = Sync(agent)
test_result = Invoke.by_key(sync_result.agent_key, parameters={})
# Use CLI for final deployment
erdo deploy my-agent --env production

Configuration

Both approaches use the same configuration system:

Config File (~/.erdo/config.yaml)

api:
  url: "https://api.erdo.ai"
  timeout: 30

auth:
  token: "your-token"
  organization: "your-org"

development:
  auto_save: true
  watch_mode: true

Environment Variables

export ERDO_API_URL="https://api.erdo.ai"
export ERDO_AUTH_TOKEN="your-token"
export ERDO_ORGANIZATION="your-org"

Programmatic Config (SDK Only)

from erdo.config import Config

# Custom configuration
config = Config(
    api_url="https://custom.erdo.ai",
    auth_token="custom-token",
    organization="custom-org"
)

# Use with SDK modules
from erdo.sync import Sync
sync = Sync(config=config)

Feature Comparison Matrix

FeatureCLISDKNotes
Agent Creation✅ Templates✅ ProgrammaticSDK offers more flexibility
Agent Sync✅ Full featured✅ Python-nativeSame backend, different interface
Agent Invocation✅ Testing focused✅ Production readySDK better for programmatic use
Testing✅ Comprehensive✅ BasicCLI has more test runner features
Deployment✅ Multi-env✅ Via syncCLI has dedicated deploy commands
File Watching✅ Built-in❌ ManualCLI better for development server
IDE Integration⚠️ Limited✅ ExcellentSDK has full type hints
CI/CD Integration✅ Shell scripts✅ Python scriptsBoth work well
Learning Curve⚠️ Commands to learn✅ Python APIsSDK more intuitive for Python devs

Recommendations

Choose CLI if you:

  • Prefer command-line tools and shell scripting
  • Need file watching and development server features
  • Want to get started quickly with templates
  • Are building CI/CD pipelines with shell scripts
  • Work with multiple programming languages

Choose SDK if you:

  • Work primarily in Python
  • Use Jupyter notebooks or interactive development
  • Want programmatic control over agent operations
  • Prefer type-safe APIs with IDE autocompletion
  • Are building Python applications that manage agents

Choose Both if you:

  • Want the best of both worlds
  • Have a team with mixed preferences
  • Need CLI for some tasks (like file watching) and SDK for others (like programmatic control)
  • Want flexibility to use whichever tool fits the specific task

Using Both Together

You can freely mix CLI and SDK in your workflow - they share configuration and authentication:
  1. Shared authentication: erdo login works for both CLI and SDK
  2. Shared configuration: Both use ~/.erdo/config.yaml
  3. Same platform: Both interact with the same backend and agents
Example mixed workflow:
# Use CLI for authentication and project setup
erdo login
erdo init my-project
# Use SDK for programmatic agent development
from erdo import Agent
from erdo.sync import Sync

agent = Agent(name="my_agent")
# ... define agent ...
Sync(agent)  # Deploy to platform
# Use CLI for file watching during development
erdo dev --watch

# Use CLI for deployment
erdo deploy my-agent --env production
You can switch between approaches seamlessly - use whichever tool is best for the task at hand.