vel Commands
> Complete reference for the per-project `vel` CLI — serve, build, migrations, queues, code generation, maintenance, and keys.
vel is the per-project binary. It’s created in your project root when
you scaffold an app with velocity new. Run ./vel <command> — or
alias vel to ./vel in your shell — from the project directory.
For the installer CLI (velocity new, velocity self-update, etc.),
see Installer Commands.
Server
vel serve
Start the development server with live reload.
vel serve [flags]| Flag | Short | Default | Description |
|---|---|---|---|
--port | -p | 4000 | HTTP port |
--env | -e | development | Environment name (sets APP_ENV) |
--no-watch | off | Disable file-watching / auto-rebuild | |
--tags | (none) | Build tags passed to go build |
vel serve
vel serve --port 3000
vel serve --env staging --no-watch
vel serve --tags="integration"On start:
- Vite dev server launches on
:5173(full-stack projects only). - The Go app compiles to
.vel/tmp/server. .gofiles are watched; a change rebuilds and restarts.
vel build
Compile a production binary.
vel build [flags]| Flag | Short | Default | Description |
|---|---|---|---|
--output | -o | ./dist/app | Output path |
--os | (host) | Target GOOS | |
--arch | (host) | Target GOARCH | |
--tags | (none) | Go build tags |
vel build
vel build --output ./bin/myapp
vel build --os linux --arch amd64Database
vel migrate
Run all pending migrations.
vel migrate [--pretend]--pretend prints the SQL that would run without executing it — useful
for reviewing migration output before committing.
vel migrate:fresh
Drop all tables, then run every migration from scratch.
vel migrate:freshvel migrate:rollback
Roll back the most recent batch of migrations.
vel migrate:rollback [--step N]| Flag | Short | Default | Description |
|---|---|---|---|
--step | -s | 1 | Number of batches to roll back |
vel migrate:status
Show which migrations have run.
vel migrate:statusvel db:wipe
Drop every table in the current database without running migrations.
vel db:wipeQueue and Scheduler
vel queue:work
Start a worker that processes queued jobs.
vel queue:work [--queue NAME] [--tries N] [--timeout S]| Flag | Short | Default | Description |
|---|---|---|---|
--queue | -q | default | Queue to consume from |
--tries | (driver) | Max attempts per job before marking failed | |
--timeout | (driver) | Per-job timeout in seconds |
vel queue:work
vel queue:work --queue emails --tries 3 --timeout 60vel schedule:work
Run the scheduler loop — picks up scheduled jobs defined via
v.Schedule(...) and dispatches them when due.
vel schedule:workTypically run under a process supervisor (systemd, Docker, etc.) rather than manually.
Cache
vel cache:clear
Flush the configured cache store.
vel cache:clearMaintenance Mode
vel down
Put the app into maintenance mode. All requests return 503 except those bearing the bypass secret.
vel down [--secret TOKEN] [--retry N]| Flag | Default | Description |
|---|---|---|
--secret | (none) | Token clients can use at ?__maintenance=TOKEN to bypass |
--retry | (none) | Value for the Retry-After response header (seconds) |
vel down --secret "abc123" --retry 60vel up
Exit maintenance mode.
vel upKeys
vel key:generate
Generate a fresh 32-byte encryption key and write it to .env under
CRYPTO_KEY (falls back to APP_KEY if that’s what the project uses).
vel key:generateRoutes
vel route:list
Print every registered route with method, path, name, and middleware.
vel route:listRebuilds the bootstrap lifecycle internally before printing — the
output always reflects the current v.Routes(...) definition.
Code Generation
All make:* commands scaffold a file into the conventional location
for that type. Names are converted to the right case for the artifact
(snake_case for migration files, PascalCase for types).
vel make:handler
vel make:handler <name> [--resource] [--api]| Flag | Short | Default | Description |
|---|---|---|---|
--resource | -r | off | Scaffold CRUD methods (Index/Show/Store/Update/Destroy) |
--api | off | JSON responses instead of view rendering |
Output: internal/handlers/<name>.go.
vel make:handler User
vel make:handler Post --resource
vel make:handler Admin/Dashboard
vel make:handler Product --api --resourcevel make:model
vel make:model <name> [--uuid] [--soft-deletes] [--migration]| Flag | Short | Default | Description |
|---|---|---|---|
--uuid | off | Use UUID primary key | |
--soft-deletes | off | Add deleted_at column and scope | |
--migration | -m | off | Also scaffold the migration |
Output: internal/models/<name>.go.
vel make:migration
vel make:migration <name> [--create TABLE] [--table TABLE] [--uuid] [--soft-deletes]| Flag | Accepts | Description |
|---|---|---|
--create | =VALUE or space | Generate a “create” migration for the given table |
--table | =VALUE or space | Generate an “alter” migration for the given table |
--uuid | flag | Use UUID primary key in the create template |
--soft-deletes | flag | Include deleted_at in the create template |
Output: database/migrations/<timestamp>_<name>.go.
vel make:migration create_posts --create=posts
vel make:migration add_slug_to_posts --table=postsOther make commands
All take a name argument and scaffold a file into the conventional directory.
| Command | Output path |
|---|---|
vel make:middleware | internal/middleware/<name>.go |
vel make:event | internal/events/<name>.go |
vel make:listener | internal/listeners/<name>.go |
vel make:job | internal/jobs/<name>.go |
vel make:mail | internal/mail/<name>.go |
vel make:notification | internal/notifications/<name>.go |
vel make:resource | internal/resources/<name>.go |
vel make:policy | internal/policies/<name>.go |
vel make:provider | internal/providers/<name>.go |
vel make:command | internal/commands/<name>.go |
vel make:middleware RateLimit
vel make:listener SendWelcomeEmail
vel make:policy PostPolicyHelp
vel help
vel --help
vel -hPrints a grouped list of every command.