@bugbug-io/cli

中文文档
14.22.0发布于 2026/11/05MITES Module零依赖近 30 天下载 2529

BugBug CLI for test automation, CI workflows, and AI-agent plugin installation

原始使用文档
文档目录18 节
  1. Requirements
  2. Install the CLI
  3. Sign in and run your first test
  4. Link a repo to a BugBug project
  5. Environment Variables
  6. Commands
  7. Auth
  8. Project
  9. Tests
  10. Test Runs
  11. Suites
  12. Suite Runs
  13. Profiles
  14. Tags
  15. AI Clients (plugin: MCP + Skills)
  16. Shorthands
  17. Global Options
  18. License

BugBug logo

BugBug CLI

Requirements

  • Node.js v24 or higher
  • BugBug account or API token

Install the CLI

npm install -g @bugbug-io/cli
bugbug --help

Or run it without a global install:

npx @bugbug-io/cli --help

CLI and MCP access require a BugBug Pro plan or higher. The bundled BugBug skills are available on all plans.

Sign in and run your first test

bugbug login
bugbug tests run <testId>

bugbug login opens a browser and stores CLI credentials. For CI or scripted use, provide an API token with --token or BUGBUG_API_TOKEN.

For self-hosted MCP clients, see bearer token setup.

Run bugbug init inside your repository to pin that directory to one BugBug project:

bugbug init

Interactively it asks how to authenticate - browser login, or a pasted project or organization API token - and then lets you pick the project to link. The authentication step is skipped if you already ran bugbug login. In CI or any non-interactive shell, pass both values instead:

bugbug --token <api-token> --project-id <project-id> init

bugbug project init is the same command.

Init writes projectId into a bugbug.yaml in the current directory and stores the token separately in the global config at ~/.bugbug/config.yaml, keyed by that project. Commands run from that directory - or any subdirectory - then resolve the project and token on their own, so bugbug tests list needs no flags. bugbug.yaml is safe to commit; the token is never written to it.

Environment Variables

VariableDescription
BUGBUG_API_TOKENAPI token used to authenticate requests
BUGBUG_PROJECT_IDProject ID (required for organization tokens in non-interactive mode)
BUGBUG_LOG_LEVELLog level; set to debug to enable verbose logging
BUGBUG_TELEMETRYSet to false to disable telemetry
DO_NOT_TRACKStandard opt-out; set to 1/true to disable telemetry
CIWhen true, forces plain (non-interactive) output

Commands

Run bugbug with no arguments for the interactive navigator, or bugbug <command> --help for details on any command.

Auth

bugbug login          # Authenticate and store a user token in the global config
bugbug logout         # Clear the stored user token and current project

Project

bugbug init                       # Create bugbug.yaml pinning this directory to a project
bugbug project settings           # Read project settings
bugbug project export             # Export project as a ZIP (bugbug-project-export-<timestamp>.zip)
bugbug project export -o out.zip  # Export to a specific file
bugbug project import out.zip     # Import a project from a ZIP archive

Tests

bugbug tests list                 # List tests
bugbug tests list -s "login"      # Filter tests by name
bugbug tests show <testId>         # Show test details
bugbug tests run <testId>          # Run a test (waits for completion by default)
bugbug tests run <testId> --profile "Production"
bugbug tests run <testId> --tag smoke --tag critical
bugbug tests run <testId> --variable FOO=bar --variable BAZ=qux
bugbug tests run <testId> --no-wait        # Queue the run and exit immediately
bugbug tests run <testId> --reporter junit --output-path report.xml
bugbug tests tags set <testId> --tag smoke # Replace test tags by name
bugbug tests tags set <testId>             # Clear test tags
bugbug tests export <testId> --format yaml
bugbug tests export <testId> --format zip -o test.zip
bugbug tests import test.yaml             # Import a test from YAML or ZIP (--folder-id <id> to choose a test folder)

Test Runs

