Configuration

Configuration loading for self-bot.

class folderbot.config.WatchConfig[source]

Bases: object

Configuration for file change watching.

The watcher is always running, but notifications are per-user and controlled via enable_file_notifications/disable_file_notifications tools.

include: list[str]
exclude: list[str]
debounce_seconds: float = 2.0
__init__(include=<factory>, exclude=<factory>, debounce_seconds=2.0)
Parameters:
Return type:

None

class folderbot.config.ReadRules[source]

Bases: object

ReadRules(include: list[str] = <factory>, exclude: list[str] = <factory>, append_allowed: list[str] = <factory>)

include: list[str]
exclude: list[str]
append_allowed: list[str]
__init__(include=<factory>, exclude=<factory>, append_allowed=<factory>)
Parameters:
Return type:

None

folderbot.config.migrate_yaml_to_toml(yaml_path)[source]

Migrate a YAML config file to TOML format.

Parameters:

yaml_path (Path) – Path to the .yaml config file.

Return type:

Path | None

Returns:

Path to the new .toml file, or None if migration was skipped.

folderbot.config.find_config_path(start_dir=None)[source]

Find the config file at .folderbot/config.toml in the given directory.

If config.toml doesn’t exist but config.yaml does, auto-migrates to TOML.

Parameters:

start_dir (Optional[Path]) – Directory to check for .folderbot/. Defaults to Path.cwd().

Return type:

Path

Returns:

Path to .folderbot/config.toml (may not exist yet — caller should check).

class folderbot.config.Config[source]

Bases: object

Config(telegram_token: str, root_folder: pathlib._local.Path, allowed_user_ids: list[int], api_key: str = ‘’, user_name: str = ‘User’, read_rules: folderbot.config.ReadRules = <factory>, watch_config: folderbot.config.WatchConfig = <factory>, db_path: pathlib._local.Path = <factory>, todo_path: pathlib._local.Path = <factory>, model: str = ‘anthropic/claude-sonnet-4-20250514’, max_context_chars: int = 100000, max_history_chars: int = 50000, whisper_model: str = ‘base’, google_api_key: str = ‘’, google_cx: str = ‘’, tools: dict[str, dict[str, typing.Any]] = <factory>)

telegram_token: str
root_folder: Path
allowed_user_ids: list[int]
api_key: str = ''
user_name: str = 'User'
read_rules: ReadRules
watch_config: WatchConfig
db_path: Path
todo_path: Path
model: str = 'anthropic/claude-sonnet-4-20250514'
max_context_chars: int = 100000
max_history_chars: int = 50000
whisper_model: str = 'base'
google_api_key: str = ''
google_cx: str = ''
tools: dict[str, dict[str, Any]]
classmethod load(config_path=None, bot_name=None)[source]

Load config from YAML file and/or environment variables.

Parameters:
  • config_path (Optional[Path]) – Path to config file. If None, searches for .folderbot/config.toml in PWD, then ~/.config/folderbot/config.toml.

  • bot_name (Optional[str]) – Name of bot to load (for multi-bot configs). If None and config has multiple bots, raises an error. If config has only one bot, it’s selected automatically.

Return type:

Config

__init__(telegram_token, root_folder, allowed_user_ids, api_key='', user_name='User', read_rules=<factory>, watch_config=<factory>, db_path=<factory>, todo_path=<factory>, model='anthropic/claude-sonnet-4-20250514', max_context_chars=100000, max_history_chars=50000, whisper_model='base', google_api_key='', google_cx='', tools=<factory>)
Parameters:
Return type:

None