CLI reference
Commands and flags for the maester CLI — init, sync, status, config editing, publish, connectors, MCP servers, skills, and global options.
This page lists every Maester subcommand and the flags they accept. For prose explanations of how the commands fit together, start with Getting started.
Entry points
There are two ways to invoke Maester:
npx baller-maester— the top-level interactive menu. Detects whether the current repo is a citadel, a maester, both, or neither, and offers the relevant next step (initialize a citadel, configure this repo as a maester, add or remove sources and documents, install or upgrade an agent skill).maester <subcommand>— direct invocation of a named subcommand (e.g.maester sync,maester status,maester skill install). Useful for scripts, CI, and once you know which verb you want.
The top-level menu is the friction-free first run; direct subcommands are the durable scriptable surface.
Global flags
These flags work on every subcommand:
| Flag | Description |
|---|---|
--verbose | Log file paths, per-file metadata and its source, and skip reasons. |
--quiet | Print only errors and the final summary line. |
--json | Emit machine-readable output — one JSON object per line. |
--color, --no-color | Force colored output on or off. |
--theme <theme> | dark or light, overriding detection. |
--no-welcome | Suppress the banner on --help, --version, and first run. |
--help, -h | Show command help and exit. |
--version, -V | Print the installed Maester version and exit. |
The MAESTER_NO_WELCOME=1 environment variable has the same effect as
--no-welcome.
Command map
| Area | Commands |
|---|---|
| Citadel setup | init, add, remove, list |
| Keeping content fresh | sync, status |
| Publishing (a maester) | publish and its sub-verbs |
| Live services | connector, mcp-server, mcp |
| Agent skills | skill |
maester init
Interactive walk-through that creates a citadel.yaml at the current
working directory and (if a package.json is present) adds a
maester:sync script entry. Reachable directly via maester init or
through the npx baller-maester top-level menu.
maester init
The walkthrough collects:
- One or more sources. For each, it asks “Git repository or local directory?”: a git source takes a URL and ref; a local directory takes a path and a link-or-copy choice.
- An optional
includeslist per source. Skipping it means “use the source’smaester.yamlif present, otherwise link the whole repository” (see How a source picks its files). - Per-source auth, captured as the name of an environment variable. The secret value never lands on disk.
- An optional per-source destination override and a top-level
baseDir(pre-filled withcitadel). - Optional connectors and MCP servers.
- A final, recommended-by-default opt-in to install the Grand Maester agent skill for one or more target agents. Declining writes zero skill artifacts.
The walkthrough is idempotent — re-running it on a repo that already has a citadel shows the existing summary and offers safe options rather than silently overwriting.
maester add, remove, list
Edit the sources in an existing citadel.yaml without hand-editing
YAML.
maester add # same prompts as init, for one source
maester remove # pick a source to remove
maester list # table of sources (--json: { filePath, baseDir, sources })
- Edits keep comments, key order, and every entry you didn’t touch, and are fully re-validated and written atomically.
removerefuses the last source. It leaves the source’s synced folder on disk for you to delete.- Exit codes:
0ok ·1declined ·2missing or invalid config, or a refused edit ·130Ctrl-C.
maester sync
Synchronises the configured sources into the citadel’s destination tree.
maester sync # all sources
maester sync source-context # one named source
maester sync source-a source-b # several
maester sync --concurrency 8 # more sources in parallel (default 4)
Sync is atomic per source: each source’s destination is swapped in only after its checkout completes successfully. Individual source failures are isolated — other sources still land — but the exit code is non-zero if any source failed, so the command is CI-safe.
Each source’s destination receives a small provenance marker
(.maester-source.json) recording where the content came from, the
resolved commit or content fingerprint, the mode, and the active
filter set. maester status reads it to decide
whether the source is behind.
How each source is materialised depends on its mode:
| Source | Result |
|---|---|
| Git, includes- or manifest-driven | Files copied, with metadata stamped inline. Safe to commit. |
| Git, whole-repository | One symlink per file into .maester/cache/<name>/; destination gitignored. |
Local, mode: link | One symlink per file into the source directory; destination gitignored. |
Local, mode: copy | Files copied, with metadata stamped inline. |
Metadata at sync time
For every copied file, sync resolves
state, category, and tags per
field in the order inline → first matching rule → default, and
writes them into the destination copy using the format’s inline
convention. The original source files are never modified. Formats with
no inline convention (images, PDFs, binaries) are copied untagged, and
linked files are never rewritten.
A value inline in the file that differs from its rule produces a
warning (silenced by --quiet). --verbose shows every file’s values
and where each came from.
Sync output
By default, sync prints one line per source, plus a category and tag roll-up:
✓ source-context: added (71ce137) canon: 0 · draft: 25 · untagged: 0
› categories: spec 24 · changelog 1 · tags: none
Linked sources are labelled (linked), with the reason a source
resolved to whole-repository mode.
With --json, sync emits one JSON object per line: progress events,
then a result per source carrying name, kind, status,
destination, commitSha, mode, filterMode, state counts,
categoryBreakdown, tagRollup, and any warnings.
Sync exit codes
| Code | Meaning |
|---|---|
| 0 | All sources synced successfully. |
| 1 | One or more sources failed, or citadel.yaml is missing or invalid. |
maester status
Read-only check that reports whether each configured source is up to date or behind and needs a sync. Status never writes to the working tree — agents and CI scripts can call it freely.
maester status # check every source
maester status source-context # check one named source
A source is behind for one or more of these reasons:
| Reason | Meaning |
|---|---|
never-synced | No provenance marker — no prior sync ran. No network call made. |
remote-ref-advanced | (Git) The configured ref now resolves to a different commit than the recorded one. |
manifest-changed | The source’s maester.yaml publish surface changed, or the source switched filter mode (e.g. a manifest appeared). |
cache-missing | (Linked git sources) The .maester/cache/ copy the links point into is gone. |
local-changed | (Local sources) The files differ from the last sync. No network call made. |
Includes-driven sources skip the manifest-changed check (their
filter set is owned by the citadel, not the remote).
Status verdicts
Each source is reported as one of:
up-to-date— matches the recorded provenance for every checked signal.behind— at least one reason above applies.failed— the check itself couldn’t complete (missing env var, network error, unreachable remote). A local source whose directory or linked original is gone fails with reasonsource-missing. Other sources continue.
Status exit codes
Designed to be branchable in a single check:
| Code | Meaning |
|---|---|
| 0 | Every checked source is up-to-date. |
| 1 | At least one source is behind, none are failed. |
| 2 | At least one source is failed, or status couldn’t start. |
2 takes precedence over 1 when both behind and failed sources
appear in the same run.
Machine-readable output
Pass --json for one object per source, then a summary:
{"name":"source-context","verdict":"behind","kind":"git","mode":"copy","filterMode":"manifest","reasons":["remote-ref-advanced"],"commitSha":"a1b2c3…","resolvedSha":"e4f5g6…"}
{"name":"platform-docs","verdict":"up-to-date","kind":"path","mode":"link","filterMode":"manifest"}
{"type":"summary","upToDate":1,"behind":1,"failed":0}
Exit-code semantics are identical in both output modes. The Grand Maester agent skill uses this interface — and the exit code — to decide whether to offer a sync before reading citadel content.
maester publish
Configure the current repo as a maester — declare what it
publishes in maester.yaml.
maester publish # walkthrough: creates maester.yaml
The walkthrough collects path-or-glob entries with optional
description, category, tags, and
state. Finishing with zero entries
(after a confirmation) writes documents: [], which publishes the
whole repository. At the end it offers to install the
Publisher skill, so your coding agent can
maintain the manifest for you. If maester.yaml already exists, it
changes nothing and points you at the editing verbs below.
Editing the manifest
| Command | What it does |
|---|---|
maester publish add | Add an entry with the walkthrough prompts. With --path, runs without prompts. |
maester publish remove | Pick an entry to remove. With --path, runs without prompts. |
maester publish update --path <path> | Change one entry in place, without prompts. |
maester publish list | Table of entries. --json adds manifest: none | whole-repository | listed. |
maester publish apply | Apply a JSON change set in one validated, atomic edit. |
Non-interactive field flags for add --path and update:
| Flag | Description |
|---|---|
--description <text> | One-line description. |
--category <slug> | Category slug. |
--tags <a,b> | Comma-separated tag slugs. |
--state <canon|draft> | Omit to defer to each file’s header. |
--unset <field> | (update only, repeatable) Clear description, category, tags, or state. |
--create | (add only) Create maester.yaml if it doesn’t exist. |
--dry-run | Validate and print the result without writing. |
--acknowledge-narrowing | Confirm that a whole-repository manifest becomes a list of documents. |
--allow-sensitive | Allow an entry that matches a likely-sensitive path (.env, keys, secrets/, …). |
maester publish apply
Reads a change set from stdin, or from --from <file> (- for
stdin), and applies it all-or-nothing:
echo '{
"add": [{ "path": "docs/adr/*.md", "category": "adr" }],
"update": [{ "path": "README.md", "set": { "description": "Overview" }, "unset": ["tags"] }],
"remove": ["old/notes.md"]
}' | maester publish apply --dry-run --json
- Operations run remove → update → add, keyed by each entry’s
exact
path. --createcreatesmaester.yamlwhen it doesn’t exist;--dry-runwrites nothing.- Guards:
"acknowledgeNarrowing": trueis required when the repo currently publishes everything (no file, ordocuments: []);"allowSensitive": trueis required for paths matching likely secrets; the last entry can’t be removed. - Exit codes:
0ok ·2invalid or refused change set. Under--json, failures print{"ok": false, "error": {"field", "path", "message"}}.
maester publish inventory
Read-only. Lists candidate documents — honouring .gitignore and the
built-in excludes — with any inline state / category / tags,
which entry covers each, the categories and tags already in use, a
per-directory roll-up, and a sensitive list of files that are never
offered as candidates. It never prints file contents.
maester publish inventory --json
maester publish inventory --all --limit 500 # every non-excluded file, capped
maester publish preview
Read-only. Shows exactly which files each entry publishes and the
state / category / tags each file ends up with, resolved by the
same code sync uses.
maester publish preview # the current manifest
echo '<change set>' | maester publish preview --from - # a proposed change
Entries that match nothing are flagged empty-entry; entries whose
files are all published by an earlier entry are flagged redundant;
files matched by several entries list every match. In whole-repository
mode, preview shows per-directory counts.
maester connector
Manage connectors — live services exposed to agents as MCP tools.
| Command | What it does |
|---|---|
maester connector add | Register a connector. Interactive, or --type --name --env-var --config <json> [--description]. |
maester connector remove <name> | Remove it and refresh every host’s MCP entry. |
maester connector list | Configured connectors and the tool names they expose. |
maester connector refresh | Re-validate citadel.yaml and rewrite each host’s MCP registration. Run it after hand edits. --dry-run shows, per host, which env-var names would be forwarded and why, writing nothing. |
maester connector tools | The tool list maester mcp would expose, without starting a session. --servers also starts proxied MCP servers to list theirs. |
maester connector exec <name> <operation> [args…] | Fallback for agents without MCP: runs one operation and prints its JSON envelope. |
maester mcp-server
Manage third-party MCP servers
declared in citadel.yaml.
| Command | What it does |
|---|---|
maester mcp-server add | Declare a server. Interactive, or flags: --name --kind local|remote, then --command --args --env-var (local) or --url --auth-env-var --auth-header (remote), plus --register proxy|direct, --tools, --description, --yes. Shows the exact command or URL before saving. |
maester mcp-server remove <name> | Remove it and refresh every host registration. |
maester mcp-server list | Name, kind, mode, and env-var names. |
maester mcp-server check [names…] | Start or connect to each proxied server outside an agent session and report its tools, or why it failed (missing-env-var, command-not-found, connection-refused, auth-failed, timeout, …). Exits 1 if any fails. |
maester mcp
Runs the stdio MCP server for the citadel. You don’t run this
yourself: agent hosts (Claude Code, Cursor, Codex CLI) start it from
the project-level MCP config that skill install and
connector refresh write. It exposes connector tools, proxied MCP
server tools (as <server>__<tool>), and — when the citadel has a
linked destination — citadel__list_linked_documents and
citadel__read_linked_document for agents that won’t follow symlinks.
maester skill
Install and manage Maester’s two agent skills:
--skill | What it teaches your agent | Needs a citadel? |
|---|---|---|
grand-maester | Read the citadel well: state, freshness, connectors. See Grand Maester. | Yes |
publisher | Define and tidy this repo’s maester.yaml. See Publisher. | No |
Without --skill, install asks which one when both apply; upgrade and
status cover every installed skill.
Targets are claude-code, codex, cursor, and agents-md (any
agent that reads a project-root AGENTS.md).
maester skill install
maester skill install # interactive
maester skill install --target claude-code # one target
maester skill install --target claude-code --target codex # several
maester skill install --skill publisher --target cursor # the Publisher
Interactive mode shows a multi-select of the targets; flag mode skips
the prompt. Re-installing an installed target is an idempotent
refresh. Both skills can share one AGENTS.md, each in its own managed
region.
maester skill upgrade
Refresh installed artifacts to match the locally-installed maester
version. Touches only the managed region of each artifact; anything
you added outside it survives.
maester skill upgrade
maester skill upgrade --skill publisher
maester skill add-target
Add a target to an existing install without reinstalling the others.
maester skill add-target cursor
maester skill status
Shows, per skill and target, whether it’s installed and up to date.
maester skill status
To switch targets, install the new one and remove the old artifacts
manually (there is no uninstall verb). Each target’s artifacts live
in their own location, so removing one doesn’t affect the others.
See also
- Getting started — narrative walk-through from install to first sync.
- Configuration — full schema reference for
citadel.yamlandmaester.yaml. - Document state, category and tags — what gets stamped into each file and how it’s resolved.
- Connectors — live services and MCP servers for agents.
- Grand Maester and
Publisher — the agent skills the
skillverbs install.