CodeFizz
ToolsDemoDocsRoadmapChangelogPricingFAQ
Get the plugin

Getting Started

  • Introduction
  • Quick Start
  • Requirements
  • Installing the CLI
  • License & Machines

Guides

  • Installing the Plugin
  • The AI Skill
  • CLI vs MCP
  • Multiple Editors
  • How It Works
  • Discovering Commands

Walkthroughs

  • Build a Blueprint with AI
  • Author a Material Graph
  • Create a Niagara System
  • Rig a Character with AI
  • Build an Animation Blueprint

Reference

  • Reference
  • Control Rig
  • Niagara
  • PCG
  • Materials
  • Behavior Trees
  • Environment Queries
  • StateTree
  • Sequencer
  • Level Actors
  • Project Settings
  • Blueprints
  • Blueprint Structs
  • Enhanced Input
  • Asset Management
  • Bulk Asset Ops
  • Data Assets
  • Object Properties
  • UMG Widgets
  • Data Tables
  • Curves
  • Animation
  • Console Commands
  • Profiling
  • Core
  • Debug

Help

  • FAQ
  • Troubleshooting
  • For AI Agents
DocsReferenceBehavior Trees

Behavior Trees

Every Behavior Trees command in CodeFizz Editor Agent, with parameters and examples.

Loading…
PreviousMaterialsNextEnvironment Queries
CodeFizz

A drop-in Unreal Engine 5 plugin that exposes the entire editor surface (Blueprints, Materials, Niagara, PCG, StateTree, Control Rig, Insights profiling, and more) over the Model Context Protocol. Connect Claude Code, Cursor, VS Code, or any MCP-compatible client and let your AI build inside the engine.

Product

  • Features
  • Docs
  • Tools
  • Demo
  • Roadmap
  • Changelog
  • Pricing
  • FAQ

Resources

  • Install guide
  • Discord
  • YouTube
  • Open-source edition
  • Manage subscription

Legal

  • Refund Policy
  • Privacy Policy
  • Terms of Service

© 2026 CodeFizz. All rights reserved.

CodeFizz Editor Agent is a CodeFizz product. Payments processed by Polar Software, Inc. (Polar), the Merchant of Record.

24 commands. Each shows its parameters and an example, and has a copyable deep link, so you (or an AI agent) can jump straight to one.

search_bt_nodes

Search Behavior Tree node classes, ranked

Searches every composite, task, decorator and service class the editor knows, engine and project alike, including Blueprint-authored nodes that are not loaded yet. Results are ranked: an exact name beats a prefix, a prefix beats a word-boundary hit, and that beats a loose substring. Pass --queries to ask several keywords in one call and get a ranked list per keyword instead of N round trips. Backed by the editor's own class cache, so what comes back is what the node menu shows.

ParameterTypeRequiredDescription
querystringNoKeyword to rank against. Omit to list everything of the chosen kind
queriesstringlistNoSeveral keywords at once; each gets its own ranked list
kindstringNocomposite | task | decorator | service | all
max_resultsintNoMaximum results per query
include_blueprintboolNoInclude Blueprint-authored node classes
include_deprecatedboolNoInclude classes flagged deprecated
example
cfa search_bt_nodes --query move --kind task --max-results 5
cfa search_bt_nodes --queries "move,wait,blackboard" --max-results 3
cfa search_bt_nodes --kind composite
get_bt_node_type_info

Read a node class: its properties and what each accepts

Returns a node class in full: whether it takes children, decorators or services, its class chain, and every editable property with its type, default and tooltip. Blackboard key selector properties additionally report which key types they accept, and when --behavior-tree is given, exactly which keys on that tree's blackboard would be accepted. That is the call to make before set_bt_node_property so a key is never rejected on the way in.

ParameterTypeRequiredDescription
node_classstringYesNode class name, display name or asset path
kindstringNoNarrow the lookup: composite | task | decorator | service
filterstringNoCase-insensitive substring filter on property names
behavior_treestringNoTree whose blackboard is used to report acceptable keys
example
cfa get_bt_node_type_info --node-class BTTask_MoveTo
cfa get_bt_node_type_info --node-class BTDecorator_Blackboard --behavior-tree /Game/AI/BT_Guard
list_blackboard_key_types

List available blackboard key types

Lists every blackboard key type in this project, discovered by reflection rather than a fixed list, so a project's own key type shows up too. Each entry reports the short name add_blackboard_keys takes and the settings that type accepts, such as an Object key's BaseClass or an Enum key's EnumType.

