Skip to content

CLI Reference

The odeion binary has five subcommands:

  • serve (the default): starts the HTTP server. Running odeion with flags but no subcommand is a shorthand for odeion serve.
  • psql: opens a psql session against the embedded database.
  • doctor: collects a diagnostic bundle for bug reports.
  • reset-password: generates a password recovery link for a user when an admin is locked out.
  • config: read and write server settings as YAML. See Configuration.

Database migrations run automatically on server startup.

Starts the HTTP server.

FlagEnv VariableDefaultDescription
--database-urlDATABASE_URL(required)PostgreSQL connection URL, or local for embedded postgres
--portODEION_PORT8080HTTP port
--data-dirODEION_DATA_DIRPlatform defaultPersistent data directory for databases, caches, logs, and thumbnails
--versionPrint version info and exit

The server always binds to 0.0.0.0 on the specified port.

Terminal window
# Start with an external PostgreSQL database
odeion serve --database-url "postgres://user:pass@localhost/odeion"
# Start with embedded postgres (data stored in --data-dir)
odeion serve --database-url local --port 3000
# Using environment variables
DATABASE_URL=local ODEION_PORT=3000 odeion serve

Opens a psql session connected to the embedded PostgreSQL database. Only works while odeion serve is running. Requires the psql client binary on PATH (the official Docker image ships it).

By default connects as a read-only role (odeion_ro) that only has SELECT on the schema. Pass --full-access to connect as the superuser.

FlagDefaultDescription
--data-dirMatches serveMust point at the same data directory the server is using
--database-urllocalOnly local is supported. For external DBs, use psql directly
--full-accessfalseConnect as the superuser instead of the read-only role

Arguments after -- are forwarded to psql verbatim:

Terminal window
# Interactive read-only session
odeion psql
# Run a one-off query
odeion psql -- -c 'SELECT count(*) FROM users'
# Full admin access (for writes / DDL)
odeion psql --full-access -- -c 'VACUUM ANALYZE'
# Execute a script
odeion psql --full-access -- -f migration.sql

Collects a diagnostic bundle (system info, embedded postgres state, redacted logs, admin settings) into a single zip suitable for attaching to a bug report or sending to support.

Terminal window
# Default: all sections, redacted, unencrypted
odeion doctor
# Server is broken, grab everything else
odeion doctor --no-db
# Encrypt for secure transfer to support
odeion doctor --age-recipient=age1qz...zk2

See Debugging for the full flag list, what’s collected, how redaction works, and how the age encryption flow works.

Generates a one-time password recovery link for a user. Intended as an escape hatch when the only admin is locked out and there’s no other admin to issue a reset through the UI. Requires the server to be running (or a --database-url pointing at the external database).

FlagDefaultDescription
<username> (positional)(required)The username of the account to reset.
--expires-in24hHow long the recovery link is valid.
--data-dir$ODEION_DATA_DIRMust match the serve process.
--database-urllocalConnect to the embedded postgres, or an external DSN.
Terminal window
odeion reset-password admin
odeion reset-password alice --expires-in=1h

The command prints the reset token, expiry time, and (when base_url is set in system_settings) a full URL to open in a browser. If the account was locked, the lock is cleared at the same time.

Terminal window
odeion --version

Prints the version number, git commit hash, and build timestamp.