Documentation
¶
Overview ¶
Package install owns the SOUL.md install conventions: harness detection, the per-framework target table, the overwrite gate, and the install receipt written by install.sh. Paths are injected so everything is testable without touching the real home directory.
Index ¶
Constants ¶
const ReceiptName = "positronick-install-receipt.json"
ReceiptName is the filename install.sh writes next to the binary — a cross-repo contract with install.sh and positronick.com/install.sh.
Variables ¶
var Targets = []string{"hermes", "claude", "cursor", "openclaw"}
Targets are the supported install targets, in detection-priority order.
Functions ¶
func DetectHarness ¶
DetectHarness returns the install target for the first harness marker directory found — all markers are checked in cwd first (a project-local harness wins), then in home — or "" when none exists. Only directories count; an empty cwd/home is skipped.
func TargetPath ¶
TargetPath returns the conventional SOUL.md location for a target. hermes, claude and openclaw are home-anchored; cursor is project-local (its rules live inside the repository).
func WriteReceipt ¶
WriteReceipt writes the receipt next to the binary at binPath, in the same shape install.sh produces.
Types ¶
type Options ¶
type Options struct {
// Target is one of Targets. It picks the destination (when Path is
// empty) and the formatting (cursor wraps the body in mdc frontmatter).
// An empty Target with a Path writes the body verbatim to Path.
Target string
// Path, when set, overrides the target's conventional destination.
Path string
// SoulName fills the cursor frontmatter description.
SoulName string
// Cwd and Home anchor the conventional paths (injected for tests).
Cwd, Home string
// Force overwrites an existing file without asking.
Force bool
// Link, with Target "claude", appends the @-import line to
// ~/.claude/CLAUDE.md when not already present.
Link bool
// Interactive enables the Confirm prompt for overwrites.
Interactive bool
// Confirm asks the user to approve overwriting the named file. Required
// when Interactive and the destination exists.
Confirm func(prompt string) (bool, error)
// OverwriteHint names the flag suggested when refusing to overwrite
// non-interactively; defaults to "--force".
OverwriteHint string
// Fetch returns the verbatim SOUL.md body. It is called only after the
// overwrite gate passes: the server's .md endpoint bumps the public
// download counter, and a refused install is not a download.
Fetch func() (string, error)
}
Options configures one SOUL.md install.
type Receipt ¶
Receipt records how the binary was installed. install.sh writes {"method":"installer","version":"..."}; `self update` rewrites it after a successful in-place update.
func ReadReceipt ¶
ReadReceipt reads the receipt next to the resolved binary at binPath. A missing, unreadable or malformed receipt yields method "unknown" — the binary is then treated like a package-manager install, which `self update` must never replace in place.