Skip to main content

outerlayer context emit

Compile .outerlayer/ into each configured target’s native files.
For a repository whose targets are only claude-code or codex, emit prints a notice that names outerlayer init --update. Both tools read AGENTS.md and .agents/skills/ as written, so the generated copies are not needed. The notice stops once the repository has declared "layout": 2. In that layout emit rewrites no maintained skill and deletes no orphaned AGENTS.md, CLAUDE.md or skills file. The cursor target still gets .cursor/commands/ and .cursor/mcp.json from emit. Targets come from targets in .outerlayer/config.json: claude-code, cursor, codex, copilot, factory. There is no --target flag. Bare outerlayer emit with no name still runs this, with a deprecation line. A maintained skill (outerlayer-evidence, outerlayer-amend, outerlayer-findings, outerlayer-cli, outerlayer-build) whose directory exists is rewritten to the installed CLI’s copy. --check reports one that differs as drift. Template skills (spec, writing-specs, writing-tests, build) are never rewritten or reported. An earlier CLI may have written a copy under the skill’s former name (amend, emitting-evidence, reporting-findings, outerlayer). Emit replaces it. It writes the skill under its current name, then deletes the old source directory and every copy compiled from it. --check reports those files as retired. Only a directory whose SKILL.md carries the “maintained by OuterLayer” line is removed. A skill of your own with one of those names is left alone.
--check reports missing files and changed content for every output. It reports an orphaned output only when the file carries the generated-by header. .mcp.json and .cursor/mcp.json are JSON and carry no header, so they are never reported as orphaned. An orphaned output is a generated file whose source is gone. emit deletes each one --check would report, and each directory that leaves empty. A file without the header is never deleted. Neither form reads inside another repository’s tree: a directory that holds a .git entry (a nested clone or a submodule) or a .outerlayer-pin.json file (a governed clone). Its files are neither sources nor outputs. Exit codes: 0 on success. 1 on drift under --check. 1 when .outerlayer/config.json is missing or has no targets; the message shows the fix, such as {"targets": ["claude-code"]}. See also: Agent context, The .outerlayer directory.

outerlayer mcp install

Write or update the outerlayer MCP server entry. It writes the entry to .outerlayer/mcp.json when that file exists, else .mcp.json. It never writes an API key.
Exit codes: 0 when written or already current. 1 when --transport is not stdio or http, or --dir does not exist. 1 with --transport http and no gateway: pass --url or run outerlayer login. 1 when .mcp.json is not valid JSON, its top level is not an object, or its mcpServers is not an object: fix or remove the file, then rerun. See also: Use the MCP server.

outerlayer mcp serve

Run a stdio MCP server that bridges to the gateway. The stdio .mcp.json entry runs this.
It reads a factory key, or your login, at start-up. See Credential resolution. It exits 1 before reading any input when it cannot connect. The MCP client shows the message as the connect error: See also: Use the MCP server.