Overview
Two companion packages to the core SDK:@struktoai/mirage-server, a Fastify daemon that owns workspaces in-process and exposes them over HTTP (/v1/workspaces,/v1/jobs, …).@struktoai/mirage-cli, acommanderCLI that speaks to the daemon. Mirrors Python’smirageCLI 1:1.
mirage workspace create if none is running.
Install
@struktoai/mirage-server transitively (the CLI spawns the daemon from the server package’s installed bin/daemon.js).
Create a workspace
Write a YAML config:- Validates the YAML + interpolates
${VAR}env references (fails fast if any are missing). - Auto-spawns a daemon on
127.0.0.1:8765if none is reachable. - Sends
POST /v1/workspacesand prints the returned detail as JSON.
Run commands in a workspace
Workspace lifecycle
Versioning
Each workspace has a git-backed history kept by the daemon (under~/.mirage/repos/<id>; set MIRAGE_VERSION_ROOT to relocate). Same verbs and
semantics as the Python CLI.
Sessions
Daemon lifecycle
Configuration
Precedence (highest first):MIRAGE_DAEMON_URLenv var, e.g.http://127.0.0.1:9000.MIRAGE_TOKENenv var, bearer token passed asAuthorization: Bearer <token>.~/.mirage/config.toml[daemon]table, managed withmirage config list|get|set|unset(per key: env var >config.toml> default;mirage config list --resolvedshows the effective values and origins):The daemon validates the table at startup and refuses to start on unknown keys or malformed TOML. The full key list and semantics match the Python CLI docs.
Python parity
The daemon speaks the same/v1/... protocol as Python’s mirage CLI. A Python CLI client can talk to a Node daemon and vice versa. The CLI subcommand tree matches Python’s mirage/cli/*.py file-for-file.