attach

package
v0.39.0 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package attach is the gtb-only `attach` command. It attaches whole external Cobra command trees — from a separate Go module — onto a generated project's root, as a first-class, regeneration-safe manifest entity. It replaces the hand-edited cmd/<tool>/main.go + .gtb/ignore workaround: because the attachment lives in .gtb/manifest.yaml and is re-rendered into the root on every regenerate, `gtb regenerate` and `gtb enable signing` never drop it.

Two channels:

  • `attach command <module>@<version>` — declarative: name a constructor and the props-derived dependencies it takes; gtb renders the call into the root and pins the module require. Re-run for each constructor from the same module.
  • `attach adapter` — the escape hatch: scaffold a small author-owned pkg/cmd/external/attach.go for any shape the declarative vocabulary cannot express.

This package lives under internal/cmd/ because the commands belong to the framework author, not downstream consumers. See https://gitlab.com/phpboyscout/go-tool-base/-/wikis/specs/0182-external-command-attachment.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCmdAttach

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

NewCmdAttach returns the top-level `gtb attach` command with its command, adapter, and list subcommands.

Types

This section is empty.

Jump to

Keyboard shortcuts

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