Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.langchain.com/llms.txt

Use this file to discover all available pages before exploring further.

The CLI uses the sandbox as tool pattern: the CLI process (LLM loop, memory, tool dispatch) runs on your machine, but agent tool calls (read_file, write_file, execute, etc.) target the remote sandbox, not your local filesystem. To get files into the sandbox, use a setup script or the provider’s file transfer APIs (see Working with files). For a deeper look at sandbox architecture, integration patterns, and security best practices, see Sandboxes.

Install provider dependency

Included by default when installing deepagents-cli. No extra installation needed.

Set provider credentials

export LANGSMITH_API_KEY="your-key"

Run the CLI with a sandbox

deepagents --sandbox langsmith

Sandbox flags and examples

FlagDescription
--sandbox TYPESandbox provider to use: langsmith, agentcore, modal, daytona, or runloop (default: none)
--sandbox-id IDReuse an existing sandbox by ID instead of creating a new one. Skips creation and cleanup. Refer to your sandbox documentation for more
--sandbox-setup PATHPath to a setup script to run inside the sandbox upon creation
Examples:
# Create a new Daytona sandbox
deepagents --sandbox daytona

# Reuse an existing sandbox (skips creation and cleanup)
deepagents --sandbox runloop --sandbox-id dbx_abc123

# Run a setup script after sandbox creation
deepagents --sandbox modal --sandbox-setup ./setup.sh

Setup scripts

Use --sandbox-setup to run a shell script inside the sandbox after creation. This is useful for cloning repos, installing dependencies, and configuring environment variables.
setup.sh
#!/bin/bash
set -e

# Clone repository using GitHub token
git clone https://x-access-token:${GITHUB_TOKEN}@github.com/username/repo.git $HOME/workspace
cd $HOME/workspace

# Make environment variables persistent
cat >> ~/.bashrc <<'EOF'
export GITHUB_TOKEN="${GITHUB_TOKEN}"
export OPENAI_API_KEY="${OPENAI_API_KEY}"
cd $HOME/workspace
EOF
source ~/.bashrc
The CLI expands ${VAR} references in setup scripts using your local environment variables. Store secrets in a local .env file for the setup script to access.
Sandboxes isolate code execution, but agents remain vulnerable to prompt injection with untrusted inputs. Use human-in-the-loop approval, short-lived secrets, and trusted setup scripts only. See Security considerations for details.