Repository navigation
feat: installable via cargo/brew/npm/plugin + schliffe setup - #12
Merged
Merged
Conversation
The keystone every install path reuses: a package manager, plugin, or curl script only has to place the binary, then `schliffe setup` does what the shell installer did inline — shim the commands, put the shims first in PATH across the login/interactive shell files, register the Claude Code hook, and lock down ~/.schliffe. Unlike the inline script it is auditable (`--dry-run` prints every planned change) and reversible (`--uninstall` removes the shims and PATH block, preserving the rest of each profile). Unix-only. The profile-editing logic is pure (content in, content out) with 8 unit tests; a full setup/uninstall round-trip was verified against a temp HOME.
When the Claude Code plugin ships the hooks, registering them again in settings.json would double-process every MCP result. --no-hook does the shims + PATH only, leaving settings.json untouched.
Ships Schliffe's hooks (MCP result trimming, image shrinking, pasted-log warnings) declaratively, so installing via `claude plugin install` needs no manual settings.json editing — more trustworthy than piping a script. The shell-command shim still needs PATH, which a plugin cannot set, so a bundled /schliffe-setup command runs `schliffe setup --no-hook` to wire it. The binary itself comes from brew/cargo/npm/curl (documented in the command).
The installer now only acquires the binary (download or build) and calls `schliffe setup`, which owns the shims, PATH wiring, hook registration and permission repair. Removes ~110 lines of shell that duplicated that logic — one source of truth shared with Homebrew/cargo/npm/plugin. Verified end-to-end from source in an isolated HOME.
Three more trustworthy, command-based install paths, all built on `schliffe setup`: - Homebrew: a prebuilt-binary formula for a tap (packaging/homebrew), with instructions to fill the per-release checksums. - npm: a dependency-free package (packaging/npm) whose postinstall downloads the platform binary and verifies it against SHA256SUMS, exposing `schliffe` via a thin launcher. - cargo: adds description/repository/keywords/categories so the crate is publish-ready (`cargo publish --dry-run` passes). packaging/README documents the publish and install steps for each.
Adds a package-manager section (cargo/brew/npm → `schliffe setup`) and the Claude Code plugin flow, plus `schliffe setup` in the command list.
setup.rs used std::os::unix::fs::symlink unconditionally; the module still has to compile on Windows even though `setup` returns early there. Wraps it in a cfg-gated helper (Unsupported error on non-Unix).
Delegating activation to `schliffe setup` coupled install.sh to a binary feature the current release lacks: `curl | bash` downloads the released binary, which has no `setup` yet, so activation failed. Restore the inline activation so the script works with any binary version. `schliffe setup` remains the activation path for cargo/brew/npm/plugin, where the binary is built from matching source. install.sh can delegate again once a release that ships `setup` is out.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Makes Schliffe installable through trustworthy, command-based paths — not just a piped script — all built on one auditable activation step.
Foundation —
schliffe setup(in the binary): shims + PATH across login/interactive shell files + Claude Code hook +~/.schliffepermission repair. Auditable (--dry-runprints every planned change) and reversible (--uninstallremoves the shims and PATH block, preserving the rest of each profile).--no-hookskips hook registration for the plugin path. Unix-only.Five install paths, all converging on
schliffe setup:install.sh) — refactored to delegate activation toschliffe setup(−110 lines of duplicated shell)cargo install schliffe— crate metadata added,cargo publish --dry-runpassesbrew install mkmuniz/schliffe/schliffe— prebuilt-binary formula for a tap (packaging/homebrew)npm i -g schliffe-tk— dependency-free package, postinstall downloads + SHA256-verifies the platform binary (packaging/npm)settings.jsonediting; bundled/schliffe-setupwires the shimpackaging/README.mddocuments the publish steps (the cargo/npm/brew publishes need the maintainer's accounts).Known limit: the shell-command axis always needs a PATH shim, so
schliffe setupis required even on the plugin/brew paths — a plugin alone cannot set PATH (the reason the shim exists over a hook).Test plan
install.sh --from-sourceend-to-end in an isolated HOMEcargo publish --dry-runpasses; plugin + npm JSON validated;node --checkon the npm scriptscargo clippy --all-targets -- -D warnings+cargo fmt --checkclean