Skip to main content

Module commands

Module commands 

Source

Modules§

admin
memstead admin — admin-only moderation over the registry’s admin endpoints. There is deliberately no web admin panel: moderation runs from the terminal, gated server-side by the MEMSTEAD_ADMINS allowlist (the CLI just sends the caller’s token; a non-admin gets a 403). Every action is recorded in the registry’s append-only audit log. Like unpublish, these destructive calls never auto-trigger the Device Flow — authenticate first with memstead login.
anchors
memstead anchors — read provenance anchors (E3a).
batch
Shared plumbing for the batch command family (batch-update, batch-create, batch-relate): the per-entry markdown breakdown, the refused-batch error envelope, and the exit-code mapping. One module so the three commands render and refuse identically — the family contract is enforced by construction, not by convention.
batch_create
memstead batch-create --from <file.json> — create many entities in one call: one workspace load, one commit per touched mem, all-or-nothing with report-all refusals.
batch_relate
memstead batch-relate --from <file.json> — apply many edge changes in one call: one workspace load, one commit per touched mem, all-or-nothing with report-all refusals.
batch_update
memstead batch-update --from <file.json> — update many entities in one call.
branch_reset
memstead branch-reset <mem> <target_sha> — the engine’s history- rewrite primitive exposed as a CLI subcommand.
changes
memstead changes — diff a mem’s HEAD against a caller-provided SHA.
check
memstead check — record a check of one entity (agent-trust plan 14).
context
create
memstead create — create a new entity from flags or a JSON file.
delete
memstead delete — remove an entity, its file, and all its relationships.
domain
memstead domain … — manage the keys that authorise publishing under a <domain>:<handle> scope.
due
memstead due — render the due-brief: every open entity whose schema-declared due date falls inside the window, overdue first, across every mem whose schema declares the axis (read-only mounts labelled as third-party quoted data). The renderer is the shared engine entry point Engine::render_due_brief, so the CLI and UniFFI serve byte-identical content — the projection-brief precedent. There is deliberately no MCP tool (briefs are the CLI/app family); the MCP server instructions name this verb as the CLI companion.
entity
export
health
init
memstead init — bootstrap a filesystem mem in the current (or named) folder.
install
memstead install — two accepted input shapes:
link
memstead link <scope/name> — fetch a published mem from the registry, cache it locally, and record the dependency in the filesystem workspace config.
list
login
memstead login — run the GitHub Device Flow and persist the resulting token at ~/.config/memstead/credentials keyed on the registry host.
logout
memstead logout — remove the stored credentials entry for one registry host. Silent no-op if nothing was stored.
mem
memstead mem init / memstead mem delete — full-only mem-lifecycle CLI front-ends.
mem_repo
memstead mem-repo ... — mem-repo-git lifecycle commands.
overview
projection
memstead projection — the binding (projection-promotion) command tree.
publish
memstead publish [<file.mem>] — upload a mem to the registry.
quickstart
memstead quickstart — the batteries-included cold start.
recover
memstead recover — bulk-fix accumulated parse-time drift.
relate
memstead relate — add or remove a typed relationship between two entities.
relations
reload
memstead reload — refresh the engine’s in-memory store from on-disk branch state. CLI surface parity with the MCP memstead_reload tool: without the Reload subcommand variant, memstead reload would refuse with unrecognized subcommand while the same op stays reachable through MCP. AGENTS.md’s parity rule (“every operation reachable through the engine SHOULD be reachable via both UniFFI and CLI”) makes this the correct direction to close.
rename
memstead rename — change an entity’s title, ID, file path, and every incoming wiki-link.
review_mark
memstead review-mark — read and move the per-mem review mark.
schema
memstead schema validate <path> — load a schema package from disk and report whether it conforms to the engine’s schema rules.
search
status
transport
memstead fetch / memstead pull / memstead push CLI subcommands. The three engine surfaces share refusal codes and an outcome shape; the CLI front-end is a thin print of each.
type_cmd
uninstall
memstead uninstall <name> — the symmetric removal for memstead install: unregister an installed read-mem’s workspace-level mount. Registration-only by default — the global cache copy is shared across workspaces and survives (a later install of the same archive re-registers without a download).
unpublish
memstead unpublish <scope>/<name> — remove a mem from the registry.
update
memstead update — strict-by-default entity update.
verify_anchors
memstead verify-anchors --mem <name> — the standalone drift statement: verify every anchor in a mem against its declared source, with no binding required. Read-only on mem content — pure sidecar read plus filesystem observation, no commit on any backend.
workspace
memstead workspace ... — workspace introspection and configuration commands.

Constants§

FILTER_HELP
--help epilog for memstead search and memstead list. Names the five frozen named-flag shortcuts and points at --filter KEY=VALUE as the path to any other schema-declared filterable: equality field.
SECTION_BYTES_VERBATIM_HELP
--help epilog for memstead create and memstead update. The CLI stores --section / --append / --patch flag values as bytes verbatim — backslash escapes (\n, \t, …) are NOT interpreted. Agents reading the help learn the multi-line-authoring escape hatch (--from <JSON file>) before they hit the friction.

Functions§

create_after_long_help
Combined --help epilog for memstead create: the section-bytes- verbatim note followed by the title-grammar rule (derived from the validator via memstead_base::TITLE_GRAMMAR_RULE) and the title→slug pipeline description. clap’s after_long_help takes a single string, so the epilogs are concatenated here.
merge_mem_changed_json
Merge a mem_changed notice array into a --json CLI response body. No-op when no reload happened during the operation or the body is not a JSON object. Mirrors the MCP server’s attach_mem_changed so the two surfaces emit the same key. (Always compiled; on lean the engine never stashes a notice, so notices is empty and this no-ops.)
parse_filter_arg
Parse a KEY=VALUE argument supplied via --filter. Returns a typed CliError on malformed input so the failure rides the INVALID_INPUT envelope rather than crashing the process.
render_mem_changed_block
Render a human-readable mem_changed block for markdown CLI output. Empty when no reload happened. Names memstead changes-since (never memstead diff) for the follow-up, matching the cross-surface recovery contract. (Always compiled; on lean notices is always empty, so this returns the empty string.)
render_type_guidance_block
Render the per-entity-type guidance block surfaced on memstead_create’s text mirror. Emits one “Type-level guidance” section per entity_type key in the map. Returns an empty string when the map is empty so callers can concatenate unconditionally. The structured channel ships the same data top-level on type_guidance.
slug_derivation_help
--help text describing the title→slug pipeline. Shared by memstead create and memstead rename so an agent reading either command’s help can predict what slug a given title will produce (and therefore why the strict gate refuses titles outside the pipeline’s accepted character classes). The leading title-grammar rule is derived from the validator’s own memstead_base::TITLE_GRAMMAR_RULE at build time, not transcribed — the docs cannot drift from the accept set alone.