Skip to content

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:

SectionExamples
Info & discoverygoca --help, goca version --short
Doctor & upgradegoca doctor --fix, goca upgrade --update
Project initWizard, all database types, API styles
Feature generationFull-stack with fields, validation, soft-delete
EntityWith timestamps, business rules, all Go types
UseCaseWith DTOs, pagination, validation
RepositoryGORM, interfaces-only
HandlerHTTP, gRPC, CLI, Worker
DI containerPer-database wiring
IntegrateWire existing features into DI + routing
InterfacesGenerate interface contracts
MessagesError message constants
Mockstestify/mock generation
Integration testsTest scaffolding
Config managementShow/generate/validate .goca.yaml
Custom templatesRegister and use custom templates
Global flags--dry-run, --force, --backup, --quiet, --verbose, --no-color
Field type examplesAll supported Go types with GORM tags
WorkflowsReal 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

bash
navi repo add sazardev/goca

Note: Do not prefix the URL with github.com/ — Navi prepends it automatically.

After adding, open navi and filter by typing goca:

bash
navi
# type: goca
bash
git clone https://github.com/sazardev/goca.git
ln -s $(pwd)/goca/goca.cheat ~/.local/share/navi/cheats/goca.cheat

Option 3: Copy the file manually

bash
curl -o ~/.local/share/navi/cheats/goca.cheat \
  https://raw.githubusercontent.com/sazardev/goca/master/goca.cheat

Usage

Browse all goca snippets

bash
navi --query goca

Run a specific snippet interactively

bash
navi
# type: feature
# select: goca feature with all fields
# fill in: Entity, Field list, Database

Use as a one-liner reference

bash
navi --print --query "goca entity"
# outputs the command text without executing it

Example 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 --timestamps

Variables 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

bash
# Preview first
goca feature Order --fields "UserID:uint,Total:float64" --dry-run

# Then apply with backup
goca feature Order --fields "UserID:uint,Total:float64" --backup

The 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.


Released under the MIT License.