Skip to content

v1.18.0 - CLI UX Overhaul

Release Date: March 24, 2026

Version 1.18.0 is a significant feature release that completely reworks the CLI output layer. All commands now produce styled, structured terminal output through a centralized renderer. An interactive wizard guides new users through project initialization. Global flags provide full control over color and interactivity. This release also resolves several accumulated correctness issues.


Notable Changes

  • All CLI output now includes ANSI color codes by default. Scripts or CI pipelines parsing raw output should pass --no-color or set NO_COLOR=1.
  • Generated file summaries are rendered as tables instead of plain lists.
  • File creation messages follow a consistent Created: <path> format across all commands.

What Changed

CLI Output Rendering System

A new UIRenderer type (cmd/ui.go) is now the single output layer for all cmd/*.go files. No command calls fmt.Printf or fmt.Println directly for user-facing messages.

The renderer provides:

MethodPurpose
HeaderSection title with separator
StepNumbered progress step
SuccessGreen confirmation message
ErrorRed error message
WarningYellow non-fatal warning
InfoInformational note
DryRunDry-run preview indicator
FileCreated / FileBackedUpFile operation confirmation
KeyValue / KeyValueFromConfigLabeled value pair
FeatureFeature flag confirmation
TableColumn-aligned table from headers and rows
Section / NextStepsGrouped guidance blocks
SpinnerAnimated progress indicator for long operations

Color output relies on lipgloss and termenv. The Spinner method runs a goroutine-based braille animation (⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏) and returns a stop function.

Interactive Initialization Wizard

When goca init <project> is run without a --module flag in an interactive terminal, a guided wizard launches automatically using huh forms. The wizard collects:

  • Module path
  • Database backend (sqlite, postgres, mysql, mongodb, sqlserver, dynamodb, elasticsearch)
  • API type (rest, grpc, graphql)
  • Optional: authentication scaffolding, configuration file generation

When --no-interactive is set or output is redirected, the wizard is bypassed and missing required flags produce an informative error.

Global Flags

Two persistent flags are now available on every command:

FlagBehavior
--no-colorDisables all ANSI escape codes. Equivalent to setting NO_COLOR=1
--no-interactiveDisables all interactive prompts. Suitable for CI and automation

Table Output for Generated File Listings

Commands that produce files now display a summary table instead of a plain list:

  • goca entity shows a File / Description table
  • goca feature shows a Layer / File / Description table across all generated layers
  • goca di, goca mocks, and the safety manager's conflict summary use the same table format

Handler Dependency Auto-injection

goca handler --type http with validation enabled now automatically adds github.com/go-playground/validator/v10 to go.mod and runs go mod tidy. Previously this dependency had to be added manually after generation.

Unified English Output

All user-facing strings across cmd/*.go have been standardised to English. Mixed-language output from earlier releases is fully resolved.


Bug Fixes

Duplicate command registrationconfigCmd was added to rootCmd in both root.go and config_debug.go, causing config to appear twice in --help. The duplicate in root.go has been removed.

Debug output in productionusecase.go printed DEBUG: Generating interface with name: ... to standard output during normal use. This line has been removed.

Error messages during init — Twenty fmt.Printf("Error writing ...") calls in cmd/init.go were printing outside the UI rendering system, causing output to appear inline with the spinner animation. All have been migrated to ui.Warning.


Dependencies Added

PackageVersionPurpose
github.com/charmbracelet/lipglossv1.1.0Terminal styling
github.com/charmbracelet/huhv1.0.0Interactive forms
github.com/charmbracelet/bubbleteav1.3.10Terminal UI runtime
github.com/charmbracelet/bubblesv1.0.0UI components
github.com/muesli/termenvv0.16.0Terminal capability detection

Migration Guide

Disabling Color Output

bash
# Per-invocation
goca entity User --fields "name:string" --no-color

# Environment-wide
export NO_COLOR=1
goca feature Product --fields "name:string,price:float64"

Non-interactive Mode for CI

bash
goca init myapp --module github.com/org/myapp --database postgres --no-interactive

Parsing Output in Scripts

If your scripts relied on parsing goca output, add --no-color to strip escape codes. The structural content (file paths, messages) is unchanged; only the format markers differ.


Verified Commands

All commands were tested against generated projects after this release:

CommandStatus
goca init (with flags)Verified
goca init (interactive wizard)Verified
goca entityVerified
goca featureVerified
goca repositoryVerified
goca usecaseVerified
goca handlerVerified
goca mocksVerified
goca interfacesVerified
goca messagesVerified
goca diVerified
goca config showVerified
goca config validateVerified
goca versionVerified
--no-color flagVerified
--no-interactive flagVerified

Released under the MIT License.