ParameterTypeRequiredDescription
filterstringNoCase-insensitive substring filter on the type name
example
cfa list_blackboard_key_types
create_behavior_tree

Create a Behavior Tree with its graph and Root node

Creates a Behavior Tree and builds its editor graph and Root node, replicating what the Behavior Tree editor does when it opens an asset. The factory alone leaves the graph null, so an asset made any other way opens blank and cannot take nodes. By default a Blackboard named <Name>_BB is created alongside and attached; pass --blackboard to attach an existing one, or --create-blackboard=false for none.

ParameterTypeRequiredDescription
namestringYesAsset name
pathstringNoContent folder
blackboardstringNoExisting Blackboard to attach
create_blackboardboolNoCreate and attach <Name>_BB when no blackboard is given
example
cfa create_behavior_tree --name BT_Guard --path /Game/AI
cfa create_behavior_tree --name BT_Guard --path /Game/AI --blackboard /Game/AI/BB_Shared
create_blackboard

Create a Blackboard

Creates a Blackboard asset. With --parent it inherits that blackboard's keys and the inherited set is refreshed immediately, so the new asset reports its full key list right away.

ParameterTypeRequiredDescription
namestringYesAsset name
pathstringNoContent folder
parentstringNoParent Blackboard to inherit keys from
example
cfa create_blackboard --name BB_Guard --path /Game/AI
cfa create_blackboard --name BB_Elite --path /Game/AI --parent /Game/AI/BB_Guard
set_bt_blackboard

Attach a Blackboard to a Behavior Tree, or set what it inherits from

Attaches a Blackboard and then re-runs the tree's blackboard update, which is what re-resolves every cached key selector on every node and sub-node. Setting the asset without that step leaves stale key IDs behind and nodes silently read the wrong key. --parent instead points the Blackboard at one it inherits keys from, through the engine's own edit path so the inherited keys and the synchronised-key flag are both refreshed; a parent that would form a cycle is refused by name rather than silently cleared the way the engine does it. Pass --parent none to clear it. Either argument may be given on its own.

ParameterTypeRequiredDescription
behavior_treestringNoBehavior Tree to attach the Blackboard to
blackboardstringYesBlackboard path
parentstringNoBlackboard this one inherits keys from; 'none' clears it
example
cfa set_bt_blackboard --behavior-tree /Game/AI/BT_Guard --blackboard /Game/AI/BB_Guard
cfa set_bt_blackboard --blackboard /Game/AI/BB_Guard --parent /Game/AI/BB_Base
create_bt_node_blueprint

Create a Blueprint task, service or decorator

Creates a node Blueprint from the right base class for the kind (BTTask_BlueprintBase, BTService_BlueprintBase, BTDecorator_BlueprintBase) and compiles it. Composites are not Blueprintable in Unreal, so --kind takes task, service or decorator only. The reply names the generated class, which is the name add_bt_node and search_bt_nodes use, and it is not the asset name. Author the graph afterwards with the blueprint graph commands.

ParameterTypeRequiredDescription
namestringYesAsset name
pathstringNoContent folder
kindstringYestask | service | decorator
parent_classstringNoParent class; defaults to the Blueprint base for the kind
example
cfa create_bt_node_blueprint --name BTT_Patrol --kind task --path /Game/AI/Nodes
cfa create_bt_node_blueprint --name BTS_ScanForEnemies --kind service
get_behavior_tree

Read a Behavior Tree as a tree

Returns the tree from the Root down: every node with its stable node_id, class, decorators, services and children, in execution order. Nodes left unconnected are reported separately rather than hidden, because they are still in the asset and still visible in the editor. Use --verbosity summary for ids and classes only, or full to include every node property.

ParameterTypeRequiredDescription
behavior_treestringYesBehavior Tree path
verbositystringNosummary | standard | full
example
cfa get_behavior_tree --behavior-tree /Game/AI/BT_Guard
cfa get_behavior_tree --behavior-tree /Game/AI/BT_Guard --verbosity summary
get_blackboard

Read a Blackboard's keys

Lists a blackboard's keys with their type, per-type detail such as an Object key's base class, instance syncing, description and category. Accepts either a Blackboard path or a Behavior Tree path, in which case the tree's attached blackboard is read. Keys inherited from a parent blackboard are included and flagged.

ParameterTypeRequiredDescription
blackboardstringYesBlackboard path, or a Behavior Tree path
filterstringNoCase-insensitive substring filter on key names
include_inheritedboolNoInclude keys inherited from parent blackboards
example
cfa get_blackboard --blackboard /Game/AI/BB_Guard
cfa get_blackboard --blackboard /Game/AI/BT_Guard --filter target
validate_behavior_tree

