Navi Integration
Navi is an interactive command-line cheat sheet tool. Goca ships a .cheat file in the repository root that covers all commands, flags, field types, and common workflows.
What You Get
The goca.cheat file provides 133 snippets across 19 sections:
| Section | Examples |
|---|---|
| Info & discovery | goca --help, goca version --short |
| Doctor & upgrade | goca doctor --fix, goca upgrade --update |
| Project init | Wizard, all database types, API styles |
| Feature generation | Full-stack with fields, validation, soft-delete |
| Entity | With timestamps, business rules, all Go types |
| UseCase | With DTOs, pagination, validation |
| Repository | GORM, interfaces-only |
| Handler | HTTP, gRPC, CLI, Worker |
| DI container | Per-database wiring |
| Integrate | Wire existing features into DI + routing |
| Interfaces | Generate interface contracts |
| Messages | Error message constants |
| Mocks | testify/mock generation |
| Integration tests | Test scaffolding |
| Config management | Show/generate/validate .goca.yaml |
| Custom templates | Register and use custom templates |
| Global flags | --dry-run, --force, --backup, --quiet, --verbose, --no-color |
| Field type examples | All supported Go types with GORM tags |
| Workflows | Real end-to-end patterns |
Variables are presented as interactive selectors. For example, the $database variable shows a menu of postgres, mysql, sqlite, mongodb, sqlserver, elasticsearch, dynamodb, and postgres-json.
Installation
Option 1: navi repo add (recommended)
navi repo add sazardev/gocaNote: Do not prefix the URL with
github.com/— Navi prepends it automatically.
After adding, open navi and filter by typing goca:
navi
# type: gocaOption 2: Symlink from a local clone
git clone https://github.com/sazardev/goca.git
ln -s $(pwd)/goca/goca.cheat ~/.local/share/navi/cheats/goca.cheatOption 3: Copy the file manually
curl -o ~/.local/share/navi/cheats/goca.cheat \
https://raw.githubusercontent.com/sazardev/goca/master/goca.cheatUsage
Browse all goca snippets
navi --query gocaRun a specific snippet interactively
navi
# type: feature
# select: goca feature with all fields
# fill in: Entity, Field list, DatabaseUse as a one-liner reference
navi --print --query "goca entity"
# outputs the command text without executing itExample Snippets
Generate a full feature
% goca, go, clean-architecture, codegen
# Generate full Clean Architecture feature with all layers
goca feature <entity> --fields "<fields>" --database <database> --validation --timestampsVariables are filled in interactively:
<entity>— free text input (e.g.Product)<fields>— free text input (e.g.Name:string,Price:float64,Stock:int)<database>— selector:postgres / mysql / sqlite / mongodb / sqlserver / elasticsearch / dynamodb / postgres-json
Safe generation workflow
# Preview first
goca feature Order --fields "UserID:uint,Total:float64" --dry-run
# Then apply with backup
goca feature Order --fields "UserID:uint,Total:float64" --backupThe cheat file includes both steps as separate snippets in the WORKFLOWS section.
Cheat File Location
The file lives at the repository root: goca.cheat
It is plain text and can be edited or extended locally to add project-specific snippets.
Related
- Safety & Dependency Management —
--dry-run,--force,--backupflags - Commands Overview — full command reference
- Navi GitHub repository — Navi documentation and installation