CLI
> Velocity CLI reference. Create projects, run dev servers, generate code, and manage your Go web application from the command line.
Velocity provides two CLI tools that work together:
velocity- Global installer (via Homebrew) for creating and managing projectsvel- Project CLI (built from source) for development commands
Installation
brew tap velocitykode/tap
brew install velocityArchitecture
velocity (global) vel (per-project)
├── new ├── serve
├── config ├── build
└── self-update ├── migrate
├── migrate fresh / rollback / status
├── db wipe
├── cache clear
├── queue work
├── schedule work
├── down / up
├── routes
├── key generate
├── run <command>
└── gen * (16 generators)Why two CLIs?
velocityis installed globally via Homebrew and only knows how to create, configure, and update itself.velis built from your project source, so it has access to your migrations, models, and app initialization code.
Quick Reference
Global Commands (velocity)
| Command | Description |
|---|---|
velocity new <name> | Create a new Velocity project |
velocity new <name> --api | API-only project (no frontend) |
velocity config | Manage CLI defaults |
velocity self-update | Update the installer |
Full reference: Installer Commands.
Project Commands (vel)
| Command | Description |
|---|---|
vel serve | Dev server with live reload |
vel build | Production build |
vel migrate | Run database migrations |
vel routes | List all registered routes |
vel queue work | Process queued jobs |
vel gen handler | Generate a handler |
vel key generate | Generate encryption key |
Command names are space-separated words (migrate fresh, gen model,
gen grpc service), and a subcommand always beats its bare parent.
Full reference: vel Commands.
Using vel
After creating a project with velocity new, a ./vel binary is built automatically. Run project commands with:
cd myproject
./vel serve
./vel migrateShell Function (Optional)
Add this to ~/.zshrc to use vel instead of ./vel:
vel() { [ -x ./vel ] && ./vel "$@" || echo "vel: not found"; }Then you can simply run:
vel serve
vel migrate