Skip to content
Minnow
Source
Download

Command reference

Every npm script, the headless CLI, smoke/maintenance scripts, and environment variables. Source of truth: package.json. Setup from source: setup-from-source.md. System map: architecture.md and ../context.md.

For UI key bindings (composer, editor, file tree, terminal), see Keyboard shortcuts.

Running & building

CommandDescription
npm startRecommended. node server.js → Vite + tool server + ~/.minnow APIs + Electron desktop shell.
npm run devVite only (UI/HMR). Most server features unavailable.
npm run desktopAlias for electron:dev.
npm run electron:devconcurrently Vite (HMR, MINNOW_ELECTRON=1) + Electron via scripts/electron-dev.mjs.
npm run electron:buildCompile the Electron main/preload (electron/tsconfig.json) + rename preload + write electron/dist/package.json version stub.
npm run headless:buildBundle src/headless/cli-main.ts into dist-headless/minnow-run.mjs — the minnow run entry an installed build spawns for Scheduler jobs. Every package* script runs it; run it by hand only to inspect the bundle.
node scripts/verify-github-update-feed.mjsCompare GitHub latest*.yml sizes to attached installers (v<package.json version> or pass a tag).
npm run electron:prodFull build + Electron build, then run the packaged main against dist/.
npm run buildtsc && vite build → dist/. prebuild regenerates src/skills/builtin-manifest.json.
npm run previewvite preview of the production build (no tool API).
npm run packageBuild + Electron build + electron-builder installer → release/pkg (Windows NSIS, macOS dmg/zip, plus latest.yml auto-update feed metadata; never uploads — see releasing).
npm run package:win / package:mac / package:linuxPackage a single platform. On Windows/macOS, AppImage needs Docker — use npm run package:linux:docker. package:win / package:linux run sandbox:ensure-helper first (Linux ELF for Landlock; WSL build on Windows).
npm run package:dirSame, unpacked directory (--dir).
npm run package:cleanClean the release/ output.
npx tsc --noEmitTypecheck only.

Generated artifacts

prebuild runs these automatically before npm run build; run them by hand when you change a source of truth and want the generated file refreshed without a full build.

CommandRegenerates
npm run wiki:generateserver/product-wiki/catalog.json from documentation/ — run after editing any wiki page
npm run test:product-wikiCatalog sync + manual copy gates (also CI job product wiki; not part of npm test)
npm run wiki:stageStages the GitHub Wiki tree (see wiki-publishing)
npm run settings-registry:generateserver/settings/registry-manifest.json from the settings catalog
npm run skills-library:indexSkills Library index
npm run check:iconsFails when an icon reference has no asset

Headless CLI (minnow run)

For an external agent connection, run node bin/minnow.mjs mcp as a stdio MCP server. Minnow must already be running. See MCP hub setup for client configuration and HTTP transport.

Drives one agent turn without the SPA. Requires the tool server (npm start) or pass --start-server. Entry: bin/minnow.mjs → src/headless/cli-main.ts. An installed build has no minnow command; it carries a bundled copy of this entry that only the Scheduler runs.

minnow run --workspace . --agent builder --mode build \
  --prompt "Summarize README.md" --json-out run.json

# or via npm
npm run minnow:run -- --prompt "Reply OK" --json

Flags (minnow run --help for the authoritative list):

FlagPurpose
--prompt <text> / --stdinThe user message (or read from stdin).
--workspace <dir>Workspace root for file/git tools.
--agent <id>Work agent to use.
--mode <id>general / build / plan / orchestrate / debug.
--model <id> / --provider <id>Override model / provider.
--profile <id>Prompt profile / setup bundle.
--base-url <url>Server origin (default detected; e.g. http://127.0.0.1:9473).
--start-serverStart a tool server for the run.
--server-timeout <ms>Server readiness timeout.
--json / --json-out <file>Machine-readable result to stdout / file.
--max-tool-turns <n>Cap tool-call iterations.
--no-approval / --auto-reject-questionsNon-interactive tool/question handling.
--persist-chat / --chat-id <id> / --chat-name <name>Save the transcript into ~/.minnow/sessions.
--scheduler-runMarks a scheduler-originated run.
--minnow-home <dir>Override ~/.minnow.
--quietSuppress progress logs.

Use --provider minnow-library --model "mtplx:<repo-id>" for an MTPLX row in My Models (or its gguf: / mlx: library ID). The server reuses or loads the model with its saved engine preference. Explicit CLI choices override work-agent defaults; unavailable models and unknown providers fail clearly. Scheduler runs use the same binding behavior.

UI-only tools (e.g. ask_question) fail with a clear error in headless mode unless you opt into unsafe automation (MINNOW_I_UNDERSTAND_UNSAFE_AUTOMATION).

Account chat latency benchmark

node scripts/benchmark-chat-latency.mjs --account --samples 3 --output /tmp/chat-latency.json runs synthetic cold/warm replies and a tool round through installed CLI adapters and configured API providers. --account explicitly enables billable inference using existing logins/keys. Override targets with --targets '[{"providerId":"codex-cli","model":"gpt-6-luna","kind":"codex"},{"providerId":"opencode-go","model":"gpt-6-luna"}]'; omit kind for API targets and use "claude" for Claude Code or "cursor" for Cursor Agent. --restart adds a CLI follow-up after closing its process to measure checkpoint recovery. The script uses a temporary workspace, cleans its native sessions, records failed targets, and does not save chats. Measurements end at the local generation subscriber, before browser paint. Compare distributions across runs: native instructions, account routing and upstream load differ even for the same model.

Opt-in MTPLX lifecycle audit

With a running scratch MINNOW_HOME host and an unused installed model/port:

node scripts/audit-mtplx-lifecycle.mjs \
  --base-url http://127.0.0.1:19473 --home /tmp/minnow-audit-home \
  --library-id "mtplx:Publisher/Model" --port 19488 \
  --output /tmp/mtplx-lifecycle.json

This performs real inference, kills its verified owned daemon to check restart, and tests direct-client traffic across idle windows. It rejects the live profile and existing serves, preserves external daemons, stops its own processes in finally, and writes a result manifest without credentials. It requires installed MTPLX weights and takes about two minutes; it is separate from npm test.

Backup and restore CLI (minnow backup, minnow restore)

The same engine as Settings → General → Backup and restore, run directly against the Minnow home. No server is needed, and it is plain Node — no tsx. Entry: bin/minnow.mjs → server/backup/cli.js. User-facing behaviour is in the manual: Backup and restore.

# Encrypted, with credentials; the passphrase comes from the environment, never argv
MINNOW_BACKUP_PASSPHRASE='…' minnow backup --out /mnt/backups --passphrase-env MINNOW_BACKUP_PASSPHRASE

# What would be backed up, with sizes
minnow backup --list

# Preview a backup (changes nothing), then restore it
minnow restore /mnt/backups
minnow restore /mnt/backups --yes --passphrase-env MINNOW_BACKUP_PASSPHRASE
CommandFlags
minnow backup--out <folder or .mnbak file>, --passphrase-env <VAR>, --include <ids>, --exclude <ids>, --list, --json
minnow restore <file or folder>--passphrase-env <VAR>, --only <ids>, --yes, --stage-only, --undo, --cancel, --json
  • minnow backup uses the category selection saved in backup.json unless --include is given. Without --passphrase-env the backup is unencrypted and leaves credentials out, and the command says so.
  • minnow restore without --yes only prints the preview. With --yes it stages the backup; if no Minnow host has the home open (see run/host.json, written by server/runtime/host-lock.js) it applies at once, otherwise at the next start.
  • Set MINNOW_HOME to restore into a different profile.
  • Exit codes: 0 success, 1 failure (message on stderr), 2 usage.

Tests

npm test runs the full suite via test/run-all.mjs — it discovers every test/**/*.test.{js,mjs,mts,ts} file and runs the correct runner/loader per path (see test/test-config.mjs). New test files are included automatically; npm run test:check-coverage fails CI when a file would be orphaned. Worker parallelism defaults to min(16, availableParallelism()); override with MINNOW_TEST_CONCURRENCY.

Memory: every runner preloads test/assert-dom-safe.mjs. Without it a failing assert.equal(document.querySelector('.x'), null) hands a happy-dom node to node:assert, which inspects it at depth: 1000 and Myers-diffs the result — synchronous, unbounded typed-array allocation that --max-old-space-size cannot cap, and enough to freeze a 64 GB workstation from a single test process (measured: one child at 49 GB and still climbing). The guard compares DOM operands itself and reports a short descriptor (<section.board-root>) instead. Do not remove the preload, and prefer assert.ok(!el) over comparing elements when adding assertions.

CI (MIN-383): .github/workflows/ci.yml runs on pull requests and pushes to main: npm ci → test:check-coverage → npx tsc --noEmit → npm test on windows-latest, ubuntu-latest, and macos-latest (includes test/headless/). Require the ci status check on main before merge (.github/BRANCH_PROTECTION.md).

Scoped suites (each delegates to node test/run-all.mjs --suite <name>):

CommandArea
npm run test:memoryMemory store + API
npm run test:brainBrain wiki / CORTEX
npm run test:engineRetrieval engine
npm run test:lspLSP integration
npm run test:mcpMCP servers
npm run test:browserCDP / browser preview tools
npm run test:skillsSkills loader + clients
npm run test:impeccable / test:skills-impeccableImpeccable skill + /impeccable
npm run test:attachmentsWorkspace refs + document readers
npm run test:researchDeep research
npm run test:benchmarkBenchmark app
npm run test:evalsEval harness
npm run test:webhooksOutgoing webhooks
npm run test:notificationsNotification inbox
npm run test:serversManaged server processes
npm run test:pluginsTool plugin scan/loader
npm run test:terminal-ptyTerminal PTY session (live server)
npm run test:ui-designerUI Designer agent
npm run test:settingsSettings registry
npm run test:orchestrator / test:boardOrchestrator V2 journal suite — see orchestrate-board-testing.md
npm run test:check-coverageOrphan test detection (also in CI)

Most TS/UI suites run under tsx with --import ./test/test-loader.mjs (stubs .css + xterm); some use --experimental-test-module-mocks.

Skill maintenance

CommandDescription
npm run impeccable:syncRe-vendor Impeccable into src/skills/impeccable/.
npm run impeccable:updateUpdate upstream Impeccable, then re-sync.
npm run impeccable:detectAnti-pattern scan of src/ + index.html (exit 2 = issues found).
npm run caveman:syncRefresh the upstream Caveman SKILL.md.
npm run matt-pocock-skills:syncRe-vendor the Matt Pocock skill pack.
node scripts/build-benchmark-packs.mjsRebuild benchmark task packs into public/benchmark-packs/ (no npm alias).
npm run report:bundle-sizePrint production chunk sizes from dist/assets (run after npm run build).
npm run report:bundle-size:ciSame as above; exits non-zero when entry chunk exceeds 1500 KB or data packs ship as JS.

Orchestrate board dev tools

CommandDescription
npm run test:orchestrator / test:boardV2 journal suite (test/orchestrator/ + scenario catalog). See orchestrate-board-testing.md.
npm run board:scenario-contractValidate the Settings board-testing catalog (PR gate).
npm run fake-modelLocal OpenAI-v1 stub for manual board runs. npm run fake-model -- --register adds provider fake-board.
npm run check:board-logRetired (exit 1). V1 JSONL invariants were deleted in MIN-713. V2 history is the journal under ~/.minnow/boards/.

Smoke scripts

Run with the server up (default port 9473 — substitute yours). API calls need the per-boot session token from ~/.minnow/session-token:

npx tsx scripts/sa16-smoke.mjs http://localhost:9473       # general/sub-agent smoke
node test/terminal-stream.test.mjs http://localhost:9473   # terminal stream API
npx tsx scripts/step16-memory-smoke.mjs http://localhost:9473

Other scripts/*.mjs cover stepwise feature smokes, Electron launch, token/CSS generation, and migrations — see the scripts/ folder.

Environment variables

VariableEffect
PORTServer/Vite port (default 9473, falls back to next free). 5173 is ignored and coerced to 9473 — it’s reserved for dev servers in your workspace.
MINNOW_HOMEOverride the ~/.minnow data directory.
MINNOW_BROWSER=1Open a system browser tab instead of the Electron shell.
MINNOW_HEADLESS=1 / BROWSER=noneDon’t auto-open any window.
MINNOW_ELECTRON=1Internal flag set when running under Electron.
TOOLS_ALLOW_ALL_PATHS=1Let file/git tools resolve outside the workspace root (use with care).
MINNOW_OAUTH_REDIRECT_BASEOverride the OAuth redirect base URL.
MINNOW_NETWORKlocal (default) or lan — bind dev server to loopback vs all interfaces. Overrides config.json → server.networkAccess. Restart after changing Settings. On Windows, allow inbound TCP on the dev port in Firewall if LAN clients cannot connect. See lan-companion.md.
MINNOW_DEBUGVerbose server logging; enables Settings → Advanced → Board testing and /api/orchestrate/board-testing/* (with MINNOW_TEST=1 for CI harnesses).
MINNOW_I_UNDERSTAND_UNSAFE_AUTOMATIONAllow UI-only tools in headless runs.
MINNOW_PLUGIN_UNSAFEAllow unsigned/unsafe tool plugins.
MINNOW_TTS_USE_COMPILEOpt into compiled TTS path.
MINNOW_TESTSet during test runs.
---