Skip to main content
The oForum CLI provides a simple, unified command-line interface for managing your forum instance. All operations—from initializing configuration to running the server—are handled through a single oforum binary.

Available Commands

The CLI includes the following commands:

serve

Start the forum server (default command)

init

Generate a .env configuration file

migrate

Run database migrations

seed

Seed database with demo data

version

Print version information

update

Update to latest release

Getting Help

Display available commands and usage information:
oforum help
The help command shows:
  • Command list with descriptions
  • Environment variable requirements
  • Usage examples
  • Current version number

Command Syntax

oforum [command]
If no command is specified, serve is used by default:
# These are equivalent
oforum
oforum serve

Environment Variables

Most commands require configuration through environment variables:
DATABASE_URL
string
required
PostgreSQL connection string. Required for serve, migrate, and seed commands.Example: postgres://user:pass@localhost:5432/oforum?sslmode=disable
PORT
string
default:"8080"
Server port for the serve command.Example: PORT=3000
Environment variables can be set in a .env file or exported in your shell. Use oforum init to generate a .env file interactively.

Common Workflows

First-Time Setup

# 1. Generate configuration
oforum init

# 2. Run migrations and start server
oforum serve
The serve command automatically runs migrations before starting the server.

Development

# Reset and seed with demo data
oforum seed

# Start server on custom port
PORT=3000 oforum serve

Production Deployment

# Run migrations only (without starting server)
oforum migrate

# Start server with production database
DATABASE_URL="postgres://..." oforum serve

Updating

# Check current version
oforum version

# Update to latest release
oforum update

Exit Codes

The CLI uses standard exit codes:
  • 0 - Success
  • 1 - Error (missing configuration, database connection failure, etc.)

Version Aliases

Several aliases are available for common commands:
oforum version
oforum --version
oforum -v

oforum help
oforum --help
oforum -h

Build docs developers (and LLMs) love