@magclaw/daemon
v0.1.40
Published
Local MagClaw daemon that connects a user's computer to MagClaw Cloud.
Readme
@magclaw/daemon
Local MagClaw CLI and daemon for connecting a user's computer to MagClaw Cloud.
MagClaw publishes two local entry commands:
magclawfrom@magclaw/daemon: the main daemon/profile command.magclaw-computerfrom@magclaw/computer: the browser-approved Computer control-plane command for setup, status, doctor, logs, channel, and upgrade workflows.
Typical connect command:
npx @magclaw/daemon@latest --server-url https://magclaw.multiego.me --api-key mc_machine_xxx --profile my-server # my-serverThe daemon stores cloud profiles and machine tokens under:
~/.magclaw/daemon/profiles/<profile>/Each profile has a fixed machine token after connecting. The daemon also writes an
owner.json file with a stable physical-machine fingerprint so the same Mac can
connect to multiple Servers without pretending to be different hardware.
It does not use the localhost MagClaw state files under ~/.magclaw/state.json,
~/.magclaw/state.sqlite, or ~/.magclaw/agents.
Foreground mode is the default connection flow. When --background is used
manually, the installed launcher keeps the profile path stable and runs the
latest npm package on service start.
Commands
Foreground mode:
npx @magclaw/daemon@latest --server-url https://magclaw.multiego.me --api-key mc_machine_xxxKeep this terminal open. Press Ctrl+C to stop.
Background mode:
npx @magclaw/daemon@latest --server-url https://magclaw.multiego.me --api-key mc_machine_xxx --backgroundThe first connect command installs durable magclaw and magclaw-computer
CLI shims when it can find a writable user bin directory on PATH. The shims
are generated text launchers for macOS, Linux, and Windows; install-cli
compares their content hashes and only rewrites missing or outdated files.
Stop a background daemon:
magclaw stop --profile defaultInspect, restart, or remove it:
magclaw status --profile default
magclaw list
magclaw help
magclaw logs --profile default
magclaw restart --profile default
magclaw uninstall --profile defaultIf magclaw or magclaw-computer is not on PATH, reinstall the command shims with
npx @magclaw/daemon@latest install-cli.
Only one daemon process may run for the same profile at a time. The lock is
stored under ~/.magclaw/daemon/profiles/<profile>/run/daemon.lock, so the same
physical computer can intentionally run multiple daemon processes with different
profiles and connect to multiple Servers. A second foreground start for the same
profile exits with an already running error; a repeated background start for
that profile reports the existing process instead of creating another
connection.
