goca upgrade
Upgrade your project's Goca configuration to the current binary version.
Syntax
goca upgrade [flags]Description
The goca upgrade command reads your .goca.yaml configuration and compares it with the schema supported by the installed Goca version:
- Reports which config sections are configured and which are at defaults
- Detects a version mismatch between the
goca_versionstored in your metadata and the installed binary version - Optionally records the current version with
--update - Optionally re-runs code generation for a feature with
--regenerate
Note
goca upgrade does not modify your Go source files. It only manages the .goca.yaml configuration. Use goca feature <name> --force to regenerate source code for a specific feature.
Flags
--update
Write the current Goca binary version into .goca.yaml under project.metadata.goca_version.
goca upgrade --update--regenerate <feature>
Print instructions for regenerating boilerplate for a named feature.
goca upgrade --regenerate User--dry-run
Preview any changes that --update or --regenerate would make, without writing anything to disk.
goca upgrade --update --dry-runUsage Examples
Check if config is current
goca upgradeExample output (up to date):
Goca Upgrade
Project: myproject
Module: github.com/user/myproject
ℹ Installed Goca version : v1.18.2
ℹ Recorded goca_version : v1.18.2 (up to date)
Config Section Status
┌─────────────────────────────────────────────────┐
│ Section Status Note │
├─────────────────────────────────────────────────┤
│ project ✓ set name, module │
│ architecture ○ default layers, DI type │
│ database ○ default type, host │
│ generation ○ default validation, style │
│ testing ○ default framework, mocks │
│ features ○ default auth, cache │
│ templates ○ default custom dir │
│ deploy ○ default docker, kubernetes │
└─────────────────────────────────────────────────┘
✓ Project configuration is up to dateRecord the installed version
goca upgrade --updateThis writes goca_version: v1.18.2 into .goca.yaml metadata and is useful after upgrading Goca itself.
Regenerate a feature's boilerplate
goca upgrade --regenerate UserPrints the exact goca feature command to run with --force.
Preview --update in dry-run mode
goca upgrade --update --dry-runShows what would be written without touching the file.
When to Run goca upgrade
- After running
go install github.com/sazardev/goca@latest - When
goca doctorreports a version mismatch - Before regenerating features to ensure config is consistent
Related Commands
| Command | Purpose |
|---|---|
goca doctor | Full project health check |
goca feature <name> --force | Regenerate all boilerplate for a feature |
goca init | Initialize a new .goca.yaml |