Lines 2-42javascript
3 * merrymen CLI — the terminal front door.
5 * Install (no clone): npm install -g merrymen (or github:millw14/merrymen)
6 * Then: merrymen onboard && merrymen start
8 * merrymen onboard interactive setup wizard (keys, strategy, basket)
9 * merrymen start run web + worker together
10 * merrymen doctor diagnose the whole stack
11 * merrymen status what the band is doing right now
12 * merrymen strategy new scaffold a custom strategy in ~/.merrymen/strategies
13 * merrymen strategy list builtins + your strategies
14 * merrymen selftest one policy-legal no-op through the full pipeline
15 * merrymen kill terminal kill switch (deletes the grant)
16 * merrymen wallets every wallet on this machine (live + archived) + balances
17 * merrymen recover sweep the smart account's funds to a wallet you control
19 * Zero dependencies. All user data lives in ~/.merrymen (override with
20 * MERRYMEN_HOME) — the install location stays disposable.
23import { spawn, spawnSync } from "node:child_process";
24import { copyFileSync, existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
25import { readdir } from "node:fs/promises";
26import os from "node:os";
27import path from "node:path";
28import readline from "node:readline";
29import { fileURLToPath } from "node:url";
30import { banner, c, spinner, type as typeOut, withSpinner } from "./ui.mjs";
32// Where the PACKAGE lives (npm global dir or a checkout) — code, never data.
33const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
34// Where the USER's data lives — settings, grant, ledger, strategies.
35const HOME = process.env.MERRYMEN_HOME ?? path.join(os.homedir(), ".merrymen");
36const SETTINGS = path.join(HOME, "settings.json");
HighSandbox Evasion Gated Capability
Source gates dangerous network, credential, or execution behavior behind CI, host, platform, time, or geo fingerprint checks.
cli/bin.mjsView on unpkg · L22 MediumInstall Persistence
Source writes installer persistence such as shell profile or service configuration.
cli/bin.mjsView on unpkg · L22 37const GRANT = path.join(HOME, "grant.json");
38const HEARTBEAT = path.join(HOME, "heartbeat.json");
39const DB = path.join(HOME, "merrymen.db");
40const STRATEGIES = path.join(HOME, "strategies");
41// Every wallet this machine has armed — one file per smart account. grant.json is
42// a single slot, so replacing or killing a wallet archives the old one here first