Skip to main content

Config

Struct Config 

Source
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: bool

Auto-close parent beans when all children are closed/archived (default: true)

§max_tokens: u32

Maximum 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: u32

Maximum agent loops before stopping (default: 10, 0 = unlimited)

§max_concurrent: u32

Maximum parallel agents for bn run (default: 4)

§poll_interval: u32

Seconds 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: bool

Enable 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

Source

pub fn load(beans_dir: &Path) -> Result<Self>

Load config from .beans/config.yaml inside the given beans directory.

Source

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.

Source

pub fn save(&self, beans_dir: &Path) -> Result<()>

Save config to .beans/config.yaml inside the given beans directory.

Source

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.

Source

pub fn increment_id(&mut self) -> u32

Return the current next_id and increment it for the next call.

Trait Implementations§

Source§

impl Debug for Config

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Config

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Config

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for Config

Source§

fn eq(&self, other: &Config) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Config

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Config

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,