Skip to content

feat: installable via cargo/brew/npm/plugin + schliffe setup - #12

Merged
mkmuniz merged 8 commits into
mainfrom
feat/install-setup
Oct 12, 2026
Merged

mkmuniz merged 8 commits into
mainfrom
feat/install-setup

Conversation

@mkmuniz

@mkmuniz mkmuniz commented Oct 12, 2026

Copy link
Copy Markdown
Owner

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 + ~/.schliffe permission repair. Auditable (--dry-run prints every planned change) and reversible (--uninstall removes the shims and PATH block, preserving the rest of each profile). --no-hook skips hook registration for the plugin path. Unix-only.

Five install paths, all converging on schliffe setup:

  • Shell script (install.sh) — refactored to delegate activation to schliffe setup (−110 lines of duplicated shell)
  • cargo install schliffe — crate metadata added, cargo publish --dry-run passes
  • brew 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)
  • Claude Code plugin + marketplace — ships the hooks with no manual settings.json editing; bundled /schliffe-setup wires the shim

packaging/README.md documents 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 setup is required even on the plugin/brew paths — a plugin alone cannot set PATH (the reason the shim exists over a hook).

Test plan

  • 8 unit tests for the pure profile-editing logic (append/prepend/zsh/noop/remove)
  • Full setup → verify → uninstall round-trip against a temp HOME (preserves existing profile content)
  • install.sh --from-source end-to-end in an isolated HOME
  • cargo publish --dry-run passes; plugin + npm JSON validated; node --check on the npm scripts
  • 204 tests passing, cargo clippy --all-targets -- -D warnings + cargo fmt --check clean

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.
@mkmuniz mkmuniz added feat New feature or new filter area/installer install.sh, install.ps1, release pipeline labels Oct 12, 2026
@mkmuniz mkmuniz self-assigned this Oct 12, 2026
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.
@mkmuniz
mkmuniz merged commit 2e99c07 into main Oct 12, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/installer install.sh, install.ps1, release pipeline feat New feature or new filter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant