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_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.
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.
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.
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
unpublish
memstead unpublish <scope>/<name> — remove a mem from the registry.
update
memstead update — strict-by-default entity update.
workspace
memstead workspace ... — workspace introspection and configuration commands.

Constants§

CREATE_AFTER_LONG_HELP
Combined --help epilog for memstead create: the section-bytes- verbatim note followed by the title→slug pipeline description. clap’s after_long_help takes a single string, so the two epilogs are pre-concatenated here.
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.
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).

Functions§

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.