Check a Behavior Tree and return a verdict

Compiles the tree and then judges the result, returning pass, pass_with_warnings or fail with the reasons. Errors cover a missing or childless Root, nodes with no runtime instance, and blackboard key selectors pointing at a missing key or a key whose type the property does not accept. Warnings cover a tree with no blackboard, empty composites and unconnected nodes. It compiles first on purpose: judging the in-memory graph alone would pass a tree whose runtime chain never builds.

ParameterTypeRequiredDescription
behavior_treestringYesBehavior Tree path
example
cfa validate_behavior_tree --behavior-tree /Game/AI/BT_Guard
add_bt_node

Add composites and tasks to a Behavior Tree

Places composite and task nodes under a parent and wires them up. Pass --node-class for one node, or --nodes with a JSON array to build a whole subtree in one call: give an entry an "id" and a later entry can name it as its "parent", so a selector and its children land together. Sibling order comes from child_index, which is what the compiled execution order is derived from. Properties are set as the node is placed, and a blackboard key selector takes the key name as a string.

ParameterTypeRequiredDescription
behavior_treestringYesBehavior Tree path
node_classstringNoNode class to place (single-node form)
parentstringNoParent node: root, a node_id, or a unique class name
child_indexintNoPosition among the parent's children; default appended
propertiesstringNoProperties for the new node, as a JSON object
nodesjsonNoJSON array of node specs, added in order. Each may carry "decorators" and "services" arrays to attach sub-nodes in the same call
decoratorsjsonNoDecorators to attach to the node being added (single-node form)
servicesjsonNoServices to attach to the node being added (single-node form)
compileboolNoCompile the tree when done
example
cfa add_bt_node --behavior-tree /Game/AI/BT_Guard --node-class BTComposite_Selector
cfa add_bt_node --behavior-tree /Game/AI/BT_Guard --nodes '[{"node_class":"BTComposite_Selector","parent":"root","id":"sel"},{"node_class":"BTTask_Wait","parent":"sel","properties":{"WaitTime":3.0}}]'
cfa add_bt_node --behavior-tree /Game/AI/BT_Guard --nodes '[{"node_class":"BTComposite_Sequence","parent":"root","decorators":[{"node_class":"BTDecorator_Blackboard","properties":{"BlackboardKey":"HasEnemy"}}],"services":[{"node_class":"BTService_DefaultFocus"}]}]'
add_bt_subnode

Attach decorators and services to a node

Attaches decorators and services, which are sub-nodes owned by a node rather than nodes in the graph. Decorators attach to composites and tasks; services attach to composites only, and asking for anything else is refused with that reason. Use --index to order them, or --sub-nodes with a JSON array to attach several at once.

ParameterTypeRequiredDescription
behavior_treestringYesBehavior Tree path
node_classstringNoDecorator or service class (single form)
parentstringNoNode to attach to: root, a node_id, or a unique class name
indexintNoPosition among that node's decorators or services
propertiesstringNoProperties for the new sub-node, as a JSON object
sub_nodesjsonNoJSON array of sub-node specs
compileboolNoCompile the tree when done
example
cfa add_bt_subnode --behavior-tree /Game/AI/BT_Guard --node-class BTDecorator_Blackboard --parent sel --properties '{"BlackboardKey":"TargetActor"}'
cfa add_bt_subnode --behavior-tree /Game/AI/BT_Guard --sub-nodes '[{"node_class":"BTService_DefaultFocus","parent":"sel"}]'
connect_bt_nodes

Re-parent a node or change its sibling order

Links a child to a parent. A Behavior Tree node has exactly one parent, so the child's existing link is dropped first unless --reparent=false. child_index sets the position among siblings, which is what decides execution order once compiled.

ParameterTypeRequiredDescription
behavior_treestringYesBehavior Tree path
parentstringYesParent node: root, a node_id, or a unique class name
childstringYesChild node: a node_id or a unique class name
child_indexintNoPosition among the parent's children
reparentboolNoDrop the child's existing parent link first
compileboolNoCompile the tree when done
example
cfa connect_bt_nodes --behavior-tree /Game/AI/BT_Guard --parent root --child BTComposite_Sequence --child-index 0
remove_bt_node

Remove a node, a subtree, or a sub-node

Removes a node and, by default, everything below it. Pass --recursive=false to remove just that node and leave its children unparented. Naming a decorator or service detaches it from its owner instead. The Root node cannot be removed.

