cli/cli
Glossary
Terms used throughout this codebase that are not part of the standard Go or GitHub vocabulary.
| Term | Meaning |
|---|---|
| Factory | The cmdutil.Factory struct in pkg/cmdutil/factory.go. Each command is constructed with a factory pointer and pulls only the dependencies it needs (HTTP client, prompter, git client, base repo, IOStreams, etc.). |
| Options | A per-command struct that holds the parsed flags plus references to the factory dependencies. Created in NewCmdFoo and consumed by the command's fooRun function. |
| runF / RunE | runF is the optional run-function injection point on NewCmdFoo; RunE is Cobra's error-returning run hook. Tests pass a stub runF to assert flag parsing without executing the real command. |
| BaseRepo | The repository the command should target. Resolved either by the simple BaseRepoFunc (first eligible remote) or SmartBaseRepoFunc (resolves networks, honours gh repo set-default). |
| Smart resolver | The repo resolver in pkg/cmd/factory/remote_resolver.go. Used by pr, issue, repo, release, etc. |
| Resolved remote | A git remote whose resolved config key has been set by gh repo set-default or fork-clone. Tells gh which remote to treat as the canonical "base". |
| GHES | GitHub Enterprise Server (self-hosted). Capabilities differ from github.com, which is why internal/featuredetection exists. |
| Feature detection | Runtime probing of the GraphQL schema (see internal/featuredetection/feature_detection.go) to decide whether to use modern API surfaces or fall back to older ones. Each detection has a paired // TODO <cleanupIdentifier> comment so the lint catches stale code paths. |
| httpmock.Registry | The HTTP mock from pkg/httpmock/. Tests register expected requests and responses via Register(matcher, responder) and defer reg.Verify(t) to assert all stubs were hit. |
| IOStreams | The terminal I/O abstraction in pkg/iostreams/iostreams.go. Encapsulates stdin/stdout/stderr, color, pager, spinner, and TTY detection. iostreams.Test() returns an in-memory pair for tests. |
| Prompter | The interactive UI abstraction in internal/prompter/. Mocked via moq so tests assert on user prompts. |
| Extension | A user- or org-installed gh-<name> script or binary, managed by pkg/cmd/extension/manager.go. |
| Official extension stub | A hidden Cobra command registered by pkg/cmd/root/official_extension_stub.go that prompts a user to install a first-party extension when an undefined command is invoked. |
| Help topic | A long-form non-command help page (gh help environment, gh help reference). Defined in pkg/cmd/root/help_topic.go and converted to manpages by cmd/gen-docs. |
| Skill | A natural-language workflow installed under the user's config directory and invoked with gh skill <name>. The user-facing commands live in pkg/cmd/skills/; the install/discovery/registry plumbing lives in internal/skills/. |
| Skill registry | The remote index of available skills queried by gh skill search and gh skill install. Cached locally; see internal/skills/registry. |
| Attestation | A SLSA / Sigstore-signed bundle that proves a release artifact was built from a specific commit and workflow. The verification stack is in pkg/cmd/attestation/. |
| Trusted root | A TUF-signed Sigstore trust bundle. gh attestation ships an embedded copy under pkg/cmd/attestation/verification/embed/tuf-repo.github.com/ and refreshes it on demand. |
| Codespace | A managed GitHub-hosted dev container. The user-facing CLI is in pkg/cmd/codespace/; the SSH, port-forwarding, and Live Share RPC client live under internal/codespaces/. |
| Agent-task | The gh agent-task command tree in pkg/cmd/agent-task/ for orchestrating long-running AI agent tasks against a repository. |
| Invoking agent | An AI coding tool that launches gh. Detected from environment variables in internal/agents/detect.go and propagated via the User-Agent and an internal header so server-side telemetry can attribute traffic. |
| Telemetry service | The opt-in client in internal/telemetry/ that emits anonymized usage events. Disabled by default on suspected GHES installs. |
| Barista | The internal Twirp service used by GitHub-hosted services to receive gh telemetry. The generated client lives in internal/barista/observability/telemetry.twirp.go. |
| Tableprinter | The structured table writer in internal/tableprinter/ used by every gh ... list command. |
| MD2Man | The runtime manpage generator (cpuguy83/go-md2man) used by cmd/gen-docs/main.go to convert command help into .1 files during release. |
| Trunk | The default branch of cli/cli. PRs target trunk. |
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.