Contributing

cagent is open source. Here’s how to set up your development environment and contribute.

Development Setup

Prerequisites

ℹ️ Platform Support

macOS and Linux are fully supported for development. On Windows, use task build-local to build via Docker.

Build from Source

# Clone and build
git clone https://github.com/docker/cagent.git
cd cagent
task build

# Set API keys
export OPENAI_API_KEY=your_key_here
export ANTHROPIC_API_KEY=your_key_here

# Run an example
./bin/cagent run examples/code.yaml

Development Commands

Command Description
task build Build the binary to ./bin/cagent
task test Run all tests (clears API keys for determinism)
task lint Run golangci-lint
task format Format code
task dev Run lint, test, and build in sequence
task build-local Build for local platform via Docker
task cross Cross-platform builds (all architectures)

Dogfooding

Use cagent to work on cagent! The project includes a specialized developer agent:

cd cagent
cagent run ./golang_developer.yaml

This agent is an expert Go developer that understands the cagent codebase. Ask it questions, request fixes, or have it implement features.

Core Concepts

Code Style

The project uses golangci-lint with strict rules. As long as task lint passes, the code is stylistically acceptable.

Key conventions:

Opening Issues

File issues on the GitHub issue tracker. Please:

ℹ️ See also
Troubleshooting — Common issues and debug mode. Telemetry — What data is collected and how to opt out.

Submitting Pull Requests

  1. Fork the repository and create a branch for your changes
  2. Write your code following the style and testing guidelines above
  3. Test your changes: run task lint and task test
  4. Sign your commits with git commit -s (DCO required)
  5. Open a pull request against the main branch
💡 Tip

Use the dogfooding agent (cagent run ./golang_developer.yaml) to help write and review your changes before submitting.

Sign Your Work

All contributions require a Developer Certificate of Origin (DCO) sign-off:

# Sign commits automatically
git config user.name "Your Name"
git config user.email "your.email@example.com"
git commit -s -m "Your commit message"

Community

Find us on Slack for questions and discussions.

Code of Conduct

We want to keep the cagent community welcoming, inclusive, and collaborative. Key guidelines:

The governance for this repository is handled by Docker Inc.