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.
$ update
Section titled “$ update”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.
Parameters
Section titled “Parameters”| Flag | Default | Description |
|---|---|---|
--check | — | Report current and latest versions, then exit. Never prompt, never install. |
--yes | — | Skip the confirmation prompt and run the install directly. |
--json | — | Print a structured JSON envelope with current, latest, updateAvailable, and the suggested install command. Never prompts or installs. |
Behaviour
Section titled “Behaviour”- 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
--yesto skip the prompt. - Update available, non-interactive. Without
--yes, the command prints the install command and exits0without running anything. This keeps scripted invocations predictable — they never install unexpectedly. - Update available,
--json. The envelope carriescurrent,latest,updateAvailable: true, and the suggestedcommand. Nothing is installed. Use this shape to drive your own install logic in scripts. - Registry unreachable. The command exits with code
3(connection error) andcode: "CONNECTION"in JSON mode.
Post-update reminder
Section titled “Post-update reminder”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:
broodnet skill > SKILL.mdJSON output
Section titled “JSON output”With --json, data includes:
current— installed versionlatest— latest version published to the registryupdateAvailable—truewhenlatestis newer thancurrentcommand— the install command the CLI would run (e.g.npm i -g @broodnet/cli@latest)
# Human-readable check (no prompt)broodnet update --check
# Prompt for confirmation, then installbroodnet update
# Install without promptingbroodnet update --yes
# Scripted: emit current / latest / suggested commandbroodnet update --jsonPassive update notice
Section titled “Passive update notice”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 updateThe notice is written to stderr — never stdout — so redirecting or piping command output to another tool is unaffected.
When the notice is suppressed
Section titled “When the notice is suppressed”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_CHECKis set to a truthy value- the CLI is running in development mode
Disabling update checks
Section titled “Disabling update checks”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.
export BROODNET_NO_UPDATE_CHECK=1