This guide covers how to effectively use opencoder in different environments and workflows.
After running ./scripts/local-setup.sh, OpenCode is available globally with the opencoder configuration installed:
# Basic OpenCode commands
opencode --version
opencode --help
opencode # Start interactive TUI
# Start OpenCode with opencoder configuration
opencodeThe opencoder configuration includes these OpenCode plugins:
@tarquinen/opencode-dcp@3.1.13cc-safety-net@1.0.6oh-my-openagent@4.12.0
The container comes with OpenCode pre-configured and ready to use:
# Check installation
podman run -it --rm opencoder opencode --version
# Interactive session
podman run -it --rm opencoder
# Run specific commands
podman run --rm opencoder opencode --helpMount your project directory to work on existing codebases:
# Mount current directory as workspace
podman run -it --rm \
-v $(pwd):/workspace \
-w /workspace \
opencoder bash
# Direct command execution
podman run --rm \
-v $(pwd):/workspace \
-w /workspace \
opencoder opencode --versionThe opencoder includes oh-my-openagent for sophisticated multi-agent workflows:
# Start orchestration session
opencode
# Available agents (examples):
# - Sisyphus: Main orchestrator
# - Hephaestus: Deep autonomous worker
# - Prometheus: Strategic planner
# - Oracle: Architecture consultant
# - Librarian: Documentation and researchAccess production-ready skills and commands:
# Skills are loaded automatically from plugins
# Use specific skills in your workflow
# - TDD workflows
# - Git operations
# - Browser automation (Playwright)
# - Debugging methodologiesInteractive development:
# Start development container
podman run -it --rm \
-v $(pwd):/workspace \
-w /workspace \
--name opencode-dev \
opencoder bash
# Inside container
opencode --version
ls -la /workspacePersistent containers:
# Create persistent container for long-running work
podman run -dit \
-v $(pwd):/workspace \
-w /workspace \
--name my-opencode-env \
opencoder
# Attach to existing container
podman exec -it my-opencode-env bash
# Stop when done
podman stop my-opencode-env
podman rm my-opencode-envGitHub Actions example:
name: OpenCode Check
on: [push, pull_request]
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check OpenCode version
run: |
podman pull ghcr.io/tankdonut/opencoder:latest
podman run --rm \
-v ${{ github.workspace }}:/workspace \
-w /workspace \
ghcr.io/tankdonut/opencoder:latest \
opencode --versionGitLab CI example:
check-opencode:
stage: test
image: ghcr.io/tankdonut/opencoder:latest
script:
- opencode --version
only:
- merge_requests
- mainConsistent environments:
# Team members use same container version
podman pull ghcr.io/tankdonut/opencoder:v1.0.0
# Shared configuration via mounted configs
podman run -it --rm \
-v $(pwd):/workspace \
-v ~/team-opencode-config:/config \
-w /workspace \
opencoderWorkspace mount:
# Mount a project workspace with the opencoder configuration
podman run -it --rm \
-v $(pwd):/workspace \
-w /workspace \
opencoderThe opencoder uses the skills.sh CLI for skill distribution. Plugins (npm packages) are pinned in opencode.json:
# Update plugin versions in opencode.json, then rebuild
./scripts/build.sh
# Refresh the skills lockfile (baseline skills)
npx skills@1.5.13 experimental_install
git add build/skills-lock.json
git commit -m "update: refresh skills lockfile"
# Container rebuild needed after plugin updates
./scripts/build.shMain configuration file: build/.opencode/opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": [
"@tarquinen/opencode-dcp@3.1.13",
"cc-safety-net@1.0.6",
"oh-my-openagent@4.12.0"
]
}Container-specific configuration: build/etc/opencode/opencode.jsonc
- Used for container-specific optimizations
- Supports comments and trailing commas
# Add the plugin to opencode.json with a pinned version
jq '.plugin += ["my-plugin@1.0.0"]' build/.opencode/opencode.json > tmp.json && mv tmp.json build/.opencode/opencode.json
# Add a new skill source at runtime (opt-in)
npx skills@1.5.13 add owner/repo --agent opencode --skill '*' --copy -y
# Rebuild container if using container deployment
./scripts/build.shCustom skills can be developed following the patterns in the upstream skill repositories linked in the README.
Environment variables for OpenCode are configured by the tool itself. Refer to the OpenCode documentation for available options.
Access container logs:
# View container logs
podman logs my-opencode-container
# Follow logs in real-time
podman logs -f my-opencode-containerResource limits:
# Limit container resources
podman run -it --rm \
--memory=4g \
--cpus=2 \
-v $(pwd):/workspace \
opencoderVolume optimization:
# Use bind mounts for better performance
podman run -it --rm \
--mount type=bind,source=$(pwd),target=/workspace \
-w /workspace \
opencoderContainer layer caching:
# Build with tag
./scripts/build.sh --tag opencoderPlugin caching:
# Skills are baked into the image at build time (oh-my-openagent baseline)
# Optional runtime skills (ECC, superpowers) are fetched on demand
# No additional caching needed for most use cases-
Container security:
- Containers run as non-root user (UID 1000)
- No secrets baked into images
- Minimal attack surface
-
Host security:
- Keep OpenCode and plugins updated
- Review plugin permissions
- Use project-specific configurations
-
Regular updates:
# Update opencoder git pull origin main # Rebuild container ./scripts/build.sh
-
Cleanup:
# Clean up old containers podman system prune -a # Clean up unused images podman image prune -a
Common issues and solutions:
-
Plugin loading failures:
# Verify plugin config is valid jq . build/.opencode/opencode.json # Verify skills lockfile jq . build/skills-lock.json # Rebuild from scratch ./scripts/build.sh --no-cache
-
Container permission issues:
# Fix workspace permissions chown -R 1000:1000 /path/to/workspace -
Memory/resource issues:
# Monitor container resource usage podman stats my-container # Increase limits if needed podman run --memory=8g --cpus=4 ...
- Documentation: Check DEVELOPMENT.md for development-specific usage
- Issues: Report problems on GitHub Issues
- Community: Join discussions for user support and tips