embeddedcli

package
v1.0.13 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Path = sync.OnceValue(func() string {
	setupMu.Lock()
	defer setupMu.Unlock()
	if !setupDone {
		return ""
	}
	pathInitialized = true
	path := install()
	return path
})

Functions

func RuntimeLibPath added in v1.0.7

func RuntimeLibPath() string

RuntimeLibPath returns the on-disk path to the installed native in-process runtime library (cdylib), or "" when no runtime library was bundled or the CLI could not be installed. It ensures the embedded CLI is installed first.

func RuntimePath added in v1.0.13

func RuntimePath() string

RuntimePath returns the installed copilot-runtime executable, or "" when the application bundle predates the out-of-process runtime pair.

func Setup

func Setup(cfg Config)

Types

type Config

type Config struct {
	Cli     io.Reader
	CliHash []byte

	License []byte

	RuntimeLib     io.Reader
	RuntimeLibHash []byte

	RuntimeExecutable     io.Reader
	RuntimeExecutableHash []byte
	RuntimeNode           io.Reader
	RuntimeNodeHash       []byte
	RuntimeAssets         io.Reader
	RuntimeAssetsHash     []byte

	// LinuxMuslCli and LinuxMuslRuntimeLib are optional alternatives selected
	// automatically when the application runs on a musl-based Linux system.
	LinuxMuslCli                   io.Reader
	LinuxMuslCliHash               []byte
	LinuxMuslRuntimeLib            io.Reader
	LinuxMuslRuntimeLibHash        []byte
	LinuxMuslRuntimeExecutable     io.Reader
	LinuxMuslRuntimeExecutableHash []byte
	LinuxMuslRuntimeNode           io.Reader
	LinuxMuslRuntimeNodeHash       []byte
	LinuxMuslRuntimeAssets         io.Reader
	LinuxMuslRuntimeAssetsHash     []byte

	Dir     string
	Version string
}

Config defines the inputs used to install and locate the embedded Copilot CLI.

Cli and CliHash are required. If Dir is empty, the CLI is installed into the system cache directory. When Version is set, the CLI is installed into a version-specific child directory so multiple versions can coexist. License, when provided, is written next to the installed binary.

RuntimeExecutable and RuntimeNode form the adjacent out-of-process runtime pair. RuntimeAssets is a filtered release package archive containing auxiliary binaries and resources. RuntimeLib is the same cdylib bytes installed under the natural platform name for the optional in-process transport.

Jump to

Keyboard shortcuts

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