Đang tải…
Đang tải…
npx claude-code-templates@latest --sandbox e2b/claude-code-sandboxExecute Claude Code in an isolated E2B cloud sandbox environment.
This component sets up E2B (E2B.dev) integration to run Claude Code in a secure, isolated cloud environment. Perfect for executing code safely without affecting your local system.
# Execute a prompt in E2B sandbox (requires API keys as environment variables or CLI parameters)
npx claude-code-templates@latest --sandbox e2b --prompt "Create a React todo app"
# Pass API keys directly as parameters
npx claude-code-templates@latest --sandbox e2b \
--e2b-api-key your_e2b_key \
--anthropic-api-key your_anthropic_key \
--prompt "Create a React todo app"
# Install components and execute in sandbox
npx claude-code-templates@latest --sandbox e2b \
--agent frontend-developer \
--command setup-react \
--e2b-api-key your_e2b_key \
--anthropic-api-key your_anthropic_key \
--prompt "Create a modern todo app with TypeScript"
The component will create:
.claude/sandbox/e2b-launcher.py - Python script to launch E2B sandbox.claude/sandbox/requirements.txt - Python dependencies.claude/sandbox/.env.example - Environment variables templateYou can provide API keys in two ways:
# Pass keys directly as command parameters
npx claude-code-templates@latest --sandbox e2b \
--e2b-api-key your_e2b_api_key \
--anthropic-api-key your_anthropic_api_key \
--prompt "Your prompt here"
Set these environment variables in your shell or .env file:
export E2B_API_KEY=your_e2b_api_key_here
export ANTHROPIC_API_KEY=your_anthropic_api_key_here
# Or create .claude/sandbox/.env file:
E2B_API_KEY=your_e2b_api_key_here
ANTHROPIC_API_KEY=your_anthropic_api_key_here
Note: CLI parameters take precedence over environment variables.
anthropic-claude-code template# Simple web app creation
npx claude-code-templates@latest --sandbox e2b --prompt "Create an HTML page with CSS animations"
# Full stack development
npx claude-code-templates@latest --sandbox e2b --agent fullstack-developer --prompt "Create a Node.js API with authentication"
# Data analysis
npx claude-code-templates@latest --sandbox e2b --agent data-scientist --prompt "Analyze this CSV data and create visualizations"