Kashvi

Docs

K
Reference

CLI Reference

Commands match the kashvi Cobra CLI. Install the binary with go install (see below).

Install

go install github.com/shashiranjanraj/kashvi/cmd/kashvi@latest

Version

kashvi version

Print the framework version (same string as app.Version).

kashvi version
# → Kashvi Framework v1.x.x

Server & routes

In project mode these delegate to your app (same as go run . serve, etc.). Your app.Run() also accepts: serve, start, run, migrate, seed, route:list, version.

kashvi run · kashvi serve · kashvi start

Start the HTTP server (and gRPC alongside HTTP per your app config). Aliases are equivalent.

kashvi serve
# → delegates to: go run . serve

kashvi route:list

Print all named routes in a sorted table (delegates to your project).

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
POST     /api/posts                   posts.store
PUT      /api/posts/{id}              posts.update

kashvi build (framework clone only)

Compiles the sample server in the framework repo to ./kashvi via go build -o kashvi ./cmd/server. For your own project, use go build -o myapp . or your CI pipeline.

kashvi grpc:serve (framework clone only)

Start only the gRPC server (health + reflection) using framework config. HTTP apps normally start gRPC with serve.

kashvi grpc:serve

Database

kashvi migrate

Run all pending migrations (delegates to your project).

kashvi migrate

kashvi migrate:rollback

Rollback the last batch of migrations.

kashvi migrate:status

Show which migrations have been applied.

kashvi seed

Run registered seeders.

kashvi seed

Workers & scheduler

kashvi queue:work

Start queue workers (-w / --workers flag, default 5).

kashvi queue:work
kashvi queue:work -w 10

kashvi schedule:run

Run the task scheduler until SIGINT/SIGTERM.

kashvi schedule:run

New project

kashvi new [ProjectName]

Creates a directory, runs go mod init, pulls Kashvi, and scaffolds main.go, app/routes/api.go, api_test.go, and .env files.

kashvi new myproject
cd myproject
kashvi serve

Scaffold commands

Generators use embedded text/template stubs. They do not overwrite existing files. Override templates by placing files under .kashvi/stubs/ (same names as in the framework: model.stub, dto.stub, repository.stub, controller.stub, resource_controller.stub, service.stub, migration.stub, seeder.stub, test_scenario.stub).

kashvi make:resource [Name] (alias: make:crud)

Full CRUD stack in one command: model, DTOs, repository, controller, service, migration, seeder, test scenarios.

kashvi make:resource Post
kashvi make:crud Product --authorize --cache

Flags:

  • --authorize — adds auth middleware placeholders in the printed route snippet and stubs.
  • --cache — adds cache-related placeholders in generated controller code.

Typical output paths for Product:

  • app/models/product.go
  • app/dto/product_dto.go (CreateProductRequest, UpdateProductRequest, …)
  • app/repositories/product.go
  • app/controllers/product_controller.go
  • app/services/product_service.go
  • database/migrations/TIMESTAMP_create_products_table.go
  • database/seeders/product_seeder.go
  • testdata/product_scenarios.json

kashvi make:dto [Name]

Request/response DTOs only — app/dto/<name>_dto.go.

kashvi make:dto Order

kashvi make:repository [Name]

Repository embedding repository.Base[T]app/repositories/<name>.go.

kashvi make:model [Name]

kashvi make:model Comment

kashvi make:controller [Name]

kashvi make:controller Comment

kashvi make:service [Name]

kashvi make:service Billing

kashvi make:migration [name]

Creates database/migrations/<timestamp>_<slug>.go.

kashvi make:seeder [Name]

Creates database/seeders/<lower>_seeder.go (name lowercased).

Discoverability

kashvi --help
kashvi make:resource --help