Skip to content

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.

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:

Terminal window
BESTIE_NO_BANNER=1 bestie status

Keep the banner but disable animation:

Terminal window
BESTIE_BANNER=static bestie status

Force animation when stdout is a TTY:

Terminal window
BESTIE_BANNER=animate bestie status

Machine-readable commands suppress the banner automatically where the CLI entrypoint can identify them.

Bestie uses colored badges, tables, and progress indicators for human output when stdout is a TTY.

Disable ANSI color:

Terminal window
NO_COLOR=1 bestie doctor

Use this when capturing command output in scripts or logs that should not contain terminal escape sequences.

Prefer commands with JSON or raw output when automation needs to parse results.

Doctor JSON:

Terminal window
bestie doctor --json

Channel Doctor JSON:

Terminal window
bestie channels doctor --channel all --json
bestie channels doctor --channel telegram --connect --json
bestie channels doctor --channel zalo --connect --json

MCP tool call JSON:

Terminal window
bestie mcp call dry-run read_file --read --json '{"path":"README.md"}'

Memory JSON and export commands:

Terminal window
bestie memory export
bestie memory analyze --json
bestie memory cleanup --dry-run --json
bestie memory cleanup --apply --yes --json

These 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.

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.

Run an explicit npm version check:

Terminal window
bestie update

Bestie 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:

Terminal window
bestie update --apply

--apply runs:

Terminal window
npm install -g bestie-agent@latest

If 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.

Doctor exits with a non-zero status when it finds issues:

Terminal window
bestie doctor --json > doctor-report.json

Use 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.

  • Prefer --json or raw export commands when available.
  • Set BESTIE_NO_BANNER=1 for human-facing commands used in scripts.
  • Set NO_COLOR=1 when logs should not contain ANSI escape sequences.
  • Treat update notices as human output, not machine-readable data.
  • Keep secrets in .bestie/.env or environment variables, not command arguments or logs.
  • Avoid parsing decorative human tables when a JSON command exists.