CLI guide

Install the beetree CLI and take a tree from idea to engine code.

The beetree CLI works on local .beetree.yaml files. It needs no account and no network.

Install

On Linux and macOS, one line installs the latest release after checking its checksum:

curl -fsSL https://beetreecraft.com/install.sh | sh
beetree version

Prefer to download by hand, or on Windows? The Download page has an archive per platform and the steps to verify it.

Your first tree

beetree init                     # creates beetree.yaml, trees/ and subtrees/
beetree new guard                # creates trees/guard.beetree.yaml
beetree builder trees/guard.beetree.yaml   # interactive terminal editor
beetree validate trees/guard.beetree.yaml
beetree render trees/guard.beetree.yaml    # ASCII diagram
beetree simulate trees/guard.beetree.yaml  # dry run with a trace
beetree generate godot trees/guard.beetree.yaml

generate accepts unity, unreal or godot. Generated files marked as stubs are yours to edit and are never overwritten; everything else is regenerated each run.

Unity and Godot output builds the tree in code. Unreal output is the task and decorator classes for Unreal’s own Behavior Tree editor: its README lists the tree node by node, each named by its Unreal counterpart, for you to place in a Behavior Tree asset, and shows how an AI controller runs that asset.

Step through a tree

A dry run shows one trace. To see how a tree reacts when a leaf fails, run beetree simulate trees/guard.beetree.yaml --step. It pauses at each leaf and asks you to choose Success, Failure or Running, then shows how the status moves up through the composites, so you can test the branch you worry about instead of the one the dry run happens to take. It uses the same walker as the TUI.

Sign in

Pulling your own trees and pushing need the terminal signed in to beetreecraft.com. Make an API key on your profile page with the trees:read scope (and trees:write to push), then:

beetree login
beetree whoami

beetree login asks for the key without showing what you type, checks it with the site, and stores it in your config directory, readable by you alone. It never takes the key as an argument, so the key stays out of your shell history; in a script, pipe it in with beetree login --key-stdin < key.txt. beetree whoami says which account and key the terminal uses and what the key’s scopes let it do; the key itself is never printed. beetree logout forgets the key; it keeps working until you revoke it on your profile page.

In CI, set BEETREE_API_KEY instead: when it is set, it is used in place of the stored key.

Find shared trees

beetree search lists the trees people have made public on beetreecraft.com whose name, description or tags contain your words. With no words it lists them all:

beetree search patrol

Each line shows the tree’s name, its author, tags, likes and its id. --json prints the API’s answer for scripts.

To list your own trees, private ones included, sign in and run beetree search --mine. Signed in, a search reads the live listing instead of the daily snapshot.

Fetch a tree into your project

beetree pull writes a tree saved on beetreecraft.com into the current directory, named after the tree. Give it the id that beetree search prints, or the address of the tree’s page:

beetree pull https://beetreecraft.com/app/#/tree/<id>

Pulling needs the terminal signed in with a key that has the trees:read scope. It reads public trees and your own private ones. The first line of the file says where it came from and when. If a file with that name already exists and differs, pull shows what would change and stops; --force replaces it and -o <file> writes elsewhere. Every tree’s page shows its beetree pull line to copy.

Save a tree to your account

beetree push validates a tree file and saves it to your account on beetreecraft.com. A new tree is private; --public shares it, so anyone can find it with beetree search and fetch it with beetree pull:

beetree push guard.beetree.yaml --public

Pushing needs the terminal signed in with a key that has the trees:read and trees:write scopes. When your account already has a tree with the same metadata.name, push shows what changes and updates that tree, keeping its visibility unless --public or --private is given; --new saves a second copy instead. The output prints the address of the tree’s page.

An invalid tree is not sent: push shows the same errors as beetree validate.

Use it in CI

beetree validate exits non-zero on an invalid tree, so it works as a gate:

beetree validate trees/*.beetree.yaml

To check trees on every commit as well, with or without the CLI installed, see Lint trees in pre-commit and CI.

Run beetree doctor to check that a project is set up correctly.

Command reference

Every command and flag is listed in the CLI reference.