Skip to main content

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.

bash
BASH
agac init <project-name> [options]
agac init list
agac init example <name> [project-name]

The command creates this structure:

text
TXT
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:

SubcommandDescription
new <project-name>Create a project from a template. This is the default when the first word is not a subcommand
listList 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>):

OptionDescription
-o, --output-dirThe directory in which to create the project (default: the current directory)
-t, --templateThe 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, --forceCreate the project, even if the directory exists

Examples:

bash
BASH
# 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:

  1. Run agac init list to see the available examples.
  2. Run agac init example <name> to create a fully working project. You can run the project immediately.
Start from an Example

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:

bash
BASH
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:

text
TXT
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.

bash
BASH
agac example list
agac example install <name> [project-name] [options]

Subcommands:

SubcommandDescription
listList the available example projects from GitHub
install <name> [project-name]Install an example project from GitHub

Options for install:

OptionDescription
-o, --output-dir TEXTThe directory in which to create the project (default: the current directory)
-f, --forceCreate the project, even if the directory exists

Examples:

bash
BASH
# 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.

bash
BASH
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:

text
TXT
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 --target or --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 a retrieve entry searches (only with --all).
  • The output of sandbox runs: agent_io/sandbox/ and agent_io/store/<workflow>.sandbox.db (only with --all). --target does not remove agent_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:

OptionDescription
-w, --workflow TEXTThe workflow name (required). -a names the same option.
-f, --forceSkip the interactive confirmation
--targetRemove agent_io/target/, your generated output
--allRemove 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:

bash
BASH
# 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
Run from Anywhere

You can run this command from any subdirectory in your project.

WARNING

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 ?.

bash
BASH
agac docs [options]

Options:

OptionDescription
-o, --outputThe output directory for the generated files. A relative path is relative to the project root (default: artefact)
-p, --portThe port of the server (default: 8000)

Examples:

bash
BASH
# 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.

bash
BASH
agac docs test [options]

Options:

OptionDescription
-t, --testThe test suite to run: schemas, actions or all (default: all)
-p, --portThe 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.

Run from Anywhere

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.

bash
BASH
agac status -w <workflow-name> [options]

Options:

OptionDescription
-w, --workflow TEXTThe workflow name (required). -a names the same option.
--sandboxShow the status of the last sandbox run (agent_io/sandbox/.agent_status.json). See Sandbox Runs
--jsonPrint the status of each action and the status of the run as one JSON document

Example:

bash
BASH
agac status -w my_workflow

JSON output:

--json prints one JSON document on stdout, and nothing else. Warnings go to stderr.

bash
BASH
agac status -w my_workflow --json
json
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.

KeyValue
workflowThe workflow name
run_statusThe 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
actionsOne object for each action in agent_io/.agent_status.json, in the order of the file
actions[].nameThe action name. The table shows it in the Agent Name column
actions[].statusThe 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[].errorThe 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, use agac 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:

text
TXT
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:

text
TXT
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:

text
TXT
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:

text
TXT
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.

Run from Anywhere

You can run this command from any subdirectory in your project.

See Also​