Skip to content
On this page

CLI reference ​

The lookup page for npx -y @vivswan/maxims: every verb, every flag, and every exit code, one row each. The behavior behind the rows lives on the pages the rows link to; this page owns nothing but the table cells.

The npm package is @vivswan/maxims; the binary it installs is maxims. Command shapes mirror npx skills, same flags, same short forms, same prompts, so a person running both never remembers two spellings.

The next dist-tag carries a pre-release built from main. A next build appears when a merge changes what the package ships (the bundled code, its dependencies, the README, the license), not on every merge.

Verbs ​

verbaliaswhat it doesnetworkowner
add <source>afetch the source, record its destination, selection, rule flag, and harnesses in state, then syncyesinstall
syncapply state to this machine and project: link bodies, regenerate rule files, reconcile hookspast the cooldownkeep fresh
update [source]check, upgraderefetch every source, or the one named, ignoring the cooldown, then syncalwayskeep fresh
remove <source or name>rm, rtake a source or one memory out of state, then syncnoremove
listlswhat state holds per source and per harness, everything past intent re-derivednocheck
show <memory or source>one memory in full, or a source's facts and the changes it holds for reviewnocheck
installireplay the project lock: add every source it names at project scope, then syncyesshare
share <source>, unshare <source>put a project-scope source into the project lock, or take it outnoshare
link <source> -a <harness>add a harness to a source's recorded list without a refetch, then syncnobelow
unlink <source> -a <harness>drop a harness from a source's recorded list, then syncnobelow
disable <memory>keep a memory in state but withhold its rule line and link here, then syncnobelow
enable <memory>undo disable, then syncnobelow
review <source>hold this source's upstream changes until acceptnokeep fresh
unreview <source>let upstream changes apply at once again, accepting any heldnokeep fresh
accept <source>, accept --allapply the held revision of one source, or of every held source, then syncnokeep fresh
doctorreport, per harness, whether the rule file and hook are where it loads themnocheck
lint [path]check a folder of memory files against the contract before publishingnomemories
config set|get|unset <key> [value]read or write a user defaultnofiles
init [name]scaffold a contract-valid memory filenomemories
  • Two scopes exist, project (-p) and user (-g). -o is an output folder for a rule file no harness owns, and it is neither scope.
  • No source argument. sync, install, and doctor read state or the lock instead. update alone refreshes every source, and update <source> one.
  • remove takes a source or a bare memory name. A bare name two sources both provide is ambiguous, so remove exits 1 and prints the qualified forms.
  • show takes a bare memory name or a source. A name two sources provide exits 1 and lists them; --source <key>, -g or -p picks one. An argument that is both is read as the memory, with a tip naming the source.
  • share and unshare touch the lock only, never what is installed.
  • link and unlink change one field, the source's harness list, and never refetch. add -a on an installed source still replaces the whole list, as it replaces the selection.
  • disable and enable act at one scope, the one you are in or the one -g or -p names. A memory disabled at project scope stays live for -g, and the other way round; the state schema owns where the list is kept. A source whose every memory is disabled at a scope has no rule file and no block there until one is enabled again.

Sources ​

A source is @owner/repo, owner/repo, a GitHub URL, any other git remote URL (https, http, ssh, git, or the git@host:path form), or a local directory. . installs the current working tree as a live source.

The @ in @owner/repo is cosmetic, as it is for skills.

source formwhat it means
@owner/repo@memory-namethe same as @owner/repo -m memory-name: one memory, by name
https://github.com/owner/repo/tree/<ref>a GitHub URL whose /tree/<ref> segment sets the ref, as --pin <ref> would
https://git.example.com/team/rules.git, git@host:pathany git remote, stored verbatim; how a source is fetched

A path after the /tree/<ref> segment is refused, because a branch containing / cannot be told from the path. Drop the /tree/ tail and pass the ref with --pin and the path with --from. A /blob/<ref>/<file> URL names one file where a source is a folder, so it is refused the same way: pass the ref with --pin, the file's folder with --from, and its name with --memory.

Flags ​

These flags work on every verb.

flagdefaultwhat it does
--dry-runoffthe exact plan and diff, nothing written; a failed fetch exits as without the flag
--jsonoffthe same plan as one JSON document, for CI assertions; never prompts, see below
--quietoffone-line output and fail-soft, see the exit codes below; the hook's mode
--verboseoffunfolds the add and install plan to every one-liner
-h, --help, -v, --versionstandard
  • --json never prompts. add and remove need -y or --all beside it, install needs -y, and --json with --list is refused. Each exits 1.

The rest belong to the verbs the second column names. A value flag takes --flag value or --flag=value. A list flag takes a comma list and may repeat, so -m a,b -m c selects three memories.

