Skip to main content
The Aspect CLI (aspect) is an open-source (Apache 2.0) task runner for Bazel. Built-in tasks cover what a Bazel monorepo does every day (build, test, format, lint, BUILD-file generation, delivery) and report to GitHub, Buildkite, GitLab, and CircleCI. You configure them, and write your own, in AXL, a Starlark dialect. The same aspect <task> runs on a laptop and on every CI provider. Source is on github.com/aspect-build/aspect-cli.
See Install the Aspect CLI for Homebrew, GitHub Actions and other methods, or the Quickstart for a walkthrough from install to a custom task. aspect build, aspect test, and aspect run work in any Bazel workspace with no config, and bazel keeps working alongside. To keep your team typing bazel, install the tools/bazel wrapper, which routes the verbs aspect wraps to aspect and everything else to vanilla Bazel (requires Bazelisk).

Built-in tasks

Every built-in runs on any CI provider and on a developer machine. Selective delivery (aspect delivery --mode=selective) needs Aspect Workflows CI runners. Aspect CLI tasks lists every task, including the setup, ci, and auth groups. Run aspect help to list the tasks in your repo, built-in and custom. Each task runs in named phases and ends with a per-phase timing summary. aspect test on a cached run:
On CI the same summary lands in Buildkite annotations, GitHub status checks, and a PR task summary comment.

Configuration

Tasks are configured in .aspect/config.axl at the repository root, and custom tasks are .axl files under .aspect/. See Run and define tasks for both, and aspect-build/bazel-examples for a full config running in CI.

Aspect Extension Language

AXL, the Aspect Extension Language, is the Starlark dialect the CLI is programmed in. AXL covers what you can build with it; the AXL reference documents every type and built-in.

Remote cache and remote execution

aspect <task> --remote sends a build to Aspect’s remote cache and build event service, and aspect setup bazelrc writes the same flags for vanilla bazel. Remote execution is opt-in, and the flag differs on Aspect Workflows CI runners; see Opting in to remote execution. Setup for each offering: Aspect Cloud or Aspect Enterprise.

Where next

Built-in tasks

Every task and the flags they all accept.

Running tasks in CI

Pipeline YAML for GitHub Actions, Buildkite, GitLab CI, and CircleCI.

AXL

Configure the built-ins and write your own tasks.

Version pinning

Pin the CLI version per repository in .aspect/version.axl.

Community

Join the Aspect Community Slack, Aspect’s free community support. Ask in #help for general support. Join the discussion and see what others are building with the Aspect CLI and Aspect Extension Language (AXL) in the #cli and #axl channels. For Bazel and the Bazel rulesets, Bazel Slack is the best place for support and discussion. Ask about Aspect’s rules_js in #javascript and rules_py in #python. Report bugs and request features on aspect-build/aspect-cli.