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

Quick start

One page, densely packed, for someone who wants to be productive now and read properly later. Every section links to the page that goes deeper.

If you want the guided, explain-as-you-go version instead, read Getting started. If you want to try magus without installing anything, the playground runs the same engine in your browser.

Install

curl --proto '=https' --tlsv1.2 -sSf https://eli.gladman.cc/magus/install | sh

Prefer to read it first (recommended, and the same two lines the script prints):

curl --proto '=https' --tlsv1.2 -sSf https://eli.gladman.cc/magus/install -o install.sh
less install.sh
sh install.sh

The installer verifies a checksum against a signed release. Package managers, containers, CI setup actions, and building from source are all on Download. To pin a version in CI, use the setup-magus action rather than curling into a runner.

Check it worked, and check the workspace is sane:

magus --help
magus doctor        # config, cache, tools, cycles, guard binary

The one thing to understand

A target is a named operation (build, test, lint, format, generate, ci) declared as a function in a magusfile.buzz. A project is a directory that owns one. A spell binds a toolchain (go, ts, rs, py, ...) so a project gets that toolchain's operations without writing them.

magus knows each target's declared inputs and outputs, so it caches results and can compute which projects a change actually affects. That is the whole value proposition, and it is also why running the raw tool underneath defeats it.

Deeper: Targets, Workspace, Spells, Cache.

Your first five commands

magus init                  # bootstrap a magusfile in an existing repo
magus ls                    # every project, its spell, sources, outputs, deps
magus describe targets      # every target; -o name for bare names
magus run test              # run a target (cwd project, or all from the root)
magus affected ci           # the gate: full pipeline over what your diff reaches

magus affected ci is the one to run before you call work done. It runs over every project your change reaches, including ones you never edited.

Deeper: Getting started, CLI reference.

Scoping: magus is CWD-relative

A bare magus run acts on the project holding your current directory, or the whole workspace from the root. Do not assume the root. Scope explicitly:

magus run test web          # name the project (positional, after the target)
magus run go::go-test web   # one spell op, when a whole target is too broad
magus run test -- -run TestX  # args after -- are forwarded to the tool
magus where web             # resolve a fuzzy project name to its path

Add --dry-run to any of these to print the exact commands without running them.

Output control

magus has output flags, so you never need to pipe its output through grep, head, or awk. Every one of these works on every command:

flag does
-s / --silent a pass prints a result line plus an output ref; a failure adds a bounded tail
-q / --quiet drops progress, keeps errors and the failing project's full output
-o json / yaml / jsonl machine-readable, schema_version-stamped
-o name bare identifiers, one per line
-o template=<go-template> project exactly the fields you want
-v / -vv / -vvv more log verbosity
--tee <file> mirror structured output to a file

When a target fails it mints an output ref (out1a2b3c). Fetch the full log with magus query output out1a2b3c instead of re-running the target to see the error again.

Deeper: Logging, CLI reference.

Set up your coding agent

magus ships skills for coding agents, and a guard hook that stops an agent bypassing the workspace. Install the skills into whichever directories your host reads:

magus agent install .claude/skills      # Claude Code
magus agent install .agents/skills      # the cross-host convention
magus agent install .opencode/skills    # opencode
magus agent install-agents-md           # the managed block in AGENTS.md

Any destination your shell can reach works via the tar form, which is also how you install outside the working tree:

magus agent install --tar | tar -xf - -C ~/.config/opencode/skills

--simple: the short permutation

Every skill ships in two hand-authored permutations from one source body:

magus agent install .claude/skills --simple

The default carries the rationale behind each step. --simple withholds it, keeping the imperative steps, for a reader that infers the why. Prefer it for a capable model where context budget matters, and the full form when you want the agent to be able to justify what it is doing, or when you are onboarding a human to the same conventions.

Both permutations share ONE content digest, so they version together: a magus upgrade makes both stale at once, never one silently. Check with:

magus graph verify

Deeper: Agent skills shows every skill in both forms with its size, and Agents covers host wiring.

The guard hook

The guard reads one command an agent is about to run and returns deny, advise, or pass. It parses the shell rather than pattern-matching it, so a command cannot evade the guard by adding an environment prefix or a shell indirection:

magus hook -- go test ./...                 # deny: magus run test covers this
magus hook -- env -u GOROOT go test ./...   # deny: same command, prefix peeled
magus hook -- magus run test                # pass

It denies on three triggers: what cannot be undone (whole-tree VCS operations), what WRITES into the working tree (codegen, formatters, build output), and what has an exact magus equivalent. Everything else it explains or ignores.

Wire it into your host with the ready-made scripts (Claude Code, Codex, Cursor, opencode, Amp, Zed are all covered): Agents: guard hooks.

Point it at a real binary. If the guard cannot find one it says so loudly, and magus doctor's guard binary check names the binary a hook would run and fails when it is older than your working tree - because a stale guard enforces stale rules while looking perfectly healthy.

Where to go next

you want read
the guided walkthrough Getting started
every install method Download
what a target is, really Targets
how caching decides a hit Cache
binding a toolchain Spells
sandboxing and what it enforces Sandbox
writing magusfile logic Buzz reference
querying the knowledge graph Knowledge
a diagnostic code you hit Diagnostics
running the daemon and console Daemon, Console
CI wiring CI providers
when something is wrong Debugging, FAQ

Every flag and target set differs per workspace and magus version, so trust magus describe targets, magus describe target <name>, and magus <verb> -h over anything written down - including this page.

getting-startedinstallquickstartagentsskillsclireference
Last updated (a103255f)
Earlier changes on this page (2)

Full history ↗ · Blame source ↗

Glossary

Workspace

The magus root directory that owns a set of projects and shared config; the unit magus operates over. See workspace.

Project

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

Magusfile

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

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. See targets.

Operation

A single tool-native command a target composes; the middle of the work hierarchy (Spell to Operation to Target). See operations.

Spell

A language/runtime adapter (e.g. go, md) that maps generic targets onto a toolchain's real commands. See spells.

Ward

A coded diagnostic that inspects a resolved op and nudges or blocks an anti-pattern before it runs. See wards.

Buzz

The language magusfiles are written in (the .buzz engine). See engines.

Engine

The interpreter a magusfile runs on; magus embeds the Buzz engine. See engines.

Cache

The content-addressed store magus consults before running a target, so unchanged work is skipped. See cache.

Affected

The set of projects touched by a change; magus affected <target> runs a target only over them. See affected.

Sandbox

The restricted filesystem and environment a target runs in, so builds stay reproducible and side-effect-free. See sandbox.

Daemon

The background magus host that owns shared state such as services and the warm knowledge graph. See daemon.

CI

An ordinary magusfile-defined target you compose yourself with magus\needs - magus does not hardcode its stages. Magus.RunCI treats it specially only in that it strips the rw charm, it is the anchor magus affected ci keys off, and a selected scope with no project declaring it is a load error rather than a silent no-op. See targets.

Health

The at-a-glance daemon state derived from the pool: healthy when the pool is reporting, degraded when it reports an error, down when there is no pool. The dashboard color-codes each state. See daemon.

Knowledge graph

The queryable graph of a workspace's spells, targets, docs, and code relationships; query it with magus query/explain/path. See knowledge.

Diagnostic code

A stable MGSxxxx identifier attached to a magus warning or error, so it can be referenced and looked up; some are guardrails (see wards), others hard errors.

Conventions

Placeholders

Angle brackets mark a value you replace with your own - never type the brackets:

magus run <target>
magus completion <shell>    # e.g. bash, zsh, fish

<target>, <path>, <shell>, <name> and the like are stand-ins, not literal text.