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
aspectfrom 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
aspectoutput 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.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:
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:
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:
aspect cache diff for the full list of formats.
Pipe-safe help and output
Useaspect --help as a useful first call for both humans and agents:
-
Every built-in task, including
build,format,gazelle,lint, andtest, 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
--helpcall:Long groups use… (+N more)to omit additional members. -
aspect test --helpcross-referencesaspect cache diffunder the section on running only affected tests.
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 featurestrips ANSI escape codes when its output isn’t a terminal and honorsNO_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
aspect cache diff: use--output=jsonwith affected-test results.- Authenticating the Aspect CLI: learn how
aspect auth loginworks and how CI authenticates withASPECT_API_TOKEN. - Tasks overview: explore the built-in tasks that
aspect describelists and how custom.axltasks appear alongside them.

