安装 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 包默认只包含核心层。用你习惯的包管理器把它添加到项目中即可,这里以 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 运行即可。
完成安装后,继续阅读快速上手。