CLI commands
Every gize command: what it generates, when to reach for it, and the flags it takes. The CLI follows the verb–subcommand shape defined in ADR-012.
Global flags
These apply to every generating command (gize new and gize make …). Generation is safe by default: nothing is overwritten unless you ask.
--dry-runPrint the planned file operations (create / skip / update) and write nothing.--forceOverwrite files that already exist; without it, existing files are skipped.Commands
gize new <name>AvailableScaffolds a new project into a directory named <name>: a compiling, servable app in seconds.
- Writes Cargo.toml, gize.toml, .env.example, .gitignore and the full src/ layout (app, config, database, middleware, shared, router.rs, state.rs, main.rs).
- By default also generates a built-in users resource (model, full CRUD and a migration with an is_admin flag) already wired into app/mod.rs and gize.toml.
- Pass --no-user to scaffold the bare skeleton without the users resource.
gize new shopgize make app <name>AvailableCreates an application module and wires it into the project.
- Generates the nine module files (mod, model, dto, repository, service, handler, routes, error, tests) with a placeholder route.
- Registers mod <name>; and .merge(<name>::routes()) in src/app/mod.rs and adds the module to gize.toml. All of this is idempotent, so re-running is a no-op.
gize make app productsgize make model <Name> field:Type …AvailableGenerates a model struct and its CREATE TABLE migration from inline field definitions.
- model.rs is an sqlx::FromRow struct; an id: Uuid primary key and created_at / updated_at timestamps are added for you.
- The table and module name are the pluralized snake_case of the model (User → users).
gize make model User name:String email:Stringgize make crud <Name> field:Type …AvailableThe headline command: a complete, wired vertical slice for a resource.
- Generates model, dto, repository (SQLx), service, handler (Axum), routes, a typed error, tests and the migration.
- Registers the module in app/mod.rs and gize.toml, exposing working GET/POST/PUT/DELETE endpoints backed by the database.
gize make crud Product name:String price:i32 active:boolgize make migration [name]AvailableCreates a blank, timestamped SQL migration to fill in by hand.
- The escape hatch for changes the model-driven generator does not cover: indexes, constraints, data backfills, column changes.
- Model-driven CREATE TABLE files come from make model / make crud instead.
gize make migration add_index_to_usersgize make admin <Name>PlannedWill generate an admin UI (List / Create / Edit / Show / Delete) for a model.
- Planned for the Beta phase: not implemented yet; the command reports its planned behaviour.
gize make admin Productgize migrate [--status]AvailableApplies pending SQL migrations from migrations/*.sql against DATABASE_URL.
- Uses the SQLx migrator, which records applied versions in _sqlx_migrations, ordered and idempotent. There is no risky runtime auto-migration.
- Pass --status to list applied [x] versus pending [ ] migrations instead of applying them.
gize migrate --statusgize serveAvailableBuilds and runs the generated application via cargo run, streaming its logs.
- Reads DATABASE_URL and PORT (default 8080) from the environment.
gize servegize syncPlannedWill reconcile the project from gize.toml.
- Planned for the Alpha phase: idempotent, dry-run first. Not implemented yet.
gize syncgize doctorAvailableSanity-checks your environment and project.
- Reports cargo / rustfmt availability, whether you are inside a Gize project (gize.toml), and whether DATABASE_URL is set.
gize doctorgize fmtAvailableFormats the project with rustfmt, a thin wrapper around cargo fmt --all.
- Runs across the whole workspace so generated and hand-written code stay consistent.
gize fmtgize checkAvailableLints the project with clippy, denying warnings.
- Wraps cargo clippy --all-targets -- -D warnings, the same quality gate CI enforces.
gize checkSafe by default: existing files are skipped unless you pass --force, and --dry-run previews the full plan without writing anything. Registry edits to app/mod.rs and gize.toml are idempotent.