aspect help to view the list of available tasks.
For example:
Extension Discovery
The Aspect CLI discovers extensions in the following locations:.aspect/*.axl
.aspect directories from your current working directory, traversing upward to the root of your Bazel workspace. This enables teams to scope tasks to specific subdirectories rather than applying them project-wide. Each .aspect directory contains .axl files defining the extension code.
Additionally, you can include a MODULE.aspect file in your repository to specify external sources for extensions.
For example:
cd app1 and then run aspect, the Aspect CLI first loads tasks from ./app1/.aspect/*.axl, then traverses up the tree to the topmost directory of your Bazel project and discovers all available tasks it finds in .aspect/*.axl at each point. As a result, the ‘build’ and ‘mycmd’ tasks come from the repository root, while the ‘subcmd’ task comes from the app1 folder.
Write your first extension
Extensions are written in the Aspect Extension Language (AXL) to define tasks and create custom workflows suited to your project’s requirements. Follow these steps to create a custommycmd task that wraps Bazel’s build functionality:
-
Create a
.aspectdirectory at the root of your project: -
Create a file named
mycmd.axlwithin the.aspectdirectory: -
Add the following Starlark code to
mycmd.axl: -
Verify the new task appears:
-
Test the new AXL task by running:

