magus v0.4.2 is out. See what's new
¶ View generated markdown
2 min read

magus-server

Manage the persistent magus daemon

Synopsis

magus server <start|stop|reload|job> [flags]

Description

Start, stop, or check the liveness of a persistent magus daemon.

By default every magus invocation starts a short-lived proc server that dies when the command exits. The persistent daemon keeps the server alive across invocations so workspace discovery, config loading, and the content-addressed cache are paid for once. Nested magus calls (from build scripts, editor integrations, etc.) forward work to the daemon automatically.

The socket address is resolved in priority order: --socket flag > MAGUS_DAEMON_ADDRESS env > daemon.address in magus.yaml > stable default ($XDG_RUNTIME_DIR/magus/magus-daemon.sock)

The socket file acts as the lock: present means a daemon is running, absent means none. Shell init hooks (e.g. Nix-injected .profile lines) typically check for the file with [ -S "$socket" ] before starting one.

server start options

--foreground
Run in the foreground and block, instead of auto-backgrounding

server stop options

--services
Stop the daemon's hosted services, leaving the daemon running
--socket string
Daemon socket (default: config / MAGUS_DAEMON_ADDRESS / auto-detect)

server reload options

--socket string
Daemon socket (default: config / MAGUS_DAEMON_ADDRESS / auto-detect)

Subcommands

start
Start a persistent daemon (auto-backgrounds by default; --foreground blocks)
stop
Send a graceful shutdown request to a running daemon
reload
Re-read configuration without restarting: drop the daemon's open workspaces
job
Submit a background maintenance job to a running daemon (no-op with no daemon)

Examples

Start the daemon (auto-backgrounds)

magus server start

Run the daemon in the foreground (supervisor or debugging)

magus server start --foreground

Stop the running daemon

magus server stop

Reload configuration without restarting

magus server reload

Submit a background job

magus server job rotate-logs

Inspect daemon pool state

magus status

Use a custom socket path

magus --daemon-address unix:///tmp/m.sock server start

See Also

magus(1), magus-ls(1), magus-describe(1), magus-run(1), magus-x(1), magus-where(1), magus-affected(1), magus-graph(1), magus-query(1), magus-explain(1), magus-path(1), magus-refs(1), magus-watch(1), magus-events(1), magus-status(1), magus-clean(1), magus-vcs(1), magus-doctor(1), magus-config(1), magus-session(1), magus-memory(1), magus-notes(1), magus-diff(1), magus-mcp(1), magus-buzz(1), magus-completion(1), magus-man(1), magus-init(1), magus-agent(1), magus-self(1), magus-version(1)

generatedinternal/cli/registry.goclimagus serverdaemonserversocketpersistent
Last updated (4f8cc295)
Earlier changes on this page (7)

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.

Op

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

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.

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.

Service

A long-running or shared process magus manages across runs, distinct from a one-shot target. See services.

Daemon

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

Pool

The concurrency pool: the shared set of slots that caps how many targets run in parallel on one machine. Its capacity defaults to MAGUS_CONCURRENCY, then 4 on GitHub-hosted runners, then min(NumCPU, 8); magus status and the dashboard report it live. See daemon.

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.

Session

One magus process's recorded facts - the targets it finished, their outcomes, and the lease it acted as - kept in a repo-scoped store every worktree shares. magus session lists them; the store prunes itself by last-fact age.

Conventions

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