pub struct Config {
pub http_proxy: String,
pub https_proxy: String,
pub proxy_auth: Option<ProxyAuth>,
pub model: Option<String>,
pub headless_auth: bool,
pub provider: String,
pub providers: ProviderConfigs,
pub server: ServerConfig,
pub data_dir: PathBuf,
}Expand description
Main configuration structure for Bamboo agent
Contains all settings needed to run the agent, including provider credentials, proxy settings, model selection, and server configuration.
Fields§
§http_proxy: StringHTTP proxy URL (e.g., http://proxy.example.com:8080)
https_proxy: StringHTTPS proxy URL (e.g., https://proxy.example.com:8080)
proxy_auth: Option<ProxyAuth>Proxy authentication credentials
model: Option<String>Default model to use (can be overridden per provider)
headless_auth: boolDeprecated: Use providers.copilot.headless_auth instead
provider: StringDefault LLM provider to use (e.g., “anthropic”, “openai”, “gemini”, “copilot”)
providers: ProviderConfigsProvider-specific configurations
server: ServerConfigHTTP server configuration
data_dir: PathBufData directory path (defaults to ~/.bamboo)
Implementations§
Source§impl Config
impl Config
Sourcepub fn new() -> Self
pub fn new() -> Self
Load configuration from file with environment variable overrides
Configuration loading order:
- Try loading from
config.json(data_dir/config.json) - Migrate old format if detected
- Fallback to
config.tomlin current directory - Use defaults
- Apply environment variable overrides (highest priority)
§Environment Variables
BAMBOO_PORT: Override server portBAMBOO_BIND: Override bind addressBAMBOO_DATA_DIR: Override data directoryBAMBOO_PROVIDER: Override default providerMODEL: Default model nameBAMBOO_HEADLESS: Enable headless authentication mode
Sourcepub fn from_data_dir(data_dir: Option<PathBuf>) -> Self
pub fn from_data_dir(data_dir: Option<PathBuf>) -> Self
Load configuration from a specific data directory
§Arguments
data_dir- Optional data directory path. If None, uses default (~/.bamboo)
Sourcepub fn server_addr(&self) -> String
pub fn server_addr(&self) -> String
Get the full server address (bind:port)