bugbug testruns show <runId>               # Show the result of a test run
bugbug testruns logs <runId>               # Get logs for a test run
bugbug testruns stop <runId>               # Stop a running test run
bugbug testruns report <runId> -o out.xml  # Get the JUnit XML report
bugbug testruns tags set <runId> --tag flaky
bugbug testruns tags set <runId>           # Clear directly assigned run tags
bugbug testruns notes set <runId> "Retried successfully"
bugbug testruns notes set <runId>           # Clear run notes

Suites

bugbug suites list                # List suites
bugbug suites list -s "checkout"  # Filter suites by name
bugbug suites show <suiteId>       # Show suite details
bugbug suites run <suiteId>        # Run a suite (waits for completion by default)
bugbug suites run <suiteId> --profile "Production" --variable FOO=bar
bugbug suites run <suiteId> --tag smoke
bugbug suites run <suiteId> --no-wait
bugbug suites tags set <suiteId> --tag regression
bugbug suites tags set <suiteId>   # Clear suite tags

Suite Runs

bugbug suiteruns show <runId>              # Show the result of a suite run (--compact: failed tests only)
bugbug suiteruns stop <runId>              # Stop a running suite run
bugbug suiteruns report <runId> -o out.xml # Get the JUnit XML report
bugbug suiteruns tags set <runId> --tag nightly
bugbug suiteruns tags set <runId>          # Clear directly assigned run tags
bugbug suiteruns notes set <runId> "Nightly follow-up"
bugbug suiteruns notes set <runId>         # Clear run notes

Profiles

bugbug profiles list              # List run profiles

Tags

bugbug tags list                  # List tags in the active project
bugbug --json tags list           # Emit tag details as JSON

AI Clients (plugin: MCP + Skills)

bugbug plugin --agent=<agent>
bugbug plugin --agent=<agent> --dry-run  # Show what would be installed, writing nothing

Supported --agent values: cursor, claude, vscode, codex, copilot.

Shorthands

Verb-first shorthands map onto the namespaced commands above:

bugbug run test <testId>
bugbug run suite <suiteId>
bugbug list test
bugbug list suite
bugbug list profile
bugbug stop test <runId>
bugbug stop suite <runId>
bugbug report test <runId>
bugbug report suite <runId>
bugbug logs test <runId>
bugbug export project
bugbug export test <testId>
bugbug import project export.zip
bugbug import test test.yaml

Global Options

  • -t, --token <token>: API token for BugBug (overrides config)
  • -p, --project-id <projectId>: Project ID (required only for organization tokens in non-interactive mode)
  • -v, --verbose: Enable verbose logging including HTTP requests
  • --ci: CI-friendly output (plain logs, no interactive UI, exit 1 on failure)
  • --json: Emit JSON output (implies non-interactive)
  • --disable-telemetry: Disable telemetry
  • -h, --help: Show help information

License

MIT

版本与发布记录

@bugbug-io/cli 共发布 41 个版本,首次发布于 2026/08/20;过去 12 个月发布了 41 个版本。

版本发布日期距今
14.22.0latest2026/11/053 天前
14.21.02026/11/035 天前
14.20.02026/10/2910 天前
14.19.12026/10/2712 天前
14.19.02026/10/2712 天前
14.18.02026/10/2217 天前

关于 @bugbug-io/cli 的常见问题

@bugbug-io/cli 是什么?

BugBug CLI for test automation, CI workflows, and AI-agent plugin installation

如何安装 @bugbug-io/cli?

在项目目录运行 npm install @bugbug-io/cli,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 bugbug,可以用 npx bugbug 直接运行。

@bugbug-io/cli 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/bugbug-io__cli 是否存在。

@bugbug-io/cli 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@bugbug-io/cli 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=24。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@bugbug-io/cli 可以商用吗?

@bugbug-io/cli 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@bugbug-io/cli 的下载量有多少?

根据 npm 官方下载统计,@bugbug-io/cli 在 2026/10/09 – 2026/11/07 这 30 天内被下载 2,529 次,日均约 84 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@bugbug-io/cli 还在维护吗?

最新版本 14.22.0 发布于 2026/11/05(3 天前);至今共发布 41 个版本,其中过去 12 个月发布了 41 个;首次发布于 2026/08/20。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。