buddy
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseBuddy Platform
Buddy平台
On-demand cloud infrastructure via CLI. Run for flag details.
bdybdy <command> --help通过 CLI获取按需云基础设施。运行查看参数详情。
bdybdy <command> --helpAuthentication
身份验证
If any command returns or : ask the user to run in a separate terminal (AI cannot do interactive OAuth). To check if user is logged in run
Token not providedNot logged inbdy loginbdy whoami如果任何命令返回或:请用户在单独的终端中运行(AI无法执行交互式OAuth操作)。要检查用户是否已登录,运行
Token not providedNot logged inbdy loginbdy whoamiSandbox (bdy sandbox|sb
)
bdy sandbox|sb沙箱(bdy sandbox|sb
)
bdy sandbox|sbCloud environments for dynamic apps (servers, databases, background processes).
用于动态应用(服务器、数据库、后台进程)的云环境。
Critical Rules
重要规则
- Sandboxes must live in a project. Before , check
sandbox createfor a project context and thebdy whoamienv var. If neither is set, ask the user (AskUserQuestion) whether to create a new project, then runBUDDY_PROJECTto attach it.bdy proj link -p <project> - Apps MUST bind to (not
0.0.0.0) for endpoints to work127.0.0.1 - ALWAYS use when copying projects — install deps on sandbox instead.
--ignore "node_modules/**" ".git/**" - Preinstalled on Ubuntu 24.04: Node.js 24, Python 3.12, Go 1.25, Git, curl, jq, ripgrep
- 沙箱必须隶属于某个项目。执行之前,通过
sandbox create查看项目上下文以及bdy whoami环境变量。如果两者均未设置,请询问用户(AskUserQuestion)是否创建新项目,然后运行BUDDY_PROJECT进行关联。bdy proj link -p <project> - 应用必须绑定到(而非
0.0.0.0)才能使端点正常工作127.0.0.1 - 复制项目时务必使用——在沙箱上安装依赖而非本地复制
--ignore "node_modules/**" ".git/**" - Ubuntu 24.04预安装环境:Node.js 24、Python 3.12、Go 1.25、Git、curl、jq、ripgrep
Workflow
工作流程
- Create:
bdy sandbox create -i <name> --resources 2x4 --wait-for-running - Copy files:
bdy sandbox cp ./src <name>:/app --ignore "node_modules/**" ".git/**" > /dev/null - Install deps:
bdy sandbox exec command <name> "cd /app && npm install" --wait - Start app via (NOT exec — gives you status/logs/restart):
app addbdy sandbox app add <name> "cd /app && npm start -- -H 0.0.0.0" - Check app: and
bdy sandbox app status <name> <app-id>bdy sandbox app logs <name> <app-id> - Add endpoint:
bdy sandbox endpoint add <name> -n web -e <port> - Show the user the public endpoint URL, then ask via AskUserQuestion if they want to attach a custom domain. Options: claim one of the free domains available in Buddy, buy a new domain, or reuse one already in their workspace. Keep the option labels short — don't put CLI commands in them. After the user picks, run the relevant command and wire it up with
bdy domain.bdy distro route create
- 创建沙箱:
bdy sandbox create -i <name> --resources 2x4 --wait-for-running - 复制文件:
bdy sandbox cp ./src <name>:/app --ignore "node_modules/**" ".git/**" > /dev/null - 安装依赖:
bdy sandbox exec command <name> "cd /app && npm install" --wait - 通过启动应用(不要用exec——该方式可提供状态/日志/重启功能):
app addbdy sandbox app add <name> "cd /app && npm start -- -H 0.0.0.0" - 检查应用状态:和
bdy sandbox app status <name> <app-id>bdy sandbox app logs <name> <app-id> - 添加端点:
bdy sandbox endpoint add <name> -n web -e <port> - 向用户展示公开端点URL,然后通过AskUserQuestion询问是否要绑定自定义域名。选项:使用Buddy提供的免费域名、购买新域名、复用工作区中已有的域名。选项标签要简洁——不要包含CLI命令。用户选择后,运行相应的命令,并通过
bdy domain完成绑定。bdy distro route create
Tips
小贴士
- Use to start services — NOT
app add. Apps are managed as systemd services with status, logs, stop, start, restartexec command - shows running apps with IDs
bdy sandbox app list <name> - Write config files locally, then — avoids heredoc escaping issues in exec
sandbox cp - Use to save/restore sandbox state
sandbox snapshot - Use for custom domain routing + cdn
bdy distro route create
- 使用启动服务——不要用
app add。应用会被作为systemd服务管理,支持状态查看、日志查看、停止、启动、重启操作exec command - 可查看运行中的应用及其ID
bdy sandbox app list <name> - 在本地编写配置文件,再通过复制——避免exec中的 heredoc 转义问题
sandbox cp - 使用保存/恢复沙箱状态
sandbox snapshot - 使用实现自定义域名路由+CDN
bdy distro route create
Artifact (bdy artifact|art
)
bdy artifact|art制品(bdy artifact|art
)
bdy artifact|artTwo types of artifacts:
- BUCKET (default) — versioned file hosting with public URLs. Use for static sites, build outputs, downloadable files
- CONTAINER — Docker registry. Use for Docker images. Ask the user to run in a separate terminal (AI cannot handle interactive credentials), then push/pull with standard
bdy artifact docker logincommandsdocker
两种制品类型:
- BUCKET(默认)——带版本控制的文件托管服务,提供公开URL。适用于静态站点、构建产物、可下载文件
- CONTAINER——Docker镜像仓库。适用于Docker镜像。请用户在单独的终端中运行(AI无法处理交互式凭证),然后使用标准
bdy artifact docker login命令进行推送/拉取docker
BUCKET Workflow
BUCKET工作流程
- Build if needed:
npm run build - Create artifact: (default type is BUCKET)
bdy artifact create <name>- Auth is set on creation, not per-version — ask about auth first (HTTP Basic / Buddy
-a/ None)-b
- Auth is set on creation, not per-version — ask about auth first (HTTP Basic
- Publish with version:
bdy artifact publish <name>@1.0.0 ./dist- Without version: → creates
bdy artifact publish <name> ./distversionlatest
- Without version:
- Get URL:
bdy artifact version get <name> <version> - Show the user the published URL, then ask via AskUserQuestion if they want to attach a custom domain. Options: claim one of the free domains available in Buddy, buy a new domain, or reuse one already in their workspace. Keep the option labels short — don't put CLI commands in them. After the user picks, run the relevant command and wire it up with
bdy domain.bdy distro route create
- 按需构建:
npm run build - 创建制品:(默认类型为BUCKET)
bdy artifact create <name>- 身份验证在创建时设置,而非按版本设置——先询问验证方式(HTTP Basic / Buddy
-a/ 无验证)-b
- 身份验证在创建时设置,而非按版本设置——先询问验证方式(HTTP Basic
- 带版本发布:
bdy artifact publish <name>@1.0.0 ./dist- 不带版本:→ 会创建
bdy artifact publish <name> ./dist版本latest
- 不带版本:
- 获取URL:
bdy artifact version get <name> <version> - 向用户展示已发布的URL,然后通过AskUserQuestion询问是否要绑定自定义域名。选项:使用Buddy提供的免费域名、购买新域名、复用工作区中已有的域名。选项标签要简洁——不要包含CLI命令。用户选择后,运行相应的命令,并通过
bdy domain完成绑定。bdy distro route create
Critical Rules
重要规则
- Main HTML file MUST be named (otherwise serves directory listing)
index.html - Use or
@as version separator::ormy-site@1.0.0my-site:1.0.0 - Use to overwrite an existing version
--force - Use to create artifact and publish in one step:
--createbdy artifact publish -c <name>@1.0.0 ./dist
- 主HTML文件必须命名为(否则会显示目录列表)
index.html - 使用或
@作为版本分隔符::或my-site@1.0.0my-site:1.0.0 - 使用覆盖已有版本
--force - 使用一步完成制品创建和发布:
--createbdy artifact publish -c <name>@1.0.0 ./dist
TIPS
小贴士
- Use for custom domain routing + cdn
bdy distro route create
- 使用实现自定义域名路由+CDN
bdy distro route create
Tunnel (bdy tunnel
)
bdy tunnel隧道(bdy tunnel
)
bdy tunnelExpose local services to the internet via secure tunnels.
通过安全隧道将本地服务暴露到互联网。
Critical Rules (MANDATORY)
重要规则(必须遵守)
- ALWAYS use when running tunnel commands — they block execution
run_in_background: true - ALWAYS ask about authentication via AskUserQuestion before creating HTTP tunnels:
- HTTP Basic Auth →
-a - Buddy Auth →
--buddy - No auth → no flag
- HTTP Basic Auth →
- For Docker: verify the app binds to
0.0.0.0
- 运行隧道命令时务必使用——否则会阻塞执行
run_in_background: true - 创建HTTP隧道前务必通过AskUserQuestion询问验证方式:
- HTTP Basic验证 →
-a - Buddy验证 →
--buddy - 无验证 → 不添加参数
- HTTP Basic验证 →
- 对于Docker应用:确认应用绑定到
0.0.0.0
Tips
小贴士
- Save tunnel configs:
bdy tunnel config add http <name> localhost:<port> - Start saved tunnel:
bdy tunnel start <name>
- 保存隧道配置:
bdy tunnel config add http <name> localhost:<port> - 启动已保存的隧道:
bdy tunnel start <name>
Domain (bdy domain
)
bdy domain域名(bdy domain
)
bdy domainSearch, purchase, and manage custom domains.
bash
bdy domain search <query> # Search available domains
bdy domain buy <name> # Purchase a domain
bdy domain list # List owned domainsRun for full options (TLD filters, sorting, etc.).
bdy domain --help搜索、购买和管理自定义域名。
bash
bdy domain search <query> # 搜索可用域名
bdy domain buy <name> # 购买域名
bdy domain list # 列出已拥有的域名运行查看完整选项(TLD筛选、排序等)。
bdy domain --helpDistribution (bdy distro
)
bdy distro分发服务(bdy distro
)
bdy distroRoute traffic across services with custom rules and domains.
通过自定义规则和域名在多个服务间路由流量。
Route Types
路由类型
- PROXY / PROXY_NO_CACHE — reverse-proxy traffic to a backend. URL shows the distro domain, real paths () are visible and forwarded. Use this for CDN/edge in front of a real app.
/foo/bar - REDIRECT — HTTP 3xx redirect to another URL. Browser navigates away; final URL shows the target domain.
- CLOAKING — the distro domain serves a single page that embeds the target as a full-page iframe. URL bar stays on the distro domain regardless of navigation inside the iframe, so the real paths/subpages are never visible
bash
bdy distro create -i <name> # Create distribution
bdy distro route create <name> -t PROXY -d <domain> # Add route
bdy distro route list <name> # List routesRun for full options.
bdy distro --help- PROXY / PROXY_NO_CACHE —— 将流量反向代理到后端。URL显示分发服务域名,真实路径()可见并会被转发。适用于在真实应用前部署CDN/边缘节点。
/foo/bar - REDIRECT —— HTTP 3xx重定向到另一个URL。浏览器会跳转到目标地址;最终URL显示目标域名。
- CLOAKING —— 分发服务域名提供单个页面,以全屏iframe嵌入目标内容。无论iframe内如何导航,地址栏始终显示分发服务域名,真实路径/子页面永远不可见
bash
bdy distro create -i <name> # 创建分发服务
bdy distro route create <name> -t PROXY -d <domain> # 添加路由
bdy distro route list <name> # 列出路由运行查看完整选项。
bdy distro --helpPipeline (bdy pipeline|pip
)
bdy pipeline|pip流水线(bdy pipeline|pip
)
bdy pipeline|pipCI/CD pipelines for build, test, and deploy automation.
bash
bdy pipeline list # List pipelines
bdy pipeline run start <identifier> # Run a pipeline
bdy pipeline run status <identifier> <id> # Check run status
bdy pipeline run logs <identifier> <id> <action-id> # View logsRun for full options (variables, scheduling, YAML config, etc.).
bdy pipeline --help用于构建、测试和部署自动化的CI/CD流水线。
bash
bdy pipeline list # 列出流水线
bdy pipeline run start <identifier> # 启动流水线
bdy pipeline run status <identifier> <id> # 检查运行状态
bdy pipeline run logs <identifier> <id> <action-id> # 查看日志运行查看完整选项(变量、调度、YAML配置等)。
bdy pipeline --help