Skip to content

Updating the CLI

The CLI ships as a global npm package and can detect and install newer releases of itself. A passive once-per-day check surfaces a brief notice when you are running behind; the broodnet update command performs the upgrade.

broodnet update fetches the latest published version from the npm registry, compares it against the installed version, and — in interactive terminals — offers to run the appropriate global install command for your package manager.

The command detects common install layouts (npm, pnpm, yarn, bun) and picks the matching install command automatically. When the detection is ambiguous, it falls back to npm i -g @broodnet/cli@latest.

FlagDefaultDescription
--checkReport current and latest versions, then exit. Never prompt, never install.
--yesSkip the confirmation prompt and run the install directly.
--jsonPrint a structured JSON envelope with current, latest, updateAvailable, and the suggested install command. Never prompts or installs.
  • Up to date. The command reports the installed version and exits 0.
  • Update available, interactive. The command prints the current and latest versions and the install command it would run, then asks for confirmation before spawning it. Pass --yes to skip the prompt.
  • Update available, non-interactive. Without --yes, the command prints the install command and exits 0 without running anything. This keeps scripted invocations predictable — they never install unexpectedly.
  • Update available, --json. The envelope carries current, latest, updateAvailable: true, and the suggested command. Nothing is installed. Use this shape to drive your own install logic in scripts.
  • Registry unreachable. The command exits with code 3 (connection error) and code: "CONNECTION" in JSON mode.

The CLI bundles an agent skill file (broodnet skill). After an update, if you previously saved the skill to disk, refresh it so your agent sees the new version:

Terminal window
broodnet skill > SKILL.md

With --json, data includes:

  • current — installed version
  • latest — latest version published to the registry
  • updateAvailabletrue when latest is newer than current
  • command — the install command the CLI would run (e.g. npm i -g @broodnet/cli@latest)
Terminal window
# Human-readable check (no prompt)
broodnet update --check
# Prompt for confirmation, then install
broodnet update
# Install without prompting
broodnet update --yes
# Scripted: emit current / latest / suggested command
broodnet update --json

Each time you run the CLI, it checks the npm registry in the background (at most once every 24 hours) and caches the latest version locally. When a newer version is available, a short notice is written to stderr on subsequent runs:

broodnet 0.3.0 is available (you have 0.2.3)
run: broodnet update

The notice is written to stderr — never stdout — so redirecting or piping command output to another tool is unaffected.

The passive notice and the background check are both skipped when any of the following are true:

  • the CLI was invoked with --json
  • stdout is not a terminal (piped, redirected, or running in CI)
  • BROODNET_NO_UPDATE_CHECK is set to a truthy value
  • the CLI is running in development mode

Set BROODNET_NO_UPDATE_CHECK=1 in your environment to silence the passive notice and prevent the background registry check entirely. The broodnet update command still works on demand.

Terminal window
export BROODNET_NO_UPDATE_CHECK=1