Skip to content

Add embeddedcli.Path() accessor for the resolved CLI path#1677

Merged
SteveSandersonMS merged 1 commit into
github:mainfrom
tbrady77:embeddedcli-path-accessor
Jun 24, 2026
Merged

Add embeddedcli.Path() accessor for the resolved CLI path#1677
SteveSandersonMS merged 1 commit into
github:mainfrom
tbrady77:embeddedcli-path-accessor

Conversation

@tbrady77

Copy link
Copy Markdown
Contributor

What

Adds a small, additive public accessor embeddedcli.Path() that returns the absolute path to the embedded Copilot CLI (installing it on first call), wrapping the existing internal/embeddedcli.Path value.

// Path returns the absolute path to the embedded Copilot CLI, installing it on
// first call if necessary. It returns an empty string when no embedded CLI was
// configured via Setup (e.g. a build compiled without the embedded runtime).
// The result is computed once and cached for the life of the process.
func Path() string {
	return embeddedcli.Path()
}

Why

The public embeddedcli package exposes Config and Setup, but currently offers no way to read back the resolved CLI path after Setup. A consumer that embeds the CLI (e.g. a packaged desktop app shipping the runtime) needs the resolved path to spawn copilot … subcommands directly — for instance when there is no copilot on PATH in a shipped build.

The value already exists in internal/embeddedcli.Path, but internal/ isn't importable by downstream modules. This exposes it through the public surface, mirroring the existing Setup wrapper one-to-one.

Notes

  • Purely additive; no behavior change to existing APIs.
  • internal/embeddedcli.Path already returns "" when Setup was never called and is memoized via sync.OnceValue, so the documented semantics are inherited as-is.
@tbrady77 tbrady77 requested a review from a team as a code owner June 15, 2026 17:18
@SteveSandersonMS SteveSandersonMS force-pushed the embeddedcli-path-accessor branch from ce29122 to 048b1f0 Compare June 24, 2026 12:16
@SteveSandersonMS SteveSandersonMS merged commit 7aa67e5 into github:main Jun 24, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants