Aspect CLI
Aspect CLI (aspect
) is wrapper for Bazel, built on top of Bazelisk, that adds additional features and extensibility to the popular polyglot build system from Google.
Why Aspect CLI?
Every organization has a different engineering culture and developer stack.
Bazel was designed for Google's workflows, not yours.
Many companies have found they have to write a wrapper around Bazel.
This starts out as a small need to shim something in the developer workflow, and is often an
untested Bash script living in /tools/bazel
which Bazelisk understands as a wrapper script.
Over time, the wrapper accumulates more code, and is a constant source of developer distress.
Licenses
Aspect CLI OSS
You can find the Aspect CLI OSS, the open-source, open-core portion of the Aspect CLI, in this repository and it is Apache 2 licensed.
Aspect CLI
The standard Aspect CLI is built on top of the open-source, open-core portion and is licensed under the Aspect Community License. The parts of the Aspect CLI that are not found in this repository are closed source.
We intend for Aspect CLI to remain free for individuals (only for personal use), Small Business (fewer than 50 employees), and non-profit or academic institutions. Please contact Aspect at https://aspect.build if you would like to use the Aspect CLI and fall outside of free use.
Installation
Aspect CLI OSS
For installation instructions for the Aspect CLI OSS go to github.com/cli/aspect-cli#installation.
Aspect CLI
Homebrew (macOS)
To install the standard Aspect CLI on macOS, run:
brew install aspect-build/aspect/aspect
This installs the aspect
command and also links it to bazel
, just like the Bazelisk installer does.
Bazelisk (macOS / Linux)
You can install the Aspect CLI in an existing Bazel workspace using Bazelisk.
This approach doesn't provide the aspect init
command, which has to run outside a Bazel workspace.
From the Aspect releases page,
copy the .bazeliskrc
snippet into your .bazeliskrc
file to install the Aspect CLI for all developers in the target repository.
You can configure the underlying version of Bazel can in the .bazelversion
file or the BAZEL_VERSION
environment variable.
Manual (macOS / Linux)
On macOS and Linux, download the aspect
binary for your platform and add it to your PATH
manually.
For each version of the Aspect CLI, you can download binaries and their SHA256 checksums from the following URLs:
https://static.aspect.build/aspect/<version>/aspect-<os>_<arch>
https://static.aspect.build/aspect/<version>/aspect-<os>_<arch>.sha256
Where os
is one of darwin
or linux
and arch
is one of amd64
or arm64
.
If you manually install for macOS, you can bypass the "Unknown Developer" dialog by running
xattr -c $(which aspect)
before launching aspect
.
Windows
Windows releases are coming soon.
Usage
Run aspect help
to see the available commands.
Some are the standard commands from Bazel and others are new, such as print
and docs
.
Write a plugin
Aspect's plugin system allows you to fit Bazel into your team's development process, with custom commands, behaviors, and integrations.
A plugin is any program (written in any language) that serves our gRPC protocol. The easiest way to get started is to clone our starter template repository.
Read the plugin Documentation for more information on how to write a plugin.
Need help or having issues?
If you think you've hit a bug, file a Bug Report.
You can also find us on Bazel Slack on the #aspect-dev channel.
For Enterprise
Aspect CLI is built by Aspect.
See our website at http://aspect.build to learn more about our product offerings.