@inference-gateway/adl-cli 0.41.2 → 0.41.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +2146 -28
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,17 +1,77 @@
1
- # @inference-gateway/adl-cli
1
+ <div align="center">
2
2
 
3
- npm distribution of [`adl`](https://github.com/inference-gateway/adl-cli) — the
4
- CLI that generates complete A2A (Agent-to-Agent) project scaffolding from YAML
5
- Agent Definition Language (ADL) manifests.
3
+ # ADL CLI
6
4
 
7
- This package is a thin wrapper: on install it downloads the native `adl` binary
8
- that matches your platform from the matching GitHub release, then proxies every
9
- command to it. The CLI itself is unchanged, so `npx @inference-gateway/adl-cli --help`
10
- produces the same output as a natively installed `adl --help`.
5
+ _A command-line interface for generating enterprise-ready A2A (Agent-to-Agent) servers from Agent Definition Language (ADL) files._
11
6
 
12
- ## Usage
7
+ > ⚠️ **Early Development Warning**: This project is in its early stages of development. Breaking changes are expected and acceptable until we reach a stable version. Use with caution in production environments.
8
+
9
+ [![Go Version](https://img.shields.io/github/go-mod/go-version/inference-gateway/adl-cli?style=flat-square&logo=go)](https://golang.org)
10
+ [![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg?style=flat-square)](LICENSE)
11
+ [![Build Status](https://img.shields.io/github/actions/workflow/status/inference-gateway/adl-cli/ci.yml?style=flat-square&logo=github)](https://github.com/inference-gateway/adl-cli/actions)
12
+ [![Go Report Card](https://goreportcard.com/badge/github.com/inference-gateway/adl-cli?style=flat-square)](https://goreportcard.com/report/github.com/inference-gateway/adl-cli)
13
+ [![Release](https://img.shields.io/github/v/release/inference-gateway/adl-cli?style=flat-square&logo=github)](https://github.com/inference-gateway/adl-cli/releases)
14
+
15
+ </div>
16
+
17
+ ## Table of Contents
18
+
19
+ - [Overview](#overview)
20
+ - [Installation](#installation)
21
+ - [npm / npx (Recommended)](#npm--npx-recommended)
22
+ - [Install Script](#install-script)
23
+ - [From Source](#from-source)
24
+ - [Using Go Install](#using-go-install)
25
+ - [Pre-built Binaries](#pre-built-binaries)
26
+ - [Quick Start](#quick-start)
27
+ - [Usage](#usage)
28
+ - [Commands](#commands)
29
+ - [Init Command](#init-command)
30
+ - [Generate Command](#generate-command)
31
+ - [Agent Definition Language (ADL)](#agent-definition-language-adl)
32
+ - [Generated Project Structure](#generated-project-structure)
33
+ - [Sandbox Environments](#sandbox-environments)
34
+ - [Enterprise Features](#enterprise-features)
35
+ - [Artifacts Support](#artifacts-support)
36
+ - [GitHub Issue Templates](#github-issue-templates)
37
+ - [Examples](#examples)
38
+ - [Template System & Architecture](#template-system--architecture)
39
+ - [Customizing Generation with .adl-ignore](#customizing-generation-with-adl-ignore)
40
+ - [Configurable Acronyms](#configurable-acronyms)
41
+ - [Post-Generation Hooks](#post-generation-hooks)
42
+ - [Development](#development)
43
+ - [Roadmap](#roadmap)
44
+ - [License](#license)
45
+ - [Support](#support)
46
+
47
+ ## Overview
48
+
49
+ The ADL CLI helps you build enterprise-ready A2A agents quickly by generating complete project scaffolding from YAML-based Agent Definition Language (ADL) files. It eliminates boilerplate code and ensures consistent patterns across your agent implementations.
50
+
51
+ ### Key Features
13
52
 
14
- Run without installing:
53
+ - 🚀 **Rapid Development** - Generate complete projects in seconds
54
+ - 📋 **Schema-Driven** - Use YAML Agent Definition Language files (ADL) to define your agents
55
+ - 🎯 **Enterprise Ready** - Single unified template with AI integration and enterprise features
56
+ - 🔐 **Enterprise Features** - Authentication, SCM integration, and audit logging
57
+ - 🛠️ **Smart Ignore** - Protect your implementations with .adl-ignore files
58
+ - ✅ **Validation** - Built-in ADL schema validation
59
+ - 🛠️ **Interactive Setup** - Guided project initialization with extensive CLI options
60
+ - 🔗 **Structured Services** - Type-safe dependency injection with interfaces and factory functions
61
+ - ⚙️ **Configuration Management** - Automatic environment variable mapping with proper naming conventions
62
+ - 🔧 **CI/CD Generation** - Automatic GitHub Actions workflows with semantic-release CD pipelines
63
+ - 🏗️ **Sandbox Environments** - Flox and DevContainer support for isolated development
64
+ - 🎣 **Post-Generation Hooks** - Customize build, format, and test commands after generation
65
+ - 🤖 **Multi-Provider AI** - OpenAI, Anthropic, DeepSeek, Ollama, Google, Mistral, and Groq support
66
+ - 📁 **Artifacts Support** - Integrated filesystem and MinIO object storage for artifact management
67
+
68
+ ## Installation
69
+
70
+ ### npm / npx (Recommended)
71
+
72
+ Most developers already have Node.js - run `adl` without a prior install via
73
+ [`@inference-gateway/adl-cli`](https://www.npmjs.com/package/@inference-gateway/adl-cli),
74
+ a thin wrapper that downloads the matching native binary on first use:
15
75
 
16
76
  ```bash
17
77
  npx @inference-gateway/adl-cli init my-agent
@@ -19,34 +79,2092 @@ npx @inference-gateway/adl-cli generate --file agent.yaml --output ./agent
19
79
  npx @inference-gateway/adl-cli validate agent.yaml
20
80
  ```
21
81
 
22
- Or install it (globally or as a dev dependency):
82
+ Or install it globally:
23
83
 
24
84
  ```bash
25
85
  npm install -g @inference-gateway/adl-cli
26
86
  adl --help
27
87
  ```
28
88
 
29
- ## Supported platforms
89
+ Prebuilt binaries are available for Linux and macOS on x64/arm64. The npm
90
+ package version tracks the native binary version one-to-one.
30
91
 
31
- Prebuilt binaries are published for **Linux** and **macOS** on **x64** and
32
- **arm64**. On other platforms, install from source — see the
33
- [main README](https://github.com/inference-gateway/adl-cli#installation).
92
+ ### Install Script
34
93
 
35
- ## How it works
94
+ Use our install script to automatically download and install the latest binary:
36
95
 
37
- - `bin/install.js` runs as a `postinstall` hook. It maps `process.platform` /
38
- `process.arch` to a release asset (`adl_linux_amd64.tar.gz`,
39
- `adl_darwin_arm64.tar.gz`, …), downloads it, verifies its SHA-256 against the
40
- release `checksums.txt`, extracts the binary, and stores it inside the package.
41
- - `bin/run.js` is the `adl` entrypoint. It locates the downloaded binary and
42
- forwards all arguments and the exit code.
96
+ ```bash
97
+ curl -fsSL https://raw.githubusercontent.com/inference-gateway/adl-cli/main/install.sh | bash
98
+ ```
43
99
 
44
- ### Environment variables
100
+ Or download and run the script manually:
45
101
 
46
- - `ADL_CLI_SKIP_DOWNLOAD=1` — skip the binary download during install (useful in
47
- CI when the binary is provided another way).
48
- - `ADL_CLI_BASE_URL` — override the release download base URL (advanced/testing).
102
+ ```bash
103
+ wget https://raw.githubusercontent.com/inference-gateway/adl-cli/main/install.sh
104
+ chmod +x install.sh
105
+ ./install.sh
106
+ ```
49
107
 
50
- ## License
108
+ **Install Options:**
109
+
110
+ - Install specific version: `./install.sh --version v1.0.0`
111
+ - Custom install directory: `INSTALL_DIR=~/bin ./install.sh`
112
+ - Show help: `./install.sh --help`
113
+
114
+ ### From Source
115
+
116
+ ```bash
117
+ git clone https://github.com/inference-gateway/adl-cli.git
118
+ cd adl-cli
119
+ go install .
120
+ ```
121
+
122
+ ### Using Go Install
123
+
124
+ ```bash
125
+ go install github.com/inference-gateway/adl-cli@latest
126
+ ```
127
+
128
+ ### Nix Flake
129
+
130
+ Run the latest version directly without installing:
131
+
132
+ ```bash
133
+ nix run github:inference-gateway/adl-cli
134
+ ```
135
+
136
+ Or pin a specific version:
137
+
138
+ ```bash
139
+ nix run github:inference-gateway/adl-cli/v0.27.13
140
+ ```
141
+
142
+ Build and add it to your profile:
143
+
144
+ ```bash
145
+ nix profile install github:inference-gateway/adl-cli/v0.27.13
146
+ ```
147
+
148
+ Enter a development shell with `go`, `go-task`, `golangci-lint`, `gopls`, and
149
+ `goreleaser` available:
150
+
151
+ ```bash
152
+ nix develop github:inference-gateway/adl-cli
153
+ ```
154
+
155
+ ### Flox
156
+
157
+ Pin `adl` to a specific version inside a [Flox](https://flox.dev) environment by
158
+ adding it to your `.flox/env/manifest.toml`:
159
+
160
+ ```toml
161
+ [install]
162
+ adl.flake = "github:inference-gateway/adl-cli/v0.31.0"
163
+ ```
164
+
165
+ Then activate the environment:
166
+
167
+ ```bash
168
+ flox activate
169
+ ```
170
+
171
+ ### Pre-built Binaries
172
+
173
+ Download pre-built binaries from the [releases page](https://github.com/inference-gateway/adl-cli/releases).
174
+
175
+ ## Quick Start
176
+
177
+ ### 1. Initialize a New Project
178
+
179
+ ```bash
180
+ # Interactive project setup - creates ADL manifest
181
+ adl init my-weather-agent
182
+
183
+ # Generate project code from the manifest
184
+ adl generate --file agent.yaml --output ./test-my-agent
185
+ ```
186
+
187
+ ### 2. Implement Your Business Logic
188
+
189
+ The generated project includes TODO placeholders for your implementations:
190
+
191
+ ```go
192
+ // TODO: Implement weather API logic
193
+ func GetWeatherTool(ctx context.Context, args map[string]any) (string, error) {
194
+ city := args["city"].(string)
195
+ // TODO: Replace with actual weather API call
196
+ return fmt.Sprintf(`{"city": "%s", "temp": "22°C"}`, city), nil
197
+ }
198
+ ```
199
+
200
+ ### 3. Build and Run
201
+
202
+ ```bash
203
+ cd test-weather-agent
204
+ task build
205
+ task run
206
+ ```
207
+
208
+ ## Usage
209
+
210
+ ### Commands
211
+
212
+ | Command | Description |
213
+ | --------------------- | ------------------------------------------------------------------ |
214
+ | `adl init [name]` | Create ADL manifest file interactively with options |
215
+ | `adl generate` | Generate project code from ADL file with CI/CD and sandbox support |
216
+ | `adl validate [file]` | Validate an ADL file against the complete schema |
217
+
218
+ ### Init Command
219
+
220
+ The `adl init` command provides a interactive wizard for creating ADL manifest files:
221
+
222
+ ```bash
223
+ # Interactive ADL manifest creation
224
+ adl init my-weather-agent
225
+
226
+ # Use defaults for all prompts
227
+ adl init my-agent --defaults
228
+
229
+ # Non-interactive with specific configuration
230
+ adl init my-agent \
231
+ --name "Weather Agent" \
232
+ --description "Provides weather information" \
233
+ --provider deepseek \
234
+ --model deepseek-v4-flash \
235
+ --language go \
236
+ --flox
237
+ ```
238
+
239
+ #### Init Command Options
240
+
241
+ The init command supports extensive configuration options:
242
+
243
+ **Project Settings:**
244
+
245
+ - `--defaults` - Use default values for all prompts
246
+ - `--path` - Project directory path
247
+ - `--name` - Agent name
248
+ - `--description` - Agent description
249
+ - `--version` - Agent version
250
+
251
+ **Agent Configuration:**
252
+
253
+ - `--type` - Agent type (`ai-powered`/`minimal`)
254
+ - `--provider` - AI provider (`openai`/`anthropic`/`deepseek`/`ollama`/`google`/`mistral`/`groq`)
255
+ - `--model` - AI model name
256
+ - `--system-prompt` - System prompt for the agent
257
+ - `--max-tokens` - Maximum tokens (integer)
258
+ - `--temperature` - Temperature (0.0-2.0)
259
+
260
+ **Capabilities:**
261
+
262
+ - `--streaming` - Enable streaming responses
263
+ - `--notifications` - Enable push notifications
264
+ - `--history` - Enable state transition history
265
+
266
+ **Server Configuration:**
267
+
268
+ - `--port` - Server port (integer)
269
+ - `--debug` - Enable debug mode
270
+
271
+ **Language-Specific Options:**
272
+
273
+ - `--language` - Programming language (`go`/`rust`/`typescript`)
274
+
275
+ **Go Options:**
276
+
277
+ - `--go-module` - Go module path (e.g., `github.com/user/project`)
278
+ - `--go-version` - Go version (e.g., `1.26.2`)
279
+
280
+ **Rust Options:**
281
+
282
+ - `--rust-package-name` - Rust package name
283
+ - `--rust-version` - Rust version (e.g., `1.94`)
284
+ - `--rust-edition` - Rust edition (e.g., `2024`)
285
+
286
+ **TypeScript Options:**
287
+
288
+ - `--typescript-name` - TypeScript package name
289
+
290
+ **Environment Options:**
291
+
292
+ - `--flox` - Enable Flox environment
293
+ - `--devcontainer` - Enable DevContainer environment
294
+
295
+ **Pipeline / AI Options (declarative, written into the manifest as `false` by default):**
296
+
297
+ - `--ai` - Shortcut for the init wizard: writes
298
+ `spec.development.ai.orchestrators.claudecode.enabled: true` into the generated
299
+ `agent.yaml`. Every other per-agent toggle (`codex`, `gemini`, `opencode`,
300
+ `infer`) stays off; edit `agent.yaml` after init to enable additional agents
301
+ (see [Per-agent AI assistants](#per-agent-ai-assistants)).
302
+ - `--ci` - Sets `spec.scm.ci: true` (generate CI workflow on `adl generate`)
303
+ - `--cd` - Sets `spec.scm.cd: true` (generate CD pipeline + semantic-release on `adl generate`)
304
+
305
+ ### Generate Command
306
+
307
+ ```bash
308
+ # Generate project from ADL file
309
+ adl generate --file agent.yaml --output ./test-my-agent
310
+
311
+ # Overwrite existing files (respects .adl-ignore)
312
+ adl generate --file agent.yaml --output ./test-my-agent --overwrite
313
+
314
+ # Generate with CI workflow configuration
315
+ adl generate --file agent.yaml --output ./test-my-agent --ci
316
+
317
+ # Generate with CloudRun deployment configuration
318
+ adl generate --file agent.yaml --output ./test-my-agent --deployment cloudrun
319
+
320
+ # Generate with CloudRun deployment and CD pipeline
321
+ adl generate --file agent.yaml --output ./test-my-agent --deployment cloudrun --cd
322
+ ```
323
+
324
+ #### Generate Flags
325
+
326
+ | Flag | Description |
327
+ | ------------------ | ---------------------------------------------------------------------------------- |
328
+ | `--file`, `-f` | ADL file to generate from (default: "agent.yaml") |
329
+ | `--output`, `-o` | Output directory for generated code (default: ".") |
330
+ | `--template`, `-t` | Template to use (default: "minimal") |
331
+ | `--overwrite` | Overwrite existing files (respects .adl-ignore) |
332
+ | `--ci` | Generate CI workflow configuration (GitHub Actions). Overrides `spec.scm.ci`. |
333
+ | `--cd` | Generate CD pipeline configuration with semantic-release. Overrides `spec.scm.cd`. |
334
+ | `--deployment` | Generate deployment configuration (`kubernetes`, `cloudrun`) |
335
+
336
+ > **Declarative equivalents:** `--ci` and `--cd` are mirrored by `spec.scm.ci`
337
+ > and `spec.scm.cd`. The CLI flag is OR'd on top of the manifest value (passing
338
+ > the flag wins; omitting it falls back to the manifest). AI assistants are
339
+ > entirely manifest-driven via the per-agent toggles in
340
+ > `spec.development.ai.orchestrators`
341
+ >
342
+ > - see the matrix below.
343
+ > `adl init` writes all toggles as `false` by default - they're opt-in. Generated files
344
+ > (`CLAUDE.md`, `GEMINI.md`, `AGENTS.md`, `.github/workflows/ci.yml`,
345
+ > `.github/workflows/cd.yml`, `.github/workflows/claude.yml`,
346
+ > `.github/workflows/codex.yml`, `.github/workflows/gemini.yml`,
347
+ > `.releaserc.yaml`) are tagged `linguist-generated=true` in `.gitattributes`
348
+ > so they collapse in pull request diffs.
349
+
350
+ **CI Generation Features:**
351
+
352
+ - **Automatic Provider Detection**: Detects GitHub from ADL `spec.scm.provider` (GitLab support planned)
353
+ - **Language-Specific Workflows**: Tailored CI configurations for Go, Rust, and TypeScript
354
+ - **Version Integration**: Uses language versions from ADL configuration
355
+ - **Task Integration**: Leverages generated Taskfile for consistent build processes
356
+ - **Caching**: Includes service caching for faster builds
357
+
358
+ **CD Generation Features:**
359
+
360
+ - **Semantic Release Integration**: Automatic versioning based on conventional commits
361
+ - **Multi-Language Support**: Builds and tests for Go, Rust, and TypeScript projects
362
+ - **Container Publishing**: Builds and pushes Docker images to GitHub Container Registry
363
+ - **Manual Dispatch**: CD workflow triggered manually via GitHub Actions
364
+ - **Changelog Generation**: Automatic CHANGELOG.md generation with release notes
365
+ - **GitHub Releases**: Creates GitHub releases with appropriate tagging
366
+ - **Deployment Integration**: Supports automatic deployment to Kubernetes and Cloud Run after successful releases
367
+
368
+ **AI Integration Features:**
369
+
370
+ The ADL CLI honours the per-agent toggles under
371
+ `spec.development.ai.orchestrators` (the per-agent toggles were introduced in
372
+ ADL schema v0.8.0 and moved under `orchestrators` in adl#27). Each entry is
373
+ independent and defaults to `false`:
374
+
375
+ ```yaml
376
+ spec:
377
+ development:
378
+ ai:
379
+ orchestrators:
380
+ claudecode:
381
+ enabled: true # generates CLAUDE.md + .github/workflows/claude.yml
382
+ codex:
383
+ enabled: false # would generate AGENTS.md + .github/workflows/codex.yml
384
+ gemini:
385
+ enabled: false # would generate GEMINI.md + .github/workflows/gemini.yml
386
+ opencode:
387
+ enabled: false # would generate AGENTS.md (no upstream action yet)
388
+ infer:
389
+ enabled: false # would generate AGENTS.md (no upstream action yet)
390
+ ```
391
+
392
+ #### Per-agent AI assistants
393
+
394
+ | Agent toggle | Docs file the agent reads | GitHub Actions workflow generated? |
395
+ | ------------ | ------------------------- | --------------------------------------------------------------------------------- |
396
+ | `claudecode` | `CLAUDE.md` | yes (`.github/workflows/claude.yml`, uses `anthropics/claude-code-action`) |
397
+ | `codex` | `AGENTS.md` (shared) | yes (`.github/workflows/codex.yml`, uses `openai/codex-action`) |
398
+ | `gemini` | `GEMINI.md` | yes (`.github/workflows/gemini.yml`, uses `google-github-actions/run-gemini-cli`) |
399
+ | `opencode` | `AGENTS.md` (shared) | no upstream action yet - docs only |
400
+ | `infer` | `AGENTS.md` (shared) | no workflow scaffolded yet - docs only |
401
+
402
+ - `AGENTS.md` is generated **once** and is shared by every enabled agent that
403
+ reads from it (`codex`, `opencode`, `infer`); the file's contents are
404
+ agent-agnostic.
405
+ - `CLAUDE.md` and `GEMINI.md` are agent-specific and only appear when the
406
+ matching toggle is on.
407
+ - If no toggles are enabled, no AI docs or workflows are emitted.
408
+ - Pre-v0.8.0 manifests using `spec.development.ai.enabled: true`, and the
409
+ flat per-agent shape `spec.development.ai.<agent>` (pre-orchestrators), are no
410
+ longer accepted - `adl validate` and `adl generate` fail with a migration hint
411
+ pointing at `spec.development.ai.orchestrators`. Move the toggle to the
412
+ specific agent you want (e.g. `orchestrators.claudecode.enabled: true`).
413
+ - When `claudecode` is enabled, sandbox environments (Flox, DevContainer)
414
+ also gain the `claude-code` CLI / extension automatically.
415
+
416
+ **Deployment Generation Features:**
417
+ The `--deployment` flag generates platform-specific deployment configurations:
418
+
419
+ - **CloudRun Deployment**: Creates a `deploy` task in the root `Taskfile.yml` for gcloud deployment
420
+ - Supports both Google Container Registry (GCR) and GitHub Container Registry (GHCR)
421
+ - Configurable resources (CPU, memory), scaling (min/max instances), and service options
422
+ - Uses direct gcloud commands for truly serverless deployment (no Kubernetes required)
423
+ - Automatic container building with Docker or Cloud Build integration
424
+ - **Kubernetes Deployment**: Creates `k8s/deployment.yaml` with standard Kubernetes manifests
425
+ - Enterprise-ready configurations with resource limits and health checks
426
+ - ConfigMap and Secret integration for environment variables
427
+ - Service and Ingress configurations for load balancing
428
+
429
+ ## Agent Definition Language (ADL)
430
+
431
+ ADL files use YAML to define your agent's configuration, capabilities, and tools.
432
+
433
+ The canonical schema lives in the [inference-gateway/adl](https://github.com/inference-gateway/adl) repository - that repo is the single source of truth for the ADL specification. This CLI vendors a pinned copy at `internal/schema/schema.json` (refresh with `task fetch-schema`).
434
+
435
+ ### Example ADL File
436
+
437
+ ```yaml
438
+ apiVersion: adl.inference-gateway.com/v1
439
+ kind: Agent
440
+ metadata:
441
+ name: weather-agent
442
+ description: "Provides weather information for cities worldwide"
443
+ version: "1.0.0"
444
+ spec:
445
+ capabilities:
446
+ streaming: true
447
+ pushNotifications: false
448
+ stateTransitionHistory: false
449
+ agent:
450
+ provider: "" # Choose: openai, anthropic, deepseek, ollama, google, mistral, groq
451
+ model: "" # Specify default model name for chosen provider
452
+ systemPrompt: "You are a helpful weather assistant."
453
+ maxTokens: 4096
454
+ temperature: 0.7
455
+ tools:
456
+ - name: get_weather
457
+ description: "Get current weather for a city"
458
+ schema:
459
+ type: object
460
+ properties:
461
+ city:
462
+ type: string
463
+ description: "City name"
464
+ country:
465
+ type: string
466
+ description: "Country code"
467
+ required:
468
+ - city
469
+ server:
470
+ port: 8080
471
+ debug: false
472
+ language:
473
+ go:
474
+ module: "github.com/example/weather-agent"
475
+ version: "1.26.2"
476
+ acronyms: # Optional: Custom acronyms for better code generation
477
+ - api
478
+ - json
479
+ - xml
480
+ ```
481
+
482
+ ### ADL Schema
483
+
484
+ The complete ADL schema includes:
485
+
486
+ - **metadata**: Agent name, description, and version
487
+ - **capabilities**: Streaming, notifications, state history
488
+ - **config**: Structured configuration sections with environment variable mapping
489
+ - **services**: Service services with interfaces, factories, and type definitions
490
+ - **agent**: AI provider configuration (OpenAI, Anthropic, DeepSeek, Ollama, Google, Mistral, Groq)
491
+ - **tools**: Function-call definitions with JSON schemas, validation, and service injection support
492
+ - **skills**: Markdown playbooks (id + optional `bare`, version, source) pulled from the skills registry, fetched as a full directory from a GitHub repo (shorthand or URL), or scaffolded locally; advertised on the agent card and prepended to the system prompt at runtime
493
+ - **server**: HTTP server configuration with authentication support
494
+ - **language**: Programming language-specific settings (Go, Rust, TypeScript) and configurable acronyms
495
+ - **scm**: Source control management configuration (GitHub, GitLab)
496
+ - **sandbox**: Development environment configuration (Flox, DevContainer)
497
+ - **deployment**: Platform-specific deployment configuration (Kubernetes, Cloud Run)
498
+
499
+ ### Complete ADL Example
500
+
501
+ ```yaml
502
+ apiVersion: adl.inference-gateway.com/v1
503
+ kind: Agent
504
+ metadata:
505
+ name: advanced-agent
506
+ description: "Enterprise agent with full feature set"
507
+ version: "1.0.0"
508
+ spec:
509
+ capabilities:
510
+ streaming: true
511
+ pushNotifications: true
512
+ stateTransitionHistory: true
513
+ agent:
514
+ provider: deepseek
515
+ model: deepseek-v4-flash
516
+ systemPrompt: |
517
+ You are a helpful assistant with enterprise capabilities.
518
+ Always prioritize security and compliance.
519
+ maxTokens: 8192
520
+ temperature: 0.3
521
+ config:
522
+ database:
523
+ connectionString: "postgresql://user:pass@localhost:5432/db"
524
+ maxConnections: "10"
525
+ timeout: "30s"
526
+ notifications:
527
+ slackWebhook: "https://hooks.slack.com/services/..."
528
+ emailApiKey: "your-email-api-key"
529
+ retryAttempts: "3"
530
+ services:
531
+ database:
532
+ type: service
533
+ interface: DatabaseService
534
+ factory: NewDatabaseService
535
+ description: PostgreSQL database service for persistent storage
536
+ notifications:
537
+ type: service
538
+ interface: NotificationService
539
+ factory: NewNotificationService
540
+ description: Multi-channel notification service
541
+ tools:
542
+ - name: query_database
543
+ description: "Execute database queries with validation"
544
+ inject:
545
+ - logger
546
+ - database
547
+ schema:
548
+ type: object
549
+ properties:
550
+ query:
551
+ type: string
552
+ description: "SQL query to execute"
553
+ table:
554
+ type: string
555
+ description: "Target table name"
556
+ limit:
557
+ type: integer
558
+ description: "Result limit"
559
+ maximum: 1000
560
+ required:
561
+ - query
562
+ - table
563
+ - name: send_notification
564
+ description: "Send multi-channel notifications"
565
+ inject:
566
+ - logger
567
+ - notifications
568
+ schema:
569
+ type: object
570
+ properties:
571
+ recipient:
572
+ type: string
573
+ description: "Recipient identifier"
574
+ message:
575
+ type: string
576
+ description: "Message content"
577
+ priority:
578
+ type: string
579
+ enum:
580
+ - low
581
+ - medium
582
+ - high
583
+ - critical
584
+ channel:
585
+ type: string
586
+ enum:
587
+ - email
588
+ - slack
589
+ - teams
590
+ - webhook
591
+ required:
592
+ - recipient
593
+ - message
594
+ - priority
595
+ - channel
596
+ server:
597
+ port: 8443
598
+ debug: false
599
+ auth:
600
+ enabled: true
601
+ language:
602
+ go:
603
+ module: "github.com/company/advanced-agent"
604
+ version: "1.26.2"
605
+ scm:
606
+ provider: github
607
+ url: "https://github.com/company/advanced-agent"
608
+ deployment:
609
+ type: cloudrun
610
+ cloudrun:
611
+ image:
612
+ registry: gcr.io
613
+ repository: advanced-agent
614
+ tag: latest
615
+ useCloudBuild: true
616
+ resources:
617
+ cpu: "2"
618
+ memory: 1Gi
619
+ scaling:
620
+ minInstances: 1
621
+ maxInstances: 100
622
+ concurrency: 1000
623
+ service:
624
+ timeout: 3600
625
+ allowUnauthenticated: false
626
+ serviceAccount: advanced-agent@PROJECT_ID.iam.gserviceaccount.com
627
+ executionEnvironment: gen2
628
+ environment:
629
+ LOG_LEVEL: info
630
+ ENVIRONMENT: production
631
+ development:
632
+ sandbox:
633
+ flox:
634
+ enabled: true
635
+ ```
636
+
637
+ ### Extra dependencies (`spec.language.<lang>.vendor`)
638
+
639
+ Every language config block accepts an optional `vendor` section that lets
640
+ the manifest extend the generator's built-in dependency set. Use `deps`
641
+ for runtime/production dependencies and `devdeps` for development-only
642
+ ones. The exact meaning of `devdeps` depends on the language - see the
643
+ mapping table below. Each entry must be `<package>@<version>` using
644
+ the target language's native package and version syntax - the schema
645
+ validates the shape up front (`^\S+@\S+$`) and points at the offending
646
+ key if you mistype it (e.g. `spec.language.go.vendor.deps.0`).
647
+
648
+ **Conflict policy:** generator built-ins always win. If your manifest
649
+ lists a package that the generator already pins (e.g.
650
+ `github.com/inference-gateway/adk` for Go, `tokio` for Rust), the
651
+ vendor entry is silently dropped and a `⚠️ vendor … collides with
652
+ built-in …` warning is printed to stderr. This prevents accidental
653
+ downgrades of the core runtime SDK.
654
+
655
+ **Output mapping per language:**
656
+
657
+ | Language | `deps` lands in | `devdeps` lands in |
658
+ | ---------- | ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
659
+ | Go | `go.mod` `require` block | `go.mod` [`tool` directive](https://go.dev/doc/modules/managing-dependencies#tools) (executable dev tools: code generators, linters, etc.) plus an `// indirect` entry in `require` so the module is downloadable. Test libraries that you `import` (testify, go-cmp, …) belong in `deps`, not `devdeps`. |
660
+ | Rust | `Cargo.toml` `[dependencies]` | `Cargo.toml` `[dev-dependencies]` |
661
+ | TypeScript | `package.json` `dependencies` | `package.json` `devDependencies` |
662
+
663
+ For Go, supply the **full tool package path** (the binary's `main` package,
664
+ e.g. `golang.org/x/tools/cmd/stringer`) with a version. After generation,
665
+ run `go mod tidy` so Go normalises the indirect `require` entry to the
666
+ actual module root.
667
+
668
+ Examples per language:
669
+
670
+ ```yaml
671
+ # Go: uuid for runtime, stringer + mockgen as dev tools.
672
+ spec:
673
+ language:
674
+ go:
675
+ module: github.com/example/agent
676
+ version: "1.26.2"
677
+ vendor:
678
+ deps:
679
+ - github.com/google/uuid@v1.6.0
680
+ - github.com/stretchr/testify@v1.10.0 # imported by *_test.go
681
+ devdeps:
682
+ - golang.org/x/tools/cmd/stringer@v0.20.0
683
+ - github.com/golang/mock/mockgen@v1.6.0
684
+ ```
685
+
686
+ ```yaml
687
+ # Rust: regex at runtime, mockall + pretty_assertions for tests.
688
+ spec:
689
+ language:
690
+ rust:
691
+ packageName: agent
692
+ version: "1.94.1"
693
+ edition: "2024"
694
+ vendor:
695
+ deps:
696
+ - regex@1.10.0
697
+ devdeps:
698
+ - mockall@0.12.1
699
+ - pretty_assertions@1.4.0
700
+ ```
701
+
702
+ ```yaml
703
+ # TypeScript: axios at runtime, vitest + @types/node for tests.
704
+ spec:
705
+ language:
706
+ typescript:
707
+ packageName: "@example/agent"
708
+ nodeVersion: "20"
709
+ vendor:
710
+ deps:
711
+ - axios@1.7.0
712
+ devdeps:
713
+ - "@types/node@20.11.0"
714
+ - vitest@1.6.0
715
+ ```
716
+
717
+ ### Extra sandbox dependencies (`spec.development.deps`)
718
+
719
+ `spec.development.deps` is the cross-cutting equivalent of the per-language
720
+ `vendor.deps` block above: it lets you install tools into the development
721
+ sandbox (Flox, devcontainer) that don't belong to any single language's
722
+ package manager. Use it for things like `deno`, `kubectl`, `terraform`,
723
+ `awscli`, or any other CLI you want available inside the dev shell. Each
724
+ entry follows the `<package>@<version>` shape, validated up front by the
725
+ schema (`^\S+@\S+$`).
726
+
727
+ ```yaml
728
+ spec:
729
+ development:
730
+ sandbox:
731
+ flox:
732
+ enabled: true
733
+ devcontainer:
734
+ enabled: true
735
+ deps:
736
+ - deno@^2.7.14
737
+ - kubectl@^1.36.1
738
+ - terraform@^1.15.3
739
+ ```
740
+
741
+ **Merge semantics:** additive. The per-language toolchain that each
742
+ sandbox template already installs (`go`/`cargo`/`nodejs`, plus `git`,
743
+ `docker`, `go-task`) is always emitted; `spec.development.deps` entries
744
+ are appended on top, sorted alphabetically so the generated file diffs
745
+ stay stable on re-run. Duplicate package names inside `deps` are deduped
746
+ (first occurrence wins on version). When a `deps` entry's package name
747
+ collides with one of the template's built-ins (e.g. `git@2.53.0`), the
748
+ generator prints a `⚠️ spec.development.deps … collides with a Flox
749
+ built-in …` warning to stderr but still renders the user entry - the
750
+ maintainer's pin wins on version conflict.
751
+
752
+ **Output mapping per backend:**
753
+
754
+ | Backend | Generated file | Per-entry rendering |
755
+ | --------------- | ------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
756
+ | `flox` | `.flox/env/manifest.toml` | A pair of TOML lines under `[install]`: `<pkg>.pkg-path = "<pkg>"` / `<pkg>.version = "<version>"`. Resolved against Nixpkgs at activation time. |
757
+ | `devcontainer` | `.devcontainer/devcontainer.json` | Added to the `features` block as `ghcr.io/devcontainers-extra/features/apt-packages:1` with the comma-joined `<pkg>=<version>` list. Resolution is best-effort against apt. |
758
+ | `dockerCompose` | _(out of scope for this release; see issue #154)_ | n/a |
759
+
760
+ If a package isn't published under its short attribute path in Nixpkgs,
761
+ or isn't available as an apt package on the devcontainer base image,
762
+ add the file to your project's `.adl-ignore` and hand-author the
763
+ override - this is the same escape hatch we use for any sandbox file
764
+ the template can't infer.
765
+
766
+ Worked example per backend:
767
+
768
+ ```yaml
769
+ # Flox: pin deno + kubectl + terraform alongside the Go toolchain
770
+ spec:
771
+ language:
772
+ go: { module: github.com/example/agent, version: "1.26.2" }
773
+ development:
774
+ sandbox:
775
+ flox:
776
+ enabled: true
777
+ deps:
778
+ - deno@2.1.4
779
+ - kubectl@1.36.1
780
+ - terraform@1.9.5
781
+ ```
782
+
783
+ ```yaml
784
+ # Devcontainer: same deps, rendered as an apt-packages feature
785
+ spec:
786
+ language:
787
+ go: { module: github.com/example/agent, version: "1.26.2" }
788
+ development:
789
+ sandbox:
790
+ devcontainer:
791
+ enabled: true
792
+ deps:
793
+ - deno@2.1.4
794
+ - kubectl@1.36.1
795
+ ```
796
+
797
+ ## Skills vs. Tools
798
+
799
+ The ADL spec distinguishes two complementary concepts:
800
+
801
+ - **Tools** (`spec.tools`) are function-call entrypoints with explicit JSON schemas. They are generated as code in the target language and registered with the agent's toolbox. The model invokes them by name with structured arguments.
802
+ - **Skills** (`spec.skills`) are markdown playbooks (with YAML frontmatter) that describe _when and how_ to use the tools. Each is written to its own directory at `skills/<id>/SKILL.md` in the generated project, advertised on the agent card so orchestrators can discover them, and prepended to the system prompt at runtime. The directory layout matches Anthropic's [agent skills convention](https://github.com/anthropics/skills) - bare skills can ship arbitrary scripts, templates, or reference material alongside `SKILL.md`.
803
+
804
+ A skill entry is small:
805
+
806
+ ```yaml
807
+ spec:
808
+ skills:
809
+ - id: data-analysis # pulled from registry.inference-gateway.com/skills/
810
+ version: 0.1.0 # optional pin
811
+ - id: report-writing # pulled at the default version
812
+ - id: company-policy # scaffolded locally (not fetched)
813
+ bare: true
814
+ name: company-policy
815
+ description: "Internal compliance rules to follow"
816
+ license: Proprietary # optional SPDX id or "Proprietary"
817
+ tags: [policy, compliance]
818
+ - id: pdf # pull a full skill directory from GitHub
819
+ source: anthropics/skills/pdf
820
+ - id: skill-creator
821
+ source: skill-creator@v1.0 # pin to a tag/branch/sha
822
+ ```
823
+
824
+ ### Resolution rules
825
+
826
+ - **`bare: true`** → the CLI scaffolds `skills/<id>/SKILL.md` with frontmatter from the manifest and a TODO body that you author by hand. The whole `skills/<id>/` directory is listed in `.adl-ignore`, so any bundled scripts, templates, or resources you drop alongside `SKILL.md` are preserved on regeneration.
827
+ - **`source:` set** → the source must resolve to a public GitHub directory (a `/tree/<ref>/<path>` URL, or one of the shorthand forms below). The CLI pulls the _entire_ directory - `SKILL.md`, reference docs, bundled scripts, anything else - and writes it to `skills/<id>/`. Non-`github.com` URLs are rejected so the same code path always produces a complete skill bundle, not a stray markdown file.
828
+ - **Otherwise** → fetch `https://registry.inference-gateway.com/skills/<id>[/<version>].md` (becomes `skills/<id>/SKILL.md`). Override the registry with `ADL_SKILLS_REGISTRY`. Registry-by-id currently ships `SKILL.md` only; if you need bundled assets, use `source:` to point at a GitHub directory.
829
+
830
+ ### Licensing
831
+
832
+ `license` is optional on every skill entry. When set, it must be one of the
833
+ SPDX identifiers enumerated in the schema (`MIT`, `Apache-2.0`, `BSD-2-Clause`,
834
+ `BSD-3-Clause`, `GPL-2.0`, `GPL-3.0`, `LGPL-2.1`, `LGPL-3.0`, `MPL-2.0`, `ISC`,
835
+ `CC0-1.0`, `CC-BY-4.0`, `CC-BY-SA-4.0`, `Unlicense`) or the literal string
836
+ `Proprietary` for closed-source skills. The resolver mirrors the value into the
837
+ generated `SKILL.md` frontmatter so the licence travels with the playbook -
838
+ shipping a separate `LICENSE` file alongside `SKILL.md` is optional. When the
839
+ ADL entry and the fetched frontmatter both set `license`, the value in the ADL
840
+ manifest wins.
841
+
842
+ Use `adl generate --offline` to skip network access - every non-bare skill must already be cached at `~/.adl/skills-cache/<id>@<ref>/` (where `<ref>` is the pinned tag/branch, or `latest` for an unpinned registry fetch).
843
+
844
+ ### `source:` shorthand grammar
845
+
846
+ Every form below resolves to a GitHub `tree/<ref>/<path>` URL. An optional `@<tag>` suffix pins a branch, tag, or commit SHA; omit it to use the default `main` branch.
847
+
848
+ | Shorthand | Expands to |
849
+ | --------------------------------- | ----------------------------------------------------------------------- |
850
+ | `<skill>` | `https://github.com/inference-gateway/skills/tree/main/skills/<skill>` |
851
+ | `<skill>@<tag>` | `https://github.com/inference-gateway/skills/tree/<tag>/skills/<skill>` |
852
+ | `<owner>/<repo>/<skill>` | `https://github.com/<owner>/<repo>/tree/main/skills/<skill>` |
853
+ | `<owner>/<repo>/<skill>@<tag>` | `https://github.com/<owner>/<repo>/tree/<tag>/skills/<skill>` |
854
+ | Full `https://github.com/...` URL | passed through unchanged |
855
+
856
+ Concrete examples:
857
+
858
+ ```yaml
859
+ # Default inference-gateway/skills, latest main:
860
+ - id: skill-creator
861
+ source: skill-creator
862
+
863
+ # Default inference-gateway/skills, pinned to a tag:
864
+ - id: skill-creator
865
+ source: skill-creator@v1.0
866
+
867
+ # Different repo (Anthropic's official skill library):
868
+ - id: pdf
869
+ source: anthropics/skills/pdf
870
+
871
+ # Different repo, pinned to a commit SHA:
872
+ - id: pdf
873
+ source: anthropics/skills/pdf@abc1234
874
+
875
+ # Full URL for anything that doesn't fit the shorthand:
876
+ - id: custom
877
+ source: https://github.com/my-org/my-repo/tree/release/path/to/skill
878
+ ```
879
+
880
+ The 3-segment form assumes a `skills/<id>/` subdirectory inside the repo (the convention used by both `inference-gateway/skills` and `anthropics/skills`). If your repo lays skills out differently, pass the full URL.
881
+
882
+ ### Runtime: AVAILABLE SKILLS manifest + on-demand Read
883
+
884
+ The generated agent advertises skills to the LLM via a frontmatter-only manifest, **not** by inlining SKILL.md bodies. At startup it walks first-level subdirectories under `skills/` (overridable with `A2A_SKILLS_DIR`), parses each `<id>/SKILL.md`'s YAML frontmatter, and appends an `AVAILABLE SKILLS:` block to the system prompt:
885
+
886
+ ```text
887
+ AVAILABLE SKILLS:
888
+ Skills are reusable instructions for specific tasks. When a task matches a
889
+ skill's description, read the SKILL.md file at the listed path using the Read
890
+ tool, then follow its instructions.
891
+
892
+ - incident-response: Use this when the user reports a production incident...
893
+ Path: skills/incident-response/SKILL.md
894
+ - pdf: Fill in PDF forms and extract structured data from PDFs.
895
+ Path: skills/pdf/SKILL.md
896
+ ```
897
+
898
+ The model loads each SKILL.md body on demand via the `Read` built-in tool, and executes any bundled scripts via `Bash` / `Write` / `Edit`. **A skills-using agent must therefore list `- id: read` in `spec.tools` and set `spec.config.tools.read.enabled: true`** - the validator enforces this; see [Reserved built-in tools](#reserved-built-in-tools).
899
+
900
+ ### Reserved built-in tools
901
+
902
+ `spec.tools` accepts five reserved IDs that map to framework-supplied implementations:
903
+
904
+ | Reserved ID | Generated as | Purpose |
905
+ | ----------- | --------------------- | ------------------------------------------------------------------------------------- |
906
+ | `read` | `tools/read.go` etc. | Read a file (`file_path`, optional `offset`/`limit`). |
907
+ | `bash` | `tools/bash.go` etc. | Execute a shell command (subject to whitelist + timeout). |
908
+ | `write` | `tools/write.go` etc. | Write content to a file (creates parent dirs). |
909
+ | `edit` | `tools/edit.go` etc. | Replace a unique string in a file (`old_string` → `new_string`). |
910
+ | `fetch` | `tools/fetch.go` etc. | Fetch an http(s) URL (whitelist, max-bytes cap, optional save-to-disk inside `/tmp`). |
911
+
912
+ Opt in by listing the id alone - the generator owns `name`, `description`, and the JSON schema:
913
+
914
+ ```yaml
915
+ spec:
916
+ tools:
917
+ - id: read
918
+ - id: bash
919
+ - id: query_database # user tool: full entry still required
920
+ name: query_database
921
+ description: "..."
922
+ schema: { type: object, ... }
923
+ ```
924
+
925
+ **All five built-ins default to `enabled: false`.** Activate them via the reserved namespace `spec.config.tools.<id>`:
926
+
927
+ ```yaml
928
+ spec:
929
+ config:
930
+ tools:
931
+ read:
932
+ enabled: true
933
+ max_lines: 2000 # offset/limit default window
934
+ allowed_roots: [] # empty = project-wide
935
+ bash:
936
+ enabled: true
937
+ whitelist: [ls, cat, grep, jq]
938
+ timeout_seconds: 30
939
+ write:
940
+ enabled: false # listed but explicitly disabled
941
+ edit:
942
+ enabled: true
943
+ fetch:
944
+ enabled: true
945
+ allowed_domains: # whitelist of hosts (empty = unrestricted, discouraged)
946
+ - example.com
947
+ - .api.dev # entries starting with "." match any subdomain
948
+ max_bytes: 10485760 # 10 MiB cap on response body (default)
949
+ timeout_seconds: 30 # total request timeout (default)
950
+ download_dir: /tmp # root for save_path writes (default /tmp)
951
+ allow_downloads: false # set true to allow writing response bodies to disk
952
+ ```
953
+
954
+ Values are baked into the generated constructor as compile-time literals - there's no `ToolsConfig` struct in `config/config.go` because reserved-namespace sections are intentionally skipped. The validator decodes each `spec.config.tools.<id>` block into the built-in's typed shape and rejects unknown keys (typos like `tymeout_seconds` fail with `spec.config.tools.bash.tymeout_seconds`).
955
+
956
+ Runtime overrides for Bash (read inside `tools/bash.go`):
957
+
958
+ - `A2A_BASH_DISABLED=1` is a kill switch - overrides `enabled: true` back to false.
959
+ - `A2A_BASH_WHITELIST=ls,cat,grep` overrides the compile-time whitelist.
960
+
961
+ Runtime overrides for Fetch (resolution precedence: env > compile-time literal > default-disabled):
962
+
963
+ - Go: `TOOLS_FETCH_ENABLED`, `TOOLS_FETCH_ALLOWED_DOMAINS`, `TOOLS_FETCH_MAX_BYTES`, `TOOLS_FETCH_TIMEOUT_SECONDS`, `TOOLS_FETCH_DOWNLOAD_DIR`, `TOOLS_FETCH_ALLOW_DOWNLOADS` (envconfig-style; comma-separated for lists).
964
+ - Rust: `A2A_FETCH_DISABLED=1` (kill switch), `A2A_FETCH_ALLOWED_DOMAINS`, `A2A_FETCH_MAX_BYTES`, `A2A_FETCH_TIMEOUT_SECONDS`, `A2A_FETCH_DOWNLOAD_DIR`, `A2A_FETCH_ALLOW_DOWNLOADS`.
965
+
966
+ The Fetch tool supports `GET` and `HEAD` only. Optional `save_path` writes the response body to a path resolved under `download_dir` - absolute paths and parent-directory traversal (`..`) are rejected, and the request fails unless `allow_downloads: true`. Bodies (and on-disk files) are capped at `max_bytes`; oversized responses are truncated and the result payload sets `"truncated": true`. The Go template uses only the standard library (`net/http`); the Rust template adds `reqwest` (rustls-tls + json features) to `Cargo.toml` automatically when `- id: fetch` is present in `spec.tools`.
967
+
968
+ Resolution precedence at runtime: **env > compile-time literal > built-in default (disabled)**.
969
+
970
+ ## Service Injection & Configuration Management
971
+
972
+ The ADL CLI provides a sophisticated service injection system with structured configuration management. This system improves testability, separation of concerns, and provides type-safe configuration with environment variable mapping.
973
+
974
+ ### Structured Service System
975
+
976
+ Define services with explicit types, interfaces, and factory functions. The system supports both built-in services (like logger) and custom service services:
977
+
978
+ ```yaml
979
+ spec:
980
+ config:
981
+ googleCalendar:
982
+ scopes: "https://www.googleapis.com/auth/calendar"
983
+ credentialsPath: "/secrets/credentials.json"
984
+ cache:
985
+ ttl: "3600"
986
+ maxEntries: "1000"
987
+ services:
988
+ googleCalendar:
989
+ type: service
990
+ interface: CalendarService
991
+ factory: NewCalendarService
992
+ description: Google Calendar API service for managing calendar events
993
+ cache:
994
+ type: service
995
+ interface: CacheRepository
996
+ factory: NewCacheRepository
997
+ description: High-performance caching layer for API responses
998
+ tools:
999
+ - name: create_event
1000
+ description: "Create a new calendar event"
1001
+ inject:
1002
+ - logger # Built-in, always available
1003
+ - googleCalendar # Custom service
1004
+ - cache # Custom service
1005
+ schema:
1006
+ type: object
1007
+ properties:
1008
+ title:
1009
+ type: string
1010
+ description: "Event title"
1011
+ start:
1012
+ type: string
1013
+ description: "Start time (ISO 8601)"
1014
+ required: [title, start]
1015
+ ```
1016
+
1017
+ ### Configuration Management
1018
+
1019
+ The configuration system generates type-safe structs with automatic environment variable mapping:
1020
+
1021
+ **Generated Configuration (`config/config.go`):**
1022
+
1023
+ ```go
1024
+ type Config struct {
1025
+ // Core application settings
1026
+ Environment string `env:"ENVIRONMENT"`
1027
+
1028
+ // A2A configuration
1029
+ A2A serverConfig.Config `env:",prefix=A2A_"`
1030
+
1031
+ // Custom configuration sections
1032
+ Cache CacheConfig `env:",prefix=CACHE_"`
1033
+ GoogleCalendar GoogleCalendarConfig `env:",prefix=GOOGLE_CALENDAR_"`
1034
+ }
1035
+
1036
+ type GoogleCalendarConfig struct {
1037
+ CredentialsPath string `env:"CREDENTIALS_PATH"`
1038
+ Scopes string `env:"SCOPES"`
1039
+ }
1040
+
1041
+ type CacheConfig struct {
1042
+ MaxEntries string `env:"MAX_ENTRIES"`
1043
+ Ttl string `env:"TTL"`
1044
+ }
1045
+ ```
1046
+
1047
+ **Environment Variables:**
1048
+
1049
+ - `GOOGLE_CALENDAR_CREDENTIALS_PATH="/secrets/google-creds.json"`
1050
+ - `GOOGLE_CALENDAR_SCOPES="https://www.googleapis.com/auth/calendar"`
1051
+ - `CACHE_MAX_ENTRIES="1000"`
1052
+ - `CACHE_TTL="3600"`
1053
+
1054
+ ### Config Subsection Injection
1055
+
1056
+ In addition to injecting entire configuration objects, you can inject specific config subsections directly into skills using dotted notation. This provides type-safe access to focused configuration scopes.
1057
+
1058
+ **Example ADL Configuration:**
1059
+
1060
+ ```yaml
1061
+ spec:
1062
+ config:
1063
+ database:
1064
+ connectionString: "postgresql://localhost:5432/db"
1065
+ maxConnections: "10"
1066
+ timeout: "30s"
1067
+ email:
1068
+ apiKey: ""
1069
+ fromAddress: "noreply@example.com"
1070
+ provider: "sendgrid"
1071
+ services:
1072
+ database:
1073
+ type: service
1074
+ interface: DatabaseService
1075
+ factory: NewDatabaseService
1076
+ description: PostgreSQL database service
1077
+ tools:
1078
+ - name: export_report
1079
+ description: "Export data and email report"
1080
+ inject:
1081
+ - logger
1082
+ - database
1083
+ - config.email # Inject only the email config subsection
1084
+ schema:
1085
+ type: object
1086
+ properties:
1087
+ recipient:
1088
+ type: string
1089
+ required: [recipient]
1090
+ ```
1091
+
1092
+ **Generated Skill Code:**
1093
+
1094
+ ```go
1095
+ type ExportReportSkill struct {
1096
+ logger *zap.Logger
1097
+ database database.DatabaseService
1098
+ email *config.EmailConfig // Type-safe access to email config only
1099
+ }
1100
+
1101
+ func NewExportReportSkill(
1102
+ logger *zap.Logger,
1103
+ database database.DatabaseService,
1104
+ email *config.EmailConfig,
1105
+ ) server.Tool {
1106
+ skill := &ExportReportSkill{
1107
+ logger: logger,
1108
+ database: database,
1109
+ email: email,
1110
+ }
1111
+ // ...
1112
+ }
1113
+
1114
+ func (s *ExportReportSkill) ExportReportHandler(ctx context.Context, args map[string]any) (string, error) {
1115
+ // Direct access to email config subsection
1116
+ apiKey := s.email.APIKey
1117
+ fromAddress := s.email.FromAddress
1118
+ provider := s.email.Provider
1119
+
1120
+ // ... implementation
1121
+ }
1122
+ ```
1123
+
1124
+ **Main Registration:**
1125
+
1126
+ ```go
1127
+ // In main.go - config subsection is passed directly
1128
+ exportReportSkill := skills.NewExportReportSkill(l, databaseSvc, &cfg.Email)
1129
+ toolBox.AddTool(exportReportSkill)
1130
+ ```
1131
+
1132
+ **Benefits of Config Subsection Injection:**
1133
+
1134
+ - **Scoped Access**: Skills only receive the configuration they need, following principle of least privilege
1135
+ - **Type Safety**: Compile-time validation ensures config fields exist
1136
+ - **Clear Dependencies**: Explicit declaration of which config sections each skill requires
1137
+ - **Easier Testing**: Mock specific config subsections without full config object
1138
+ - **Better Separation**: Skills don't have access to unrelated configuration
1139
+ - **Auto-Validation**: ADL CLI validates that injected config sections exist in `spec.config`
1140
+
1141
+ **Injection Patterns:**
1142
+
1143
+ ```yaml
1144
+ inject:
1145
+ - logger # Built-in logger service
1146
+ - config # Entire config object (*config.Config)
1147
+ - config.database # Database config subsection (*config.DatabaseConfig)
1148
+ - config.email # Email config subsection (*config.EmailConfig)
1149
+ - myService # Custom service from spec.services
1150
+ ```
1151
+
1152
+ ### Service Architecture
1153
+
1154
+ The service injection system generates:
1155
+
1156
+ 1. **Built-in Logger**: Automatically available as `*zap.Logger` without declaration
1157
+ 2. **Type-Safe Configuration**: Structured config with environment variable mapping
1158
+ 3. **Service Interfaces**: Custom service packages with interface definitions
1159
+ 4. **Factory Functions**: Constructor functions that receive logger and configuration
1160
+ 5. **Automatic Registration**: Services are automatically wired into skills
1161
+ 6. **File Protection**: Generated service files are automatically added to `.adl-ignore`
1162
+
1163
+ ### Generated Structure
1164
+
1165
+ ```text
1166
+ my-agent/
1167
+ ├── config/
1168
+ │ └── config.go # Type-safe configuration with env mapping
1169
+ ├── internal/
1170
+ │ ├── logger/
1171
+ │ │ └── logger.go # Built-in logger factory
1172
+ │ ├── googleCalendar/
1173
+ │ │ └── googleCalendar.go # Calendar service with interface
1174
+ │ └── cache/
1175
+ │ └── cache.go # Cache service with interface
1176
+ ├── tools/
1177
+ │ ├── create_event.go # Function-call tools with injected services
1178
+ │ └── list_events.go
1179
+ ├── skills/
1180
+ │ ├── calendar-workflow/ # Markdown playbooks loaded into the system prompt
1181
+ │ │ └── SKILL.md
1182
+ │ └── meeting-summary/
1183
+ │ └── SKILL.md
1184
+ └── .adl-ignore # Protects custom implementations
1185
+ ```
1186
+
1187
+ ### Generated Service Code
1188
+
1189
+ Each service generates a package with interface and factory:
1190
+
1191
+ **Example `internal/googleCalendar/googleCalendar.go`:**
1192
+
1193
+ ```go
1194
+ type CalendarService interface {
1195
+ // TODO: Define your CalendarService interface methods
1196
+ CreateEvent(ctx context.Context, event *Event) error
1197
+ ListEvents(ctx context.Context, query *Query) ([]*Event, error)
1198
+ }
1199
+
1200
+ type calendarService struct {
1201
+ logger *zap.Logger
1202
+ config *config.Config
1203
+ }
1204
+
1205
+ func NewCalendarService(logger *zap.Logger, cfg *config.Config) (CalendarService, error) {
1206
+ // TODO: Implement CalendarService initialization
1207
+ return &calendarService{
1208
+ logger: logger,
1209
+ config: cfg,
1210
+ }, nil
1211
+ }
1212
+ ```
1213
+
1214
+ ### Skill Integration
1215
+
1216
+ Skills automatically receive injected services as constructor parameters:
1217
+
1218
+ **Example `skills/create_event.go`:**
1219
+
1220
+ ```go
1221
+ type CreateEventSkill struct {
1222
+ logger *zap.Logger
1223
+ calendar googleCalendar.CalendarService
1224
+ cache cache.CacheRepository
1225
+ }
1226
+
1227
+ func NewCreateEventSkill(logger *zap.Logger, calendar googleCalendar.CalendarService, cache cache.CacheRepository) *CreateEventSkill {
1228
+ return &CreateEventSkill{
1229
+ logger: logger,
1230
+ calendar: calendar,
1231
+ cache: cache,
1232
+ }
1233
+ }
1234
+ ```
1235
+
1236
+ ### Benefits
1237
+
1238
+ - **Type Safety**: Structured configuration with compile-time validation
1239
+ - **Environment Variables**: Automatic mapping with proper naming conventions
1240
+ - **Interface-Based Design**: Testable services with clear contracts
1241
+ - **Separation of Concerns**: Configuration separate from service definitions
1242
+ - **Language Agnostic**: Works across Go, Rust, and TypeScript
1243
+ - **Hot Reload**: Configuration changes via environment variables
1244
+ - **Security**: No secrets in code, environment-based configuration
1245
+ - **Scalability**: Easy to add new services and configuration sections
1246
+
1247
+ ### Best Practices
1248
+
1249
+ 1. **Configuration**: Use environment variables for secrets and environment-specific values
1250
+ 2. **Interfaces**: Define clear interfaces for testability and modularity
1251
+ 3. **Factory Functions**: Initialize services with proper error handling
1252
+ 4. **Logging**: Use the injected logger for consistent log formatting
1253
+ 5. **Testing**: Create mock implementations of service interfaces
1254
+ 6. **Documentation**: Document interface methods and configuration options
1255
+
1256
+ ## Generated Project Structure
1257
+
1258
+ The ADL CLI generates project scaffolding tailored to your chosen language:
1259
+
1260
+ ### Go Project Structure
1261
+
1262
+ ```text
1263
+ my-go-agent/
1264
+ ├── main.go # Main server setup
1265
+ ├── go.mod # Go module definition
1266
+ ├── config/
1267
+ │ └── config.go # Centralized application configuration
1268
+ ├── internal/
1269
+ │ └── logger/
1270
+ │ └── logger.go # Built-in logger factory
1271
+ ├── tools/ # Function-call tool implementations
1272
+ │ ├── query_database.go # Individual tool files (TODO placeholders)
1273
+ │ └── send_notification.go
1274
+ ├── skills/ # Skill directories (SKILL.md + optional bundled assets)
1275
+ │ ├── incident-response/ # Loaded into the system prompt at startup
1276
+ │ │ └── SKILL.md
1277
+ │ └── support-handoff/
1278
+ │ └── SKILL.md
1279
+ ├── Taskfile.yml # Development tasks (build, test, lint)
1280
+ ├── Dockerfile # Container configuration
1281
+ ├── .adl-ignore # Files to protect from regeneration
1282
+ ├── .well-known/
1283
+ │ └── agent-card.json # Agent capabilities (auto-generated)
1284
+ ├── .github/ # GitHub-specific configurations
1285
+ │ ├── workflows/ # Generated when using --ci flag
1286
+ │ │ ├── ci.yml # GitHub Actions CI workflow
1287
+ │ │ └── cd.yml # GitHub Actions CD workflow (with --cd flag)
1288
+ │ ├── dependabot.yml # Generated when scm.dependabot: true
1289
+ │ └── ISSUE_TEMPLATE/ # Generated when issue_templates: true
1290
+ │ ├── bug_report.md # Bug report template
1291
+ │ ├── feature_request.md # Feature request template
1292
+ │ └── refactor_request.md # Refactoring request template
1293
+ ├── .releaserc.yaml # Semantic-release configuration (with --cd flag)
1294
+ ├── k8s/
1295
+ │ └── deployment.yaml # Kubernetes deployment manifest
1296
+ ├── cloudrun/
1297
+ │ └── deploy.sh # CloudRun deployment script (with --deployment cloudrun)
1298
+ ├── .flox/ # Generated when sandbox: flox
1299
+ │ ├── env/manifest.toml
1300
+ │ ├── env.json
1301
+ │ ├── .gitignore
1302
+ │ └── .gitattributes
1303
+ ├── .gitignore # Standard Git ignore patterns
1304
+ ├── .gitattributes # Git attributes configuration
1305
+ ├── .editorconfig # Editor configuration
1306
+ ├── CLAUDE.md # AI assistant instructions (spec.development.ai.orchestrators.claudecode.enabled: true)
1307
+ └── README.md # Project documentation with setup instructions
1308
+ ```
1309
+
1310
+ ### Rust Project Structure
1311
+
1312
+ ```text
1313
+ my-rust-agent/
1314
+ ├── src/
1315
+ │ ├── main.rs # Main application entry point
1316
+ │ └── tools/ # Function-call tool implementations
1317
+ │ ├── mod.rs # Module declarations
1318
+ │ ├── query_database.rs # Individual tool implementations
1319
+ │ └── send_notification.rs
1320
+ ├── skills/ # Skill directories (SKILL.md + optional bundled assets)
1321
+ │ ├── incident-response/
1322
+ │ │ └── SKILL.md
1323
+ │ └── support-handoff/
1324
+ │ └── SKILL.md
1325
+ ├── Cargo.toml # Rust package configuration
1326
+ ├── Taskfile.yml # Development tasks
1327
+ ├── Dockerfile # Rust-optimized container
1328
+ ├── .adl-ignore # Protection configuration
1329
+ ├── .well-known/
1330
+ │ └── agent-card.json # Agent capabilities
1331
+ ├── .github/workflows/ # CI configuration (with --ci)
1332
+ │ ├── ci.yml # Rust-specific CI workflow
1333
+ │ └── cd.yml # GitHub Actions CD workflow (with --cd flag)
1334
+ ├── .releaserc.yaml # Semantic-release configuration (with --cd flag)
1335
+ ├── k8s/
1336
+ │ └── deployment.yaml # Kubernetes deployment
1337
+ ├── cloudrun/
1338
+ │ └── deploy.sh # CloudRun deployment script (with --deployment cloudrun)
1339
+ ├── CLAUDE.md # AI assistant instructions (spec.development.ai.orchestrators.claudecode.enabled: true)
1340
+ └── README.md # Documentation
1341
+ ```
1342
+
1343
+ ### TypeScript Project Structure
1344
+
1345
+ ```text
1346
+ my-typescript-agent/
1347
+ ├── src/
1348
+ │ ├── index.ts # Main server setup + background task worker
1349
+ │ ├── config.ts # Typed configuration loader (env-mapped)
1350
+ │ ├── logger.ts # Built-in logger factory
1351
+ │ ├── services/ # Injectable service implementations
1352
+ │ │ └── database.ts
1353
+ │ └── tools/ # Function-call tool implementations
1354
+ │ ├── index.ts # Toolbox wiring
1355
+ │ ├── query_database.ts # Individual tool implementations (TODO placeholders)
1356
+ │ └── send_notification.ts
1357
+ ├── skills/ # Skill directories (SKILL.md + optional bundled assets)
1358
+ │ ├── incident-response/
1359
+ │ │ └── SKILL.md
1360
+ │ └── support-handoff/
1361
+ │ └── SKILL.md
1362
+ ├── package.json # Node package definition + scripts
1363
+ ├── tsconfig.json # TypeScript compiler configuration
1364
+ ├── Taskfile.yml # Development tasks
1365
+ ├── Dockerfile # Node-optimized container
1366
+ ├── .adl-ignore # Protection configuration
1367
+ ├── .well-known/
1368
+ │ └── agent-card.json # Agent capabilities
1369
+ ├── .github/workflows/ # CI configuration (with --ci)
1370
+ │ ├── ci.yml # TypeScript-specific CI workflow
1371
+ │ └── cd.yml # GitHub Actions CD workflow (with --cd flag)
1372
+ ├── .releaserc.yaml # Semantic-release configuration (with --cd flag)
1373
+ ├── k8s/
1374
+ │ └── deployment.yaml # Kubernetes deployment (with --deployment kubernetes)
1375
+ ├── CLAUDE.md # AI assistant instructions (spec.development.ai.orchestrators.claudecode.enabled: true)
1376
+ └── README.md # Documentation
1377
+ ```
1378
+
1379
+ ### Universal Generated Files
1380
+
1381
+ All projects include these essential files regardless of language:
1382
+
1383
+ - **`.well-known/agent-card.json`** - A2A agent discovery and capabilities manifest
1384
+ - **`Taskfile.yml`** - Unified task runner configuration for build, test, lint, run
1385
+ - **`Dockerfile`** - Language-optimized container configuration
1386
+ - **`k8s/deployment.yaml`** - Kubernetes deployment manifest
1387
+ - **`deploy` task in `Taskfile.yml`** - CloudRun deployment task (when using `--deployment cloudrun`)
1388
+ - **`.adl-ignore`** - Protects user implementations from overwrite
1389
+ - **CI Workflows** - When using `--ci` flag, generates GitHub Actions workflows:
1390
+ - **GitHub Actions**: `.github/workflows/ci.yml`
1391
+ - **GitLab CI**: `.gitlab-ci.yml` (planned, not yet implemented)
1392
+ - **CD Workflows** - When using `--cd` flag, generates continuous deployment:
1393
+ - **GitHub Actions**: `.github/workflows/cd.yml`
1394
+ - **Semantic Release**: `.releaserc.yaml`
1395
+ - **Development Environment** - Based on `sandbox` configuration:
1396
+ - **Flox**: `.flox/` directory with environment configuration when `sandbox.flox.enabled: true`
1397
+ - **DevContainer**: `.devcontainer/devcontainer.json` when `sandbox.devcontainer.enabled: true`
1398
+ - **AI Assistant Instructions** - Per-agent toggles under `spec.development.ai.orchestrators`
1399
+ (see [Per-agent AI assistants](#per-agent-ai-assistants)):
1400
+ - **CLAUDE.md** when `spec.development.ai.orchestrators.claudecode.enabled: true`
1401
+ - **GEMINI.md** when `spec.development.ai.orchestrators.gemini.enabled: true`
1402
+ - **AGENTS.md** (shared) when any of `codex`, `opencode`, or `infer` is enabled
1403
+
1404
+ ### CI Integration
1405
+
1406
+ When using the `--ci` flag, the ADL CLI generates GitHub Actions workflows for your project:
1407
+
1408
+ ```bash
1409
+ # Generate project with CI workflow
1410
+ adl generate --file agent.yaml --output ./test-my-agent --ci
1411
+ ```
1412
+
1413
+ This creates a GitHub Actions workflow (`.github/workflows/ci.yml`) that includes:
1414
+
1415
+ - **Automated Testing**: Runs all tests on every push and pull request
1416
+ - **Code Quality**: Format checking and linting
1417
+ - **Multi-Environment**: Supports main and develop branches
1418
+ - **Caching**: Go module caching for faster builds
1419
+ - **Task Integration**: Uses the generated Taskfile for consistent build steps
1420
+
1421
+ The generated workflow automatically detects your Go version from the ADL file and configures the appropriate environment.
1422
+
1423
+ ### CD Integration
1424
+
1425
+ The ADL CLI can generate continuous deployment (CD) pipelines with semantic release automation:
1426
+
1427
+ ```bash
1428
+ # Generate project with CD pipeline
1429
+ adl generate --file agent.yaml --output ./test-my-agent --cd
1430
+ ```
1431
+
1432
+ This creates a complete CD setup including:
1433
+
1434
+ - **`.releaserc.yaml`** - Semantic-release configuration with conventional commits
1435
+ - **`.github/workflows/cd.yml`** - GitHub Actions CD workflow with manual dispatch
1436
+
1437
+ The generated CD pipeline includes:
1438
+
1439
+ - **Semantic Versioning**: Automatic version bumping based on conventional commit messages
1440
+ - **Release Automation**: Creates GitHub releases with generated release notes
1441
+ - **Container Publishing**: Builds and publishes Docker images to GitHub Container Registry
1442
+ - **Multi-Platform Builds**: Supports both AMD64 and ARM64 architectures
1443
+ - **Language Detection**: Automatically configures build steps based on your project language
1444
+ - **Change Detection**: Only publishes releases when there are changes to release
1445
+
1446
+ #### CD Workflow Features
1447
+
1448
+ **Manual Trigger**: The CD workflow uses `workflow_dispatch` for controlled releases:
1449
+
1450
+ ```bash
1451
+ # Trigger via GitHub CLI
1452
+ gh workflow run cd.yml
1453
+
1454
+ # Or trigger via GitHub Actions UI
1455
+ ```
1456
+
1457
+ **Conventional Commits Support**: The pipeline recognizes these commit types for versioning:
1458
+
1459
+ - `feat:` - Minor version bump (new features)
1460
+ - `fix:` - Patch version bump (bug fixes)
1461
+ - `refactor:`, `perf:`, `ci:`, `docs:`, `style:`, `test:`, `build:`, `chore:` - Patch version bump
1462
+
1463
+ **Container Registry**: Published images are available at:
1464
+
1465
+ ```text
1466
+ ghcr.io/your-org/your-agent:latest
1467
+ ghcr.io/your-org/your-agent:v1.0.0
1468
+ ghcr.io/your-org/your-agent:1.0
1469
+ ```
1470
+
1471
+ ## CloudRun Deployment
1472
+
1473
+ The ADL CLI provides native support for deploying A2A agents to Google Cloud Run, offering a truly serverless deployment experience without Kubernetes complexity.
1474
+
1475
+ ### CloudRun Configuration
1476
+
1477
+ Configure CloudRun deployment in your ADL file:
1478
+
1479
+ ```yaml
1480
+ spec:
1481
+ deployment:
1482
+ type: cloudrun
1483
+ cloudrun:
1484
+ image:
1485
+ registry: gcr.io # gcr.io or ghcr.io
1486
+ repository: my-agent # Repository name
1487
+ tag: latest # Image tag
1488
+ useCloudBuild: true # Use Cloud Build or local Docker
1489
+ resources:
1490
+ cpu: "2" # CPU allocation (0.1 to 8)
1491
+ memory: 1Gi # Memory limit (128Mi to 32Gi)
1492
+ scaling:
1493
+ minInstances: 0 # Minimum instances (0 to 1000)
1494
+ maxInstances: 100 # Maximum instances (1 to 1000)
1495
+ concurrency: 1000 # Max concurrent requests per instance
1496
+ service:
1497
+ timeout: 3600 # Request timeout in seconds
1498
+ allowUnauthenticated: true # Allow public access
1499
+ serviceAccount: my-agent@PROJECT_ID.iam.gserviceaccount.com
1500
+ executionEnvironment: gen2 # gen1 or gen2
1501
+ environment: # Custom environment variables
1502
+ LOG_LEVEL: info
1503
+ ENVIRONMENT: production
1504
+ ```
1505
+
1506
+ ### Container Registry Options
1507
+
1508
+ **Google Container Registry (GCR):**
1509
+
1510
+ ```yaml
1511
+ image:
1512
+ registry: gcr.io
1513
+ repository: my-project/my-agent
1514
+ useCloudBuild: true # Automatically build and push
1515
+ ```
1516
+
1517
+ **GitHub Container Registry (GHCR):**
1518
+
1519
+ ```yaml
1520
+ image:
1521
+ registry: ghcr.io
1522
+ repository: myorg/my-agent
1523
+ useCloudBuild: false # Skip Cloud Build, use pre-built image
1524
+ ```
1525
+
1526
+ ### Generated Deployment Script
1527
+
1528
+ When using `--deployment cloudrun`, the ADL CLI generates a `deploy` task in the `Taskfile.yml` that:
1529
+
1530
+ - **Validates Environment**: Checks for required `PROJECT_ID` and `REGION` variables
1531
+ - **Container Building**: Uses Docker locally or Cloud Build based on configuration
1532
+ - **Direct gcloud Deployment**: Uses `gcloud run deploy` for serverless deployment
1533
+ - **Configuration Summary**: Displays all deployment settings for verification
1534
+
1535
+ ### CloudRun Deployment Workflow
1536
+
1537
+ ```bash
1538
+ # 1. Generate project with CloudRun deployment
1539
+ adl generate --file agent.yaml --output ./my-agent --deployment cloudrun
1540
+
1541
+ # 2. Set required environment variables
1542
+ export PROJECT_ID="my-gcp-project"
1543
+ export REGION="us-central1"
1544
+
1545
+ # 3. Deploy to CloudRun
1546
+ cd my-agent
1547
+ task deploy
1548
+ ```
1549
+
1550
+ ### CloudRun with CI/CD
1551
+
1552
+ Generate CloudRun deployment with continuous deployment:
1553
+
1554
+ ```bash
1555
+ adl generate --file agent.yaml --deployment cloudrun --cd
1556
+ ```
1557
+
1558
+ This creates:
1559
+
1560
+ - **CD Workflow**: Automatically deploys to CloudRun after releases
1561
+ - **Environment Integration**: Uses GitHub secrets for GCP authentication
1562
+ - **Multi-Environment Support**: Deploy to different regions/projects
1563
+
1564
+ **Required GitHub Secrets:**
1565
+
1566
+ - `GCP_SA_KEY`: Service account key JSON
1567
+ - `GCP_PROJECT_ID`: Google Cloud project ID
1568
+ - `GCP_REGION`: Deployment region (e.g., us-central1)
1569
+
1570
+ ### CloudRun Benefits
1571
+
1572
+ - **Truly Serverless**: No Kubernetes clusters or infrastructure management
1573
+ - **Auto-Scaling**: Scale to zero when idle, scale up automatically under load
1574
+ - **Pay-per-Use**: Only pay for actual request processing time
1575
+ - **Global Edge**: Deploy to multiple regions with traffic management
1576
+ - **Integrated Monitoring**: Built-in logging, metrics, and tracing
1577
+ - **Custom Domains**: HTTPS support with automatic SSL certificates
1578
+
1579
+ ### Example ADL Files
1580
+
1581
+ The CLI includes CloudRun example files:
1582
+
1583
+ ```bash
1584
+ # Validate CloudRun examples
1585
+ adl validate examples/cloudrun-agent.yaml
1586
+ adl validate examples/cloudrun-ghcr-agent.yaml
1587
+
1588
+ # Generate CloudRun projects
1589
+ adl generate --file examples/cloudrun-agent.yaml --output ./cloudrun-test
1590
+ adl generate --file examples/cloudrun-ghcr-agent.yaml --output ./ghcr-test
1591
+ ```
1592
+
1593
+ ## Sandbox Environments
1594
+
1595
+ The ADL CLI supports multiple development environments for isolated, reproducible development:
1596
+
1597
+ ### Flox Environment
1598
+
1599
+ Configure Flox for your project by adding to your ADL file:
1600
+
1601
+ ```yaml
1602
+ spec:
1603
+ development:
1604
+ sandbox:
1605
+ flox:
1606
+ enabled: true
1607
+ ```
1608
+
1609
+ Generated files:
1610
+
1611
+ - `.flox/env/manifest.toml` - Flox environment manifest with language-specific services
1612
+ - `.flox/env.json` - Environment configuration
1613
+ - `.flox/.gitignore` - Flox-specific ignore patterns
1614
+ - `.flox/.gitattributes` - Git attributes for Flox files
1615
+
1616
+ ### DevContainer Environment
1617
+
1618
+ Configure DevContainer for your project:
1619
+
1620
+ ```yaml
1621
+ spec:
1622
+ development:
1623
+ sandbox:
1624
+ devcontainer:
1625
+ enabled: true
1626
+ ```
1627
+
1628
+ Generated files:
1629
+
1630
+ - `.devcontainer/devcontainer.json` - VS Code DevContainer configuration with language support
1631
+
1632
+ ### Multiple Environment Support
1633
+
1634
+ You can enable multiple sandbox environments simultaneously:
1635
+
1636
+ ```yaml
1637
+ spec:
1638
+ development:
1639
+ sandbox:
1640
+ flox:
1641
+ enabled: true
1642
+ devcontainer:
1643
+ enabled: true
1644
+ ```
1645
+
1646
+ This generates both Flox and DevContainer configurations, allowing developers to choose their preferred environment.
1647
+
1648
+ ### Benefits of Sandbox Environments
1649
+
1650
+ - **Reproducible Development** - Consistent environments across team members
1651
+ - **Isolated Dependencies** - No conflicts with system-wide installations
1652
+ - **Language-Specific Tooling** - Pre-configured with appropriate development tools
1653
+ - **CI/CD Integration** - Matches production environment characteristics
1654
+
1655
+ ## Enterprise Features
1656
+
1657
+ ### Authentication Configuration
1658
+
1659
+ Enable server authentication in your ADL file:
1660
+
1661
+ ```yaml
1662
+ spec:
1663
+ server:
1664
+ port: 8443
1665
+ debug: false
1666
+ auth:
1667
+ enabled: true
1668
+ ```
1669
+
1670
+ This generates enterprise-ready authentication scaffolding in your project.
1671
+
1672
+ ### SCM Integration
1673
+
1674
+ Configure source control management for automatic CI/CD provider detection:
1675
+
1676
+ ```yaml
1677
+ spec:
1678
+ scm:
1679
+ provider: github # gitlab support planned
1680
+ url: "https://github.com/company/my-agent"
1681
+ github_app: false # optional: enable GitHub App for CD
1682
+ issue_templates: true # optional: generate GitHub issue templates
1683
+ dependabot: true # optional: generate Dependabot configuration
1684
+ ```
1685
+
1686
+ **Features:**
1687
+
1688
+ - **Automatic CI Detection** - Generates appropriate workflows based on SCM provider
1689
+ - **Repository Integration** - Links generated projects to source control
1690
+ - **Workflow Optimization** - SCM-specific optimizations and best practices
1691
+ - **GitHub App Support** - Enhanced security for enterprise CD pipelines
1692
+ - **Issue Templates** - Generate GitHub issue templates for standardized bug reports and feature requests
1693
+ - **Dependabot Configuration** - Auto-generate `.github/dependabot.yml` for dependency upgrades
1694
+
1695
+ #### GitHub App Integration
1696
+
1697
+ For enterprise environments, you can enable GitHub App-based CD deployment for enhanced security:
1698
+
1699
+ ```yaml
1700
+ spec:
1701
+ scm:
1702
+ provider: github
1703
+ url: "https://github.com/company/my-agent"
1704
+ github_app: true
1705
+ ```
1706
+
1707
+ **GitHub App CD Benefits:**
1708
+
1709
+ - **Enhanced Security** - App tokens are automatically revoked after pipeline execution
1710
+ - **Enterprise Compliance** - Keeps main branch protected from direct pushes
1711
+ - **Bot Identity** - Release operations performed by dedicated bot account
1712
+ - **Audit Trail** - Clear attribution of automated actions
1713
+
1714
+ **Required GitHub Secrets:**
1715
+
1716
+ - `BOT_GH_APP_ID` - Your GitHub App ID
1717
+ - `BOT_GH_APP_PRIVATE_KEY` - Your GitHub App private key
1718
+
1719
+ When `github_app: true` is set, the generated CD pipeline will use GitHub App authentication instead of the default `GITHUB_TOKEN`, providing better security isolation for release management.
1720
+
1721
+ ### AI Provider Support
1722
+
1723
+ The ADL CLI supports multiple AI providers including OpenAI, Anthropic, DeepSeek, Ollama (for local LLMs), Google AI, Mistral, and Groq. Each provider requires appropriate API keys to be configured as environment variables. See the ADL examples above for configuration details.
1724
+
1725
+ ## Artifacts Support
1726
+
1727
+ Enable artifacts support to allow your agent to create, store, and manage files and resources:
1728
+
1729
+ ```yaml
1730
+ spec:
1731
+ artifacts:
1732
+ enabled: true
1733
+ ```
1734
+
1735
+ Configure storage via environment variables (see generated README for A2A*ARTIFACT*\* variables). Supports both filesystem and MinIO/S3 storage backends.
1736
+
1737
+ **Examples:**
1738
+
1739
+ - `examples/go-agent-artifacts-filesystem.yaml` - Filesystem storage example
1740
+ - `examples/go-agent-artifacts-minio.yaml` - MinIO storage example
1741
+
1742
+ ## GitHub Issue Templates
1743
+
1744
+ The ADL CLI can automatically generate GitHub issue templates for your agent projects, providing standardized forms for bug reports, feature requests, and refactoring tasks:
1745
+
1746
+ ```yaml
1747
+ spec:
1748
+ scm:
1749
+ provider: github
1750
+ url: "https://github.com/company/my-agent"
1751
+ issue_templates: true # Enable issue template generation
1752
+ ```
1753
+
1754
+ When `issue_templates: true` is set, the following templates are generated in `.github/ISSUE_TEMPLATE/`:
1755
+
1756
+ - **`bug_report.md`** - Structured bug reporting with severity levels, reproduction steps, and environment details
1757
+ - **`feature_request.md`** - Feature proposals with use case descriptions and acceptance criteria
1758
+ - **`refactor_request.md`** - Code improvement requests with motivation and impact analysis
1759
+
1760
+ **Issue Template Features:**
1761
+
1762
+ - **Agent Context** - Templates include agent name and version from your ADL metadata
1763
+ - **Structured Sections** - Consistent formatting for better issue triage and tracking
1764
+ - **GitHub Integration** - Automatic labels and assignees configured in frontmatter
1765
+ - **Severity Levels** - Priority classification for bug reports (critical, high, medium, low)
1766
+ - **Environment Info** - Sections for capturing logs, system details, and configurations
1767
+
1768
+ ## Dependabot Configuration
1769
+
1770
+ The ADL CLI can generate a `.github/dependabot.yml` manifest so generated agent
1771
+ projects keep their dependencies up to date automatically. The feature defaults
1772
+ to `false` and is opted into via `spec.scm.dependabot`:
1773
+
1774
+ ```yaml
1775
+ spec:
1776
+ scm:
1777
+ provider: github
1778
+ url: "https://github.com/company/my-agent"
1779
+ dependabot: true # Enable Dependabot configuration
1780
+ ```
1781
+
1782
+ When `dependabot: true` is set (and the SCM provider is GitHub), the generator
1783
+ emits a weekly-schedule manifest covering the ecosystems present in your ADL:
1784
+
1785
+ - **Language ecosystem** - `gomod`, `cargo`, or `npm` (selected from `spec.language`)
1786
+ - **`github-actions`** - Keeps `.github/workflows/` actions pinned
1787
+ - **`docker`** - Tracks the base image in the generated `Dockerfile`
1788
+ - **`devcontainers`** - Included when `spec.development.sandbox.devcontainer.enabled: true`
1789
+
1790
+ Each ecosystem groups all updates into a single PR per week to keep noise low.
1791
+ The default of `false` keeps the existing behavior unchanged for projects that
1792
+ manage dependency upgrades themselves.
1793
+
1794
+ ## Examples
1795
+
1796
+ The CLI includes example ADL files in the `examples/` directory:
1797
+
1798
+ ```bash
1799
+ # Validate examples
1800
+ adl validate examples/go-agent.yaml
1801
+ adl validate examples/rust-agent.yaml
1802
+ adl validate examples/typescript-agent.yaml
1803
+ adl validate examples/cloudrun-agent.yaml
1804
+ adl validate examples/cloudrun-ghcr-agent.yaml
1805
+
1806
+ # Generate from examples
1807
+ adl generate --file examples/go-agent.yaml --output ./test-go-agent
1808
+ adl generate --file examples/rust-agent.yaml --output ./test-rust-agent
1809
+ adl generate --file examples/typescript-agent.yaml --output ./test-typescript-agent
1810
+ adl generate --file examples/github-app-agent.yaml --output ./test-github-app-agent --cd
1811
+ adl generate --file examples/cloudrun-agent.yaml --output ./test-cloudrun-agent --deployment cloudrun
1812
+ adl generate --file examples/cloudrun-ghcr-agent.yaml --output ./test-ghcr-agent --deployment cloudrun
1813
+
1814
+ # Generate with CI/CD pipeline
1815
+ adl generate --file examples/github-app-agent.yaml --output ./enterprise-agent --ci --cd
1816
+ adl generate --file examples/cloudrun-agent.yaml --output ./cloudrun-enterprise --deployment cloudrun --cd
1817
+ ```
1818
+
1819
+ **Example ADL Files:**
1820
+
1821
+ - `go-agent.yaml` - Basic Go agent with multiple skills and capabilities
1822
+ - `rust-agent.yaml` - Rust agent with enterprise features
1823
+ - `typescript-agent.yaml` - Minimal TypeScript agent built with the TypeScript ADK
1824
+ - `typescript-agent-tools.yaml` - TypeScript agent with tools, services, and dependency injection
1825
+ - `typescript-agent-ai.yaml` - AI-powered TypeScript agent with LLM-driven tools
1826
+ - `github-app-agent.yaml` - Enterprise agent with GitHub App CD integration
1827
+ - `cloudrun-agent.yaml` - CloudRun deployment with Google Container Registry
1828
+ - `cloudrun-ghcr-agent.yaml` - CloudRun deployment with GitHub Container Registry
1829
+
1830
+ ## Template System & Architecture
1831
+
1832
+ The ADL CLI uses a sophisticated template system that generates language-specific projects:
1833
+
1834
+ ### Language Detection
1835
+
1836
+ The generator automatically detects your target language from the ADL file:
1837
+
1838
+ ```go
1839
+ // Automatic detection based on spec.language configuration
1840
+ func DetectLanguageFromADL(adl *schema.ADL) string {
1841
+ if adl.Spec.Language.Go != nil { return "go" }
1842
+ if adl.Spec.Language.Rust != nil { return "rust" }
1843
+ if adl.Spec.Language.TypeScript != nil { return "typescript" }
1844
+ return "go" // default
1845
+ }
1846
+ ```
1847
+
1848
+ ### File Mapping System
1849
+
1850
+ Each language has its own file mapping that determines what gets generated:
1851
+
1852
+ **Go Projects:**
1853
+
1854
+ - `main.go` → Go main server setup
1855
+ - `tools/{toolname}.go` → Individual function-call tool implementations
1856
+ - `skills/{skillid}/SKILL.md` → Markdown skill playbooks (loaded into system prompt at runtime)
1857
+ - `go.mod` → Go module configuration
1858
+ - Language-specific Dockerfile and CI configurations
1859
+
1860
+ **Rust Projects:**
1861
+
1862
+ - `src/main.rs` → Rust main application
1863
+ - `src/tools/{toolname}.rs` → Tool descriptor + handler
1864
+ - `src/tools/mod.rs` → Module declarations
1865
+ - `skills/{skillid}/SKILL.md` → Markdown skill playbooks
1866
+ - `Cargo.toml` → Rust package configuration
1867
+
1868
+ **Universal Files:**
1869
+
1870
+ - `Taskfile.yml` → Development task runner
1871
+ - `.well-known/agent-card.json` → A2A capabilities manifest (skills are listed here, not tools)
1872
+ - `k8s/deployment.yaml` → Kubernetes deployment
1873
+ - CI workflows and sandbox configurations
1874
+
1875
+ ### Template Context
1876
+
1877
+ All templates receive a rich context object:
1878
+
1879
+ ```go
1880
+ type Context struct {
1881
+ ADL *schema.ADL // Complete ADL configuration
1882
+ Metadata GeneratedMetadata // Generation metadata
1883
+ Language string // Detected language
1884
+ }
1885
+ ```
1886
+
1887
+ This allows templates to access any ADL configuration and generate language-appropriate code.
1888
+
1889
+ ## Customizing Generation with .adl-ignore
1890
+
1891
+ The ADL CLI automatically creates a `.adl-ignore` file during project generation to protect files containing TODO implementations. This file works similar to `.gitignore` and prevents important implementation files from being overwritten during subsequent generations.
1892
+
1893
+ ### Automatically Protected Files
1894
+
1895
+ When you generate a project, implementation files are automatically added to `.adl-ignore` to protect your business logic from being overwritten during regeneration.
1896
+
1897
+ You can control which additional files are generated or updated by editing the `.adl-ignore` file:
1898
+
1899
+ ```bash
1900
+ # .adl-ignore
1901
+ # Skip Docker-related files if you have custom containerization
1902
+ Dockerfile
1903
+ docker-compose.yml
1904
+
1905
+ # Skip Kubernetes manifests if you use different deployment tools
1906
+ k8s/
1907
+
1908
+ # Skip specific generated files you want to customize
1909
+ middleware.go
1910
+ auth.go
1911
+
1912
+ # Skip build configuration if you have custom setup
1913
+ Taskfile.yml
1914
+ ```
1915
+
1916
+ ### .adl-ignore Patterns
1917
+
1918
+ - Use `#` for comments
1919
+ - Use `/` at the end to match directories
1920
+ - Use `*` for wildcards
1921
+ - Exact file paths or glob patterns
1922
+ - Protects files during all `generate` operations
1923
+
1924
+ ### Common Use Cases
1925
+
1926
+ - **Custom Deployment**: Skip `Dockerfile`, `k8s/`, `docker-compose.yml`
1927
+ - **Custom Build**: Skip `Taskfile.yml`, `Makefile`
1928
+ - **Custom Auth**: Skip `auth.go`, `middleware.go`
1929
+ - **Custom Documentation**: Skip `README.md`
1930
+
1931
+ ## Development
1932
+
1933
+ ### Prerequisites
1934
+
1935
+ - Go 1.26.2+
1936
+ - [Task](https://taskfile.dev/) (optional, for using Taskfile commands)
1937
+
1938
+ ### Building from Source
1939
+
1940
+ ```bash
1941
+ git clone https://github.com/inference-gateway/adl-cli.git
1942
+ cd adl-cli
1943
+
1944
+ # Install dependencies
1945
+ go mod download
1946
+
1947
+ # Build
1948
+ task build
1949
+
1950
+ # Run tests
1951
+ task test
1952
+
1953
+ # Format code
1954
+ task fmt
1955
+
1956
+ # Lint
1957
+ task lint
1958
+ ```
1959
+
1960
+ ### Testing
1961
+
1962
+ ```bash
1963
+ # Run tests
1964
+ task test
1965
+
1966
+ # Test with coverage
1967
+ task test:coverage
1968
+
1969
+ # Test all examples
1970
+ task examples:test
1971
+
1972
+ # Generate all examples
1973
+ task examples:generate
1974
+ ```
1975
+
1976
+ ### Contributing
1977
+
1978
+ 1. Fork the repository
1979
+ 2. Create a feature branch
1980
+ 3. Make your changes
1981
+ 4. Add tests for new functionality
1982
+ 5. Run `task ci` to ensure everything passes
1983
+ 6. Submit a pull request
1984
+
1985
+ ## Configurable Acronyms
1986
+
1987
+ The ADL CLI includes support for configurable acronyms to improve code generation readability. This feature helps generate more readable function and struct names by properly capitalizing acronyms in generated code.
1988
+
1989
+ ### How It Works
1990
+
1991
+ Define custom acronyms in your ADL file's `spec.acronyms` field. These acronyms will be properly capitalized when generating identifiers in your code.
1992
+
1993
+ ### Configuration
1994
+
1995
+ ```yaml
1996
+ spec:
1997
+ language:
1998
+ go:
1999
+ module: "github.com/company/my-agent"
2000
+ version: "1.26.2"
2001
+ acronyms: ["n8n", "xml", "mqtt", "iot", "uuid"]
2002
+ ```
2003
+
2004
+ ### Generated Code Examples
2005
+
2006
+ **Without custom acronyms:**
2007
+
2008
+ - `get_n8n_docs` → `GetN8nDocsSkill`
2009
+ - `process_xml_data` → `ProcessXmlDataSkill`
2010
+
2011
+ **With custom acronyms:**
2012
+
2013
+ - `get_n8n_docs` → `GetN8NDocsSkill`
2014
+ - `process_xml_data` → `ProcessXMLDataSkill`
2015
+
2016
+ ### Default Acronyms
2017
+
2018
+ The following acronyms are recognized by default:
2019
+
2020
+ - **Common**: id, api, url, uri, json, xml, sql, html, css, js, ui, uuid
2021
+ - **Network**: http, https, tcp, udp, ip, dns, tls, ssl
2022
+ - **Tech**: cpu, gpu, ram, io, os, db
2023
+
2024
+ Your custom acronyms extend these defaults and take precedence over them.
2025
+
2026
+ ## Post-Generation Hooks
2027
+
2028
+ The ADL CLI supports custom post-generation hooks that run automatically after project generation. These hooks allow you to execute commands like formatting, linting, testing, or custom setup scripts.
2029
+
2030
+ ### Default Hooks
2031
+
2032
+ Each language has sensible defaults:
2033
+
2034
+ **Go Projects:**
2035
+
2036
+ - `go fmt ./...` - Format all Go source files
2037
+ - `go mod tidy` - Download dependencies and clean up go.mod
2038
+
2039
+ **Rust Projects:**
2040
+
2041
+ - `cargo fmt` - Format all Rust source files
2042
+ - `cargo check` - Check the project for errors
2043
+
2044
+ ### Custom Hooks
2045
+
2046
+ You can customize or extend the default behavior by adding a `hooks` section to your ADL file:
2047
+
2048
+ ```yaml
2049
+ apiVersion: adl.inference-gateway.com/v1
2050
+ kind: Agent
2051
+ metadata:
2052
+ name: my-agent
2053
+ spec:
2054
+ # ... other configuration ...
2055
+
2056
+ # Custom post-generation hooks
2057
+ hooks:
2058
+ post:
2059
+ - "go fmt ./..."
2060
+ - "go mod tidy"
2061
+ - "go vet ./..."
2062
+ - "go test -short ./..."
2063
+ - "golangci-lint run --fix"
2064
+ ```
2065
+
2066
+ ### Hooks Behavior
2067
+
2068
+ - **Override Defaults**: When you specify custom hooks, they completely replace the language defaults
2069
+ - **Command Execution**: Commands run in the generated project directory
2070
+ - **Error Handling**: Failed commands show warnings but don't stop generation
2071
+ - **Sequential Execution**: Commands run in the order specified
2072
+ - **Shell Support**: Commands are executed through the system shell
2073
+
2074
+ ### Example Configurations
2075
+
2076
+ **Extended Go Development:**
2077
+
2078
+ ```yaml
2079
+ hooks:
2080
+ post:
2081
+ - "go mod download" # Download dependencies first
2082
+ - "go generate ./..." # Generate code if needed
2083
+ - "gofumpt -l -w ." # Improved formatting
2084
+ - "golangci-lint run --fix" # Lint and auto-fix
2085
+ - "go test -race -short ./..." # Run tests
2086
+ - "go build -v ./..." # Verify build works
2087
+ ```
2088
+
2089
+ **Rust with Additional Tools:**
2090
+
2091
+ ```yaml
2092
+ hooks:
2093
+ post:
2094
+ - "cargo fmt"
2095
+ - "cargo clippy --fix --allow-dirty"
2096
+ - "cargo check --all-targets"
2097
+ - "cargo test --lib"
2098
+ ```
2099
+
2100
+ **TypeScript/Node.js:**
2101
+
2102
+ ```yaml
2103
+ hooks:
2104
+ post:
2105
+ - "npm install"
2106
+ - "npm run format"
2107
+ - "npm run lint:fix"
2108
+ - "npm run type-check"
2109
+ - "npm test"
2110
+ ```
2111
+
2112
+ ### Best Practices
2113
+
2114
+ - **Keep hooks fast** - Avoid long-running commands that slow down generation
2115
+ - **Use error-tolerant commands** - Commands should gracefully handle missing tools
2116
+ - **Order matters** - Place dependencies first (e.g., `npm install` before `npm run lint`)
2117
+ - **Document requirements** - Note any required tools in your project README
2118
+
2119
+ ## Roadmap
2120
+
2121
+ ### Language Support
2122
+
2123
+ The ADL CLI currently supports Go, Rust, and TypeScript, with plans to expand to additional programming languages:
2124
+
2125
+ #### ✅ Currently Supported
2126
+
2127
+ - **Go** - Full support with templates for main.go, go.mod, and tools
2128
+ - **Rust** - Full support with templates for main.rs, Cargo.toml, and tools
2129
+ - **TypeScript/Node.js** - Full support with templates for src/index.ts, package.json, and tools
2130
+
2131
+ #### 🚧 Planned Support
2132
+
2133
+ - **Python** - Rapid prototyping and AI-first development
2134
+ - FastAPI-based server generation
2135
+ - Rich AI ecosystem integration
2136
+ - Jupyter notebook support for development
2137
+
2138
+ #### 🔮 Future Considerations
2139
+
2140
+ - **Java/Kotlin** - Enterprise JVM support
2141
+ - **C#/.NET** - Microsoft ecosystem integration
2142
+ - **Swift** - Apple ecosystem and server-side Swift
2143
+
2144
+ ### Template Enhancements
2145
+
2146
+ - **Multi-language projects** - Generate polyglot agents with language-specific microservices
2147
+ - **Custom templates** - User-defined project templates and scaffolding
2148
+ - **Plugin system** - Extensible architecture for custom generators
2149
+ - **Cloud-native templates** - Serverless (AWS Lambda, Vercel) and edge deployment support
2150
+
2151
+ ### Contribute to the Roadmap
2152
+
2153
+ We welcome community input on our roadmap! Please:
2154
+
2155
+ - 💡 Suggest new languages or frameworks via [Issues](https://github.com/inference-gateway/adl-cli/issues)
2156
+ - 🤝 Contribute implementations for new languages (see [Contributing Guide](CONTRIBUTING.md))
2157
+
2158
+ ## License
2159
+
2160
+ This project is licensed under the Apache 2.0 License - see the [LICENSE](LICENSE) file for details.
2161
+
2162
+ ## Support
2163
+
2164
+ - 📖 [Documentation](https://docs.inference-gateway.com)
2165
+ - 💬 [Discussions](https://github.com/inference-gateway/adl-cli/discussions)
2166
+ - 🐛 [Issues](https://github.com/inference-gateway/adl-cli/issues)
2167
+
2168
+ ---
51
2169
 
52
- Apache-2.0. See [LICENSE](https://github.com/inference-gateway/adl-cli/blob/main/LICENSE).
2170
+ > 🤖 Powered by the [Inference Gateway ecosystem](https://github.com/inference-gateway/)