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 projects
  • vel - Project CLI (built from source) for development commands

Installation

brew tap velocitykode/tap
brew install velocity

Architecture

velocity (global)          vel (per-project)
├── new                    ├── serve
├── init                   ├── build
├── config                 ├── migrate
└── self-update            ├── migrate:fresh
                           ├── make:handler
                           └── key:generate

Why two CLIs?

  • velocity is installed globally via Homebrew
  • vel is built from your project source, so it has access to your migrations, models, and app initialization code

Quick Reference

Global Commands (velocity)

CommandDescription
velocity new <name>Create a new Velocity project
velocity new <name> --apiCreate an API-only project (no frontend)
velocity initInitialize Velocity in existing project
velocity configManage CLI configuration
velocity self-updateUpdate the installer

Project Commands (vel)

CommandDescription
vel serveStart development server with hot reload
vel buildBuild for production
vel migrateRun database migrations
vel migrate:freshDrop all tables and re-migrate
vel make:handlerGenerate a handler
vel key:generateGenerate 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 migrate

Shell 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

In This Section