Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
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.
Types ¶
type Config ¶
type Config struct {
Cli io.Reader
CliHash []byte
License []byte
RuntimeLib io.Reader
RuntimeLibHash []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
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.
RuntimeLib and RuntimeLibHash are optional: when set, the native in-process runtime library (cdylib) is installed next to the CLI binary so the in-process (FFI) transport can load it. They are omitted for CLI packages that do not ship the native runtime.