Command summary
Embedded lifecycle
Start in the foreground:--background because foreground mode remains attached until shutdown.
start accepts --port/-p and --host. When the default API port is occupied, it tries the documented local fallback ports and reports the selected port. An explicitly selected occupied port is a conflict. Background start and restart verify all four final service states before returning success; stop verifies that none remains running. Their JSON results include the verified services list, and an unverified transition exits with code 9 plus observed state in error.result.
Startup performs these steps in order:
- Installs embedded dependencies when missing. Downloads require a published SHA-256 checksum and archives reject links and path traversal.
- Starts PostgreSQL, ClickHouse, and Redis.
- Applies PostgreSQL and ClickHouse migrations. Migration failures stop startup; the CLI never stamps a failed PostgreSQL schema as current.
- Starts the API.
- Bootstraps a local admin only on a fresh embedded server and persists the real access and refresh tokens. It never writes placeholder credentials or an API key.
- Attempts telemetry hook installation. Optional hook failures are explicit warnings.
Status and configuration
healthy is false.
Logs
Read a bounded snapshot:service field. Valid services are postgres, clickhouse, redis, and api.
Install and reset
--force:
Docker upgrade
Preview an upgrade:--skip-backup is set, pulls images, atomically updates OBSERVAL_VERSION, recreates containers, and runs the configured health check. A failed health check requests the previous image version again and returns an unavailable error.
JSON mutation requires --force; dry run does not.
Docker rollback
clickhouse_restored: false. Use observal server migrate for ClickHouse export and import.
Docker versions
Error and output contract
All finite commands accept--output table|json. JSON success writes one document to stdout. Failures leave stdout empty and write one categorized error to stderr. Log following is the only JSON Lines stream.
Related
- Database migration
- Self-hosted upgrades
- Backup and restore
observal self, for CLI binary versions

