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
Local commands
These run locally against the current directory / workspace.
oxide new <name> [flags]
Scaffold a new project.
oxide new billing-apioxide new billing-api --tag v0.1.0oxide new billing-api --branch developoxide new billing-api --rev a1b2c3dWithout a pin flag, defaults to branch = "main". Override the default
framework repo by exporting OXIDE_FRAMEWORK_REPO.
oxide make:migration <snake_name>
Scaffold a timestamped migration file under
src/database/migrations/ and register it in the migrator.
oxide make:migration create_posts_tableoxide vendor:publish <tag>
Copy framework-shipped stubs (migrations + configs) into your project.
oxide vendor:publish sanctum # auth tokens — from oxide-authoxide vendor:publish cors # cors config — from oxide-httpThe 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
| Flag | Commands | Purpose |
|---|---|---|
--repo <url> | new | override the framework git URL |
--branch <name> | new | pin to a branch (default main) |
--tag <version> | new | pin to a released tag |
--rev <sha> | new | pin to a specific commit |
--version, -V | (global) | print the CLI version |
Exit codes
| Code | Meaning |
|---|---|
| 0 | success |
| 1 | user-visible failure (missing arg, target dir exists, etc.) |
| 2 | unknown command or subcommand |