Skip to main content
The Aspect CLI surface can vary by repository. In addition to built-in tasks, aspect <task> runs tasks declared in your .aspect/*.axl files. The CLI provides a machine-readable view of the tasks, flags, and defaults available in the current workspace, along with structured output for other read-only commands used in automation. Use the features on this page when:
  • You’re writing a shell script or CI job that needs to enumerate tasks or flags without parsing help text.
  • You’re driving aspect from an AI coding agent that needs to discover commands, inspect a task’s flags on demand, and recover from errors without relying on prior knowledge.
  • You’re piping aspect output to a log, another process, or a file and need clean output without interactive progress updates or ANSI escape codes.

Discover the surface with aspect describe

aspect describe prints the resolved CLI surface as JSON on stdout. It includes built-in and custom .axl tasks, the flags each task accepts, and the effective defaults after config.axl is applied. Flag names come from the same definitions used by the CLI, keeping the description aligned with the accepted arguments. Start with the command index, then request full details for a specific task when needed:
Quote multi-word task paths as a single argument. Use to inspect the cache diff task. If you run aspect describe cache diff without quotes, the command reports the extra argument as an error.
Both forms default to JSON on stdout and exit non-zero on an unknown command (aspect describe 'nope' fails), so scripts can rely on the exit status.

The index (aspect describe)

The index lists every reachable task with a copy-pasteable command string, its group path, one-line summary, and defining module. Use it to discover what’s available before drilling into a specific task:

One task’s flags (aspect describe '<command>')

Passing a command string returns the same header plus every flag it accepts, with type, default, allowed values, and description. Feature flags accepted everywhere are included too:

config.axl overrides show through as effective defaults

If your config.axl overrides a task’s default, describe reports the effective default that applies in the current repository. Overrides preserve their declared types, so an integer override reads 2, not ["2"], and include "default_from_config": true:
This makes describe a reliable way to determine a command’s default behavior in the current repository.

Check auth state with aspect auth status --output=json

aspect auth status prints a human-readable summary by default. Pass --output=json for machine-readable data that scripts and agents can use to diagnose authentication problems without parsing the text output:
Each entry includes logged_in, status, identity, its endpoints, and the exact login_command that re-authenticates it. A caller that finds an expired token gets the remedy without additional lookups. Only the JSON goes to stdout. The task header stays on stderr, so you can pipe stdout cleanly to jq or a file. Text output is unchanged.

--output is the standard flag for machine-readable output

Read commands use --output for their format switch. aspect cache diff now documents --output as the spelling for its format flag. The older --format still works but prints a deprecation warning:
See aspect cache diff for the full list of formats.

Pipe-safe help and output

Use aspect --help as a useful first call for both humans and agents:
  • Every built-in task, including build, format, gazelle, lint, and test, has a one-line summary in the top-level help.
  • Task groups list their members inline, so you can see what’s inside a group without a second --help call:
    Long groups use … (+N more) to omit additional members.
  • aspect test --help cross-references aspect cache diff under the section on running only affected tests.
The launcher’s download progress and aspect feature output are also safe to capture:
  • For redirected output, the launcher emits concise progress updates instead of terminal redraws. Interactive terminals and CI retain their existing progress behavior.
  • aspect feature strips ANSI escape codes when its output isn’t a terminal and honors NO_COLOR.

When to use which command

Example: driving aspect from a script

Enumerate every task, drill into one, and act on its flags:

Example: an agent recovering from an auth failure

See also