安装 Bub
Bub 有 CLI 和 SDK 两种使用方式,因此可以根据你的需要选择对应安装方式。
安装 CLI 应用
Section titled “安装 CLI 应用”curl -fsSL https://bub.build/install.sh | bashpowershell -ExecutionPolicy ByPass -c "irm https://bub.build/install.ps1 | iex"uv tool install "bub[app]"uv tool update-shell使用安装脚本时,脚本会安装 uv 和 Python 3.12,并把 bub[app] 安装到当前环境中。app 是 Bub 的可选依赖组,包含 CLI、渠道和插件等应用层能力;只使用 SDK 时不需要它。
完成后执行 bub --help,再运行 bub onboard 开始配置。
安装 SDK
Section titled “安装 SDK”自 0.6.0 起,Bub 默认只包含核心。可以用包管理工具把 Bub 安装到项目中,这里以 uv 为例:
uv add bubuv run python -c "from bub.core import Agent; print(Agent.__name__)"克隆项目仓库,按如下步骤同步依赖即可:
git clone https://github.com/bubbuild/bub.gitcd bubuv sync之后执行 uv run bub 运行即可。