Skip to content

CLI Reference

The CLI is a single binary (oxide) installed once globally. It knows how to scaffold projects, generate migrations, publish framework stubs, and forward app-level commands to your project binary.

Install

Terminal window
cargo install oxide-cli --registry com7-innovation

See Internal Registry for one-time kellnr setup.

Local commands

These run locally against the current directory / workspace.

oxide new <name>

Scaffold a new project.

Terminal window
oxide new billing-api

The scaffolded Cargo.toml pins oxide to the same version as the CLI that generated it, against the com7-innovation registry. Bump or change the pin by editing Cargo.toml after scaffolding.

oxide make:migration <snake_name>

Scaffold a timestamped migration file under src/database/migrations/ and register it in the migrator.

Terminal window
oxide make:migration create_posts_table

oxide vendor:publish <tag>

Copy framework-shipped stubs (migrations + configs) into your project.

Terminal window
oxide vendor:publish sanctum # auth tokens — from oxide-auth
oxide vendor:publish cors # cors config — from oxide

The CLI uses cargo metadata to find every resolved dependency’s source, scans database/migrations/<tag>/*.rs and config/<tag>.toml in each, and copies them in. Works equally for git deps and crates.io deps.

App-forwarded commands

These forward to your project binary via cargo run --quiet --. They assume you’re inside a scaffolded project.

oxide serve

Start the HTTP server. Honors APP_LISTEN (default 127.0.0.1:8000).

oxide migrate

Apply every pending migration.

oxide migrate:rollback [N]

Undo the last N migrations (default 1).

oxide migrate:fresh

Drop every table and re-run all migrations. Never run in production.

oxide migrate:status

Print a table of applied + pending migrations.

Flags

FlagCommandsPurpose
--version, -V(global)print the CLI version

Exit codes

CodeMeaning
0success
1user-visible failure (missing arg, target dir exists, etc.)
2unknown command or subcommand