Documentation
¶
Overview ¶
Package setup owns the user-facing installation state: which transport is installed, where its artifacts live, which global clients are registered, and how all of that is diagnosed and removed. It deliberately lives outside the browser engine because installation is a local-filesystem concern and must not create a Chrome process.
Index ¶
- Constants
- Variables
- func BinarySuffix() string
- func Home() (string, error)
- func InstallEmbeddedSkills() ([]string, error)
- func InstalledSkillDirs() []string
- func InstructionPath(home, client string) string
- func LegacyMCPPresent(paths Paths, clients []string) (bool, error)
- func ParseClients(value string) ([]string, error)
- func PrintDoctor(out io.Writer, checks []DoctorCheck, strict, asJSON bool) error
- func PrintStatus(out io.Writer, status Status, asJSON bool) error
- func RemoveInstalledSkills() int
- func RunInstructions(out io.Writer, write bool, clientsFlag string) error
- func SetEmbeddedSkill(name, content string)
- func SetEmbeddedSkillFile(path, content string)
- func SetVersion(v string)
- func Uninstall(yes, purge bool, out, errOut io.Writer) error
- func UserSkillsDir() (string, error)
- type Check
- type DoctorCheck
- type Manifest
- type Mode
- type Paths
- type Status
Constants ¶
const (
DefaultClients = "claude,codex,grok"
)
Variables ¶
var BundledSkillNames = []string{"ghostchrome"}
BundledSkillNames lists every skill ghostchrome ships, used for removal even when the embed is empty (e.g. a stripped build).
Functions ¶
func BinarySuffix ¶
func BinarySuffix() string
func InstallEmbeddedSkills ¶
InstallEmbeddedSkills writes each bundled skill to ~/.claude/skills/<name>/. Returns the installed paths. Best-effort: failures are reported, not fatal.
func InstalledSkillDirs ¶
func InstalledSkillDirs() []string
InstalledSkillDirs returns the on-disk dirs of bundled skills that exist.
func InstructionPath ¶
func ParseClients ¶
func PrintDoctor ¶
func PrintDoctor(out io.Writer, checks []DoctorCheck, strict, asJSON bool) error
func RemoveInstalledSkills ¶
func RemoveInstalledSkills() int
RemoveInstalledSkills deletes every bundled skill dir from ~/.claude/skills. Returns the count removed.
func RunInstructions ¶
RunInstructions rewrites the managed policy block in every selected client instruction file. write must be the confirmation the caller obtained; clientsFlag is the raw comma-separated client list.
func SetEmbeddedSkill ¶
func SetEmbeddedSkill(name, content string)
SetEmbeddedSkill registers an embedded skill's content (called from the binary entrypoint that owns the embed).
func SetEmbeddedSkillFile ¶
func SetEmbeddedSkillFile(path, content string)
SetEmbeddedSkillFile registers one path from the complete embedded skill tree. Paths are relative to the skill directory and must not escape it.
func SetVersion ¶
func SetVersion(v string)
SetVersion records the binary version written into the manifest.
func UserSkillsDir ¶
Types ¶
type Check ¶
type Check struct {
Name string `json:"name"`
Status string `json:"status"`
Detail string `json:"detail,omitempty"`
}
Check is one line of the runtime diagnostic reported by `ghostchrome doctor`.
type DoctorCheck ¶
type DoctorCheck struct {
Name string `json:"name"`
Status string `json:"status"`
Detail string `json:"detail,omitempty"`
}
func RunDoctor ¶
func RunDoctor(strict bool) ([]DoctorCheck, error)
type Manifest ¶
type Manifest struct {
SchemaVersion int `json:"schema_version"`
Mode Mode `json:"mode"`
Version string `json:"version"`
InstallRoot string `json:"install_root"`
Binary string `json:"binary"`
Clients []string `json:"clients"`
SkillSHA256 string `json:"skill_sha256,omitempty"`
ManagedFiles []string `json:"managed_files"`
InstalledAt string `json:"installed_at"`
}
Manifest is intentionally small and forward-compatible. Paths are absolute so a client can consume the file without having to expand `~`. managed_files contains files Ghostchrome may update/remove; it never grants permission to remove arbitrary user files.