Files
wehub-resource-sync bb5c75ce05
Component Security Validation / Security Audit (push) Has been cancelled
Deploy to Cloudflare Pages / deploy (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:38:58 +08:00

1 line
3.7 KiB
JSON

{"content": "# E2B Claude Code Sandbox\n\nExecute Claude Code in an isolated E2B cloud sandbox environment.\n\n## Description\n\nThis 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.\n\n## Features\n\n- **Isolated Execution**: Run Claude Code in a secure cloud sandbox\n- **Pre-configured Environment**: Ships with Claude Code already installed\n- **API Integration**: Seamless connection to Anthropic's Claude API\n- **Safe Code Execution**: Execute prompts without local system risks\n- **Component Installation**: Automatically installs any components specified with CLI flags\n\n## Requirements\n\n- E2B API Key (get from https://e2b.dev/dashboard)\n- Anthropic API Key\n- Python 3.11+ (for E2B SDK)\n\n## Usage\n\n```bash\n# Execute a prompt in E2B sandbox (requires API keys as environment variables or CLI parameters)\nnpx claude-code-templates@latest --sandbox e2b --prompt \"Create a React todo app\"\n\n# Pass API keys directly as parameters\nnpx claude-code-templates@latest --sandbox e2b \\\n --e2b-api-key your_e2b_key \\\n --anthropic-api-key your_anthropic_key \\\n --prompt \"Create a React todo app\"\n\n# Install components and execute in sandbox\nnpx claude-code-templates@latest --sandbox e2b \\\n --agent frontend-developer \\\n --command setup-react \\\n --e2b-api-key your_e2b_key \\\n --anthropic-api-key your_anthropic_key \\\n --prompt \"Create a modern todo app with TypeScript\"\n```\n\n## Environment Setup\n\nThe component will create:\n- `.claude/sandbox/e2b-launcher.py` - Python script to launch E2B sandbox\n- `.claude/sandbox/requirements.txt` - Python dependencies \n- `.claude/sandbox/.env.example` - Environment variables template\n\n## API Key Configuration\n\nYou can provide API keys in two ways:\n\n### Option 1: CLI Parameters (Recommended)\n```bash\n# Pass keys directly as command parameters\nnpx claude-code-templates@latest --sandbox e2b \\\n --e2b-api-key your_e2b_api_key \\\n --anthropic-api-key your_anthropic_api_key \\\n --prompt \"Your prompt here\"\n```\n\n### Option 2: Environment Variables\nSet these environment variables in your shell or `.env` file:\n```bash\nexport E2B_API_KEY=your_e2b_api_key_here\nexport ANTHROPIC_API_KEY=your_anthropic_api_key_here\n\n# Or create .claude/sandbox/.env file:\nE2B_API_KEY=your_e2b_api_key_here\nANTHROPIC_API_KEY=your_anthropic_api_key_here\n```\n\n**Note**: CLI parameters take precedence over environment variables.\n\n## How it Works\n\n1. Creates E2B sandbox with `anthropic-claude-code` template\n2. Installs any specified components (agents, commands, etc.)\n3. Executes your prompt using Claude Code inside the sandbox\n4. Returns the complete output and any generated files\n5. Automatically cleans up the sandbox after execution\n\n## Security Benefits\n\n- **Isolation**: Code runs in a separate cloud environment\n- **No Local Impact**: No risk to your local system or files\n- **Temporary**: Sandbox is destroyed after execution\n- **Controlled**: Only specified components and prompts are executed\n\n## Examples\n\n```bash\n# Simple web app creation\nnpx claude-code-templates@latest --sandbox e2b --prompt \"Create an HTML page with CSS animations\"\n\n# Full stack development\nnpx claude-code-templates@latest --sandbox e2b --agent fullstack-developer --prompt \"Create a Node.js API with authentication\"\n\n# Data analysis\nnpx claude-code-templates@latest --sandbox e2b --agent data-scientist --prompt \"Analyze this CSV data and create visualizations\"\n```\n\n## Template Information\n\n- **Provider**: E2B (https://e2b.dev)\n- **Base Template**: anthropic-claude-code\n- **Timeout**: 5 minutes (configurable)\n- **Environment**: Ubuntu with Claude Code pre-installed"}