pub struct Config {Show 17 fields
pub project: String,
pub next_id: u32,
pub auto_close_parent: bool,
pub max_tokens: u32,
pub run: Option<String>,
pub plan: Option<String>,
pub max_loops: u32,
pub max_concurrent: u32,
pub poll_interval: u32,
pub extends: Vec<String>,
pub rules_file: Option<String>,
pub file_locking: bool,
pub on_close: Option<String>,
pub on_fail: Option<String>,
pub post_plan: Option<String>,
pub verify_timeout: Option<u64>,
pub review: Option<ReviewConfig>,
}Fields§
§project: String§next_id: u32§auto_close_parent: boolAuto-close parent beans when all children are closed/archived (default: true)
max_tokens: u32Maximum tokens for bean context (default: 30000)
run: Option<String>Shell command template for --run. Use {id} as placeholder for bean ID.
Example: claude -p "implement bean {id} and run bn close {id}".
If unset, --run will print an error asking the user to configure it.
plan: Option<String>Shell command template for planning large beans. Uses {id} placeholder.
If unset, plan operations will print an error asking the user to configure it.
max_loops: u32Maximum agent loops before stopping (default: 10, 0 = unlimited)
max_concurrent: u32Maximum parallel agents for bn run (default: 4)
poll_interval: u32Seconds between polls in –watch mode (default: 30)
extends: Vec<String>Paths to parent config files to inherit from (lowest to highest priority).
Supports ~/ for home directory. Paths are relative to the project root.
rules_file: Option<String>Path to project rules file, relative to .beans/ directory (default: “RULES.md”).
Contents are injected into every bn context output.
file_locking: boolEnable file locking for concurrent agents (default: false).
When enabled, agents lock files listed in bean paths on spawn
and lock-on-write during execution. Prevents concurrent agents
from clobbering the same file.
on_close: Option<String>Shell command template to run after a bean is successfully closed. Supports template variables: {id}, {title}, {status}, {branch}. Runs asynchronously — failures are logged but don’t affect the close.
on_fail: Option<String>Shell command template to run after a verify attempt fails. Supports template variables: {id}, {title}, {attempt}, {output}, {branch}. Runs asynchronously — failures are logged but don’t affect the operation.
post_plan: Option<String>Shell command template to run after bn plan creates children.
Supports template variables: {id}, {parent}, {children}, {branch}.
Runs asynchronously — failures are logged but don’t affect the plan.
verify_timeout: Option<u64>Default timeout in seconds for verify commands (default: None = no limit).
Per-bean verify_timeout overrides this value.
review: Option<ReviewConfig>Adversarial review configuration (bn review / bn run --review).
Optional — review is disabled if not configured.
Implementations§
Source§impl Config
impl Config
Sourcepub fn load(beans_dir: &Path) -> Result<Self>
pub fn load(beans_dir: &Path) -> Result<Self>
Load config from .beans/config.yaml inside the given beans directory.
Sourcepub fn load_with_extends(beans_dir: &Path) -> Result<Self>
pub fn load_with_extends(beans_dir: &Path) -> Result<Self>
Load config with inheritance from extended configs.
Resolves the extends field, loading parent configs and merging
inheritable fields. Local values take precedence over extended values.
Fields project, next_id, and extends are never inherited.
Sourcepub fn save(&self, beans_dir: &Path) -> Result<()>
pub fn save(&self, beans_dir: &Path) -> Result<()>
Save config to .beans/config.yaml inside the given beans directory.
Sourcepub fn rules_path(&self, beans_dir: &Path) -> PathBuf
pub fn rules_path(&self, beans_dir: &Path) -> PathBuf
Return the path to the project rules file.
Defaults to .beans/RULES.md if rules_file is not set.
The path is resolved relative to the beans directory.
Sourcepub fn increment_id(&mut self) -> u32
pub fn increment_id(&mut self) -> u32
Return the current next_id and increment it for the next call.