install

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: MIT Imports: 15 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 install adds and removes Smif's hooks, status line, slash command, MCP registration and service unit (RFC 7.3, 7.4, R-OPS-1).

Every file it edits is backed up first. Uninstall restores the backup byte for byte when the file has not changed since install; otherwise it removes only Smif's entries.

Index

Constants

View Source
const Label = "local.smif"

Label is the launchd label.

Variables

View Source
var HookEvents = []string{"SessionStart", "SessionEnd", "UserPromptSubmit", "Stop"}

HookEvents are the Claude Code hooks Smif adds.

View Source
var LegacyLabels = []string{"local.mailroom", "dev.appnice.mailroom"}

LegacyLabels are the labels of installs made under the old name Mailroom (ADR-0016) and before 2026-11-02; install replaces such an agent and doctor still finds it.

Functions

func CommandPath

func CommandPath() string

CommandPath is ~/.claude/commands/smif.md.

func HookCommand

func HookCommand(bin, event string) string

HookCommand is the command line for one hook event.

func LaunchdPlist

func LaunchdPlist(bin, logPath string) []byte

LaunchdPlist renders the launchd agent.

func ServiceLoaded

func ServiceLoaded() (bool, string)

ServiceLoaded reports whether the service is loaded (for doctor).

func SettingsPath

func SettingsPath() string

SettingsPath is ~/.claude/settings.json.

func SlashCommand

func SlashCommand(bin string) []byte

SlashCommand is the /smif command file. Digest content enters the session only when the human types /smif.

func StatusLineCommand

func StatusLineCommand(bin, existing string) string

StatusLineCommand builds the status-line command, wrapping an existing one.

func SystemdUnit

func SystemdUnit(bin string) []byte

SystemdUnit renders the systemd user unit.

func Uninstall

func Uninstall(o Options) error

Uninstall reverses Install.

Types

type FileRecord

type FileRecord struct {
	Path    string `json:"path"`
	Existed bool   `json:"existed"`
	Backup  string `json:"backup,omitempty"`
	PreSHA  string `json:"pre_sha,omitempty"`
	PostSHA string `json:"post_sha"`
}

FileRecord tracks one edited file.

type Manifest

type Manifest struct {
	InstalledAt       time.Time       `json:"installed_at"`
	Binary            string          `json:"binary"`
	Files             []FileRecord    `json:"files"`
	StatusLineOrig    json.RawMessage `json:"statusline_original,omitempty"`
	MCPRegistered     bool            `json:"mcp_registered"`
	ServiceKind       string          `json:"service_kind,omitempty"`
	ServicePath       string          `json:"service_path,omitempty"`
	ServiceWasPresent bool            `json:"service_was_present,omitempty"`
}

Manifest is ~/.config/smif/install.json.

func Install

func Install(o Options) (*Manifest, error)

Install performs every install step and writes the manifest.

func LoadManifest

func LoadManifest() (*Manifest, error)

LoadManifest reads the manifest (nil if not installed).

type Options

type Options struct {
	Binary        string // absolute path of the smif binary
	ClaudeCommand string // for `claude mcp add/remove`
	NoService     bool
	NoMCP         bool
	Log           func(format string, a ...any)
}

Options control install and uninstall.

Jump to

Keyboard shortcuts

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