CLI output and automation
Bestie CLI output has two modes: human-facing output for terminals and machine-readable output for scripts. Use the controls on this page when you run Bestie in CI, shell scripts, cron jobs, or other automation.
Disable the banner
Section titled “Disable the banner”Human-facing commands print the Bestie ASCII banner before command output. In an interactive terminal, the banner may animate briefly. In non-interactive output, Bestie prints the static banner.
Suppress the banner for a command:
BESTIE_NO_BANNER=1 bestie statusKeep the banner but disable animation:
BESTIE_BANNER=static bestie statusForce animation when stdout is a TTY:
BESTIE_BANNER=animate bestie statusMachine-readable commands suppress the banner automatically where the CLI entrypoint can identify them.
Disable color
Section titled “Disable color”Bestie uses colored badges, tables, and progress indicators for human output when stdout is a TTY.
Disable ANSI color:
NO_COLOR=1 bestie doctorUse this when capturing command output in scripts or logs that should not contain terminal escape sequences.
Use machine-readable commands
Section titled “Use machine-readable commands”Prefer commands with JSON or raw output when automation needs to parse results.
Doctor JSON:
bestie doctor --jsonChannel Doctor JSON:
bestie channels doctor --channel all --jsonbestie channels doctor --channel telegram --connect --jsonbestie channels doctor --channel zalo --connect --jsonMCP tool call JSON:
bestie mcp call dry-run read_file --read --json '{"path":"README.md"}'Memory JSON and export commands:
bestie memory exportbestie memory analyze --jsonbestie memory cleanup --dry-run --jsonbestie memory cleanup --apply --yes --jsonThese commands are intended to avoid decorative output. For commands that do not have a JSON mode, set BESTIE_NO_BANNER=1 and NO_COLOR=1 before parsing their human output.
Handle update notices
Section titled “Handle update notices”Bestie may print a quiet update notice when a newer npm version is available. The notice tells you the current version, latest version, and the command to apply the update:
Có bản Bestie mới: <current> -> <latest>Chạy `bestie update --apply` để cài bản npm mới nhất.Update notices use a 24-hour cache stored in the runtime data directory. Chat and daemon start or restart paths can trigger the notice.
Check for updates explicitly
Section titled “Check for updates explicitly”Run an explicit npm version check:
bestie updateBestie reads the current package name and version from its installed package.json, asks the npm registry for the latest version, writes update-check.json in the runtime data directory, and prints the current and latest versions.
If npm cannot be reached, Bestie prints the local version, reports that the npm check failed, suggests the manual install command, and exits non-zero.
Apply an available update:
bestie update --apply--apply runs:
npm install -g bestie-agent@latestIf the install command succeeds, open a new terminal if your shell still caches the old bestie binary. If npm exits non-zero, Bestie reports that exit code.
Use --apply only when your environment is allowed to modify the global npm installation. In CI or locked-down hosts, prefer bestie update and let your deployment process decide how to install the new package.
Check exit codes
Section titled “Check exit codes”Doctor exits with a non-zero status when it finds issues:
bestie doctor --json > doctor-report.jsonUse the exit code to fail CI or setup scripts, and use the JSON report to display the checks that failed.
Invalid command arguments also set or return a non-zero exit status. For destructive or state-changing commands, prefer explicit confirmation flags such as --yes, --apply, or --confirm only after a dry run has passed.
Script checklist
Section titled “Script checklist”- Prefer
--jsonor raw export commands when available. - Set
BESTIE_NO_BANNER=1for human-facing commands used in scripts. - Set
NO_COLOR=1when logs should not contain ANSI escape sequences. - Treat update notices as human output, not machine-readable data.
- Keep secrets in
.bestie/.envor environment variables, not command arguments or logs. - Avoid parsing decorative human tables when a JSON command exists.
