extension

package
v1.19.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: MIT Imports: 16 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
const (
	// Testsuite is the official extension for running tests.
	Testsuite = "testsuite"
)

Variables

This section is empty.

Functions

func IsExtensionCmd added in v1.19.0

func IsExtensionCmd(cmd *cobra.Command) bool

IsExtensionCmd reports whether cmd runs an extension: a top-level extension command, or a child added to one by PrepareForMCP.

func NewExtensionCmd

func NewExtensionCmd() *cobra.Command

func ParseRootFlags

func ParseRootFlags(cmd *cobra.Command) (extArgs []string)

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

func PrepareForMCP(ctx context.Context, root *cobra.Command) (instructions []string)

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

func RegisterExtensions(rootCmd *cobra.Command)

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.

Jump to

Keyboard shortcuts

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