Bub it. Build it. Batteries-included, hook-first AI framework.
Project description
Bub
Bub is a hook-first AI framework built on pluggy: the core stays small and orchestrates turns, while builtins and plugins provide behavior.
Current Implementation
- CLI bootstrap:
src/bub/__main__.py(Typer app) - Turn orchestrator:
src/bub/framework.py - Hook contract:
src/bub/hookspecs.py - Builtin hooks/runtime:
src/bub/builtin/hook_impl.py+src/bub/builtin/engine.py - Skill discovery and validation:
src/bub/skills.py
Quick Start
git clone https://github.com/bubbuild/bub.git
cd bub
uv sync
uv run bub --help
# Runtime off: falls back to model_output=prompt
BUB_RUNTIME_ENABLED=0 uv run bub run "hello"
# Internal command mode (line starts with ',')
BUB_RUNTIME_ENABLED=0 uv run bub run ",help"
# Model runtime (hosted providers usually require a key)
BUB_API_KEY=your_key uv run bub run "Summarize this repository"
CLI Commands
bub run MESSAGE: execute one inbound turn and print outbound messagesbub hooks: print hook-to-plugin bindingsbub install PLUGIN_SPEC: install plugin from PyPI orowner/repo(GitHub shorthand)
Runtime Behavior
- Regular text input: uses
run_model; if runtime is unavailable, output falls back to the prompt text - Comma commands:
,help,,tools,,fs.read ..., etc. - Unknown comma commands: executed as
bash -lcin workspace - Session event log:
.bub/runtime/<session-hash>.jsonl AGENTS.md: if present in workspace, appended to runtime system prompt
Skills
- Discovery roots with deterministic override:
<workspace>/.agent/skills~/.agent/skillssrc/bub_skills
- Each skill directory must include
SKILL.md - Supported frontmatter fields:
- required:
name,description - optional:
license,compatibility,metadata,allowed-tools
- required:
Plugin Development
Plugins are loaded from Python entry points in group="bub":
[project.entry-points."bub"]
my_plugin = "my_package.my_plugin"
Implement hooks with @hookimpl following BubHookSpecs.
Runtime Environment Variables
BUB_RUNTIME_ENABLED:auto(default),1,0BUB_MODEL: defaultopenrouter:qwen/qwen3-coder-nextBUB_API_KEY: runtime provider keyBUB_API_BASE: optional provider base URLBUB_RUNTIME_MAX_STEPS: default8BUB_RUNTIME_MAX_TOKENS: default1024BUB_RUNTIME_MODEL_TIMEOUT_SECONDS: default90
Documentation
docs/index.md: overviewdocs/architecture.md: lifecycle, precedence, and failure isolationdocs/skills.md: skill discovery and frontmatter constraintsdocs/cli.md: CLI usage and comma command modedocs/features.md: implemented capabilities and limits
Development Checks
uv run ruff check .
uv run mypy src
uv run pytest -q
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bub-0.3.0a1.tar.gz.
File metadata
- Download URL: bub-0.3.0a1.tar.gz
- Upload date:
- Size: 64.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
293c2a6553446d9217dcb9d976b9fdab15ac75eb5d043f241da21d7a36efc332
|
|
| MD5 |
4b418f68014c45d76843fc05877f5d68
|
|
| BLAKE2b-256 |
41d358aa6a2de465f8b3a65f9a0ac6b2c521cefb428a9d8efa491f1c32b0b37d
|
File details
Details for the file bub-0.3.0a1-py3-none-any.whl.
File metadata
- Download URL: bub-0.3.0a1-py3-none-any.whl
- Upload date:
- Size: 74.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6358e827453737ed45a474e77b068791d6883eaa1622343896fb5b71efc661a7
|
|
| MD5 |
13f05b494761ea2c15f87fcb5cb77549
|
|
| BLAKE2b-256 |
d6d38c609754c14c23360decdcaecae2e24b257927c2fd153c789483d9c58c84
|