Help us shape the future of Go! Take the 2026 Go Developer Survey

enable

package
v0.49.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package enable is the gtb-only `enable` command. It turns on a capability of a generated tool and rewrites the existing generated wiring to match, as opposed to `generate`, which adds new user-facing surface (commands, flags, config fields).

Simple on/off built-in features (ai, config, telemetry, init, update, mcp, docs, doctor, changelog) are a positional argument on `enable` itself — `gtb enable ai` flips properties.features in .gtb/manifest.yaml and re-renders the root command. Capabilities with their own configuration are scoped subcommands: `gtb enable signing` turns on consumer-side release-signing verification with its own flag set. cobra routes a first argument that matches a subcommand (signing) there, and otherwise falls through to the parent's positional feature handler.

This package lives under internal/cmd/ because the commands belong to the framework author, not the framework's downstream consumers. See https://gitlab.com/phpboyscout/go-tool-base/-/wikis/specs/0086-enable-disable-features and https://gitlab.com/phpboyscout/go-tool-base/-/wikis/specs/0071-signing-generator-feature.

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidBackend = errors.NewSentinel("gtb.enable.invalid_backend", "invalid --backend: not a registered signing backend")

ErrInvalidBackend is returned when --backend is not a registered signing backend.

View Source
var ErrInvalidKeySource = errors.NewSentinel("gtb.enable.invalid_key_source", "invalid --key-source: must be embedded, external, or both")

ErrInvalidKeySource is returned when --key-source is not one of the accepted values.

Functions

func NewCmdEnable

func NewCmdEnable(p *props.Props) *setup.Command

NewCmdEnable returns the top-level `gtb enable [feature]` command. A built-in feature passed positionally is toggled on; a first argument matching a scoped subcommand (signing) routes there instead; no argument opens the feature picker.

func NewCmdEnableMCP

func NewCmdEnableMCP(p *props.Props) *setup.Command

NewCmdEnableMCP returns the dual-purpose `gtb enable mcp` subcommand. With no arguments it turns the mcp feature on (the MCP server subsystem). With one or more slash-separated command paths it puts those commands back on the MCP tool surface — recording mcp_enabled: true (a deliberate, auditable re-enablement) and re-rendering each command's cmd.go with the setup.IncludeInMCP marker, which also overrides an excluded ancestor.

func NewCmdEnableSigning

func NewCmdEnableSigning(p *props.Props) *setup.Command

NewCmdEnableSigning returns the `gtb enable signing` subcommand. It flips the manifest signing block on and selectively regenerates only the signing-affected files.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL