Skip to main content
orchagent offers three ways to use agents:
CommandPurposeWhere It Runs
orch runExecute agent nowCloud (E2B sandbox) by default
orch run --localExecute agent nowYour machine
orch devHTTP dev server with hot-reloadYour machine
orch installExport for AI toolsCreates local files
orch service deployDeploy always-on serviceCloud (Cloud Run)

Quick Comparison: Cloud vs Local

Cloud (orch run, default)Local (orch run --local)
Primary usersApps in productionPower users, devs exploring
InterfaceCLI or HTTP APICLI
Where code runsE2B sandboxes (ephemeral)Your machine
Account requiredYes (free)No
LLM keysFrom your accountFrom your environment
Rate limits1000 calls/day freeYour LLM provider limits
DependenciesHandled automaticallyMust be downloadable
Download toggleAlways availableAuthor must enable allow_local_download
Paid agentsAnyone (credits charged)Owner only (free for testing)
Best forProduction integrationDevelopment, exploration
Production apps call the HTTP API directly from code. The CLI is useful for testing.
Local download is on by default. New agents and skills are locally downloadable unless authors explicitly disable it using the --no-local-download flag at publish time or the toggle in the web UI.

Cloud Execution (orch run)

Run an agent on orchagent’s servers. This is the default mode.
orch run acme/summarizer --data '{"text": "..."}'

What Happens

  1. CLI sends request to gateway (api.orchagent.io)
  2. Gateway authenticates your API key
  3. Gateway spins up an E2B sandbox (ephemeral)
  4. Agent code runs with input via stdin
  5. Agent runs with your stored LLM keys
  6. Response (stdout) returned through gateway

When to Use

  • Production - Reliable, managed infrastructure
  • Orchestration - Agents calling other agents
  • No local setup - Run without installing dependencies
  • Higher reliability - Auto-scaling, health checks

Requirements

  • orchagent account (free)
  • API key from dashboard
  • LLM key stored in account

Local Execution (orch run --local)

Download and run an agent on your machine.
# No account needed for public agents
npx orchagent run --local acme/summarizer --input '{"text": "..."}'

# With CLI installed
orch run --local acme/summarizer --input '{"text": "..."}'

What Happens

  1. CLI downloads agent code from registry
  2. Agent installs on your machine
  3. Agent runs locally
  4. Agent calls LLM using YOUR environment keys
  5. Results returned to terminal

When to Use

  • Development - Test agents before deploying
  • Privacy - Keep data on your machine
  • No account - Try agents without signing up
  • Debugging - See full execution locally

Requirements

  • Agent must have source_url or pip_package in manifest
  • Agent must have allow_local_download enabled by its author
  • LLM API key in environment variable
  • For orchestrators: dependencies must also be downloadable

Architecture Diagrams

Local Execution

┌──────────────┐      ┌──────────────┐      ┌──────────────┐
│  Your CLI    │─────▶│ Agent Code   │─────▶│  LLM API     │
│              │      │ (local)      │      │  (direct)    │
└──────────────┘      └──────────────┘      └──────────────┘
      │                      │
      └──────────────────────┘
           All on your machine

Server Execution

┌──────────────┐      ┌──────────────┐      ┌──────────────┐
│  Your CLI    │─────▶│  Gateway     │─────▶│ E2B Sandbox  │
│              │      │              │      │ (ephemeral)  │
└──────────────┘      └──────────────┘      └──────┬───────┘

                             ┌─────────────────────┘

                      ┌──────────────┐
                      │  LLM API     │
                      │  (via proxy) │
                      └──────────────┘

Handling Dependencies

Local with Dependencies

Orchestrator agents have dependencies. When running locally:
$ orch run joe/security-review .

Checking dependencies...

This agent has dependencies:
  joe/leak-finder@v1 (downloadable)
  joe/vuln-scanner@v1 (downloadable)
  acme/premium-scan@v1 (cloud-only)

Options:
  [1] Run on cloud (orch run) - recommended
  [2] Download 2 available deps, run locally
  [3] Cancel
Auto-download:
orch run joe/security-review --with-deps .

Server with Dependencies

On the server, dependencies are handled automatically. The gateway routes calls between agents.

Installing Agents as Sub-Agents (orch install)

A third option: export agents as configuration files for AI coding tools like Claude Code or Cursor.
# Install to Claude Code (default)
orch install joe/code-reviewer

# Install to Cursor
orch install joe/code-reviewer --format cursor

# Install to project directory
orch install joe/code-reviewer --scope project
What happens:
  1. CLI downloads agent metadata from registry
  2. Converts to target format (Claude Code, Cursor, AGENTS.md)
  3. Writes configuration file to AI tool directory
When to use install:
  • You want Claude Code or Cursor to delegate tasks to specialized agents
  • You want sub-agents available across all your projects
  • You’re building a team workflow with shared agents
Key difference from run:
  • run executes the agent immediately and returns results
  • install creates files that your AI tool reads later
See CLI Commands for full details.

Service Deployment (orch service deploy)

A fourth mode: deploy agents as always-on services (run_mode: "always_on") that run continuously on Cloud Run.
orch service deploy acme/discord-bot \
  --secret DISCORD_BOT_TOKEN \
  --env BOT_PREFIX="!"

How It Differs

On-demand (run_mode: "on_demand")Always-on (run_mode: "always_on")
RuntimeEphemeral E2B sandboxPersistent Cloud Run container
LifetimeSeconds to minutesRuns indefinitely
Use caseRequest/response tasksBots, listeners, workers
Restart on crashNo (single execution)Yes (automatic)
StateStatelessCan maintain in-memory state
RequiresAny agentruntime.command or loop config
See Always-On Services for full documentation.

CLI Commands Summary

CommandModeDescription
orch runCloudRun on orchagent servers (default)
orch run --localLocalRun with installed CLI
orch devLocalHTTP dev server with hot-reload
npx orchagent run --localLocalRun without installing CLI
orch run --local --download-onlyLocalJust download, don’t execute
orch run --local --with-depsLocalAuto-download dependencies
orch service deployServiceDeploy as always-on service
orch installExportCreate sub-agent files for AI tools
orch updateExportUpdate installed sub-agents
orch formatsExportList available export formats

Choosing the Right Mode

Use Local (--local or orch dev) When

  • You want to keep data on your machine
  • You’re developing or debugging an agent (use orch dev for hot-reload)
  • You want to try an agent without an account
  • The agent doesn’t have complex dependencies
  • The agent author has enabled allow_local_download

Use Cloud (Default) When

  • You’re building production integrations
  • The agent has dependencies (orchestrator)
  • You want managed infrastructure
  • You need usage tracking and logs
  • The agent does not allow local download
  • You want usage tracking and logs

Development Server (orch dev)

For active development, use orch dev to start a local HTTP server with hot-reload:
orch dev
This starts a server on http://localhost:4900 that:
  • Accepts POST requests with JSON input and runs your agent locally
  • Watches for file changes and reloads automatically
  • Works with all agent types (prompt, tool, agent)
# Terminal 1: Start dev server
orch dev

# Terminal 2: Send test requests
curl -X POST http://localhost:4900/run \
  -H "Content-Type: application/json" \
  -d '{"task": "hello world"}'
See CLI Commands — dev for full options.

Mixed Mode

You can use all modes in your development workflow:
# Active development with hot-reload
orch dev

# One-off local test
orch run --local my-agent --input '{"test": true}'

# Test on cloud
orch run my-agent --data '{"test": true}'

# Deploy to production
# (Your app calls api.orchagent.io directly)