CLI commands
Reference for the constellation binary: init, lint, rename, mcp, serve, repos, working, add skills, version, and upgrade.
The constellation binary drives everything from the terminal.
constellation init # scaffold constellation/ with a starter plan.md, set up working memory constellation lint # validate handles, references, folders, schemas constellation rename A-X A-Y # rename a card + rewrite every reference to it constellation mcp # run the MCP server (stdio) for AI agents constellation serve # open the local viewer (editable; --readonly to disable) constellation repos # list sibling repos declared in connected_repos constellation working # print the working memory set (what the SessionStart hook runs) constellation working off # switch working memory off for this repo (on, new-session keep|clear, config) constellation add skills # install the skills (authoring + /working) into ~/.claude, ~/.codex, … constellation version # print the CLI version (`v` also works) constellation upgrade # npm install -g @magic-spells/constellation@latest
init
Scaffolds a constellation/ folder with a starter plan.md to build from, and sets up working memory. It takes an optional target directory (default: the current one), and -n, --name sets the project name the viewer shows as its title (default: the folder name, title-cased).
--workingor--no-workinganswers whether to use working memory (.constellation/) on this repo, skipping the question.--new-session keep|clearsets what a new session does to the working set:clearkeeps only CONSTRAINT items.
constellation init # plan in the current directory constellation init ./my-app --name "My App" constellation init --no-working # do not use working memory on this repo
lint
Validates handles, references, folders, and schemas. Lint distinguishes two severities:
- Errors mean a broken graph: bad handles, dangling structured references, duplicates. These exit non-zero, so
constellation lintfails CI. - Warnings cover a wrong folder, schema violations, unknown fields, dangling prose links. These don’t block.
constellation lint # non-zero exit on graph-breaking errors; safe for CI gates
rename A-X A-Y
Renames a card and rewrites every reference to it plan-wide, so no handle is left dangling.
constellation rename API-TICKETS API-TICKET
mcp
Runs the MCP server over stdio for AI agents. See Add to Claude Code & Codex for wiring it into a client.
serve
Renders the plan as a local website at http://localhost:4747, editable in place (viewer assets ship prebuilt with the package). Pass --readonly to disable writes.
[path]serves exactly one plan; without it, every plan in the repo is served. Plans inconnected_reposare served too, with a switcher in the viewer.-p, --port <port>sets the port to listen on (default 4747).--plan <id>sets the default plan without filtering the served set.--no-opendoes not open the browser.--dev-origin <origin>views the plan through a forwarded or proxied port (ssh -L, VS Code, a dev proxy). Without it, those requests get a 403.
constellation serve # editable viewer at http://localhost:4747 constellation serve --readonly # read-only constellation serve --dev-origin http://localhost:8080 # view through a forwarded/proxied port
The Appearance picker in the header sets one of five color schemes and a Light, Medium, Dark, or System mode:
| Scheme | Feel |
|---|---|
| observatory | the default: a deep-navy night sky in dark, a cool daybreak in light |
| default | the base puzzle-pieces palette |
| warm | warm neutrals with a coral accent |
| void | pure black and white, near monochrome |
| dim | cool slate blue-grey |
Card pages show structured fields, the markdown body, connection chips in both directions, and a small constellation diagram of the card’s neighborhood (nodes tinted by card type). Mermaid blocks render in-browser, [[HANDLE]] links navigate, and the page live-reloads when plan files change on disk.
repos
Lists the sibling repos declared in connected_repos (multi-repo plans).
working
Prints the session’s working memory set, .constellation/working.md: the goals, constraints, focus, and tasks an agent keeps across context compaction. It is what the SessionStart hook runs, so it stays silent and exits 0 wherever there is nothing to print. It takes an optional path: a plan folder, a directory containing constellation/, or any directory in a git repository (default: the current one).
working install-hook creates .constellation/ and adds the SessionStart hook to .claude/settings.json, so the set is printed back after every compaction. It exits 2 while working memory is off.
working onandworking offturn working memory on or off for this repo, in.constellation/config.json. Off means noworking_*tools and a silent hook.working new-session keep|clearchooses what a new session (startup or/clear) does to the working set:keepcarries it over,clearkeeps only CONSTRAINT items.working configprints the effective settings.
constellation working # print .constellation/working.md constellation working install-hook # create .constellation/ and the SessionStart hook constellation working off # switch working memory off for this repo
add skills
Installs or refreshes the Constellation skills (the card-authoring skill and the /working command) into your agent config folders. It detects which of ~/.claude, ~/.codex, ~/.cursor, and ~/.agents exist and lets you pick from them. An install already on this version is left alone, and an older one asks before it is updated.
--skill-root <dir...>installs into these folders instead of detecting them, and skips the picker.--overwritereplaces existing installs without asking, symlinked ones included.
constellation add skills # pick from the detected folders constellation add skills --skill-root ~/.claude # install into one folder, no picker constellation add skills --overwrite # reinstall even if current
version
Prints the CLI version. constellation v also works.
upgrade
Updates the global install by running npm install -g @magic-spells/constellation@latest, then, if Constellation skills are installed, offers to update them too.