magus v0.4.3 is out. See what's new
¶ View markdown source · ✎ Suggest an edit
2 min read

One source, every door

Structured output was never an AI feature. -o json, -o name, -o template= and an output ref for anything that ran are what a command line has owed its users for forty years. Point an agent at magus ls -o json and it gets what an MCP tool would have handed it. If a CLI needs a protocol server before an agent can drive it, the problem sits upstream of the server.

So a capability lives in one place, and the CLI, the MCP tools and a script are each a door onto it. The Buzz module is the layer a magusfile, a magus buzz script and anything built on them call into, so putting a capability there gives every caller the same access, rather than reserving it for whichever door was built most recently. Guidance follows the same rule: anything worth saying to an agent in a tool description is worth saying to a person, as a hint or an error that names the next step.

The same holds for the CLI's own description of itself. Flags, configuration keys, help text, completions and man pages come from one generated source, so no second parser or help printer can disagree with the first.

Enforced by

  • The man pages and the CLI reference are generated from the command registry (internal/commands/registry.go), and the drift gate fails a hand edit.
  • The MCP tool catalog is generated from the same descriptor the CLI reads.
  • Review: a capability only one door reaches says why.

Good

The same answer through two doors, from one implementation:

magus ls -o json
magus buzz -e 'import "std"; import "magus"; fun main(args: [str]) > void !> any { std\print("{magus\describe.file(["MAGUS.md"]).files.len()}"); }'

Bad

mcp tool "list_projects_with_details": a projects listing with owners and
targets that no CLI verb returns

The agent's door now reaches something the person's does not. The two drift, and the person loses the one view the tool chose to give only to the machine.

See also

designprincipleclimcpbuzz
Last updated (2df714e8)
Glossary

Project

A directory magus recognizes as a unit of work (it has a magusfile); the unit of caching, scheduling, and dependency tracking. Project in full.

Magusfile

The magusfile.buzz that declares a project's targets (as export funs) and binds its spells. Magusfile in full.

Target

A named operation (build, test, ...) you invoke with magus run <target>; it may compose a spell's tool-native operations and depend on other targets. Target in full.

Op

A single tool-native command a target composes (long form: operation); the middle of the work hierarchy (Spell to Op to Target). Op in full.

Module

A magus stdlib namespace a magusfile imports for host capabilities: filesystem, exec, vcs, and more. Module in full.

Buzz

The language magusfiles are written in (the .buzz engine). Buzz in full.

CI

An ordinary target you compose yourself with ctx.needs; magus does not hardcode its stages. It is the anchor magus affected ci keys off, and ci strips the rw charm. CI in full.

MAGUS.md

The committed routing index at a workspace root, regenerated from the knowledge graph: it lists every node and points at the exact query for a given question, so it is the entry point an agent reads first. MAGUS.md in full.

Agent

A model working through an agent host such as Claude Code, Codex, Cursor or OpenCode. magus treats an agent as one more caller of its CLI, MCP tools and console, held to the same checks as a person. Agent in full.

Tool

An action a model can call through its host: a name, a description, a typed input and a result. magus serves its tools over MCP, each a read of the workspace model or a run of the CLI it already has. Tool in full.

Conventions

This page uses none of the site's convention markers. The full set is on the conventions page.