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
├── init ├── build
├── config ├── migrate
└── self-update ├── migrate:fresh
├── make:handler
└── key:generateWhy two CLIs?
velocityis installed globally via Homebrewvelis 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 | Create an API-only project (no frontend) |
velocity init | Initialize Velocity in existing project |
velocity config | Manage CLI configuration |
velocity self-update | Update the installer |
Project Commands (vel)
| Command | Description |
|---|---|
vel serve | Start development server with hot reload |
vel build | Build for production |
vel migrate | Run database migrations |
vel migrate:fresh | Drop all tables and re-migrate |
vel make:handler | Generate a handler |
vel key:generate | Generate encryption key |
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 migrateIn This Section
- Installation - Install the Velocity CLI
- Commands - Complete command reference
- Configuration - CLI configuration options
