BrainFrame CLI¶
The BrainFrame Command Line Interface (CLI) is used to install, update, and manage the lifecycle of the BrainFrame
server and system. Its command, brainframe, starts and stops the BrainFrame server, and manages other related
controls.
Command Structure
The command is structured as
brainframe [Sub-Command] [Arguments]
To view a list of sub-commands, you can use
brainframe --help
To view help for a specific sub-command, you can use
brainframe [Sub-Command] --help
Using Tools with a Remote Server
The tools that talk to a BrainFrame server, such as brainframe-apps and brainframe-sys-tools, assume that the
server is running on the same machine. If the server is on another machine, give its address with
--server-url SERVER_URL.
Command: brainframe¶
The BrainFrame server consists of several smaller microservices, which are containerized using Docker. The
lifecycle and control of those services are delegated to Docker Compose, which orchestrates the containers. The
brainframe command installs the server, starts and stops it, updates it, backs up its data, and removes it.
brainframe <command> [options]
| Command | Purpose |
|---|---|
install |
Install the BrainFrame server. |
compose |
Start, stop, and inspect the server using Docker Compose. |
update |
Update the server to a new version. |
info |
Show where BrainFrame is installed and which version it is. |
backup |
Back up the server's data. |
uninstall |
Remove the server. |
shell |
Open a shell that has the BrainFrame command line tools. |
self-update |
Update the CLI itself, when it was installed as a standalone binary. |
For instructions on the installation of the CLI, please refer to our getting started guide. To update the CLI to the latest version, run:
sudo -H pip3 install --upgrade brainframe-cli
Note
The latest version of the CLI needs Python 3.10 or newer. On a system with an older Python, such as Ubuntu 20.04,
pip installs the newest older version of the CLI instead.
Permissions¶
install,backup, anduninstallmust be run as root, for example withsudo.composeandupdateneed permission to use Docker. This means being root or a member of thedockergroup.updatealso needs write access to the install directory, which is given to thebrainframegroup, so usesudoor be a member of that group.- If you installed the CLI with
pipas a regular user,sudo brainframemay not find it. Usesudo $(which brainframe)instead.
The installer can add your user to the docker and brainframe groups. Log out and back in, or reboot, for the
change to take effect.
Install location and data location¶
BrainFrame uses two directories:
| Directory | Contents | Default | Environment variable |
|---|---|---|---|
| Install path | docker-compose.yml and its related configuration, such as .env |
/usr/local/share/brainframe |
BRAINFRAME_INSTALL_PATH |
| Data path | The data that the server writes at runtime: the database, stored files, and capsules | /var/local/brainframe |
BRAINFRAME_DATA_PATH |
If you install to custom locations, brainframe install prints export lines for these variables. Add them to your
~/.bashrc, so that later brainframe commands can find the installation. Because sudo does not pass environment
variables on, use sudo -E when a command needs them. To print the locations in use, run brainframe info.
install¶
Installs the BrainFrame server. It downloads the server's docker-compose.yml, downloads the server's Docker images,
and offers to start the server.
sudo brainframe install
With no options, the installer asks about each setting. It can install Docker if it is missing, add your user to the
docker and brainframe groups, and choose the install and data directories.
To install without questions, for example in a script, give any option. The command then runs non-interactively, and anything you leave out takes its default value.
sudo brainframe install --noninteractive --version v0.31.16
| Option | Description |
|---|---|
--noninteractive |
Do not ask questions. |
--version VERSION |
The version to install, such as v0.31.16, or latest. Default: latest. |
--install-path PATH |
Where to install the docker-compose.yml. Default: /usr/local/share/brainframe. |
--data-path PATH |
Where the server writes its data. Default: /var/local/brainframe. |
--install-docker |
Install Docker if it is not present. |
--add-to-group |
Add the current user to the brainframe group. |
--add-to-docker-group |
Add the current user to the docker group. |
Note
Installing Docker automatically is only offered on operating systems that the CLI officially supports. On other systems, install Docker first by following the instructions in Get BrainFrame.
compose¶
Runs a Docker Compose command on the BrainFrame installation. It can be run from any directory. Everything after
compose is passed to Docker Compose, using the installed docker-compose.yml, the docker-compose.override.yml
and .env files if they exist.
Starting the server
brainframe compose up -d
If you remove the -d flag, it will attach the logs stream to your terminal,
and allow you to close the server when you Ctrl+C.
Stopping the server
brainframe compose down
Restarting the server
brainframe compose restart
To apply changes to docker-compose.override.yml or .env, stop the server with brainframe compose down, and then
start it again with brainframe compose up -d.
Streaming logs
To view all logs, run:
brainframe compose logs -f
To view logs just for the core service, run:
brainframe compose logs -f core
Other commands
Any Docker Compose command works, for example brainframe compose ps to list the services, or
brainframe compose exec database psql -U user -d brainframe to open a database shell.
Note
brainframe compose down adds the --volumes flag for you, which also removes the Docker volumes defined by
BrainFrame. The server's data is kept in the data path on the host, and is not deleted. To stop the server
without removing the volumes, add --except-volumes.
update¶
Updates the server to a new version. It downloads the new docker-compose.yml, downloads the new Docker images, and
then offers to restart the server to apply the update.
sudo brainframe update
To update to a specific version:
sudo -E brainframe update --version v0.31.16
If you give any option, the command runs non-interactively, so add --restart to restart the server when the update
finishes. Without --restart, the new version starts the next time that you stop and start the server.
sudo brainframe update --restart
| Option | Description |
|---|---|
--version VERSION |
The version to update to, or latest. Default: latest. |
--restart |
Restart the server after the update, in non-interactive mode. |
--noninteractive |
Do not ask questions. |
-f, --force |
Install the requested version even if it is the same as, or older than, the installed version. |
Warning
Downgrading BrainFrame is not supported, and can cause data loss or instability when the data was written by a
newer version. Back up your data first with brainframe backup.
Early access partners can download from the staging server by setting the BRAINFRAME_STAGING=yes,
BRAINFRAME_STAGING_USERNAME, and BRAINFRAME_STAGING_PASSWORD environment variables.
info¶
Shows where BrainFrame is installed and which version is installed.
brainframe info
install_path: /usr/local/share/brainframe
data_path: /var/local/brainframe
server_version: v0.31.16
To print only one value, name the field. This is useful in scripts:
brainframe info install_path
brainframe info data_path
brainframe info server_version
backup¶
Backs up the server's data directory. The server must be stopped for the backup, so the command stops it first.
sudo brainframe backup
By default, the backup is saved in a new directory named with the current date and time, under backups in the data
path, for example /var/local/brainframe/backups/2026-01-31_10-30-00. The backups directory itself is not copied.
To save the backup in another location, for example on an external drive:
sudo brainframe backup --destination /mnt/backup/brainframe-2026-01-31
The backup uses rsync, which is installed on most systems. Use --install-rsync if it is missing.
| Option | Description |
|---|---|
--destination PATH |
The directory to save the backup in. |
--noninteractive |
Do not ask for confirmation before stopping the server. |
--install-rsync |
Install rsync if it is missing. |
Note
The server is not restarted after the backup. Start it again with brainframe compose up -d.
uninstall¶
Removes the BrainFrame server. It stops the server, deletes the server's Docker images, and deletes the install directory. It does not remove the CLI itself.
sudo brainframe uninstall
By default, the data path is kept. To also delete the data the server has produced, answer yes when asked, or use
--delete-data.
| Option | Description |
|---|---|
--delete-data |
Also delete the data path, including the database and any backups saved in it. This cannot be undone. |
--noninteractive |
Do not ask for confirmation. |
Warning
With --noninteractive, the command does not ask you to confirm. Use --delete-data only when you are sure that
you no longer need the data.
shell¶
Opens a shell in a Docker container that has the BrainFrame command line tools installed, such as
brainframe-apps and
brainframe-sys-tools. You do not need to install the tools with pip.
brainframe shell
Your current directory is mounted in the container at /host, which is also the starting directory, so the files you
create there are saved on your machine. The container is removed when you exit the shell. Docker must be installed
and your user must be allowed to use it.
self-update¶
Updates the CLI itself. This is only for the standalone binary version of the CLI. If you installed the CLI with
pip or a package manager, update it with that tool instead.
brainframe self-update