ParameterTypeRequiredDescription
behavior_treestringYesBehavior Tree path
nodestringYesNode or sub-node: a node_id or a unique class name
recursiveboolNoRemove the node's children too
compileboolNoCompile the tree when done
example
cfa remove_bt_node --behavior-tree /Game/AI/BT_Guard --node BTTask_Wait
set_bt_node_property

Set properties on a node, decorator or service

Writes any reflected property on a node's runtime instance, so every property type works without per-type handling. Setting a decorator's FlowAbortMode (None, LowerPriority, Self, Both) is checked against reality: the engine clamps a mode the parent composite cannot support, so a Sequence turns Both into Self and a Simple Parallel turns everything into None, and the reply reports the change under 'coerced' instead of leaving you with a tree that behaves differently from what you asked for. A blackboard key selector is the one other special case: pass the key name as a plain string and it is resolved against the tree's blackboard. If the key does not exist, or its type is not one the property accepts, the write is refused and the error names the key's actual type and what the property wanted, rather than leaving a tree that compiles and misbehaves. An unknown property name comes back with the close matches.

ParameterTypeRequiredDescription
behavior_treestringYesBehavior Tree path
nodestringYesNode or sub-node: a node_id or a unique class name
propertystringNoProperty name or dotted path
valuestringNoValue to write
propertiesstringNoSeveral properties at once, as a JSON object
indexintNoFor a decorator or service, move it to this position among its owner's sub-nodes
compileboolNoCompile the tree when done
example
cfa set_bt_node_property --behavior-tree /Game/AI/BT_Guard --node BTTask_MoveTo --property BlackboardKey --value TargetActor
cfa set_bt_node_property --behavior-tree /Game/AI/BT_Guard --node BTTask_Wait --properties '{"WaitTime":2.5,"RandomDeviation":0.5}'
compile_behavior_tree

Rebuild the runtime node chain from the graph

Rebuilds parent links, execution order and the runtime node chain from the editor graph. Behavior Trees have no compiler results log, so the honest signal is whether a runtime root came out and what per-node error messages the graph recorded; both are reported. The authoring commands compile by default, so this is for after a batch run with --compile=false.

ParameterTypeRequiredDescription
behavior_treestringYesBehavior Tree path
example
cfa compile_behavior_tree --behavior-tree /Game/AI/BT_Guard
arrange_behavior_tree

Auto-arrange the graph layout

Runs the Behavior Tree editor's own auto-arrange over the graph, then recompiles. The recompile is not optional: node X position is what sibling order is derived from, so a layout pass can change execution order and the tree must be rebuilt to match what is now on screen.

ParameterTypeRequiredDescription
behavior_treestringYesBehavior Tree path
example
cfa arrange_behavior_tree --behavior-tree /Game/AI/BT_Guard
add_bt_composite_decorator

Combine decorators with AND, OR or NOT

Attaches a composite decorator: several decorators combined into one condition. --operator takes and, or or not; and/or need two or more children, not takes exactly one. The inner logic graph is built by the engine from the expression, which is the only workable route because the inner graph node classes carry no API tag in any engine version and cannot be linked at all. Each child is an ordinary decorator with its own properties, so a blackboard key selector still takes the key name and is still type-checked.

ParameterTypeRequiredDescription
behavior_treestringYesBehavior Tree path
parentstringNoNode to attach the composite decorator to
replacestringNonode_id of an existing composite decorator to rewrite in place
operatorstringNoand | or | not
childrenjsonYesJSON array of {node_class, properties} decorators to combine
example
cfa add_bt_composite_decorator --behavior-tree /Game/AI/BT_Guard --parent BTTask_MoveTo --operator and --children '[{"node_class":"BTDecorator_Blackboard","properties":{"BlackboardKey":"HasEnemy"}},{"node_class":"BTDecorator_Blackboard","properties":{"BlackboardKey":"Alert"}}]'
cfa add_bt_composite_decorator --behavior-tree /Game/AI/BT_Guard --parent BTTask_Wait --operator not --children '[{"node_class":"BTDecorator_Blackboard","properties":{"BlackboardKey":"HasEnemy"}}]'
get_bt_runtime

Inspect Behavior Trees running in play

Reports every Behavior Tree component running in PIE: its root and current tree, whether it is running or paused, the engine's own active-task and active-tree debug strings, the active node, and every blackboard key with its live value. Nothing runs in the editor world, so this needs play started. It also states the template-cache rule: a tree executes from a template captured when it first ran and nothing in the engine invalidates it, so editing the asset mid-play changes nothing until play restarts.

