Lines 27-67javascript
27 * pi-messenger-swarm release
28 * pi-messenger-swarm set-status "debugging auth"
29 * pi-messenger-swarm rename NewName
30 * pi-messenger-swarm spawn --role Researcher "Analyze the protocol" --task-id task-1 [--persona "..."] [--agent-file path] [--objective "..."] [--context "..."] [--message-file <path>] [--force]
31 * pi-messenger-swarm spawn list
32 * pi-messenger-swarm spawn history
33 * pi-messenger-swarm spawn stop <id>
34 * pi-messenger-swarm --status
35 * pi-messenger-swarm --start
36 * pi-messenger-swarm --stop
37 * pi-messenger-swarm --restart
38 * pi-messenger-swarm --logs
40 * Also accepts JSON for programmatic use:
41 * pi-messenger-swarm '{ "action": "task.claim", "id": "task-1" }'
43 * Agent identity is resolved automatically from the process tree —
44 * no environment variables required. The CLI finds its parent pi process
45 * and sends the PID to the harness server, which matches it against
46 * registrations on disk.
48import { execSync, spawn as spawnChild } from 'node:child_process';
49import * as fs from 'node:fs';
50import * as path from 'node:path';
51import { fileURLToPath } from 'node:url';
52import * as http from 'node:http';
53const __filename = fileURLToPath(import.meta.url);
54const __dirname = path.dirname(__filename);
55const PORT = Number(process.env.PI_MESSENGER_PORT ?? 9877);
56const HOST = '127.0.0.1';
HighSame File Env Network Execution
A single source file combines environment access, network access, and code or shell execution; review context before blocking.
dist/harness/cli.jsView on unpkg · L47 57const BASE_URL = `http://${HOST}:${PORT}`;
58const LOG = process.env.PI_MESSENGER_LOG ?? '/tmp/pi-messenger-swarm.log';
59const SERVER_SCRIPT = path.resolve(__dirname, 'server.js');
60const CLI_VERSION = (() => {
62 const pkgPath = path.resolve(__dirname, '..', '..', 'package.json');
63 const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'));
64 return pkg.version || 'unknown';