Skip to content

goca config

Manage .goca.yaml configuration files for your project.

Syntax

bash
goca config [subcommand] [flags]

Description

The goca config command provides tools to initialize, display, validate, and manage your project's .goca.yaml configuration file. When run without a subcommand, it defaults to show.

Configuration First

Running goca config init before generating features ensures consistent code generation settings across your team.

Subcommands

show

Display the current project configuration loaded from .goca.yaml.

bash
goca config show

init

Initialize a new .goca.yaml configuration file in the current directory with intelligent defaults based on your project structure.

bash
goca config init [flags]

Flags:

FlagTypeDefaultDescription
--templatestring""Use predefined template (web, api, microservice, full)
--forceboolfalseOverwrite existing configuration file
--databasestring""Database type (postgres, mysql, sqlite)
--handlersstrings[]Handler types (http, grpc, cli)

validate

Validate the current .goca.yaml configuration file for errors and warnings.

bash
goca config validate

template

Show available predefined configuration templates for different project types.

bash
goca config template

Usage Examples

Initialize with defaults

bash
goca config init

Initialize from a template

bash
goca config init --template api --database postgres

Validate existing config

bash
goca config validate

View current settings

bash
goca config
# or
goca config show

Configuration File Format

The .goca.yaml file controls code generation behavior:

yaml
project:
  name: myproject
  module: github.com/user/myproject

database:
  type: postgres

handlers:
  - http

templates:
  directory: .goca/templates

naming:
  file_convention: snake_case

Released under the MIT License.