Skip to content

CLI Reference 🟑 BETA

This page lists the botserver and advisory commands that exist in source, with their exact flags.

Where this topic sits in the Developer guide

General Usage

The botserver command dispatcher accepts one command per invocation. Its implementation is botserver/crates/botcorepkg/src/cli.rs; a second dispatcher in botcore/src/package_manager/cli/cli_run.rs adds the advisory commands.

Commands Overview

Command Effect
start Start every installed component
stop Stop components through their termination command
restart Stop, wait two seconds, then start installed components
install <component> Install a component; protection is handled separately
remove <component> Remove a component
list Print available components with installed status
status <component> Report whether one component is installed
setup-env [vault-container] Generate .env from a Vault container
version [--all] Print the product version and, with --all, components
rotate-secret <component> Rotate one secret
rotate-secrets --all Rotate every secret
vault <subcommand> Vault operations (see below)
--version / -v, --help / -h Version and usage output
audit Advisory check (gb audit <product> <version>)

Global Options

Option Applies to Meaning
--container install, remove, start, restart, status Use container mode
--container-only install Create the container without completing installation
--tenant <name> install, remove, start, restart, status, list Select a tenant container name
--all version, rotate-secrets All components / full rotation

Component Management

Component names come from get_all_components() in the package manager. The manifest of downloadable components and checksums is botserver/3rdparty.toml; botcorepkg owns installation, listing and removal.

Install a Component

  1. Run botserver install <component>.
  2. Add --container for an Incus container, or --container-only to stop after creating it.
  3. Verify with botserver status <component>.

Remove a Component

botserver remove <component> accepts the same mode and tenant options as install and reports success explicitly.

List Components

botserver list prints each component with * installed or available.

Check Status

botserver status <component> [--container] [--tenant <name>] reports a single component; status protection prints the protection verification instead.

Service Control

start, stop and restart operate on installed components. The desktop sidecar manages the botserver process itself (botapp/src/desktop/sidecar.rs), not through these commands.

Start Services

botserver start starts each installed component and prints success or failure per component.

Stop Services

botserver stop terminates components using their configured termination command.

Restart Services

botserver restart stops components, sleeps two seconds, then starts the installed ones.

Vault Commands

Subcommand Form
migrate vault migrate [env-file]; defaults to .env
put vault put <path> [key=value ...]; interactive when no pairs are given
get vault get <path> [key]
list vault list
health vault health

Prerequisites

Vault must be reachable and unsealed. Credentials come from /tmp/vault-token-gb or the environment; secrets are never written into the repository.

Migrate Secrets from .env

vault migrate <file> reads a dotenv file and stores its values at the documented secret path. After migration, keep only VAULT_* variables in .env (root AGENTS.md, Secrets).

Store Secrets

Use vault put <path> key=value, preferably through a shell history-safe invocation. Paths are listed in the Secret Paths Reference below.

Retrieve Secrets

vault get <path> [key] masks values for a whole-path read and prints a single key when one is named. Drive credentials are read from secret/gbo/drive.

List Secret Paths

vault list prints the configured paths. The canonical paths are secret/gbo/drive, tables, cache, directory, llm, email, encryption and the per-bot LLM path.

Health Check

vault health reports seal status and reachability. A sealed Vault blocks bootstrap until it is unsealed.

Version Information

botserver version prints the workspace version from the root Cargo.toml: 7.1.2. version --all adds the pinned component versions from botserver/3rdparty.toml.

Secret Rotation

rotate-secret <component> accepts tables, drive, cache, email, directory, encryption and jwt. rotate-secrets --all rotates every secret and is guarded by an explicit --all flag.

Rotate Single Component

  1. Run botserver rotate-secret <component>.
  2. Apply the new credential to the component that owns it.
  3. Restart the affected process only after all dependent services are updated.

Rotate All Secrets

rotate-secrets --all prints a warning and must be used with care. Record the old values in /tmp before rotating so a failed update can be reversed.

Post-Rotation Checklist

  1. Update PostgreSQL if the database password changed.
  2. Update OtterIO credentials by creating a new user and migrating data.
  3. Update Valkey if the cache password changed.
  4. Update the directory application secret through its admin console.
  5. Restart botserver and verify /health.

Security Considerations

Rotation changes the secret store; it does not update every consumer. The operator owns the follow-up steps.

Current Limitations

  • The CLI does not reconfigure dependent services automatically.
  • A rotated JWT secret invalidates existing tokens until the new secret is loaded.
  • Rotation output is sensitive: keep it out of logs and issues.

Available Components for Rotation

tables, drive, cache, email, directory, encryption, jwt β€” exactly the list printed by rotate-secret without arguments.

Best Practices

Keep tokens in /tmp/vault-token-gb, use short-lived tokens in production, and enable Vault audit logging. Never commit a .env file.

Verification

After any rotation, check /health, one authenticated request and one chat turn before closing the change.

Complete Setup Example

  1. Install Vault in container mode with --tenant.
  2. Install the vector database component in container mode.
  3. Read the container addresses from the container runtime, not from a hardcoded value.
  4. Export only VAULT_* variables into the shell.
  5. Run vault migrate .env and verify with vault health.
  6. Start botserver and check /health.

Secret Paths Reference

Paths are relative to secret/gbo/: tables, drive, email, llm, stripe, cache, directory, encryption, plus per-bot paths. All credentials are read at runtime through ConfigManager.

Troubleshooting

An unknown command prints usage. A failed installation is diagnosed from component logs and the container runtime; a sealed Vault is diagnosed with vault health.

Security Best Practices

Do not pass secrets as command-line arguments in shared shells; interactive vault put avoids history. Prefer a restricted-permission token file under /tmp.

Token Management

Prefix a sensitive shell command with a space where history control supports it, and store the token file with owner-only permissions.

File Permissions

Secret files belong under /tmp/ with 0600 permissions; the repository contains no secret file.

Vault Hardening

Enable audit logging and short-lived tokens in production; set token TTL in Vault policies.

Network Security

Restrict which container can reach the secret store at the container network layer; do not publish an internal address in documentation.

Credential Rotation Schedule

Rotate on a fixed schedule and immediately after any suspected exposure. Every rotation needs a verification pass.

Incident Response

  1. Rotate all secrets.
  2. Update every consumer with the new values.
  3. Restart affected services.
  4. Review logs and the Vault audit log.
  5. Record the outcome in an issue, without pasting credentials.

Advisory API and gb audit 🟒 STABLE (#2723)

The advisory feed is served by botserver/src/main_module/routes/advisories.rs at GET /api/advisories and GET /api/advisories/:id. The gb audit command in botcorepkg/src/cli_audit.rs accepts a product and version, with --api, --offline, --json and --lang en|pt-BR options.

HTTP API (English)

The list route accepts filters for product, component, severity and publication date; the detail route returns one bulletin.

Configuration

The audit command reads the configured advisory API or a signed offline bundle. Sources are the security scripts and workflows under scripts/security/ and .github/workflows/.

Source of truth

Command forms come from botcorepkg/src/cli.rs, botcorepkg/src/cli_audit.rs and botcore/src/package_manager/cli/cli_run.rs. Product version comes from the root Cargo.toml; component pins come from botserver/3rdparty.toml.

Limits

  • Only the subcommands implemented in cli.rs, cli_run.rs and cli_audit.rs are documented; no flag is inferred.
  • audit is a separate dispatcher (gb), not a botserver subcommand.
  • Rotation never reconfigures consumers automatically.
  • Component versions and checksums are read from botserver/3rdparty.toml; this page does not restate them.