flagverbsdefaultmeaning
-g, --globaladd, remove, show, disable, enableautothe user scope; where it lands
-p, --projectadd, remove, show, disable, enableautothe project scope; where it lands
-o, --out <dir>add, removeoffan output folder instead of a scope; where it lands
-m, --memory <names>add, remove*only these memories; what gets installed
-a, --agent <ids>add, remove, sync, update, install, link, unlinkdetectedtarget harnesses, ids from the matrix; each verb reads it differently, see below
-l, --listaddoffpreview the source, write nothing; what gets installed
-y, --yesadd, remove, installautoskip the confirmation prompt; non-interactive behavior
--alladd, remove, acceptoffevery memory, every harness, no prompt; what gets installed
--ruleaddoffpublish one-liners into the rule file; two separate choices
--add-hookaddoffregister the harness's sync hook and MCP server where declared; two separate choices
--shareaddoffrecord the source in the project lock as well as in state
--copyaddoffcopy bodies instead of linking them; bodies
--linkaddoff, on for .local sources: link the store to the directory; bodies
--from <path>addmemories/the folder in the source holding memories; source layout
--full-depthadd, lintoffscan the whole source; source layout
--pin <sha or tag>addofftrack this ref; refs
--paths <glob>addoffscope the rules to matching files, repeatable; path scoping
--rename <upstream>=<local>add, updateoffresolve a name collision, repeatable; collisions
--allow-hiddenaddoffaccept descriptions carrying hidden characters
--reviewaddoffhold upstream changes until accept; hold changes for review
--strictadd, install, updateoffrefuse a source whose descriptions carry a risky shape, exit 3
--authaddofffetch with your gh login, as MAXIMS_AUTH=1 does; fetching
--no-fetchsyncoffnever touch the network; fetching
--cooldown <days>add, sync, update7days between refreshes, saved to config.json; the cap and the cooldown
--cap <n>add, sync, update, lint25most rule lines per source, saved to config.json; the cap and the cooldown
--expect <name or @owner/repo/name>doctoroffassert this memory has a rule line, repeatable; the CI one-liner
--source <key>showoffthe source to read the memory from, when several provide the name; read one memory
  • -a on sync limits the run to the named harnesses and fetches nothing; -a '*' names them all and fetches as a plain sync does.
  • -a on update does not narrow the refresh: every source, or the one named, is still fetched, and a refreshed source is written for every harness that reads it. The filter narrows only the untouched sources.
  • --rename on update needs the source it applies to, so update --rename a=b without one exits 1.
  • -a on remove drops those harnesses from a whole source and is refused on a memory.
  • --strict on update plans the refresh first and applies it only when no warning exists.
  • --all on accept takes every held source.

On lint, --cap is a threshold for this run only and persists nothing; the lint section owns it.

Flags compose. The everyday invocation, add @Octocat/rules -g --rule --add-hook, is the quickstart.

Exit codes ​

codemeaning
0success, or nothing to do
1usage error, or a failed check
2source unresolvable
3nothing resolved to install
4destination write failed
5store locked
6name collision
7unmet dependency
8rule cap exceeded
  • Exit 0 includes "already up to date" and every --quiet outcome.
  • Exit 1 follows an unknown flag, --json on add, remove, or install without -y (--all also serves on add and remove), --json with --list, -g with -o, an ambiguous bare name, a show of a name that is not installed, a non-interactive remove without --yes, a re-add of an installed source at another scope (remove it first), or a doctor --expect that is not met.
  • Exit 2 follows a repo not found, no read access, a missing local directory, a non-GitHub git URL with no git on PATH, or an interactive sync whose fetch failed.
  • Exit 3 follows a --memory name the source lacks, a filter matching nothing, a source with zero valid memories, a source carrying hidden characters without --allow-hidden, a risky shape under --strict, or a lint that found problems.
  • Exit 4 follows permissions, a read-only filesystem, a full disk, an unparsable harness config, a rule file whose block marker carries another version, or a remove or unlink refused because stray marker lines surround the block.
  • Exit 5 means another maxims process held the lock past the wait.
  • Exit 6 means an incoming memory's name is owned by another source and no rename was chosen.
  • Exit 7 means a [[wikilink]] target does not resolve.
  • Exit 8 means the source's rule-flagged set is over the cap, or a rule file is over the harness's byte budget.

Codes 3, 6, 7, and 8 are one family. The install would be incomplete, so nothing at all is written; a partial install is a set of rules the user believes is loaded and is not.

--json prints a failure as one document: ok: false, code (the exit), message, and hint (null when there is none). A failure reported after the verb's run adds its success document's fields, so sync and update put a dry run's plan in it alike; one before the run (an unknown flag) carries the four alone. Under --quiet the document still names the code and the exit is 0.

--quiet collapses every non-zero code to 0 after logging. This is a requirement, not an optimization. A harness shows a failing hook to the user at every session start, and fail-soft is what keeps that notice from becoming permanent.

Built from main at 5f6e985Source: docs/cli.md