Skip to content

Commit a36e96d

Browse files
docs(site): add lifecycle commands to CLI reference (#632)
1 parent 50bd4e0 commit a36e96d

1 file changed

Lines changed: 165 additions & 40 deletions

File tree

site/src/content/docs/setup/cli.mdx

Lines changed: 165 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -5,56 +5,189 @@ sidebar:
55
order: 2
66
---
77

8-
The `ado-aw` CLI provides commands for initializing repositories, compiling pipelines, running MCP servers, executing safe outputs, and configuring Azure DevOps definitions.
8+
import { Aside } from '@astrojs/starlight/components';
9+
10+
The `ado-aw` CLI provides commands for authoring, compiling, and managing the full lifecycle of Azure DevOps agentic pipelines.
911

1012
## Global flags
1113

1214
These flags apply to all commands:
1315

1416
- `--verbose`, `-v` -- enable more detailed logging
15-
- `--debug`, `-d` -- enable debug logging
16-
- `--log-output-dir <path>` -- write log files to a specific directory
17+
- `--debug`, `-d` -- enable debug logging (implies verbose)
18+
- `--log-output-dir <path>` -- write log files to a specific directory (overrides `ADO_AW_LOG_DIR`)
1719

18-
## Commands
20+
## Authoring commands
1921

2022
### `init`
2123

22-
Initialize a repository for AI-first agentic pipeline authoring.
24+
Initialize a repository for AI-first agentic pipeline authoring. Creates `.github/agents/ado-aw.agent.md`, a Copilot dispatcher agent that routes to the create, update, and debug prompts.
2325

2426
```bash
2527
ado-aw init [--path <path>] [--force]
2628
```
2729

2830
Options:
2931

30-
- `--path <path>` -- target directory
31-
- `--force` -- continue even when repository checks would normally block initialization
32+
- `--path <path>` -- target directory (defaults to current directory)
33+
- `--force` -- bypass the GitHub-remote guard (use when running inside a GitHub-hosted repository like `githubnext/ado-aw`)
3234

3335
### `compile [<path>]`
3436

35-
Compile markdown into Azure DevOps pipeline YAML. If you omit the path, `ado-aw` auto-discovers agentic pipeline sources in the current directory.
37+
Compile a markdown agent file into Azure DevOps pipeline YAML. If you omit the path, `ado-aw` auto-discovers and recompiles all agentic pipeline sources in the current directory.
3638

3739
```bash
3840
ado-aw compile [<path>] [--output <path>]
3941
```
4042

4143
Options:
4244

43-
- `--output`, `-o <path>` -- write the generated YAML to a specific file or directory
44-
- `--skip-integrity` -- debug-only option to skip the generated integrity check step
45-
- `--debug-pipeline` -- debug-only option to include extra pipeline diagnostics
45+
- `--output`, `-o <path>` -- write the generated YAML to a specific file or directory; if an existing directory is given, the filename is derived from the source (e.g. `agent.md``agent.lock.yml`)
46+
- `--force` -- bypass the GitHub-remote guard
47+
- `--skip-integrity` -- *(debug builds only)* skip the "Verify pipeline integrity" step
48+
- `--debug-pipeline` -- *(debug builds only)* include MCPG debug diagnostics in the generated pipeline
4649

4750
### `check <pipeline>`
4851

49-
Verify that a compiled pipeline still matches its source markdown.
52+
Verify that a compiled pipeline still matches its source markdown. Useful as a CI gate to catch un-regenerated pipelines.
5053

5154
```bash
5255
ado-aw check <pipeline>
5356
```
5457

58+
The source markdown path is auto-detected from the `@ado-aw` header inside the compiled YAML.
59+
60+
## Pipeline lifecycle commands
61+
62+
These commands interact with Azure DevOps build definitions and require ADO API access. They infer the ADO organization and project from the local git remote by default; pass `--org` and `--project` to override.
63+
64+
For ADO authentication, the commands try the **Azure CLI** (`az` login) first and fall back to prompting for a PAT. You can also set `AZURE_DEVOPS_EXT_PAT` in your environment to skip the prompt.
65+
66+
### `secrets set <name> [<value>] [path]`
67+
68+
Set a pipeline variable (stored as `isSecret=true`) on every matched ADO definition.
69+
70+
```bash
71+
ado-aw secrets set GITHUB_TOKEN [path]
72+
```
73+
74+
Value resolution order: positional `<value>` argument → `--value-stdin` (one line from stdin) → interactive prompt with echo off.
75+
76+
Options:
77+
78+
- `--allow-override` -- set `allowOverride=true`; when omitted, `allowOverride` is preserved on existing variables and defaults to `false` for new ones
79+
- `--value-stdin` -- read the value from a single line on stdin (mutually exclusive with the positional value)
80+
- `--org <url>` -- Azure DevOps organization URL or bare org name
81+
- `--project <name>` -- Azure DevOps project name
82+
- `--pat <pat>` -- PAT for ADO API authentication
83+
- `--definition-ids <ids>` -- explicit comma-separated definition IDs (skips auto-detection)
84+
- `--dry-run` -- print the planned set without calling the ADO API
85+
86+
### `secrets list [path]`
87+
88+
List variable names and their `isSecret` / `allowOverride` flags on every matched definition. **Never prints values.**
89+
90+
Options:
91+
92+
- `--json` -- emit machine-readable JSON
93+
- `--org`, `--project`, `--pat`, `--definition-ids` -- same as `secrets set`
94+
95+
### `secrets delete <name> [path]`
96+
97+
Delete a named variable from every matched definition. No-op when the variable is absent.
98+
99+
Options:
100+
101+
- `--org`, `--project`, `--pat`, `--definition-ids` -- same as `secrets set`
102+
- `--dry-run` -- print the planned deletion without calling the ADO API
103+
104+
### `enable [path]`
105+
106+
Register an ADO build definition for each compiled pipeline discovered under `path` and ensure it is `enabled`. Matches existing definitions by YAML filename first, then by display name; creates a new definition when no match is found.
107+
108+
```bash
109+
ado-aw enable [path] [options]
110+
```
111+
112+
Options:
113+
114+
- `--org <url>` -- Azure DevOps organization URL or bare org name
115+
- `--project <name>` -- Azure DevOps project name
116+
- `--pat <pat>` -- PAT for ADO API authentication
117+
- `--folder <ado-folder>` -- ADO folder for newly-created definitions (default: `\`); only applies on create
118+
- `--default-branch <ref>` -- default branch for newly-created definitions (default: `refs/heads/main`)
119+
- `--also-set-token` -- set `GITHUB_TOKEN` as a secret variable after creating new definitions
120+
- `--token <value>` -- token value for `--also-set-token` (falls back to `$GITHUB_TOKEN`, then interactive prompt)
121+
- `--dry-run` -- print the planned actions without calling the ADO API
122+
123+
<Aside type="note">
124+
`enable` requires the local git remote to be an Azure DevOps Git remote. GitHub-hosted source repos are not yet supported.
125+
</Aside>
126+
127+
### `disable [path]`
128+
129+
Set `queueStatus` to `disabled` (or `paused`) on every matched ADO definition.
130+
131+
Options:
132+
133+
- `--paused` -- use `queueStatus: paused` instead of `disabled`; paused definitions still queue scheduled runs but hold the queue, while disabled definitions reject all queue requests
134+
- `--org`, `--project`, `--pat` -- same as `enable`
135+
- `--dry-run` -- print the planned transitions without calling the ADO API
136+
137+
### `remove [path]`
138+
139+
**Destructive.** Delete every matched ADO build definition. Bulk deletes (more than one match) require `--yes`; a single match on a tty prompts interactively.
140+
141+
Options:
142+
143+
- `--yes` -- required for bulk deletes and for any delete in a non-tty context
144+
- `--org`, `--project`, `--pat` -- same as `enable`
145+
- `--dry-run` -- print the planned deletions without calling the ADO API
146+
147+
### `list [path]`
148+
149+
List every matched ADO build definition along with its `queueStatus`, ADO folder, and latest-run summary.
150+
151+
Options:
152+
153+
- `--all` -- also include ADO definitions that do not match any local fixture
154+
- `--json` -- emit machine-readable JSON
155+
- `--org`, `--project`, `--pat` -- same as `enable`
156+
157+
### `status [path]`
158+
159+
Show a denser per-pipeline status block for every matched definition: name, ID, folder, `queueStatus`, latest-run summary, and a deep link. `--json` emits the same shape as `list --json`.
160+
161+
Options:
162+
163+
- `--json` -- emit machine-readable JSON
164+
- `--org`, `--project`, `--pat` -- same as `enable`
165+
166+
### `run [path]`
167+
168+
Queue an ADO build for every matched definition. With `--wait`, polls each queued build to completion and exits with a non-zero code if any build failed.
169+
170+
```bash
171+
ado-aw run [path] [--wait] [--parameters key=value]
172+
```
173+
174+
Options:
175+
176+
- `--branch <ref>` -- source branch to queue (defaults to the definition's `defaultBranch`)
177+
- `--parameters <k=v>` -- ADO `templateParameters` as `key=value` pairs; repeatable and/or comma-separated. Values must not contain commas — use one `--parameters` flag per pair when values contain commas.
178+
- `--wait` -- poll each queued build to completion before exiting
179+
- `--poll-interval <secs>` -- polling interval when `--wait` is set (default: `10`)
180+
- `--timeout <secs>` -- maximum wait time when `--wait` is set (default: `1800`)
181+
- `--org`, `--project`, `--pat` -- same as `enable`
182+
- `--dry-run` -- print the planned queue body without calling the ADO API
183+
184+
## Internal / pipeline runtime commands
185+
186+
These commands are used by the compiled pipeline itself and are not typically called by users directly.
187+
55188
### `mcp <output_directory> <bounding_directory>`
56189

57-
Run SafeOutputs as a stdio MCP server.
190+
Run SafeOutputs as a stdio MCP server (used by Stage 1).
58191

59192
```bash
60193
ado-aw mcp <output_directory> <bounding_directory> [--enabled-tools <name>]
@@ -66,55 +199,35 @@ Options:
66199

67200
### `mcp-http <output_directory> <bounding_directory>`
68201

69-
Run SafeOutputs as an HTTP MCP server.
202+
Run SafeOutputs as an HTTP MCP server (for MCPG integration).
70203

71204
```bash
72205
ado-aw mcp-http <output_directory> <bounding_directory> [options]
73206
```
74207

75208
Options:
76209

77-
- `--port <port>` -- port to listen on
78-
- `--api-key <key>` -- API key used to authenticate requests
210+
- `--port <port>` -- port to listen on (default: `8100`)
211+
- `--api-key <key>` -- API key for authentication (auto-generated if not provided)
79212
- `--enabled-tools <name>` -- limit the server to specific tools; repeat to allow more than one
80213

81214
### `execute`
82215

83-
Execute safe outputs as the final runtime stage.
216+
Execute safe outputs as the Stage 3 executor.
84217

85218
```bash
86219
ado-aw execute [options]
87220
```
88221

89222
Options:
90223

91-
- `--source`, `-s <path>` -- source markdown file
92-
- `--safe-output-dir <path>` -- directory containing safe output records
93-
- `--output-dir <path>` -- directory for processed artifacts
224+
- `--source`, `-s <path>` -- source markdown file (reads tool config from front matter)
225+
- `--safe-output-dir <path>` -- directory containing safe output NDJSON (default: current directory)
226+
- `--output-dir <path>` -- directory for processed artifacts (e.g., agent memory)
94227
- `--ado-org-url <url>` -- Azure DevOps organization URL override
95228
- `--ado-project <name>` -- Azure DevOps project name override
96229
- `--dry-run` -- validate inputs without making write calls
97230

98-
### `configure`
99-
100-
Detect agentic pipelines in a local repository and update the `GITHUB_TOKEN` pipeline variable on their Azure DevOps build definitions. The Copilot CLI engine needs this token to authenticate with GitHub.
101-
102-
For Azure DevOps API authentication, the command first tries the **Azure CLI** (`az` login session) and falls back to prompting for a PAT if unavailable.
103-
104-
```bash
105-
ado-aw configure [options]
106-
```
107-
108-
Options:
109-
110-
- `--token <token>` -- GitHub PAT value to apply (prompted if omitted). Must be a [fine-grained PAT](/ado-aw/setup/quick-start/#github-pat-permissions) with **Copilot Requests: Read** permission.
111-
- `--org <url>` -- Azure DevOps organization URL
112-
- `--project <name>` -- Azure DevOps project name
113-
- `--pat <pat>` -- PAT used for Azure DevOps API authentication (fallback if Azure CLI is unavailable)
114-
- `--path <path>` -- repository path to inspect
115-
- `--dry-run` -- preview changes without applying them
116-
- `--definition-ids <ids>` -- comma-separated definition IDs to update
117-
118231
## Common examples
119232

120233
```bash
@@ -126,4 +239,16 @@ ado-aw compile
126239

127240
# Verify a generated pipeline
128241
ado-aw check agent.lock.yml
242+
243+
# Set GITHUB_TOKEN on all matched pipelines
244+
ado-aw secrets set GITHUB_TOKEN
245+
246+
# Register pipelines with ADO and set their token in one step
247+
ado-aw enable --also-set-token
248+
249+
# Check which pipelines are registered and their latest status
250+
ado-aw status
251+
252+
# Queue all matched pipelines and wait for them to finish
253+
ado-aw run --wait
129254
```

0 commit comments

Comments
 (0)