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 --git [email protected]:com7-innovation/oxide.git oxide-cli

Local commands

These run locally against the current directory / workspace.

oxide new <name> [flags]

Scaffold a new project.

Terminal window
oxide new billing-api
oxide new billing-api --tag v0.1.0
oxide new billing-api --branch develop
oxide new billing-api --rev a1b2c3d
oxide new billing-api --repo ssh://[email protected]/your-org/oxide.git

Without 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.

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-http

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
--repo <url>newoverride the framework git URL
--branch <name>newpin to a branch (default main)
--tag <version>newpin to a released tag
--rev <sha>newpin to a specific commit
--version, -V(global)print the CLI version

Exit codes

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