-
Notifications
You must be signed in to change notification settings - Fork 367
Add gh aw run guidance and CLI commands reference
#28616
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,311 @@ | ||||||
| --- | ||||||
| description: Complete reference for gh aw CLI commands and their MCP tool equivalents for restricted environments | ||||||
| --- | ||||||
|
|
||||||
| # gh aw CLI Commands Reference | ||||||
|
|
||||||
| This document describes all `gh aw` commands, when to use the CLI versus the **agentic-workflows** MCP tool, and common debugging scenarios. | ||||||
|
|
||||||
| ## CLI vs MCP Tool — When to Use Each | ||||||
|
|
||||||
| | Environment | Use | | ||||||
| |---|---| | ||||||
| | **Local development** (terminal with `gh` auth) | `gh aw <command>` CLI | | ||||||
| | **GitHub Copilot Cloud** (coding agent, Copilot Chat) | `agentic-workflows` MCP tool | | ||||||
| | **GitHub Actions workflow step** | `gh aw <command>` after installing `github/gh-aw/actions/setup-cli` | | ||||||
| | **CI runner without gh auth** | `agentic-workflows` MCP tool | | ||||||
|
|
||||||
| > [!NOTE] | ||||||
| > **agentic-workflows MCP tool availability** | ||||||
| > | ||||||
| > The MCP tool is available when `agentic-workflows:` is added to a workflow's `tools:` section. In Copilot Chat / Copilot coding agent, it is pre-configured and always available. | ||||||
| > | ||||||
| > In a GitHub Actions workflow step, install the CLI first: | ||||||
| > ```yaml | ||||||
| > - uses: github/gh-aw/actions/setup-cli@<version> | ||||||
| > - run: gh aw compile | ||||||
| > ``` | ||||||
|
|
||||||
| --- | ||||||
|
|
||||||
| ## Command Reference | ||||||
|
|
||||||
| ### `gh aw init` | ||||||
|
|
||||||
| Initialize a repository for agentic workflows. | ||||||
|
|
||||||
| ```bash | ||||||
| gh aw init | ||||||
| ``` | ||||||
|
|
||||||
| Creates `.github/agents/agentic-workflows.agent.md` and supporting files. | ||||||
|
|
||||||
| **MCP equivalent**: Not available — run from a local terminal or use the `upgrade` tool for updates. | ||||||
|
|
||||||
| --- | ||||||
|
|
||||||
| ### `gh aw compile` | ||||||
|
|
||||||
| Compile workflow `.md` files into GitHub Actions `.lock.yml` files. | ||||||
|
|
||||||
| ```bash | ||||||
| gh aw compile # Compile all workflows | ||||||
| gh aw compile <workflow-name> # Compile a specific workflow | ||||||
| gh aw compile --strict # Compile with strict mode validation | ||||||
| gh aw compile --validate # Validate without emitting lock files | ||||||
| gh aw compile --fail-fast # Stop at first error | ||||||
| gh aw compile --purge # Remove orphaned .lock.yml files | ||||||
| gh aw compile --approve # Approve new secrets / action changes | ||||||
| ``` | ||||||
|
|
||||||
| **MCP equivalent**: `compile` tool | ||||||
|
|
||||||
| ``` | ||||||
| Use the compile tool with workflow_name: "my-workflow" | ||||||
| ``` | ||||||
|
|
||||||
| --- | ||||||
|
|
||||||
| ### `gh aw run` | ||||||
|
|
||||||
| > [!IMPORTANT] | ||||||
| > **Always prefer `gh aw run` over `gh workflow run <file>.lock.yml`** — it handles workflow resolution by short name, validates inputs, and enables correct run-tracking with `gh aw audit` and `gh aw logs`. | ||||||
|
|
||||||
| Trigger a workflow on demand using `workflow_dispatch`. Capabilities: | ||||||
| - Workflow resolution by short name (no need to remember `.lock.yml`) | ||||||
| - Input parsing and validation against declared inputs | ||||||
| - Correct run-tracking so `gh aw audit` and `gh aw logs` work immediately after | ||||||
|
|
||||||
| ```bash | ||||||
| gh aw run # Interactive mode — pick workflow and fill inputs | ||||||
| gh aw run <workflow-name> # Run by short name | ||||||
| gh aw run <workflow-name>.md # Alternative: explicit .md extension | ||||||
| gh aw run <workflow-name> --ref main # Run on a specific branch/tag/SHA | ||||||
| gh aw run <workflow-name> --repeat 3 # Run 4 times total (1 + 3 repeats) | ||||||
| gh aw run <workflow-name> --input key=value # Pass a specific input | ||||||
|
||||||
| gh aw run <workflow-name> --input key=value # Pass a specific input | |
| gh aw run <workflow-name> -F key=value # Pass a specific input |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gh aw compile --validateis described here as "Validate without emitting lock files", but--validateonly enables schema/image/action-SHA validation; emitting lock files is controlled by--no-emit. Update the examples to use--no-emit(optionally combined with--validate) and adjust the description accordingly.