{"id":31287960,"url":"https://github.com/cabinlab/claude-code-sdk-docker","last_synced_at":"2026-02-12T14:19:06.149Z","repository":{"id":305700870,"uuid":"1021186960","full_name":"cabinlab/claude-code-sdk-docker","owner":"cabinlab","description":"Docker containers for Claude Code Typescript and Python SDKs with built-in authentication support for Claude Pro and Max plans","archived":false,"fork":false,"pushed_at":"2025-08-04T02:07:36.000Z","size":74,"stargazers_count":21,"open_issues_count":0,"forks_count":5,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-28T07:42:51.592Z","etag":null,"topics":["claude-code","claude-code-sdk","docker-container"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cabinlab.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-07-17T03:08:09.000Z","updated_at":"2026-01-24T22:26:27.000Z","dependencies_parsed_at":"2025-07-21T16:18:02.788Z","dependency_job_id":"f6f2002a-0c06-4e8d-89fe-6b70454eaad7","html_url":"https://github.com/cabinlab/claude-code-sdk-docker","commit_stats":null,"previous_names":["cabinlab/claude-code-sdk-docker"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/cabinlab/claude-code-sdk-docker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cabinlab%2Fclaude-code-sdk-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cabinlab%2Fclaude-code-sdk-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cabinlab%2Fclaude-code-sdk-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cabinlab%2Fclaude-code-sdk-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cabinlab","download_url":"https://codeload.github.com/cabinlab/claude-code-sdk-docker/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cabinlab%2Fclaude-code-sdk-docker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29368252,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-12T08:51:36.827Z","status":"ssl_error","status_checked_at":"2026-02-12T08:51:26.849Z","response_time":55,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["claude-code","claude-code-sdk","docker-container"],"created_at":"2025-09-24T11:38:02.197Z","updated_at":"2026-02-12T14:19:06.144Z","avatar_url":"https://github.com/cabinlab.png","language":"Shell","readme":"# Claude Agent SDKs in Docker\n\n\n[![Discord](https://img.shields.io/badge/Discord-Join%20Community-7289da?logo=discord\u0026logoColor=white)](https://discord.gg/aaSgZBgkCK) [![Build and Publish](https://github.com/cabinlab/claude-code-sdk-docker/actions/workflows/build-and-publish.yml/badge.svg)](https://github.com/cabinlab/claude-code-sdk-docker/actions/workflows/build-and-publish.yml)\n\n### Docker images with Official Claude Agent SDK built-in.\n\nImages:\n\n - TypeScript (607MB) - Includes the [@anthropic-ai/claude-agent-sdk](https://www.npmjs.com/package/@anthropic-ai/claude-agent-sdk) SDK and [@anthropic-ai/claude-code](https://www.npmjs.com/package/@anthropic-ai/claude-code) CLI.\n - 🐍 Python (693MB) - adds Python 3 and Anthropic's [claude-agent-sdk-python](https://github.com/anthropics/claude-agent-sdk-python) aka [claude-agent-sdk](https://pypi.org/project/claude-agent-sdk/) on PyPI.\n - 🏔️ Alpine TypeScript (383MB) - Minimal Alpine Linux base\n - 🏔️ Alpine Python (474MB) - Alpine with Python support\n\n## Why use these images?\n\n### ✅ Claude Pro and Max subscription compatibility\n\n***Problem:*** The Claude Agent SDKs use the CLI OAuth flow, which is clunky inside a container.\n\n***Solution:*** These containers replace the CLI authentication with Long-lived access tokens. See: `claude setup-token --help`\n\n## Available Images\n\n**Debian-based:**\n- `ghcr.io/cabinlab/claude-agent-sdk:typescript` - CLI + TypeScript SDK\n- `ghcr.io/cabinlab/claude-agent-sdk:python` - Above + Python SDK\n\n**Alpine-based:**\n- `ghcr.io/cabinlab/claude-agent-sdk:alpine` - Minimal TypeScript\n- `ghcr.io/cabinlab/claude-agent-sdk:alpine-python` - Minimal + Python\n\n## Quick Start (for Claude Pro and Max users)\n\n1. **Get your OAuth token** (on host machine):\n   ```bash\n   claude setup-token\n   ```\n   ```bash\n   # Follow Anthropic's 2 or 3 screens of auth flow CLI --\u003e Browser --\u003e CLI\n   ```\n   ```bash\n   # Copy the token that starts with \"sk-ant-oat01-\"\n   ```\n\n2. **Set environment variable**:\n   #### RECOMMENDED:\n\n   ```bash\n   export CLAUDE_CODE_OAUTH_TOKEN=sk-ant-oat01-your-token-here\n   ```\n   \n   ALTERNATE:\n\n   ```bash\n   # Copy .env.example to .env\n   cp .env.example .env\n   ```\n   ```bash\n   # Edit .env and update this line with your actual token\n   CLAUDE_CODE_OAUTH_TOKEN=sk-ant-oat01-your-token-here\n   ```\n\n3. **Start the containers**:\n   ```bash\n   # Start containers (automatically uses .env file)\n   docker compose up -d\n   ```\n\n4. **Test it works**:\n   ```bash\n   # TypeScript (using compose.yaml)\n   docker compose exec typescript node /app/scripts/test-auth.js\n   \n   # Python (using compose-python.yaml)\n   docker compose -f compose-python.yaml exec python python /app/scripts/test_auth.py\n   ```\n\n### Using Docker Compose (Full Examples)\n\n**Note:** This project includes compose files for different variants:\n- `compose.yaml` - Debian TypeScript\n- `compose-python.yaml` - Debian Python  \n- `compose-alpine.yaml` - Alpine TypeScript\n- `compose-alpine-python.yaml` - Alpine Python\n\n#### Option 1: Run TypeScript\n```bash\n# Start TypeScript container\ndocker compose up -d\n\n# Run TypeScript example\ndocker compose exec typescript tsx /app/examples/typescript/hello.ts\n\n# Interactive TypeScript development\ndocker compose exec typescript bash\n```\n\n#### Option 2: Run Python (Includes Typescript!)\n```bash\n# Start Python container\ndocker compose -f compose-python.yaml up -d\n\n# Run Python example\ndocker compose -f compose-python.yaml exec python python /app/examples/python/hello.py\n\n# Interactive Python development\ndocker compose -f compose-python.yaml exec python python\n\n# Tip: If you only use Python, rename the file for convenience\nmv compose-python.yaml compose.yaml\n```\n\n### Using Docker Run\n\nFor users who prefer direct docker commands:\n\n```bash\n# TypeScript\ndocker run --rm -it \\\n  -e CLAUDE_CODE_OAUTH_TOKEN=\"sk-ant-oat01-...\" \\\n  -v $(pwd):/app \\\n  -p 3000:3000 \\\n  ghcr.io/cabinlab/claude-agent-sdk:typescript \\\n  bash\n\n# Python\ndocker run --rm -it \\\n  -e CLAUDE_CODE_OAUTH_TOKEN=\"sk-ant-oat01-...\" \\\n  -v $(pwd):/app \\\n  -p 3000:3000 \\\n  ghcr.io/cabinlab/claude-agent-sdk:python \\\n  python\n```\n\n## Features\n\n### Included Tools\n\n#### Base (CLI + Typescript SDK)\n- **Non-root user** - Security best practice\n- **Claude Agent SDK CLI** - Familiar Claude CLI and auth flow\n- **TypeScript SDK** - Native TypeScript/JavaScript support\n- **tsx** - Run TypeScript files directly without compilation\n- **Git, cURL, jq** - Essential development tools\n\n#### Python\n- **Python SDK** - Python bindings (in `:python` image)\n\n\n### Claude Config Scaffolding\n\nEach container includes a `.claude/` directory with:\n\n- **Slash Commands** - Directory and instructions for extending Claude with custom commands\n- **Hooks** - Directory and instructions to leverage Claude's behavior\n- Example configurations and documentation\n\nMount your own configuration:\n```bash\ndocker run -v ~/.claude:/home/claude/.claude ...\n```\n\n## Authentication\n\n### Which method should I use?\n\n#### Claude Pro/Max users\n- Long-lived tokens [Recommended] → See [Quick Start](#quick-start-for-claude-pro-and-max-users) above\n- Session based tokens - This is the standard Claude auth flow\n\n#### Anthropic API Keys\n- Anthropic API keys → Set `ANTHROPIC_API_KEY` in your `.env` file\n- Can also be used through standard Claude auth flow\n- ⚠️ Likely overrides OAuth/Subscription plan settings\n- ✅ Use API ***OR*** Subscription, not both together\n\nFor technical details and troubleshooting, see our [Authentication Guide](docs/AUTHENTICATION.md).\n\n## Building Your Own Images\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eExtending the Base Images\u003c/b\u003e (click to expand)\u003c/summary\u003e\n\n### For TypeScript Projects\n\n```dockerfile\n# For TypeScript projects\nFROM ghcr.io/cabinlab/claude-agent-sdk:typescript\n\nWORKDIR /app\nCOPY package*.json ./\nRUN npm ci\nCOPY . .\nCMD [\"npm\", \"start\"]\n```\n\n### For Python Projects\n\n```dockerfile\n# For Python projects\nFROM ghcr.io/cabinlab/claude-agent-sdk:python\n\nWORKDIR /app\nCOPY requirements.txt .\nRUN pip install -r requirements.txt\nCOPY . .\nCMD [\"python\", \"main.py\"]\n```\n\n### Building Locally\n\n```bash\n# Build TypeScript base\ndocker build -f Dockerfile.typescript -t claude-agent-sdk:typescript .\n\n# Build Python extension\ndocker build --build-arg BASE_IMAGE=claude-agent-sdk:typescript \\\n  -t claude-agent-sdk:python .\n```\n\n\u003c/details\u003e\n\n## Security\n\n- Containers run as non-root user `claude`\n- OAuth tokens should never be built into images\n- Use `.aiexclude` to prevent Claude from accessing sensitive files\n- Mount secrets at runtime, don't embed them\n\n## Examples\n\nSee the `examples/` directory for sample code in:\n- JavaScript\n- TypeScript (with direct execution via tsx)\n- Python\n\n## Automatic Updates\n\nThis repository automatically checks for new SDK versions daily and creates pull requests when updates are available. The automated workflow:\n- Runs daily at 2 AM UTC\n- Checks npm for Claude Agent SDK CLI updates\n- Checks PyPI for Python SDK updates\n- Creates PRs with updated versions\n- Auto-merges PRs after tests pass\n\nManual version checks can be triggered via the \"Check for Updates\" workflow in the Actions tab.\n\n## Contributing\n\nContributions welcome! Please:\n1. Fork the repository\n2. Create a feature branch\n3. Submit a pull request\n\n## License\n\nMIT License - see LICENSE file for details\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcabinlab%2Fclaude-code-sdk-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcabinlab%2Fclaude-code-sdk-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcabinlab%2Fclaude-code-sdk-docker/lists"}