Documentation
¶
Overview ¶
Package extension implements the circleci plugin mechanism.
Any executable named "circleci-<name>" found in PATH is treated as an extension and can be invoked transparently as "circleci <name>". The extension receives CIRCLE_TOKEN, CIRCLE_HOST, and best-effort project metadata via environment variables so it can call the CircleCI API without reimplementing authentication.
Index ¶
Constants ¶
const (
// Testsuite is the official extension for running tests.
Testsuite = "testsuite"
)
Variables ¶
This section is empty.
Functions ¶
func IsExtensionCmd ¶ added in v1.19.0
IsExtensionCmd reports whether cmd runs an extension: a top-level extension command, or a child added to one by PrepareForMCP.
func NewExtensionCmd ¶
func ParseRootFlags ¶
ParseRootFlags populates the root command's persistent flags from os.Args for a command that sets DisableFlagParsing. Cobra never calls ParseFlags for such commands, so without this --theme, --debug, --quiet, --config, etc. would still hold their defaults when the root PersistentPreRunE sets up streams and loads config.
Parsing is non-interspersed, so it stops at the first positional argument (the extension name); flags after it belong to the extension and are returned verbatim along with any other trailing args.
func PrepareForMCP ¶ added in v1.19.0
PrepareForMCP readies the extension commands under root for the MCP server. It refreshes the cached reference of each official extension that is not installed, then gives every extension command with a reference one child per documented subcommand, so the server exposes each as its own tool with typed flags rather than one tool taking opaque args.
It returns the MCP instructions of the extensions it prepared, in command order, leaving out those whose reference has none.
func RegisterExtensions ¶
RegisterExtensions registers extensions in the following order:
- Managed extensions found in the extensions directory.
- Official uninstalled extensions.
- Unmanaged extensions found in PATH.
Types ¶
This section is empty.