integrate

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2026 License: Apache-2.0 Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package integrate connects hopsesh to the rest of the user's machine: the command-line tool on PATH (for app installs) and the hopsesh skill for Claude Code. Both are opt-in and reversible, and neither ever replaces something hopsesh did not create.

Index

Constants

View Source
const (
	CLIMissing    = "missing"    // nothing there
	CLIOurs       = "ours"       // a link to this app's tool
	CLIOtherApp   = "other-app"  // a link into another copy of hopsesh.app
	CLIDangling   = "dangling"   // a link whose target is gone (the app moved or was deleted)
	CLIStandalone = "standalone" // a regular file (install script, go install)
	CLIForeign    = "foreign"    // a link somewhere else (e.g. Homebrew)
)

States of the command-line tool link at ~/.local/bin/hopsesh.

Variables

This section is empty.

Functions

func AddToPath

func AddToPath() (string, error)

AddToPath appends a marked block that puts ~/.local/bin on PATH to the login-shell profile (only when the user asks). It returns the file it changed.

func AdoptLoginEnv

func AdoptLoginEnv()

AdoptLoginEnv sets CLAUDE_CONFIG_DIR in this process from the login shell when the process does not have it (an app started from Finder), so every part of hopsesh, and the programs it starts, use the same Claude Code folder.

func AppCLI

func AppCLI() (string, error)

AppCLI is the command-line tool inside the running app bundle, or an error explaining why it cannot be linked (not an app, running from a disk image or a translocated copy).

func ClaudeConfigDir

func ClaudeConfigDir() string

ClaudeConfigDir is Claude Code's config folder: CLAUDE_CONFIG_DIR from this process or the login shell, else ~/.claude.

func ClaudeSettingsPath

func ClaudeSettingsPath() string

ClaudeSettingsPath is Claude Code's user settings file.

func InstallSkill

func InstallSkill(force, addRules bool) (claudeskill.Status, []string, error)

InstallSkill installs or updates the skill, and adds the permission rules when asked.

func LinkPath

func LinkPath() string

LinkPath is where the command-line tool is linked.

func LoginEnv

func LoginEnv() map[string]string

LoginEnv returns PATH, CLAUDE_CONFIG_DIR and HOME from an interactive login shell (cached; empty values when it cannot be read).

func LoginPathHas

func LoginPathHas(dir string) bool

LoginPathHas reports whether dir is on the login shell's PATH (falling back to this process's PATH when the shell cannot be read).

func LookLoginPath

func LookLoginPath(name string) string

LookLoginPath finds a command on the login shell's PATH.

func RemovePathBlock

func RemovePathBlock() error

RemovePathBlock removes the block AddToPath added, if present.

func RemoveSkill

func RemoveSkill(force bool) error

RemoveSkill removes the skill hopsesh installed (force: even an edited one).

func SkillBin

func SkillBin() string

SkillBin is how Claude Code should run hopsesh: plain "hopsesh" when the user's login shell finds it, otherwise an absolute path (the linked tool, the app's tool, or this program).

func SkillParams

func SkillParams() claudeskill.Params

SkillParams are what this build renders into the skill.

func SkillRulesPresent

func SkillRulesPresent() bool

SkillRulesPresent reports whether the optional permission rules are in place.

func SkillStatus

func SkillStatus() (claudeskill.Status, error)

SkillStatus checks the installed skill against this build.

func UninstallCLI

func UninstallCLI() error

UninstallCLI removes the link when it points into a hopsesh.app (or is broken), and the PATH block hopsesh added, if any.

Types

type CLIStatus

type CLIStatus struct {
	State      string `json:"state"`
	Path       string `json:"path"`             // ~/.local/bin/hopsesh
	Target     string `json:"target,omitempty"` // where the link points
	AppCLI     string `json:"appCli,omitempty"` // the tool inside this app
	DirOnPath  bool   `json:"dirOnPath"`        // ~/.local/bin is on the login PATH
	Resolves   string `json:"resolves,omitempty"`
	Profile    string `json:"profile,omitempty"` // file "Add to PATH" would change
	PathLine   string `json:"pathLine"`
	PathAdded  bool   `json:"pathAdded,omitempty"` // hopsesh's block is in the profile
	CanInstall string `json:"cannotInstall,omitempty"`
}

CLIStatus describes the command-line tool link.

func CheckCLI

func CheckCLI() CLIStatus

CheckCLI reports the state of ~/.local/bin/hopsesh without following it.

func InstallCLI

func InstallCLI(force bool) (CLIStatus, error)

InstallCLI links ~/.local/bin/hopsesh to this app's tool. It replaces only links that hopsesh made (into a hopsesh.app, or broken ones); a standalone copy or someone else's link is replaced only with force, and kept as hopsesh.bak-<time>.

Jump to

Keyboard shortcuts

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