The project CLI library for Velocity Go web framework.
Vel provides development commands for Velocity projects. Unlike traditional CLIs, vel is built from source in each project, giving it access to your migrations, models, and bootstrap code.
Velocity uses two CLI tools:
| Tool | Install | Purpose |
|---|---|---|
velocity |
Homebrew | Create projects, manage config |
vel |
Built from source | Dev server, migrations, generators |
After creating a project with velocity new, use ./vel for development:
./vel serve # Start dev server with hot reload
./vel migrate # Run database migrations
./vel migrate:fresh # Drop and re-run all migrations
./vel make:controller # Generate a controller
./vel build # Build for production
./vel key:generate # Generate encryption keyAdd to ~/.zshrc to use vel instead of ./vel:
vel() { [ -x ./vel ] && ./vel "$@" || echo "vel: not found"; }Your project's cmd/vel/main.go imports this package:
package main
import (
"github.com/velocitykode/velocity-cli"
_ "myapp/bootstrap"
_ "myapp/database/migrations"
)
func main() {
vel.Execute()
}This gives vel access to your project's migrations and configuration.
Full documentation at velocity.velocitykode.com/docs
MIT License - See LICENSE for details.