Terminal editor (TUI)

Debug and simulate behavior trees in the terminal: step through each leaf, then build and edit trees without leaving the keyboard.

beetree builder opens a full-screen editor for a .beetree.yaml file. Its best feature is debugging: press r and the tree pauses at every leaf so you decide whether it succeeds, fails or keeps running, then watch how each composite resolves.

beetree builder examples/full-enemy-ai.beetree.yaml

Step through a simulation

Select the tree and press r. The walker visits leaves in tree order and stops at each one. Press S, F or R to answer Success, Failure or Running. Sequences, selectors, parallels and decorators resolve from your answers, so you can reproduce a bug path by hand. Esc stops the run. When the tree finishes, the final status is shown and q returns to editing.

The TUI paused at a leaf during a step-through simulation

Run the whole tree

Press R to run the whole tree at once, unsaved edits included, with the engine beetree simulate uses. A full-screen page shows the final status and the trace: every node entered, every leaf run and the status each node returned. Every leaf answers Success, so this shows the path the tree takes when nothing goes wrong; use r to choose each answer yourself. The arrow keys scroll a long trace, and Esc or q closes the page. A tree that does not validate is not run: the page lists what to fix instead. Subtree references are read from the files next to the tree being edited.

From the shell, beetree simulate <file> prints the same trace, and --override name=FAILURE forces a node’s result. See the CLI reference.

Build and edit

Move with the arrow keys, press a to add a child, e to edit, m to move, u to undo. Press v to validate and s to save. Press ? any time for the in-app help.

Navigating a tree and opening the help overlay in the TUI

Key bindings

ModeKeyAction
NavigateaAdd a child node
NavigateeEdit the selected node
NavigatedDelete the selected node
NavigatecDuplicate the selected node
NavigatemStart a move, then press m on the target to place it
NavigatepEdit node parameters
NavigatebEdit blackboard variables
NavigateuUndo the last change
NavigateURedo
NavigaterRun the step-through simulation
NavigateRRun the whole tree and show the final status and trace
NavigatevValidate the tree
Navigate/Search nodes by name
NavigatesSave
NavigateSSave as a new path
NavigateqQuit (prompts if unsaved)
Navigate?Show the help overlay
NavigateUp/DownMove the selection
NavigateLeft/RightCollapse or expand the node
NavigateEnterCollapse or expand the node
MoveUp/DownChoose the target parent
MovemPlace the node under the target
MoveEscCancel the move
SimulateSResolve the paused leaf as Success
SimulateFResolve the paused leaf as Failure
SimulateRResolve the paused leaf as Running
SimulateEscStop the simulation
SimulateqLeave the finished simulation
EvaluateUp/DownScroll the trace of a full evaluation
EvaluateEscClose the full evaluation
EvaluateqClose the full evaluation