This file provides comprehensive guidance for AI agents working with the ADL CLI project. It covers project architecture, development workflow, testing strategies, and conventions.
ADL CLI (Agent Definition Language Command Line Interface) is a Go-based tool for generating enterprise-ready A2A (Agent-to-Agent) servers from YAML-based Agent Definition Language (ADL) files. It eliminates boilerplate code and ensures consistent patterns across agent implementations.
- Language: Go 1.26+
- Framework: Cobra CLI framework
- Templating: Go templates with Sprig functions
- Build System: Taskfile for automation
- CI/CD: GitHub Actions with semantic-release
- Containerization: Docker with multi-platform support
adl-cli/
├── cmd/ # CLI command implementations
│ ├── root.go # Main CLI setup
│ ├── generate.go # Generate command
│ ├── init.go # Init command
│ ├── validate.go # Validate command
│ └── *_test.go # Command tests
├── internal/ # Internal packages
│ ├── generator/ # Code generation engine
│ ├── schema/ # ADL schema definitions and validation
│ ├── templates/ # Template system
│ │ ├── common/ # Cross-language templates
│ │ ├── languages/ # Language-specific templates
│ │ └── sandbox/ # Environment templates
│ └── prompt/ # Interactive prompt system
├── examples/ # Example ADL files
├── .github/workflows/ # CI/CD workflows
├── Taskfile.yml # Build automation
├── go.mod # Go dependencies
└── main.go # Application entry point
- CLI Interface (
cmd/): Cobra-based command structure withinit,generate, andvalidatecommands - Template Engine (
internal/templates/): Multi-language template system with support for Go, Rust, and TypeScript - Schema System (
internal/schema/): YAML schema validation using JSON Schema - Generator (
internal/generator/): File generation engine with.adl-ignoresupport - Prompt System (
internal/prompt/): Interactive CLI prompts for project initialization
- Go 1.26+ (as specified in
go.mod) - Task for build automation
- Docker (for container operations)
- Git for version control
# Clone the repository
git clone https://github.com/inference-gateway/adl-cli.git
cd adl-cli
# Install dependencies
task mod
# Build the CLI
task build
# Run tests
task test- Task Runner: Use
task <command>for all development operations - Linting:
golangci-lintconfigured in CI workflow - Formatting:
go fmtandprettierfor consistent code style - Testing: Go's built-in testing framework with coverage support
# Build the ADL CLI binary
task build # Build to bin/adl
task install # Install to GOPATH/bin
# Development mode
task dev -- <args> # Run CLI with arguments
task dev -- init my-agent # Interactive project setup# Format code
task fmt # Format Go code
task format # Run prettier formatter
# Lint and vet
task lint # Run golangci-lint
task vet # Run go vet
# Complete CI pipeline
task ci # fmt → lint → test → build# Run tests
task test # Run all tests
task test:coverage # Tests with coverage
# Example validation
task examples:test # Validate all example ADL files
task examples:generate # Generate projects from examples# Build release binaries
task release # Multi-platform builds via goreleaser
# Docker operations
task docker:build # Build Docker image- Unit Tests: Test individual functions and methods
- Integration Tests: Test command execution and file generation
- Example Tests: Validate example ADL files and generated output
# Run all tests
go test -v ./...
# Run specific package tests
go test -v ./cmd
go test -v ./internal/generator
go test -v ./internal/schema
# Run with coverage
go test -v -cover ./...- Table-driven tests: Use for comprehensive test coverage
- Golden files: Compare generated output with expected results
- Mock file system: Test file operations without touching disk
- Command testing: Test CLI commands with different arguments
# Validate example ADL files
adl validate examples/go-agent.yaml
adl validate examples/rust-agent.yaml
adl validate examples/cloudrun-agent.yaml
# Generate and test example projects
rm -rf test-output
mkdir -p test-output
adl generate --file examples/go-agent.yaml --output test-output/go-agent --overwrite --ci- Follow standard Go conventions and
gofmtformatting - Use
golangci-lintfor linting with project-specific configuration - Prefer early returns to avoid deep nesting
- Use table-driven tests for comprehensive coverage
- Always add a new line at the end of files
- Use lowercase log messages
- Code to interfaces for easier testing
Use conventional commits format:
type(scope): Description
feat(generator): Add CloudRun deployment support
fix(schema): Resolve validation issue with nested config
chore(deps): Update Go dependencies
Types: feat, fix, refactor, perf, ci, docs, style, test, build, chore, security
- Generated Files: Mark with "DO NOT EDIT" headers
- Internal Packages: Use
internal/for non-public code - Test Files: Place
*_test.gofiles alongside implementation - Configuration: Centralize in root directory files
When modifying templates:
- Update templates in
internal/templates/ - Add corresponding tests
- Update example files if needed
- Test generation with example ADL files
- Ensure backward compatibility or document breaking changes
Taskfile.yml: Build automation and development tasks.goreleaser.yaml: Multi-platform binary distribution.releaserc.yaml: Semantic-release configuration.github/workflows/: CI/CD pipeline definitionsgo.mod: Go module dependencies
cmd/root.go: Main CLI setup and version managementinternal/schema/types.go: ADL type definitionsinternal/templates/engine.go: Template execution engineinternal/generator/generator.go: File generation logic
internal/templates/
├── common/ # Cross-language templates
│ ├── ai/ # AI assistant instructions
│ ├── config/ # Configuration templates
│ ├── docker/ # Docker configurations
│ ├── docs/ # Documentation templates
│ ├── github/ # GitHub workflows
│ ├── kubernetes/ # K8s deployment
│ └── taskfile/ # Taskfile templates
├── languages/ # Language-specific templates
│ ├── go/ # Go project templates
│ ├── rust/ # Rust project templates
│ └── typescript/ # TypeScript templates (planned)
└── sandbox/ # Development environments
├── devcontainer/ # VS Code DevContainer
└── flox/ # Flox environment
# Create feature branch
git checkout -b feat/feature-name
# Make changes and test
task ci # Run full CI pipeline
# Commit with conventional commit
git commit -m "feat(scope): Description"
# Push and create PR
git push origin feat/feature-name# Test command changes
task dev -- init test-agent
task dev -- generate --file examples/go-agent.yaml --output test-output
# Test template changes
rm -rf test-output
task examples:generate
ls -la test-output/go-agent/
# Run all tests
task test- Merge changes to
mainbranch - Run
task releaseto build binaries - Use semantic-release for versioning and changelog
- GitHub Actions automatically creates releases
apiVersion: adl.dev/v1
kind: Agent
metadata:
name: agent-name
description: Agent description
version: "1.0.0"
spec:
capabilities:
streaming: true
pushNotifications: false
stateTransitionHistory: false
agent:
provider: "openai"
model: "gpt-4o-mini"
systemPrompt: "You are a helpful assistant."
maxTokens: 4096
temperature: 0.7
skills:
- name: get_weather
description: "Get current weather"
schema:
type: object
properties:
city:
type: string
description: "City name"
required:
- city
server:
port: 8080
debug: false
language:
go:
module: "github.com/user/agent"
version: "1.26"- Multi-language support: Go, Rust, TypeScript (planned)
- CI/CD integration: GitHub Actions workflows
- Deployment options: Kubernetes, CloudRun
- Sandbox environments: Flox, DevContainer
- Service injection: Type-safe dependency injection
- Configuration management: Environment variable mapping
- Artifacts support: Filesystem and MinIO storage
- Template errors: Check template syntax and context variables
- Schema validation: Use
adl validateto debug ADL files - File permissions: Ensure write access to output directories
- Dependency issues: Run
task modto update dependencies
# Validate ADL schema
adl validate agent.yaml
# Debug generation
adl generate --file agent.yaml --output ./test --verbose
# Check generated structure
tree test-output/go-agent/
# Test with minimal example
adl init test-minimal --defaults
adl generate --file agent.yaml --output test-minimal- Use
--verboseflag for detailed output - Check
test-output/directory for generation results - Review GitHub Actions logs for CI/CD issues
- Use Go's built-in testing
-vflag for test output
.infer/config.yaml: Inference configuration.infer/*.db: Database files.infer/shortcuts/: Shortcut configurations.infer/agents.yaml: Agent configurations.infer/mcp.yaml: MCP configurations.git/: Git repository data*.env: Environment files
- Never commit secrets or API keys
- Use environment variables for sensitive configuration
- Validate all user input in ADL files
- Follow principle of least privilege for file operations
- Use
.adl-ignoreto protect custom implementations
- Use
-trimpathflag for reproducible builds - Enable Go module caching in CI
- Parallelize test execution where possible
- Use
--skip=publishfor local release testing
- Batch file operations when possible
- Use template caching for repeated generations
- Minimize file I/O operations
- Validate ADL before generation to avoid wasted work
- Language Support: Add templates to
internal/templates/languages/ - New Commands: Add to
cmd/with tests - Template Features: Update engine and add tests
- Schema Extensions: Update
internal/schema/types.go
- Add unit tests for new functionality
- Update example files if schema changes
- Test generation with example ADL files
- Ensure backward compatibility or document breaking changes
- Update README.md for user-facing changes
- Update AGENTS.md for agent workflow changes
- Update example files for new features
- Add changelog entries for significant changes
- README.md: User documentation and examples
- CLAUDE.md: AI assistant instructions
- CONTRIBUTING.md: Contribution guidelines
- CHANGELOG.md: Version history
- GitHub Issues: Bug reports and feature requests
- GitHub Discussions: Questions and community support
- Documentation: Project documentation and examples
Last Updated: Based on project analysis on January 27, 2026
Project Version: 0.26.4 (from Taskfile.yml)
Go Version: 1.26.1 (from go.mod)
Main Branch: main