CLI Reference
All commands are run via the kashvi binary. Install with make install.
Server Commands
kashvi run
Start the HTTP server (serve alias). In project mode this delegates to your app entrypoint (go run . serve).
kashvi run
# โ ๐ Kashvi running on :8080 [env: local]kashvi serve
Alias for kashvi run.
kashvi build
Compile the server binary to ./kashvi.
kashvi build
# โ โ
Built: ./kashvikashvi route:list
Print all named routes in a sorted table.
kashvi route:list
METHOD PATH NAME
------ ---- ----
DELETE /api/posts/{id} posts.destroy
GET /api/health health
GET /api/posts posts.index
GET /api/posts/{id} posts.show
GET /api/profile auth.profile
POST /api/login auth.login
POST /api/posts posts.store
POST /api/register auth.register
PUT /api/posts/{id} posts.updateDatabase Commands
kashvi migrate
Run all pending migrations.
kashvi migrate
โถ Migrating: 20240101000000_create_users_table
โ
Migrated: 20240101000000_create_users_table
โถ Migrating: 20240102000000_create_posts_table
โ
Migrated: 20240102000000_create_posts_tablekashvi migrate:rollback
Rollback the last batch of migrations.
kashvi migrate:rollback
โ Rolling back: 20240102000000_create_posts_table
โ
Rolled back: 20240102000000_create_posts_tablekashvi migrate:status
Show which migrations have been run.
kashvi migrate:status
Migration Status Batch
20240101000000_create_users_table Ran 1
20240102000000_create_posts_table Ran 1
20240103000000_add_role_to_users Pending -kashvi seed
Run all database seeders.
kashvi seedWorker Commands
kashvi queue:work
Start queue workers to process background jobs.
kashvi queue:work # default: 5 workers
kashvi queue:work -w 10 # 10 workersWorkers run until SIGINT/SIGTERM, then finish the current job and exit.
kashvi schedule:run
Start the task scheduler. Runs scheduled tasks at their configured times.
kashvi schedule:runScaffold Commands
All scaffold commands create files in your project using a built-in text/template engine. They will not overwrite existing files.
Template Overrides
You can customize the boilerplates for all scaffolding commands by mirroring the framework's .stub files into your project's .kashvi/stubs/ directory.
mkdir -p .kashvi/stubs
# create .kashvi/stubs/model.stub to override the default model templateCustomizable stubs include: model.stub, controller.stub, service.stub, migration.stub, seeder.stub, and test_scenario.stub.
kashvi make:resource [Name] (alias: make:crud)
Most useful command. Scaffolds a complete CRUD resource in one shot.
kashvi make:crud Post --authorize --cacheCreates:
app/models/post.goapp/controllers/post_controller.go(full CRUD usingctx.Context)app/services/post_service.godatabase/migrations/TIMESTAMP_create_posts_table.godatabase/seeders/post_seeder.gotestdata/post_scenarios.json(Automated API tests)
Flags:
--authorize: injects auth middleware placeholder and JWT header placeholders into scenarios.--cache: adds cache template placeholders in generated controller methods.
kashvi make:model [Name]
Scaffold a GORM model.
kashvi make:model Comment
# Creates: app/models/comment.gokashvi make:controller [Name]
Scaffold a basic controller.
kashvi make:controller Comment
# Creates: app/controllers/comment.gokashvi make:service [Name]
Scaffold a service layer struct.
kashvi make:service BillingService
# Creates: app/services/billingservice.gokashvi make:migration [name]
Create a new migration file with a timestamp prefix.
kashvi make:migration "add tags to posts"
# Creates: database/migrations/20260221170000_add_tags_to_posts.gokashvi make:seeder [Name]
Scaffold a seeder function.
kashvi make:seeder PostSeeder
# Creates: database/seeders/postseeder.go (name is lowercased)Tips
# See all available commands
kashvi --help
# See help for a specific command
kashvi make:resource --help
kashvi queue:work --help