@builtbyberry/prymer-cli
v0.2.0
Published
The Prymer executing-hook helper: load context at session start and checkpoint at session stop, deterministically, from a scoped channel credential.
Maintainers
Readme
prymer — Prymer executing-hook helper
A small, dependency-free CLI for the executing-hook power mode. The web connectors install instructional hooks that nudge the model to call the Prymer MCP tools. This CLI instead runs the ritual itself, so the load step happens deterministically — even when the model forgets.
It is built on Node's standard library only (no npm dependencies).
Install
npm install -g @builtbyberry/prymer-cliAuthenticate
- In Prymer, open Settings → Connected tools and create a hook credential
for the channel you want this machine to use. The token (
swhk_…) is shown once. - Store it:
prymer login --url https://your-prymer-host --token swhk_xxxThe token reaches exactly one channel and only the load + checkpoint verbs, so a
leak is contained to that channel — never your whole account. On macOS it is kept
in the login keychain; elsewhere in a ~/.prymer/*.json file with 0600
permissions. Use --profile <name> to keep tokens for several channels side by
side.
Use it in hooks
prymer install-hooks --client codex # writes .codex/hooks.json
prymer install-hooks --client claude # writes .claude/settings.jsonBoth write a SessionStart hook that runs prymer inject. Codex and Claude Code
both feed SessionStart stdout to the model as additional context, so the
channel's context document loads automatically at the start of every session.
Commands
| Command | What it does |
| ----------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| prymer login | Store a hook credential (verifies it before saving). |
| prymer logout | Remove a stored credential. |
| prymer whoami | Show the stored host + a masked token. |
| prymer inject | Print the channel's context document (for SessionStart). Fails quiet so it never breaks a session; use --strict to surface errors. |
| prymer checkpoint --title <t> --summary <s> | Append a checkpoint. Idempotent per session + state; only shares when the channel's capture mode is Auto. |
| prymer install-hooks --client <codex\|claude> | Write the executing SessionStart hook for a client. |
Checkpointing
inject is fully deterministic — no model needed. A checkpoint, by contrast,
needs a summary worth keeping, so it's a step the agent (or you) takes when there
is something to record rather than a blind Stop hook:
prymer checkpoint --session "$SESSION_ID" \
--title "Finished the billing fix" \
--summary "Switched to Stripe; tests green."The idempotency key is derived from the session id + title + summary, so re-running the same checkpoint for the same session is a no-op rather than a duplicate.
Test
cd cli/prymer && npm test