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

magus-run

Run a target for selected projects

Synopsis

magus run <target> [flags] [project...]

Description

Run a named target for the selected projects. With no project arguments, selects the project containing the current directory, or all projects if the current directory is not inside a project. Explicit project paths on the command line select exactly those projects.

The target ci is an ordinary magusfile-defined target - magus does not hardcode its steps; your magusfile composes them with magus.needs. magus keeps ci as the anchor that the affected set keys off, and always runs it read-only; apply the rw charm (e.g. 'magus run format:rw') to mutate files.

Options

--depth int
With --graph: cap displayed depth (0 = unlimited)
--dry-run
Print what would run without executing
--graph
Render the dependency graph for the selected scope instead of executing
--no-cache
Force a fresh run even on a cache hit; still refreshes the entry
--upstream
With --graph: show dependents instead of dependencies

Targets

ls
Print selected projects without executing anything
build
Build selected projects
test
Test selected projects
lint
Lint selected projects (read-only)
format
Format source files in selected projects
clean
Remove build artifacts from selected projects
generate
Run code generation for selected projects
ci
Run the magusfile's ci target read-only (affected-set anchor)

Examples

Build everything

magus run build

Test one project

magus run test api/gateway

Build two specific projects

magus run build api/gateway web/studio

Dry-run: show what would run

magus run build --dry-run

Force a fresh rebuild past a cache hit

magus run build --no-cache

Full CI pipeline

magus run ci

Show dependency graph for build target

magus run build --graph

Graph in Mermaid format

magus run build --graph -o mermaid

Graph dependents of api/gateway

magus run build api/gateway --graph --upstream

Stream JSONL target events to a file

magus run build -o jsonl --tee build.jsonl

See Also

magus(1), magus-ls(1), magus-describe(1), magus-x(1), magus-where(1), magus-affected(1), magus-insight(1), magus-graph(1), magus-watch(1), magus-status(1), magus-doctor(1), magus-config(1), magus-server(1), magus-completion(1), magus-man(1), magus-init(1), magus-self(1), magus-version(1)

auto-generatedclimagus runruntargetbuildtestci
Last updated (38e9171e)
Earlier changes on this page (3)

Full history ↗ · Blame source ↗

Glossary

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.

Charm

An execution modifier attached with : (lint:rw) that changes how a target runs, not which one; the built-in rw flips a check-only target to mutate in place, and ci always strips it. See charms.

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.

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.

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

Insight

The reports magus derives over the graph and history (hotspots, affinity, ownership, trend). See insight.

Conventions

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