ParameterTypeRequiredDescription
actorstringNoOnly components whose owning actor's name contains this
include_blackboardboolNoInclude every blackboard key with its live value
example
cfa get_bt_runtime
cfa get_bt_runtime --actor Enemy --include-blackboard=false
control_bt_runtime

Start, stop, restart, pause or resume running logic

Drives the brain component's own lifecycle on running actors, so a tree can be halted and restarted without leaving play. Applies to every running component unless --actor narrows it.

ParameterTypeRequiredDescription
actionstringYesstart | stop | restart | pause | resume
actorstringNoOnly components whose owning actor's name contains this
example
cfa control_bt_runtime --action restart
cfa control_bt_runtime --action stop --actor Enemy
set_bt_dynamic_subtree

Swap the subtree behind a Run Behavior Dynamic task

Injects a Behavior Tree into a Run Behavior Dynamic task on a running tree. The tag is matched by equality, not by tag hierarchy, so it must equal the task's InjectionTag exactly. This is the only way to change what a running tree does without restarting play, because a plain Run Behavior task is baked into the template. Where no task carries the tag the engine does nothing and says so only in its log, so the reply repeats that caveat.

ParameterTypeRequiredDescription
inject_tagstringYesGameplay tag equal to the task's InjectionTag
subtreestringYesBehavior Tree to inject
actorstringNoOnly components whose owning actor's name contains this
example
cfa set_bt_dynamic_subtree --inject-tag AI.Combat --subtree /Game/AI/BT_Aggressive
add_blackboard_keys

Add keys to a Blackboard

Adds one or many keys in a single edit, following the editor's own add sequence so key IDs and instance-sync state are recomputed exactly as they would be by hand. Per-type settings go in the same call: --base-class for Object and Class keys, --enum-type for Enum and NativeEnum, --struct-type for Struct. Every key type is validated before anything is written, so a bad type in one entry cannot leave the earlier ones half-added.

ParameterTypeRequiredDescription
blackboardstringYesBlackboard path, or a Behavior Tree path
namestringNoKey name (single-key form)
typestringNoBool, Float, Int, Vector, Rotator, String, Name, Object, Class, Enum, NativeEnum, Struct
base_classstringNoFor Object and Class keys, the base class
enum_typestringNoFor Enum and NativeEnum keys, the enum
struct_typestringNoFor Struct keys, the struct
default_valuestringNoStarting value before anything writes to the key, e.g. true, 5.0, or [100,0,50] for a Vector
descriptionstringNoDescription shown in the editor
categorystringNoEditor category for grouping
instance_syncedboolNoSynchronize across every instance of this blackboard
keysjsonNoJSON array of key specs
example
cfa add_blackboard_keys --blackboard /Game/AI/BB_Guard --name TargetActor --type Object --base-class Actor
cfa add_blackboard_keys --blackboard /Game/AI/BB_Guard --keys '[{"name":"HasTarget","type":"Bool"},{"name":"PatrolPoint","type":"Vector"}]'
remove_blackboard_key

Remove a key from a Blackboard

Removes a key and recomputes key IDs. A name that is not there comes back with the list of keys that are, so a typo costs one call rather than two.

ParameterTypeRequiredDescription
blackboardstringYesBlackboard path, or a Behavior Tree path
namestringYesKey name to remove
example
cfa remove_blackboard_key --blackboard /Game/AI/BB_Guard --name PatrolPoint
set_blackboard_key

Rename, retype or edit a Blackboard key

Edits an existing key: rename it, change its type, adjust the per-type settings, or set its description, category and instance syncing. Changing the type replaces the key's type object rather than mutating it, because the class is what defines the key. instance_synced is only applied when actually passed, so the flag's default cannot silently unsync a key you were only renaming.

ParameterTypeRequiredDescription
blackboardstringYesBlackboard path, or a Behavior Tree path
namestringYesKey to edit
new_namestringNoRename the key to this
typestringNoChange the key type
base_classstringNoFor Object and Class keys, the base class
enum_typestringNoFor Enum and NativeEnum keys, the enum
struct_typestringNoFor Struct keys, the struct
default_valuestringNoStarting value before anything writes to the key
descriptionstringNoDescription shown in the editor
categorystringNoEditor category for grouping
instance_syncedboolNoSynchronize across instances; only applied when passed
example
cfa set_blackboard_key --blackboard /Game/AI/BB_Guard --name TargetActor --new-name EnemyActor
cfa set_blackboard_key --blackboard /Game/AI/BB_Guard --name TargetActor --type Object --base-class Pawn