Official DevContainer feature for installing the Langstar CLI in development containers.
The Langstar DevContainer feature provides automatic installation of the Langstar CLI in any devcontainer environment, including:
- VS Code Dev Containers - Local development with consistent environments
- GitHub Codespaces - Cloud-based development workspaces
- devpod - Client-only development container runtime
- Any OCI-compliant devcontainer implementation
Add to your .devcontainer/devcontainer.json:
Specify which version of Langstar CLI to install.
| Value | Description | Example |
|---|---|---|
"latest" |
Most recent release (default) | "latest" |
| Specific version | Pin to exact version | "v0.4.0", "v0.3.0" |
Default: "latest"
Example:
{
"features": {
"ghcr.io/codekiln/langstar/langstar:1": {
"version": "v0.4.0"
}
}
}- Binary:
/usr/local/bin/langstar - Architecture Support:
- Linux x86_64 (amd64) ✅
- Linux ARM64 (aarch64) ✅
- macOS ARM64 (Apple Silicon) ✅
The feature has been tested and verified on:
| Distribution | Versions | Status |
|---|---|---|
| Ubuntu | 22.04, 24.04 | ✅ Fully tested |
| Debian | 11 (bullseye), 12 (bookworm) | ✅ Fully tested |
| Alpine | 3.18, 3.19 | ✅ Fully tested |
The feature should work on any Linux-based devcontainer image.
| Implementation | Support |
|---|---|
| VS Code Dev Containers | ✅ Supported |
| GitHub Codespaces | ✅ Supported |
| devpod | ✅ Supported |
| Docker | ✅ Supported |
| Podman | ✅ Supported (with devcontainer CLI) |
Minimal configuration using defaults:
{
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"features": {
"ghcr.io/codekiln/langstar/langstar:1": {}
}
}Pin to a specific version for reproducibility:
{
"image": "mcr.microsoft.com/devcontainers/rust:1",
"features": {
"ghcr.io/codekiln/langstar/langstar:1": {
"version": "v0.4.0"
}
}
}Combine with other devcontainer features:
{
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": true,
"installOhMyZsh": true
},
"ghcr.io/devcontainers/features/github-cli:1": {
"version": "latest"
},
"ghcr.io/devcontainers/features/rust:1": {
"version": "latest"
},
"ghcr.io/codekiln/langstar/langstar:1": {
"version": "latest"
}
}
}Complete devcontainer configuration with environment variables:
{
"name": "LangGraph Development",
"image": "mcr.microsoft.com/devcontainers/rust:1",
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": true
},
"ghcr.io/devcontainers/features/github-cli:1": {},
"ghcr.io/codekiln/langstar/langstar:1": {
"version": "latest"
}
},
"remoteEnv": {
"LANGSMITH_API_KEY": "${localEnv:LANGSMITH_API_KEY}"
},
"postCreateCommand": "langstar --version && langstar config"
}After the feature installs Langstar, you'll need to configure it with your LangSmith credentials.
Use devcontainer remoteEnv to pass credentials from your local environment:
{
"features": {
"ghcr.io/codekiln/langstar/langstar:1": {}
},
"remoteEnv": {
"LANGSMITH_API_KEY": "${localEnv:LANGSMITH_API_KEY}",
"LANGSMITH_ORGANIZATION_ID": "${localEnv:LANGSMITH_ORGANIZATION_ID}",
"LANGSMITH_WORKSPACE_ID": "${localEnv:LANGSMITH_WORKSPACE_ID}"
}
}Set local environment variables in your shell:
# ~/.bashrc or ~/.zshrc
export LANGSMITH_API_KEY="<your-api-key>"
export LANGSMITH_ORGANIZATION_ID="<your-org-id>" # Optional
export LANGSMITH_WORKSPACE_ID="<your-workspace-id>" # OptionalFor GitHub Codespaces, use repository or organization secrets:
- Go to your repository settings → Secrets and variables → Codespaces
- Add secrets:
LANGSMITH_API_KEYLANGSMITH_ORGANIZATION_ID(optional)LANGSMITH_WORKSPACE_ID(optional)
Reference in devcontainer.json:
{
"remoteEnv": {
"LANGSMITH_API_KEY": "${secret:LANGSMITH_API_KEY}"
}
}Create a configuration file inside the container:
# Inside the devcontainer
mkdir -p ~/.langstar
cat > ~/.langstar/config.toml << 'EOF'
[langstar]
langsmith_api_key = "<your-api-key>"
organization_id = "<your-org-id>" # Optional
workspace_id = "<your-workspace-id>" # Optional
EOFAfter starting your devcontainer:
# Check Langstar is installed
langstar --version
# Verify configuration
langstar config
# Test with a simple command
langstar prompt listAlways use the most recent release:
{
"features": {
"ghcr.io/codekiln/langstar/langstar:1": {
"version": "latest"
}
}
}Pros:
- Always up-to-date with latest features and fixes
- No manual version management
Cons:
- May introduce breaking changes (follow semantic versioning)
- Less reproducible across team members
Lock to a specific version for reproducibility:
{
"features": {
"ghcr.io/codekiln/langstar/langstar:1": {
"version": "v0.4.0"
}
}
}Pros:
- Reproducible builds across team
- No surprise breaking changes
- Better for CI/CD pipelines
Cons:
- Manual updates required
- May miss bug fixes and new features
For most projects, use pinned versions in production and latest for development:
// devcontainer.json (development)
{
"features": {
"ghcr.io/codekiln/langstar/langstar:1": {
"version": "latest"
}
}
}
// devcontainer.prod.json (production/CI)
{
"features": {
"ghcr.io/codekiln/langstar/langstar:1": {
"version": "v0.4.0"
}
}
}When the feature runs:
-
Version Resolution
- Resolves
"latest"to current GitHub release - Validates specific version exists
- Resolves
-
Architecture Detection
- Detects container architecture (x86_64, ARM64)
- Selects appropriate binary
-
Binary Download
- Downloads from GitHub Releases
- Verifies SHA256 checksums
-
Installation
- Installs to
/usr/local/bin/langstar - Makes binary executable
- Verifies installation with
langstar --version
- Installs to
The feature uses the official Langstar install script:
curl -fsSL https://raw.githubusercontent.com/codekiln/langstar/main/scripts/install.sh | bash -s -- --prefix /usr/localSource code:
- Feature definition:
.devcontainer/features/langstar/devcontainer-feature.json - Install script:
.devcontainer/features/langstar/install.sh - Published to:
ghcr.io/codekiln/langstar/langstar:1
Problem: Installation fails during container build
Solutions:
-
Check network connectivity:
curl -I https://github.com
-
Verify feature version exists:
# Check available releases gh release list --repo codekiln/langstar -
Check container logs:
# In VS Code: View → Output → Dev Containers # Or rebuild with verbose logging: docker build --progress=plain .
Problem: langstar: command not found
Solutions:
-
Verify installation location:
ls -la /usr/local/bin/langstar
-
Check PATH includes
/usr/local/bin:echo $PATH
-
Restart the terminal or source your shell config:
source ~/.bashrc # or ~/.zshrc
Problem: Binary doesn't match container architecture
Solutions:
-
Check container architecture:
uname -m # Should be x86_64 or aarch64 -
Check binary type:
file /usr/local/bin/langstar
-
If mismatch, rebuild container:
# In VS Code: Dev Containers: Rebuild Container # Or via CLI: devcontainer build --workspace-folder .
Problem: langstar config shows no credentials
Solutions:
-
Verify environment variables are set:
env | grep LANGSMITH -
Check
remoteEnvindevcontainer.json:{ "remoteEnv": { "LANGSMITH_API_KEY": "${localEnv:LANGSMITH_API_KEY}" } } -
Verify local environment has the variables:
# On host machine echo $LANGSMITH_API_KEY
-
Rebuild container to pick up new environment:
# In VS Code: Dev Containers: Rebuild Container
Use the feature in GitHub Actions workflows:
name: Test with Langstar
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup DevContainer CLI
run: npm install -g @devcontainers/cli
- name: Build and Run DevContainer
run: |
devcontainer up --workspace-folder .
devcontainer exec --workspace-folder . langstar --version
devcontainer exec --workspace-folder . langstar prompt list
env:
LANGSMITH_API_KEY: ${{ secrets.LANGSMITH_API_KEY }}test:
image: docker:latest
services:
- docker:dind
before_script:
- npm install -g @devcontainers/cli
script:
- devcontainer build --workspace-folder .
- devcontainer exec --workspace-folder . langstar --version
variables:
LANGSMITH_API_KEY: ${LANGSMITH_API_KEY}- Feature Version:
1.0.0 - Feature ID:
langstar - Registry:
ghcr.io/codekiln/langstar/langstar:1
| Feature Version | Langstar CLI Versions | Status |
|---|---|---|
1.x.x |
v0.3.0 and above |
Active |
The feature automatically uses the latest available version when "version": "latest" is specified. No manual updates required.
To check for updates:
# Inside devcontainer
langstar --version
# Check latest release
curl -s https://api.github.com/repos/codekiln/langstar/releases/latest | grep '"tag_name"'The feature works with custom base images:
# Dockerfile
FROM mcr.microsoft.com/devcontainers/base:ubuntu
RUN apt-get update && apt-get install -y curl git// devcontainer.json
{
"build": {
"dockerfile": "Dockerfile"
},
"features": {
"ghcr.io/codekiln/langstar/langstar:1": {}
}
}Run commands after feature installation:
{
"features": {
"ghcr.io/codekiln/langstar/langstar:1": {}
},
"postCreateCommand": "langstar --version && langstar config"
}Execute custom scripts at different container lifecycle stages:
{
"features": {
"ghcr.io/codekiln/langstar/langstar:1": {}
},
"postCreateCommand": "echo 'Container created'",
"postStartCommand": "echo 'Container started'",
"postAttachCommand": "langstar config"
}Do NOT:
- Hard-code API keys in
devcontainer.json - Commit secrets to version control
- Share API keys in plain text
Do:
- Use environment variables with
${localEnv:VAR} - Use secrets for Codespaces (
${secret:VAR}) - Use vault solutions for team environments
- Rotate API keys regularly
The install script automatically verifies SHA256 checksums of downloaded binaries. This ensures:
- Binary integrity (not corrupted)
- Binary authenticity (from official releases)
- Protection against MITM attacks
If you encounter issues:
- Check this documentation for common solutions
- Search existing issues: GitHub Issues
- Open a new issue with:
- DevContainer configuration
- Base image and architecture
- Error messages and logs
- Steps to reproduce
- Main Repository: https://github.com/codekiln/langstar
- Feature Source:
.devcontainer/features/langstar/ - Install Script:
scripts/install.sh - CI Testing: See
.github/workflows/test-devcontainer-feature.yml
Contributions welcome! See:
- Installation Guide - All installation methods
- Configuration Guide - Detailed configuration options
- Architecture Overview - System design and principles
- Troubleshooting Guide - Common issues and solutions
{ "features": { "ghcr.io/codekiln/langstar/langstar:1": { "version": "latest" } } }