diff --git a/README.md b/README.md index 8b3d02d..4028365 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ A modern Python project template with best practices for development and collabo - ๐Ÿ” Type checking with [mypy](https://github.com/python/mypy) - ๐Ÿงช Testing with [pytest](https://github.com/pytest-dev/pytest) - ๐Ÿณ Docker support for development and deployment +- ๐Ÿค– Claude Code integration for AI-assisted development - ๐Ÿ‘ท CI/CD with GitHub Actions ## Python Version @@ -109,6 +110,34 @@ This creates a container with: - Source code mounted (changes reflect immediately) - Development tools ready to use - Automatic UID/GID mapping for file permissions +- Claude Code CLI for AI-assisted development + +#### Using Claude Code in the Container + +1. Set up your API key: +```bash +# Copy the environment template +cp docker/template.env docker/.env + +# Add your Anthropic API key to docker/.env +echo "ANTHROPIC_API_KEY=your_api_key_here" >> docker/.env +``` + +2. Start the development environment: +```bash +make dev-env +``` + +3. Inside the container, use Claude Code: +```bash +# Interactive mode (asks for permission before each action) +claude + +# Autonomous mode (runs without permission prompts) +claude --dangerously-skip-permissions +``` + +**Note**: The `--dangerously-skip-permissions` flag allows Claude to work autonomously. Use with caution and always review changes before committing. ### Production Image ```bash diff --git a/docker/Dockerfile b/docker/Dockerfile index 92f18ff..d497181 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,6 +1,6 @@ FROM python:3.12-slim -# Install Auxiliary Software +# Install Auxiliary Software + Node.js for Claude Code RUN apt-get update && apt-get install -y \ make \ apt-utils \ @@ -12,8 +12,13 @@ RUN apt-get update && apt-get install -y \ graphviz \ software-properties-common \ vim \ + && curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \ + && apt-get install -y nodejs \ && rm -rf /var/lib/apt/lists/* +# Install Claude Code CLI +RUN npm install -g @anthropic-ai/claude-code + WORKDIR /workspace # Copy essential files for dependency resolution to temp location diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index eed0854..6b60bc6 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -10,6 +10,7 @@ services: environment: EXAMPLE: ${EXAMPLE} EXAMPLE_SECRET: ${EXAMPLE_SECRET} + ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY} command: /bin/bash # Note: user mapping handled by Podman rootless automatically # Bind whole project directory for simplicity diff --git a/docker/template.env b/docker/template.env index 1b7ed75..fa5c97b 100644 --- a/docker/template.env +++ b/docker/template.env @@ -8,6 +8,7 @@ DEBUG=true # Secrets (do not commit actual values) API_KEY= DATABASE_URL= +ANTHROPIC_API_KEY= # Container runtime settings (optional) # UID=${UID} # Uncomment to use your system UID