@wagemule/daemon
v0.1.66
Published
NiuMa local daemon for connecting local agent runtimes to Workspace Server.
Readme
@wagemule/daemon
NiuMa local daemon connects local agent runtimes to a Workspace Server.
Install and start
Use the command shown in the NiuMa Web machine page. The default command is a bootstrap installer for a temporary foreground daemon. It includes the pairing token for the current space, installs Node/npm/npx when missing, installs Docker by default, installs the latest daemon package, and then starts the daemon.
Temporary foreground startup is the default:
curl -fsSL "https://your-server/api/daemon/install.sh" | bash -s -- --mode temporary --server-url "https://your-server" --api-key "daemon_xxx"Switch the Web command tab to persistent service when the machine should reconnect after login or reboot:
curl -fsSL "https://your-server/api/daemon/install.sh" | bash -s -- --mode service --server-url "https://your-server" --api-key "daemon_xxx"The bootstrap script detects the host OS. In service mode it delegates to wm-daemon install-service:
- Linux: systemd user service
- macOS: LaunchAgent
- Windows: per-user scheduled task on logon
Runtime CLIs such as Codex, Claude Code, Kimi, Cursor Agent, Antigravity, OpenCode, and Hermes are only detected. The daemon does not install or authenticate them.
Commands
wm-daemon --help
wm-daemon runtimes
wm-daemon models
wm-daemon doctor
wm-daemon install-service --server-url "https://your-server" --api-key "daemon_xxx"
wm-daemon start --server-url "https://your-server" --api-key "daemon_xxx"
wm status
wm log
wm stop
wm startwm-daemon is the low-level daemon entrypoint. wm is the host-level service manager installed by the npm package; it manages the persistent daemon service and reads daemon logs. It is separate from the per-agent workspace .wm/wm wrapper.
doctor reports local runtime binaries and versions. Missing runtimes are reported honestly; install or log in to the relevant runtime CLI before creating agents for it.
Feishu delegation
The npm package includes the official @larksuite/cli package. When an agent needs Feishu/Lark access, the daemon initializes credentials in that agent workspace and writes a controlled .wm/lark-cli wrapper. The wrapper prefers the daemon-bundled lark-cli binary, so new agents use the daemon's pinned CLI version instead of whatever happens to be on the host PATH. Set WM_LARK_CLI_BIN only when you intentionally need to override the bundled binary.
The wrapper reads .wm/runtime-env at runtime, including LARKSUITE_CLI_CONFIG_DIR=<agent workspace>/.wm/lark-cli-config, and blocks external Feishu send commands unless WM_FEISHU_ALLOW_SEND=1 is set. Bot credentials and user OAuth credentials live in the workspace-local lark-cli config directory; secrets are not embedded in the wrapper.
The platform Feishu app must include the scopes required by the employee template. Bot credentials handle receiving and replying to messages; reading user Drive/Docs resources additionally requires user authorization through lark-cli device flow.
Required start options
--server-url: Workspace Server HTTP URL.--api-key: daemon pairing or reconnect token from the Web machine page.--name: optional display name for this machine.--root: optional daemon root directory. Defaults to~/.wm.
Development
Inside the monorepo, use the local restart script instead of npm:
bash scripts/restart.sh daemon startBefore publishing:
pnpm --filter @wagemule/daemon typecheck
pnpm --filter @wagemule/daemon test
pnpm --filter @wagemule/daemon build
pnpm --filter @wagemule/daemon pack:check