Utility Commands
agac runs workflows. It also has commands for project setup, debugging and maintenance. These utility commands initialize projects, help you debug template rendering, run tests and keep your workspace clean.
render / compile
There are no standalone agac render or agac compile commands. Rendering occurs implicitly during the preflight checks.
When agac inspect loads a workflow, it expands the templates with Jinja2 and
resolves the prompts. It also puts the schemas inline and expands the versions. If rendering fails,
the command exits with a non-zero code. When the rendered text is not valid YAML, the
command also writes the text to
.agent-actions/cache/rendered_workflows/<workflow>_failed.yml for
debugging.
To create the project folders, use agac init.
init
Use the init command to start a new Agent Actions project from the beginning. The command creates an organized directory structure with all the standard folders that you will need.
agac init <project-name> [options]
agac init list
agac init example <name> [project-name]
The command creates this structure:
my-project/
├── agent_actions.yml # Project configuration (required marker file)
├── agent_workflow/ # Agentic workflow definitions
├── schema/ # JSON schemas for validation
├── prompt_store/ # Prompt templates
├── templates/ # Jinja2 templates for config rendering
├── tools/ # Custom tools
├── seed_data/ # Static reference data
└── .gitignore # Holds .agac/, the derived state such as the knowledge indexes
agac init and agac init example add the line .agac/ to the .gitignore of the project. If the file does not exist, the command writes it. The .agac/ folder holds derived state, for example the knowledge indexes. Agent Actions builds that state again from your files, so do not commit it.
The command gives you a working start point with sensible defaults. It is similar to npm init or git init.
Subcommands:
| Subcommand | Description |
|---|---|
new <project-name> | Create a project from a template. This is the default when the first word is not a subcommand |
list | List the available example projects from GitHub |
example <name> [project-name] | Create a project from a GitHub example. This subcommand accepts -o, --output-dir and -f, --force |
Options (for agac init <project-name>):
| Option | Description |
|---|---|
-o, --output-dir | The directory in which to create the project (default: the current directory) |
-t, --template | The template name: default, minimal, full or sandbox (default: default). default, minimal and full create the same empty structure. sandbox creates a small project that runs offline. See The sandbox template |
-f, --force | Create the project, even if the directory exists |
Examples:
# Create a new project in the current directory
agac init my_project
# Create a project in a specific directory
agac init my_project -o ~/projects
# Name a template (default, minimal or full)
agac init my_project -t minimal
# Create the sandbox starter project
agac init my_sandbox --template sandbox
# See all available examples
agac init list
# Scaffold from a GitHub example
agac init example contract_reviewer
# Scaffold from an example with a custom project name
agac init example contract_reviewer my_project
# Force overwrite existing files
agac init my_project -f
To start from an example, do these steps:
- Run
agac init listto see the available examples. - Run
agac init example <name>to create a fully working project. You can run the project immediately.
The command gets the examples from GitHub. Thus the package stays small.
The Sandbox Template
agac init <project-name> --template sandbox creates a small project with one workflow, support_desk. The workflow uses each feature once, and a sandbox run runs it offline in a few seconds, with no API key:
agac init my_sandbox --template sandbox
cd my_sandbox
agac sandbox check -w support_desk
The project has these files, together with the standard folders:
my_sandbox/
├── agent_actions.yml # with the knowledge base help_center
├── agent_workflow/support_desk/
│ ├── agent_config/support_desk.yml # the workflow, with a comment on each part
│ └── agent_io/staging/tickets.json # six tickets, two of them spam
├── branches/reply_round.yml # one round of the loop; draft_reply retrieves help articles
├── knowledge/help_center/ # three help articles: billing, refunds, account access
├── prompt_store/support_desk.md
├── schema/support_desk/ # the output schemas
├── seed_data/teams.json
├── tools/support_desk/support_tools.py # the tool actions: plain Python, no network
├── sandbox.yml # the scenario: faults that heal
└── sandbox_expected.yml # what a sandbox run must produce
The template ships in the package, so it needs no network. The workflow names a real vendor (openai), so it is also a start for real runs. A sandbox run sends each LLM action to the mock. See The starter project for the features of the workflow and agac sandbox check for the check.
example
The example command lists and installs example projects from GitHub. It gives the same catalog as agac init list / agac init example, as a standalone command group.
agac example list
agac example install <name> [project-name] [options]
Subcommands:
| Subcommand | Description |
|---|---|
list | List the available example projects from GitHub |
install <name> [project-name] | Install an example project from GitHub |
Options for install:
| Option | Description |
|---|---|
-o, --output-dir TEXT | The directory in which to create the project (default: the current directory) |
-f, --force | Create the project, even if the directory exists |
Examples:
# See what's available
agac example list
# Install an example under its own name
agac example install contract_reviewer
# Install an example as a custom-named project
agac example install contract_reviewer my_project
clean
The clean command removes the working directories of a workflow under agent_io/. You must select what to remove with --target or --all.
If clean finds something to remove during a run or a retry of the workflow, it removes nothing. It exits 75 with Another run of workflow '<workflow>' is in progress (see Concurrent runs). clean holds the same lock from before it asks for confirmation until it finishes. It keeps the lock file. After --all, agent_io/store/ holds only the empty <workflow>.db.lock.
agac clean -w <workflow-name> --target|--all [-f]
If you do not give --target or --all, the command removes nothing. It prints the choices on stderr and stops with exit code 2:
Error: Give --target or --all to say what to clean:
--target Remove agent_io/target/, the generated output.
--all Remove all agent_io directories, the store and the
sandbox output included, and reclaim the local records
of the workflow's batches.
-f, --force Do not ask for confirmation.
The command removes these items:
agent_io/target/: Your generated output (with--targetor--all).agent_io/staging/and the durable store: Your input data and run history (only with--all).agent_io/retrieve/: the indexes of the records that aretrieveentry searches (only with--all).- The output of sandbox runs:
agent_io/sandbox/andagent_io/store/<workflow>.sandbox.db(only with--all).--targetdoes not removeagent_io/sandbox/target/. - The data that a provider recorded locally about the batches of this workflow, under
.agac/at the project root (only with--all). Only the store that the command removes names this data. Thus this is the last time that anything can get to the data. The real store and the sandbox store each name the batches of their own runs, and the command reclaims the data of each.
The command does not remove the indexes of the knowledge bases in .agac/knowledge/. All workflows of the project share them. To remove the old index files, run agac knowledge build --prune.
Options:
| Option | Description |
|---|---|
-w, --workflow TEXT | The workflow name (required). -a names the same option. |
-f, --force | Skip the interactive confirmation |
--target | Remove agent_io/target/, your generated output |
--all | Remove all directories, which include target, staging, the durable store and the sandbox output. Also remove the data that a provider recorded locally about the batches of this workflow. You cannot recover the removed data |
Examples:
# Remove generated output (with confirmation)
agac clean -w my_workflow --target
# Remove everything, including staging inputs and the durable store
agac clean -w my_workflow --all
You can run this command from any subdirectory in your project.
If you did not retrieve the batch results yet, retrieve them before you clean. --target deletes your generated output. --all also deletes the staging inputs and the durable store. You cannot recover any of this data.
docs
Build and serve interactive documentation for your workflows. In one step, the docs command scans your project, generates the documentation data and starts an HTTP server.
The documentation lists an optional observe field as a plain input of the action, without the ?.
agac docs [options]
Options:
| Option | Description |
|---|---|
-o, --output | The output directory for the generated files. A relative path is relative to the project root (default: artefact) |
-p, --port | The port of the server (default: 8000) |
Examples:
# Build and serve documentation on default port
agac docs
# Serve on a custom port
agac docs --port 3000
# Generate to a custom directory
agac docs --output ./custom-artefact
docs test
Run Playwright tests to verify that the documentation site renders correctly.
agac docs test [options]
Options:
| Option | Description |
|---|---|
-t, --test | The test suite to run: schemas, actions or all (default: all) |
-p, --port | The port of the running docs server (default: 8890) |
The command does not start a server. It needs Node.js, a running docs server, and the test scripts (test-all-schemas.js, test-run-actions-complete.js, test-actions-specific.js) in the project root.
You can run docs commands from any subdirectory in your project.
status
Show the execution status of a specified workflow. The status shows which actions are running, completed or failed.
An action can fail as a whole, with the error in its status (error_message in agent_io/.agent_status.json). For such an action, an Error column shows the first line of that error next to the action. The command cuts the line to 200 characters. The column shows only when a failed action has an error message. This command does not list the failures of single records. For those, see agac dispositions or agac retry --dry-run.
agac status -w <workflow-name> [options]
Options:
| Option | Description |
|---|---|
-w, --workflow TEXT | The workflow name (required). -a names the same option. |
--sandbox | Show the status of the last sandbox run (agent_io/sandbox/.agent_status.json). See Sandbox Runs |
--json | Print the status of each action and the status of the run as one JSON document |
Example:
agac status -w my_workflow
JSON output:
--json prints one JSON document on stdout, and nothing else. Warnings go to stderr.
agac status -w my_workflow --json
{
"workflow": "my_workflow",
"run_status": "FAILED",
"actions": [
{ "name": "extract", "status": "completed", "error": null },
{ "name": "summarize", "status": "failed", "error": "the error that stopped the action" }
]
}
The shape is stable. A later release can add a key, but it does not rename or remove one.
| Key | Value |
|---|---|
workflow | The workflow name |
run_status | The status that agac run gives to a run with these action statuses: SUCCESS, FAILED or PAUSED. It is null when no action status is stored, because the workflow did not run. Then the command also prints a message on stderr. See the text below this table |
actions | One object for each action in agent_io/.agent_status.json, in the order of the file |
actions[].name | The action name. The table shows it in the Agent Name column |
actions[].status | The Status column: pending, running, batch_submitted, checking_batch, completed, completed_with_failures, failed, skipped or interrupted. It is null where the table shows N/A |
actions[].error | The full error message of a failed action, or null. The Error column of the table shows only its first line |
run_status has these values:
SUCCESS: Each action completed. An action that completed with failed records (completed_with_failures) is also a completed action. To count the failed records, useagac dispositions --json.FAILED: Each action ended, and one or more actions failed.PAUSED: One or more actions did not end. The run is in progress, or it waits for a batch, or it stopped early.
The exit code of agac run and of agac retry tells more than run_status. A run with the status SUCCESS exits 3, not 0, when an action holds failed or exhausted records. A run that waits for a batch exits 4. A run that a provider quota stopped exits 5, and run_status is PAUSED.
run_status is PAUSED also while a run is in progress. Thus run_status cannot tell a running workflow from a paused one. A monitor must read actions[].status for this, for example to find an action with the status running.
If the status file holds no action status, the command prints this message and stops with exit code 0. An empty status file ({}) gives the same message. With --json, the message goes to stderr, and stdout has the document with run_status set to null. Without --json, the message goes to stdout:
No action status is stored for workflow 'my_workflow'. Has it been run?
If the status file holds a status that is not in the list above, the command stops with exit code 1. The command does this also for a status file that is not valid JSON. The error names the file and the action:
Error: Status file is corrupted: <project>/agent_workflow/my_workflow/agent_io/.agent_status.json
Action 'summarize' has an unknown status: 'weird'
Each action entry in the status file must be a JSON object. If an entry is not an object, for example "summarize": "completed", the command stops with exit code 1 and gives this error:
Error: Status file is corrupted: <project>/agent_workflow/my_workflow/agent_io/.agent_status.json
Action 'summarize' is not an object: 'completed'
agac run, agac dispositions, agac schema and agac retry --dry-run also stop on such an entry, with exit code 1 and the same two lines in their error. These four commands also stop on a status file that is not a JSON object, for example [1] or null. agac status stops on such a file too. The error for such a file is:
Status file has unexpected format (expected JSON object): <project>/agent_workflow/my_workflow/agent_io/.agent_status.json
In run, dispositions, schema and retry, the error tells you to edit the status file or to start again with agac run --fresh. agac run --fresh does not stop on these files. It clears the status file and starts again.
The command reads only the status file. It does not read the workflow configuration. Thus an action that you removed from the configuration stays in the output until agac run --fresh clears the file.
You can run this command from any subdirectory in your project.
See Also
- run Command: Run workflows
- batch Commands: Manage batch processing
- schema Command: Analyze the structure of a workflow