This guide covers setting up the Langstar development environment for first-time contributors. The project uses devcontainers for consistent development environments across different IDEs and platforms.
- Docker Desktop installed and running (local development)
- One of:
- VS Code with Dev Containers extension
- JetBrains IDE with Gateway/Remote Development
- GitHub account (for Codespaces)
Choose your development environment:
| Environment | Setup Time | Best For |
|---|---|---|
| GitHub Codespaces | ~5 min | Quick start, no local setup |
| VS Code Devcontainer | ~10 min | Full-featured local development |
| JetBrains Devcontainer | ~10 min | RustRover, IntelliJ users |
The fastest way to get started. No local Docker installation required.
- Go to the repository on GitHub
- Navigate to Settings → Secrets and variables → Codespaces
- Add the following secrets:
| Secret Name | Required | Description |
|---|---|---|
GH_PAT |
Yes | GitHub Personal Access Token with repo scope |
GH_USER |
Yes | Your GitHub username |
AWS_ACCESS_KEY_ID |
Yes | AWS access key for Bedrock |
AWS_SECRET_ACCESS_KEY |
Yes | AWS secret access key |
LANGSMITH_API_KEY |
Optional | LangSmith API key for testing |
GH_PROJECT_PAT |
Optional | GitHub PAT with project permissions |
- Go to the repository on GitHub
- Click the green Code button
- Select the Codespaces tab
- Click Create codespace on main (or your target branch)
The codespace will automatically:
- Clone the repository
- Build the devcontainer
- Configure git authentication
- Install all development tools
Once the codespace is ready, verify the setup:
# Check git authentication
gh auth status
# Verify environment variables
printenv | grep -E 'LANGSMITH|AWS' | cut -d= -f1
# Run a test build
cargo check --workspaceFor local development with full Docker support.
git clone https://github.com/codekiln/langstar.git
cd langstarcd .devcontainer
cp .env.default .envEdit .env with your actual credentials:
# Required
GITHUB_PAT=ghp_YourActualTokenHere
GITHUB_USER=your_github_username
AWS_ACCESS_KEY_ID=your_aws_access_key
AWS_SECRET_ACCESS_KEY=your_aws_secret_key
# Optional
LANGSMITH_API_KEY=lsv2_YourActualKeyHere
GITHUB_PROJECT_PAT=ghp_YourProjectTokenHere- Open the repository folder in VS Code
- Press
Cmd+Shift+P(Mac) orCtrl+Shift+P(Windows/Linux) - Select Dev Containers: Reopen in Container
- Wait for the container to build (first time takes ~5 minutes)
After the container starts, your local repository files are mounted at /workspace via bind mount.
# Check git authentication
gh auth status
# Verify environment variables
printenv | grep -E 'LANGSMITH|AWS' | cut -d= -f1
# Run a test build
cargo check --workspaceVS Code offers a streamlined workflow that handles cloning automatically:
- Press
Cmd+Shift+P(Mac) orCtrl+Shift+P(Windows/Linux) - Select Dev Containers: Clone Repository in Container Volume...
- Enter the repository URL:
https://github.com/codekiln/langstar - Wait for clone and container build
Note: With this method, you'll need to configure secrets inside the container or use VS Code's Remote Containers settings to pass environment variables.
For RustRover, IntelliJ IDEA, and other JetBrains IDEs.
git clone https://github.com/codekiln/langstar.git
cd langstarcd .devcontainer
cp .env.default .envEdit .env with your actual credentials (same as VS Code setup above).
- Open JetBrains Gateway
- Select Dev Containers connection type
- Choose Open Folder in Container
- Navigate to the cloned repository folder
- Wait for the container to build
After the container starts, your local repository files are mounted at /workspace via bind mount.
# Check git authentication
gh auth status
# Verify environment variables
printenv | grep -E 'LANGSMITH|AWS' | cut -d= -f1
# Run a test build
cargo check --workspaceIf you see "External file changes sync might be slow" in RustRover/IntelliJ, this is because Docker's bind mount on macOS uses gRPC FUSE which doesn't provide full inotify support.
To fix this, you can optionally switch to a named Docker volume:
- Edit
docker-compose.override.yml(copy from template if needed) - Uncomment the named volume configuration
- Rebuild the container
- Clone the repo inside the container:
cd /workspace && git clone <repo-url> .
See .devcontainer/docker-compose.override.yml.template for detailed instructions.
Trade-off: With named volumes, code lives inside the container volume rather than on your host filesystem. You'll need to clone the repo into the container after setup.
┌─────────────────────────────────────────────────────────────────┐
│ HOST MACHINE │
│ ┌─────────────────────────────────────────────────────────┐ │
│ │ .devcontainer/ │ │
│ │ ├── .env ← Your secrets (gitignored) │ │
│ │ ├── docker-compose.yml ← Reads .env for substitution │ │
│ │ └── devcontainer.json │ │
│ └─────────────────────────────────────────────────────────┘ │
│ │ │
│ Docker Compose │
│ substitutes ${VARS} │
│ │ │
│ ▼ │
│ ┌─────────────────────────────────────────────────────────┐ │
│ │ CONTAINER │ │
│ │ Environment variables set via docker-compose.yml │ │
│ │ ├── GITHUB_PAT=<from .env> │ │
│ │ ├── AWS_ACCESS_KEY_ID=<from .env> │ │
│ │ └── LANGSMITH_API_KEY=<from .env> │ │
│ │ │ │
│ │ /workspace ← Named Docker volume (code lives here) │ │
│ └─────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────┘
Key insight: Docker Compose reads .env from the host filesystem before starting the container. Environment variables are passed into the container via the environment: section in docker-compose.yml. The .env file itself doesn't need to be inside the container.
By default, the devcontainer uses a bind mount for maximum compatibility:
HOST CONTAINER
<repo-root>/ /workspace/ (bind mount)
├── .devcontainer/ ────────────→├── .devcontainer/
├── src/ ────────────→├── src/
├── Cargo.toml ────────────→├── Cargo.toml
└── ... ────────────→└── ...
Benefits:
- Standard "Reopen in Container" workflow
- Changes sync bidirectionally between host and container
- Compatible with VS Code, JetBrains, and GitHub Codespaces
- Edit files with host-based tools outside the container
Optional: JetBrains users can switch to a named volume for proper inotify support. See .devcontainer/README.md for details.
Named volumes (bash history, Claude config) persist across container rebuilds:
# List volumes
docker volume ls | grep langstar
# Persistent volumes used by default:
# - claude-code-bashhistory (shell history)
# - claude-code-config (Claude settings)
# If using optional named volume for JetBrains:
# - langstar-workspace (code - only if enabled)- Ensure Docker Desktop is running
- Check
.envfile exists and has actual values (not placeholders) - Try rebuilding without cache:
docker-compose -f .devcontainer/docker-compose.yml build --no-cache
- Verify
.devcontainer/.envexists with actual values - Check variables are declared in
docker-compose.ymlenvironment section - Rebuild the container: Dev Containers: Rebuild Container
- Test substitution:
cd .devcontainer docker-compose config | grep -A 20 environment:
- Verify
GITHUB_PAT(local) orGH_PAT(Codespaces) is set correctly - Check the token has
reposcope - Run setup manually:
bash .devcontainer/setup-github-auth.sh - Check credential store:
git credential-store --file ~/.git-credentials get <<< "protocol=https host=github.com"
If /workspace is empty after container starts:
# Clone the repository into the workspace
cd /workspace
git clone https://github.com/codekiln/langstar.git .This is expected behavior with named volumes. The volume starts empty and you clone the repo into it.
After setup is complete:
- Review GitHub Workflow for development practices
- Check Testing Standards for test requirements
- Read Git SCM Conventions for commit formatting
- See Environment Variables for API authentication details
For complete environment variable documentation, see environment-variables.md.
| Variable | Local Name | Codespaces Name | Purpose |
|---|---|---|---|
| GitHub PAT | GITHUB_PAT |
GH_PAT |
Git operations |
| GitHub User | GITHUB_USER |
GH_USER |
Git config |
| AWS Access Key | AWS_ACCESS_KEY_ID |
Same | Bedrock auth |
| AWS Secret Key | AWS_SECRET_ACCESS_KEY |
Same | Bedrock auth |
| LangSmith API Key | LANGSMITH_API_KEY |
Same | LangSmith API |