Overview
DocsCLI
The as2 command for building, testing and moving around a source workspace, and fetching example projects.
Authored by
The as2 command wraps the everyday tasks of working on Aerostack2 from source. It builds and tests
packages from any directory, jumps to a package's folder, and downloads the example projects.
For source workspaces
The CLI works in a colcon workspace built from source against a ROS 2 install in /opt/ros. It
doesn't apply to Pixi or Docker installs.
Set up
Point AEROSTACK2_PATH at the Aerostack2 folder inside your workspace and load the CLI from your
shell's startup file. It works in bash and zsh, with tab completion in bash:
~/.bashrc
source /opt/ros/humble/setup.bash
export AEROSTACK2_PATH=$HOME/aerostack2_ws/src/aerostack2
source $AEROSTACK2_PATH/as2_cli/setup_env.bashsetup_env.bash defines the as2 command and sources the workspace's install/setup.bash once
it's built. The workspace is taken as the folder two levels above AEROSTACK2_PATH.
It also sets AEROSTACK2_SIMULATION_DRONE_ID, which many launch files use as the default
namespace, to drone_sim_<user>_0. The value is kept in as2_cli/env_variables.bash, where you can
change it.
Commands
| Command | What it does |
|---|---|
as2 build | Builds the workspace, or a package and what it depends on |
as2 test | Runs the tests of the workspace or of one package |
as2 clean | Removes build output, for some packages or the whole workspace |
as2 list | Lists the packages in the workspace |
as2 cd | Goes to a package's folder, a project's folder or the Aerostack2 folder |
as2 project | Lists and downloads the example projects |
Every command except as2 cd prints its help with -h. Short flags can be combined, so -dv is
the same as -d -v.
[### Build and test
Build, test and clean packages from any directory.](/u/2c658ac28043e6f6)[### Packages and folders
List the workspace's packages and jump to their folders.](/u/78768fd52e42cadc)[### Projects
Download the example projects and move into them.](/u/4c078cda8f4e9277)
Last updated on November 11, 2026
[
Other components
The interfaces of the map server, geozones, the external object to TF tool, the mission executor and the alerts.](068_2026-12-05_other-components.md)[
Build and test
Build, test and clean the packages of a source workspace with as2 build, as2 test and as2 clean.](019_2026-12-05_build-and-test.md)
