squads-cli 0.4.9 → 0.4.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -765,6 +765,44 @@ squads workers Show active workers
765
765
  -v, --verbose More details
766
766
  -k, --kill <pid> Kill process
767
767
 
768
+ squads context Business context for alignment
769
+ -s, --squad <squad> Focus on specific squad
770
+ -t, --topic <topic> Search memory for relevant context
771
+ -v, --verbose Show additional details
772
+ --json JSON output
773
+
774
+ squads history Recent agent execution history
775
+ -d, --days <n> Days to look back (default: 7)
776
+ -s, --squad <squad> Filter by squad
777
+ -v, --verbose Show cost and token details
778
+ -j, --json JSON output
779
+
780
+ squads health Quick infrastructure health check
781
+ -v, --verbose Show logs for failures
782
+ --json JSON output
783
+
784
+ squads watch <command> [args] Live refresh any command (like Unix watch)
785
+ -n, --interval <seconds> Refresh interval (default: 2)
786
+
787
+ squads live Live TUI dashboard (like htop)
788
+ -r, --refresh <ms> Refresh rate (default: 1000)
789
+
790
+ squads top Live process table (like Unix top)
791
+
792
+ squads version Show version information
793
+
794
+ squads env show <squad> Squad execution environment (MCP, model, budget)
795
+ --json JSON output
796
+ squads env list List all squad environments
797
+ --json JSON output
798
+
799
+ squads cost Cost summary (today, week, by squad)
800
+ -s, --squad <squad> Filter to specific squad
801
+ --json JSON output
802
+
803
+ squads budget <squad> Check budget status for a squad
804
+ --json JSON output
805
+
768
806
  squads issues GitHub issues
769
807
  -o, --org <org> Organization (default: agents-squads)
770
808
  -r, --repos <repos> Comma-separated repos
package/dist/cli.js CHANGED
@@ -388,7 +388,7 @@ function getActivitySparkline(basePath, days = 7) {
388
388
  // src/lib/telemetry.ts
389
389
  import { existsSync as existsSync2, readFileSync, writeFileSync, mkdirSync } from "fs";
390
390
  import { join as join2 } from "path";
391
- import { homedir } from "os";
391
+ import { homedir, platform, release } from "os";
392
392
  import { randomUUID } from "crypto";
393
393
  var TELEMETRY_DIR = join2(homedir(), ".squads-cli");
394
394
  var CONFIG_PATH = join2(TELEMETRY_DIR, "telemetry.json");
@@ -400,6 +400,20 @@ var TELEMETRY_ENDPOINT = Buffer.from(
400
400
  var TELEMETRY_KEY = Buffer.from("c3FfdGVsX3YxXzdmOGE5YjJjM2Q0ZTVmNmE=", "base64").toString();
401
401
  var eventQueue = [];
402
402
  var flushScheduled = false;
403
+ var cachedSystemContext = null;
404
+ function getSystemContext() {
405
+ if (cachedSystemContext) return cachedSystemContext;
406
+ cachedSystemContext = {
407
+ os: platform(),
408
+ // darwin, linux, win32
409
+ osVersion: release(),
410
+ nodeVersion: process.version,
411
+ shell: process.env.SHELL?.split("/").pop() || process.env.ComSpec?.split("\\").pop(),
412
+ terminal: process.env.TERM_PROGRAM || void 0,
413
+ ci: process.env.CI === "true" ? "true" : void 0
414
+ };
415
+ return cachedSystemContext;
416
+ }
403
417
  function ensureDir() {
404
418
  if (!existsSync2(TELEMETRY_DIR)) {
405
419
  mkdirSync(TELEMETRY_DIR, { recursive: true });
@@ -440,6 +454,7 @@ async function track(event, properties) {
440
454
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
441
455
  properties: {
442
456
  ...properties,
457
+ ...getSystemContext(),
443
458
  anonymousId: config2.anonymousId,
444
459
  cliVersion: process.env.npm_package_version || "unknown"
445
460
  }
@@ -837,8 +852,9 @@ async function initCommand(options) {
837
852
  }
838
853
  }
839
854
  console.log();
840
- if (hasMissingRequired) {
855
+ if (hasMissingRequired && !options.force) {
841
856
  console.log(chalk.yellow(" Install missing tools to continue, then run squads init again."));
857
+ console.log(chalk.dim(" Or use --force to skip requirement checks."));
842
858
  console.log();
843
859
  track(Events.CLI_INIT, {
844
860
  success: false,
@@ -867,8 +883,11 @@ async function initCommand(options) {
867
883
  ".agents/squads",
868
884
  ".agents/squads/demo",
869
885
  ".agents/memory",
886
+ ".agents/memory/getting-started",
870
887
  ".agents/outputs",
871
- ".claude"
888
+ ".claude",
889
+ ".claude/skills",
890
+ ".claude/skills/squads-workflow"
872
891
  ];
873
892
  for (const dir of dirs) {
874
893
  await fs.mkdir(path.join(cwd, dir), { recursive: true });
@@ -969,6 +988,139 @@ Markdown report saved to .agents/outputs/demo/project-analysis.md
969
988
  path.join(cwd, ".agents/squads/demo/analyzer.md"),
970
989
  analyzerAgent
971
990
  );
991
+ const squadsWorkflowSkill = `# Squads Workflow
992
+
993
+ Use this skill when working with squads-cli to maintain persistent memory, track goals, and coordinate work.
994
+
995
+ ## Session Start
996
+
997
+ At session start, you'll see \`squads status\` output automatically. For complex tasks, run:
998
+
999
+ \`\`\`bash
1000
+ squads context # Get business context, goals, decisions
1001
+ squads memory query "<topic>" # Check what we already know
1002
+ \`\`\`
1003
+
1004
+ **Skip context loading for simple tasks** (typo fixes, quick questions).
1005
+
1006
+ ## Core Commands
1007
+
1008
+ \`\`\`bash
1009
+ # Context & Status
1010
+ squads context # Business context for alignment
1011
+ squads status # Squad overview
1012
+ squads dash # Full dashboard
1013
+
1014
+ # Memory
1015
+ squads memory query "<topic>" # Search memory
1016
+ squads memory show <squad> # Squad's full memory
1017
+
1018
+ # Goals
1019
+ squads goal list # All active goals
1020
+ squads goal set <squad> "X" # Add a goal
1021
+
1022
+ # Running Agents
1023
+ squads run <squad> # Run all agents in squad
1024
+ squads run <squad>/<agent> # Run specific agent
1025
+ squads list # List all agents
1026
+ \`\`\`
1027
+
1028
+ ## Workflow
1029
+
1030
+ ### Before Research
1031
+ Always check memory first to avoid re-researching:
1032
+ \`\`\`bash
1033
+ squads memory query "topic"
1034
+ \`\`\`
1035
+
1036
+ ### After Work
1037
+ Update memory with what you learned by editing:
1038
+ \`.agents/memory/<squad>/<agent>/state.md\`
1039
+
1040
+ ### Commits
1041
+ Include goal attribution when relevant:
1042
+ \`\`\`
1043
+ feat: add user auth [goal:engineering/1]
1044
+ \`\`\`
1045
+
1046
+ ## Agent Execution
1047
+
1048
+ When a task could be automated:
1049
+ 1. Check if agent exists: \`squads list | grep <keyword>\`
1050
+ 2. If yes: \`squads run <squad>/<agent>\`
1051
+ 3. If no: Create agent in \`.agents/squads/<squad>/<name>.md\`
1052
+
1053
+ ## Memory Locations
1054
+
1055
+ - \`.agents/memory/<squad>/<agent>/state.md\` - Current knowledge
1056
+ - \`.agents/memory/<squad>/<agent>/learnings.md\` - Insights over time
1057
+
1058
+ ## Key Principle
1059
+
1060
+ **Memory is your cross-session brain.** Without it, every session starts fresh. With it, you build on previous work.
1061
+ `;
1062
+ await fs.writeFile(
1063
+ path.join(cwd, ".claude/skills/squads-workflow/instruction.md"),
1064
+ squadsWorkflowSkill
1065
+ );
1066
+ const seedMemory = `# Getting Started with Squads
1067
+
1068
+ ## What You've Set Up
1069
+
1070
+ - **Demo squad** ready to run (\`squads run demo\`)
1071
+ - **Memory system** for persistent context
1072
+ - **Hooks** that sync status and memory automatically
1073
+
1074
+ ## Next Steps
1075
+
1076
+ 1. Run the demo: \`squads run demo\`
1077
+ 2. Check the dashboard: \`squads dash\`
1078
+ 3. Create your first real squad in \`.agents/squads/\`
1079
+
1080
+ ## Tips
1081
+
1082
+ - Check memory before researching: \`squads memory query "<topic>"\`
1083
+ - Use \`squads context\` for business alignment on complex tasks
1084
+ - Agents are reusable - if you do something twice, make it an agent
1085
+ `;
1086
+ await fs.writeFile(
1087
+ path.join(cwd, ".agents/memory/getting-started/state.md"),
1088
+ seedMemory
1089
+ );
1090
+ const businessBrief = `# Business Brief
1091
+
1092
+ ## #1 Priority
1093
+
1094
+ **[Define your top priority here]**
1095
+
1096
+ ## Runway
1097
+
1098
+ **Pressure**: LOW | MEDIUM | HIGH
1099
+
1100
+ ## Current Focus
1101
+
1102
+ 1. **[Focus area 1]** - Description
1103
+ 2. **[Focus area 2]** - Description
1104
+ 3. **[Focus area 3]** - Description
1105
+
1106
+ ## Blockers
1107
+
1108
+ - None currently (or list blockers)
1109
+
1110
+ ## Decision Framework
1111
+
1112
+ 1. Does this drive the #1 priority?
1113
+ 2. Is there a simpler approach?
1114
+ 3. What's the opportunity cost?
1115
+
1116
+ ---
1117
+
1118
+ *This file is read by \`squads context\` to provide business alignment.*
1119
+ `;
1120
+ await fs.writeFile(
1121
+ path.join(cwd, ".agents/BUSINESS_BRIEF.md"),
1122
+ businessBrief
1123
+ );
972
1124
  const claudeSettings = {
973
1125
  hooks: {
974
1126
  SessionStart: [
@@ -1023,12 +1175,22 @@ Each **squad** is a team of **agents** (markdown prompts) that execute via Claud
1023
1175
 
1024
1176
  ## For Claude (READ THIS)
1025
1177
 
1026
- When helping users with squad-related tasks:
1178
+ **Skill available**: Use \`/squads-workflow\` for detailed workflow guidance.
1179
+
1180
+ ### Session Start
1181
+
1182
+ You'll see \`squads status\` automatically. For complex tasks, also run:
1183
+ \`\`\`bash
1184
+ squads context # Business context, goals, decisions
1185
+ squads memory query "<topic>" # What we already know
1186
+ \`\`\`
1187
+
1188
+ **Skip for simple tasks** (typo fixes, quick questions).
1027
1189
 
1028
- ### Check Context First
1190
+ ### Before Research
1191
+ Always check memory first:
1029
1192
  \`\`\`bash
1030
- squads status # What squads exist?
1031
- squads memory query "X" # What do we know about X?
1193
+ squads memory query "<topic>"
1032
1194
  \`\`\`
1033
1195
 
1034
1196
  ### Creating Agents
@@ -1071,10 +1233,12 @@ squads goal set <squad> "X" # Add a goal
1071
1233
  | "What's the status?" | Run \`squads dash\` or \`squads status\` |
1072
1234
  | "Run the X agent" | \`squads run <squad>/x\` |
1073
1235
  | "Check memory" | \`squads memory query "<topic>"\` |
1236
+ | "Get context" | \`squads context\` |
1074
1237
 
1075
1238
  ## Quick Reference
1076
1239
 
1077
1240
  \`\`\`bash
1241
+ squads context # Business context for alignment
1078
1242
  squads status # Overview
1079
1243
  squads dash # Full dashboard
1080
1244
  squads run demo # Try demo squad
@@ -1137,9 +1301,12 @@ squads goal list # View goals
1137
1301
  console.log(chalk.green.bold(" \u2713 Squads initialized!"));
1138
1302
  console.log();
1139
1303
  console.log(chalk.dim(" Created:"));
1140
- console.log(chalk.dim(" \u2022 .agents/squads/demo/ - Demo squad with 2 agents"));
1141
- console.log(chalk.dim(" \u2022 .claude/settings.json - Claude Code hooks"));
1142
- console.log(chalk.dim(" \u2022 CLAUDE.md - Agent instructions"));
1304
+ console.log(chalk.dim(" \u2022 .agents/squads/demo/ - Demo squad with 2 agents"));
1305
+ console.log(chalk.dim(" \u2022 .agents/BUSINESS_BRIEF - Business context template"));
1306
+ console.log(chalk.dim(" \u2022 .agents/memory/ - Seed memory"));
1307
+ console.log(chalk.dim(" \u2022 .claude/settings.json - Claude Code hooks"));
1308
+ console.log(chalk.dim(" \u2022 .claude/skills/ - Squads workflow skill"));
1309
+ console.log(chalk.dim(" \u2022 CLAUDE.md - Agent instructions"));
1143
1310
  console.log();
1144
1311
  const email = await promptEmail();
1145
1312
  if (email) {
@@ -1533,11 +1700,11 @@ function validateMcpServer(server, allow, deny) {
1533
1700
  }
1534
1701
  return null;
1535
1702
  }
1536
- function validateExecution(context2, request) {
1703
+ function validateExecution(context, request) {
1537
1704
  const violations = [];
1538
1705
  if (request.bashCommands) {
1539
1706
  for (const cmd of request.bashCommands) {
1540
- const violation = validateBashCommand(cmd, context2.permissions.bash);
1707
+ const violation = validateBashCommand(cmd, context.permissions.bash);
1541
1708
  if (violation) {
1542
1709
  violations.push(violation);
1543
1710
  }
@@ -1545,7 +1712,7 @@ function validateExecution(context2, request) {
1545
1712
  }
1546
1713
  if (request.writePaths) {
1547
1714
  for (const path3 of request.writePaths) {
1548
- const violation = validateFilePath(path3, context2.permissions.write, "write");
1715
+ const violation = validateFilePath(path3, context.permissions.write, "write");
1549
1716
  if (violation) {
1550
1717
  violations.push(violation);
1551
1718
  }
@@ -1553,7 +1720,7 @@ function validateExecution(context2, request) {
1553
1720
  }
1554
1721
  if (request.readPaths) {
1555
1722
  for (const path3 of request.readPaths) {
1556
- const violation = validateFilePath(path3, context2.permissions.read, "read");
1723
+ const violation = validateFilePath(path3, context.permissions.read, "read");
1557
1724
  if (violation) {
1558
1725
  violations.push(violation);
1559
1726
  }
@@ -1563,8 +1730,8 @@ function validateExecution(context2, request) {
1563
1730
  for (const server of request.mcpServers) {
1564
1731
  const violation = validateMcpServer(
1565
1732
  server,
1566
- context2.permissions.mcp.allow,
1567
- context2.permissions.mcp.deny
1733
+ context.permissions.mcp.allow,
1734
+ context.permissions.mcp.deny
1568
1735
  );
1569
1736
  if (violation) {
1570
1737
  violations.push(violation);
@@ -1572,11 +1739,11 @@ function validateExecution(context2, request) {
1572
1739
  }
1573
1740
  }
1574
1741
  const hasErrors = violations.some((v) => v.severity === "error");
1575
- const allowed = context2.permissions.mode !== "strict" || !hasErrors;
1742
+ const allowed = context.permissions.mode !== "strict" || !hasErrors;
1576
1743
  return {
1577
1744
  allowed,
1578
1745
  violations,
1579
- mode: context2.permissions.mode
1746
+ mode: context.permissions.mode
1580
1747
  };
1581
1748
  }
1582
1749
  function formatViolations(result) {
@@ -1639,16 +1806,16 @@ function parsePermissionsYaml(content) {
1639
1806
  return Object.keys(permissions).length > 0 ? permissions : null;
1640
1807
  }
1641
1808
  function buildContextFromSquad(squadName, squadContent, agentName) {
1642
- const context2 = getDefaultContext(squadName, agentName);
1809
+ const context = getDefaultContext(squadName, agentName);
1643
1810
  const parsed = parsePermissionsYaml(squadContent);
1644
1811
  if (parsed) {
1645
- if (parsed.mode) context2.permissions.mode = parsed.mode;
1646
- if (parsed.bash) context2.permissions.bash = parsed.bash;
1647
- if (parsed.write) context2.permissions.write = parsed.write;
1648
- if (parsed.read) context2.permissions.read = parsed.read;
1649
- if (parsed.mcp) context2.permissions.mcp = parsed.mcp;
1812
+ if (parsed.mode) context.permissions.mode = parsed.mode;
1813
+ if (parsed.bash) context.permissions.bash = parsed.bash;
1814
+ if (parsed.write) context.permissions.write = parsed.write;
1815
+ if (parsed.read) context.permissions.read = parsed.read;
1816
+ if (parsed.mcp) context.permissions.mcp = parsed.mcp;
1650
1817
  }
1651
- return context2;
1818
+ return context;
1652
1819
  }
1653
1820
 
1654
1821
  // src/commands/run.ts
@@ -8705,9 +8872,9 @@ async function permissionsShowCommand(squadName) {
8705
8872
  }
8706
8873
  const squadFilePath = join18(squadsDir, squadName, "SQUAD.md");
8707
8874
  const squadContent = readFileSync14(squadFilePath, "utf-8");
8708
- const context2 = buildContextFromSquad(squadName, squadContent);
8875
+ const context = buildContextFromSquad(squadName, squadContent);
8709
8876
  const defaults = getDefaultContext(squadName);
8710
- const isDefault = JSON.stringify(context2.permissions) === JSON.stringify(defaults.permissions);
8877
+ const isDefault = JSON.stringify(context.permissions) === JSON.stringify(defaults.permissions);
8711
8878
  writeLine(` ${bold}Squad:${RESET} ${squadName}`);
8712
8879
  if (squad.mission) {
8713
8880
  writeLine(` ${colors.dim}${squad.mission}${RESET}`);
@@ -8718,47 +8885,47 @@ async function permissionsShowCommand(squadName) {
8718
8885
  writeLine(` ${colors.dim}Add a permissions block to SQUAD.md to restrict access.${RESET}`);
8719
8886
  writeLine();
8720
8887
  }
8721
- writeLine(` ${bold}Mode:${RESET} ${formatMode(context2.permissions.mode)}`);
8888
+ writeLine(` ${bold}Mode:${RESET} ${formatMode(context.permissions.mode)}`);
8722
8889
  writeLine();
8723
8890
  writeLine(` ${bold}Bash Commands:${RESET}`);
8724
- if (context2.permissions.bash.includes("*")) {
8891
+ if (context.permissions.bash.includes("*")) {
8725
8892
  writeLine(` ${colors.dim}All commands allowed (*)${RESET}`);
8726
8893
  } else {
8727
- for (const cmd of context2.permissions.bash) {
8894
+ for (const cmd of context.permissions.bash) {
8728
8895
  writeLine(` ${icons.active} ${cmd}`);
8729
8896
  }
8730
8897
  }
8731
8898
  writeLine();
8732
8899
  writeLine(` ${bold}Write Paths:${RESET}`);
8733
- if (context2.permissions.write.includes("**") || context2.permissions.write.includes("*")) {
8900
+ if (context.permissions.write.includes("**") || context.permissions.write.includes("*")) {
8734
8901
  writeLine(` ${colors.dim}All paths writable (**)${RESET}`);
8735
8902
  } else {
8736
- for (const path3 of context2.permissions.write) {
8903
+ for (const path3 of context.permissions.write) {
8737
8904
  writeLine(` ${icons.active} ${path3}`);
8738
8905
  }
8739
8906
  }
8740
8907
  writeLine();
8741
8908
  writeLine(` ${bold}Read Paths:${RESET}`);
8742
- if (context2.permissions.read.includes("**") || context2.permissions.read.includes("*")) {
8909
+ if (context.permissions.read.includes("**") || context.permissions.read.includes("*")) {
8743
8910
  writeLine(` ${colors.dim}All paths readable (**)${RESET}`);
8744
8911
  } else {
8745
- for (const path3 of context2.permissions.read) {
8912
+ for (const path3 of context.permissions.read) {
8746
8913
  writeLine(` ${icons.active} ${path3}`);
8747
8914
  }
8748
8915
  }
8749
8916
  writeLine();
8750
8917
  writeLine(` ${bold}MCP Servers:${RESET}`);
8751
- if (context2.permissions.mcp.allow.includes("*")) {
8918
+ if (context.permissions.mcp.allow.includes("*")) {
8752
8919
  writeLine(` ${colors.dim}All servers allowed (*)${RESET}`);
8753
8920
  } else {
8754
8921
  writeLine(` ${colors.green}Allow:${RESET}`);
8755
- for (const server of context2.permissions.mcp.allow) {
8922
+ for (const server of context.permissions.mcp.allow) {
8756
8923
  writeLine(` ${icons.success} ${server}`);
8757
8924
  }
8758
8925
  }
8759
- if (context2.permissions.mcp.deny.length > 0) {
8926
+ if (context.permissions.mcp.deny.length > 0) {
8760
8927
  writeLine(` ${colors.red}Deny:${RESET}`);
8761
- for (const server of context2.permissions.mcp.deny) {
8928
+ for (const server of context.permissions.mcp.deny) {
8762
8929
  writeLine(` ${icons.error} ${server}`);
8763
8930
  }
8764
8931
  }
@@ -8800,7 +8967,7 @@ async function permissionsCheckCommand(squadName, options) {
8800
8967
  }
8801
8968
  const squadFilePath = join18(squadsDir, squadName, "SQUAD.md");
8802
8969
  const squadContent = readFileSync14(squadFilePath, "utf-8");
8803
- const context2 = buildContextFromSquad(squadName, squadContent, options.agent);
8970
+ const context = buildContextFromSquad(squadName, squadContent, options.agent);
8804
8971
  const request = {
8805
8972
  mcpServers: options.mcp,
8806
8973
  bashCommands: options.bash,
@@ -8817,7 +8984,7 @@ async function permissionsCheckCommand(squadName, options) {
8817
8984
  writeLine();
8818
8985
  return;
8819
8986
  }
8820
- const result = validateExecution(context2, request);
8987
+ const result = validateExecution(context, request);
8821
8988
  if (result.violations.length === 0) {
8822
8989
  writeLine(` ${icons.success} ${colors.green}All permissions valid${RESET}`);
8823
8990
  writeLine();
@@ -9612,6 +9779,7 @@ function launchAgent(target, projectRoot, sessionId, logFile) {
9612
9779
  const sessionName = `squads-tonight-${sessionId}`;
9613
9780
  const claudeCmd = [
9614
9781
  `cd '${projectRoot}'`,
9782
+ `unset ANTHROPIC_API_KEY`,
9615
9783
  `echo "=== Tonight Session: ${target} ===" >> '${logFile}'`,
9616
9784
  `echo "Started: $(date)" >> '${logFile}'`,
9617
9785
  `claude --dangerously-skip-permissions -p 'You are running as part of an overnight autonomous session. Execute your tasks efficiently. If you encounter errors, document them clearly and move on. Do not ask for user input.' -- "Run squad: ${target}" 2>&1 | tee -a '${logFile}'`,
@@ -9935,14 +10103,24 @@ program.name("squads").description("A CLI for humans and agents").version(versio
9935
10103
  }
9936
10104
  await statusCommand(void 0, {});
9937
10105
  });
9938
- program.command("init").description("Initialize a new squad project").option("-t, --template <template>", "Project template", "default").option("--skip-infra", "Skip infrastructure setup prompt").action(initCommand);
9939
- program.command("run <target>").description("Run a squad or agent").option("-v, --verbose", "Verbose output").option("-d, --dry-run", "Show what would be run without executing").option("-e, --execute", "Execute agent via Claude CLI (requires claude installed)").option("-a, --agent <agent>", "Run specific agent within squad").option("-t, --timeout <minutes>", "Execution timeout in minutes (default: 30)", "30").option("-p, --parallel", "Run all agents in parallel (N tmux sessions)").option("-l, --lead", "Lead mode: single orchestrator using Task tool for parallelization").option("-f, --foreground", "Run in foreground (no tmux, blocks terminal)").option("--use-api", "Use API credits instead of subscription").option("--effort <level>", "Effort level: high, medium, low (default: from SQUAD.md or high)").option("--skills <skills...>", "Skills to load (skill IDs or local paths)").action((target, options) => runCommand(target, { ...options, timeout: parseInt(options.timeout, 10) }));
9940
- program.command("list").description("List agents and squads").option("-s, --squads", "List squads only").option("-a, --agents", "List agents only").action(listCommand);
10106
+ program.command("init").description("Initialize a new squad project").option("-t, --template <template>", "Project template", "default").option("--skip-infra", "Skip infrastructure setup prompt").option("--force", "Skip requirement checks (for CI/testing)").action(initCommand);
10107
+ program.command("run <target>").description("Run a squad or agent").option("-v, --verbose", "Verbose output").option("-d, --dry-run", "Show what would be run without executing").option("-e, --execute", "Execute agent via Claude CLI (requires claude installed)").option("-a, --agent <agent>", "Run specific agent within squad").option("-t, --timeout <minutes>", "Execution timeout in minutes (default: 30)", "30").option("-p, --parallel", "Run all agents in parallel (N tmux sessions)").option("-l, --lead", "Lead mode: single orchestrator using Task tool for parallelization").option("-f, --foreground", "Run in foreground (no tmux, blocks terminal)").option("--use-api", "Use API credits instead of subscription").option("--effort <level>", "Effort level: high, medium, low (default: from SQUAD.md or high)").option("--skills <skills...>", "Skills to load (skill IDs or local paths)").addHelpText("after", `
10108
+ Examples:
10109
+ $ squads run engineering Run whole squad (shows agent list)
10110
+ $ squads run engineering/code-review Run specific agent (slash notation)
10111
+ $ squads run engineering -a code-review Same as above (flag notation)
10112
+ $ squads run engineering --dry-run Preview what would run
10113
+ $ squads run engineering --execute Execute via Claude CLI
10114
+ $ squads run engineering --parallel Run all agents in parallel (tmux)
10115
+ $ squads run engineering --lead Single orchestrator with Task tool
10116
+ $ squads run engineering -f Run in foreground (blocks terminal)
10117
+ `).action((target, options) => runCommand(target, { ...options, timeout: parseInt(options.timeout, 10) }));
10118
+ program.command("list").description("List agents and squads").option("-s, --squads", "List squads only").option("-a, --agents", "List agents only").option("-v, --verbose", "Show additional details").action(listCommand);
9941
10119
  program.command("status [squad]").description("Show squad status and state").option("-v, --verbose", "Show detailed status").action(statusCommand);
9942
10120
  program.command("dashboard").alias("dash").description("Show comprehensive goals and metrics dashboard").option("-v, --verbose", "Show additional details").option("-c, --ceo", "Executive summary with priorities and blockers").option("-f, --full", "Include GitHub PR/issue stats (slower, ~30s)").action((options) => dashboardCommand({ ...options, fast: !options.full }));
9943
- var context = program.command("context").description("View and manage squad execution context");
9944
- context.command("show <squad>").description("Show context for a squad (MCP, skills, model, budget)").option("--json", "Output as JSON").action(contextShowCommand);
9945
- context.command("list").description("List context for all squads").option("--json", "Output as JSON").action(contextListCommand);
10121
+ var env = program.command("env").description("View squad execution environment (MCP, skills, model, budget)");
10122
+ env.command("show <squad>").description("Show execution environment for a squad").option("--json", "Output as JSON").action(contextShowCommand);
10123
+ env.command("list").description("List execution environment for all squads").option("--json", "Output as JSON").action(contextListCommand);
9946
10124
  program.command("cost").description("Show cost summary (today, week, by squad)").option("-s, --squad <squad>", "Filter to specific squad").option("--json", "Output as JSON").action(costCommand);
9947
10125
  program.command("budget").description("Check budget status for a squad").argument("<squad>", "Squad to check").option("--json", "Output as JSON").action(budgetCheckCommand);
9948
10126
  var exec2 = program.command("exec").description("View execution history and statistics");
@@ -9958,7 +10136,7 @@ progress.command("start <squad> <description>").description("Register a new acti
9958
10136
  progress.command("complete <taskId>").description("Mark a task as completed").option("-f, --failed", "Mark as failed instead").action(progressCompleteCommand);
9959
10137
  program.command("results [squad]").description("Show squad results: git activity + KPI goals vs actuals").option("-d, --days <days>", "Days to look back", "7").option("-v, --verbose", "Show detailed KPIs per goal").action((squad, options) => resultsCommand({ ...options, squad }));
9960
10138
  program.command("history").description("Show recent agent execution history").option("-d, --days <days>", "Days to look back", "7").option("-s, --squad <squad>", "Filter by squad").option("-v, --verbose", "Show cost and token details").option("-j, --json", "Output as JSON").action((options) => historyCommand(options));
9961
- program.command("context-feed").alias("feed").description("Context feed for agents: goals, memory, costs, activity").option("-s, --squad <squad>", "Focus on specific squad").option("-t, --topic <topic>", "Search memory for relevant context").option("-a, --agent", "Output JSON for agent consumption").option("-j, --json", "Output as JSON (alias for --agent)").option("-v, --verbose", "Show additional details").action((options) => contextFeedCommand(options));
10139
+ program.command("context").alias("feed").description("Get business context for alignment: goals, memory, costs, activity").option("-s, --squad <squad>", "Focus on specific squad").option("-t, --topic <topic>", "Search memory for relevant context").option("-a, --agent", "Output JSON for agent consumption").option("-j, --json", "Output as JSON (alias for --agent)").option("-v, --verbose", "Show additional details").action((options) => contextFeedCommand(options));
9962
10140
  program.command("workers").description("Show active workers: Claude sessions, tasks, dev servers").option("-v, --verbose", "Show more details").option("-k, --kill <pid>", "Kill a process by PID").action(workersCommand);
9963
10141
  program.command("health").description("Quick health check for all infrastructure services").option("-v, --verbose", "Show optional services").action((options) => healthCommand(options));
9964
10142
  program.command("watch <command> [args...]").description("Live refresh any squads command (like Unix watch)").option("-n, --interval <seconds>", "Refresh interval in seconds", "2").option("--no-clear", "Don't clear screen between refreshes").action((command, args, options) => watchCommand(command, args, {
@@ -9967,7 +10145,14 @@ program.command("watch <command> [args...]").description("Live refresh any squad
9967
10145
  }));
9968
10146
  program.command("live").description("Live TUI dashboard with real-time metrics (like htop)").option("-m, --minimal", "Minimal view").option("-f, --focus <panel>", "Focus on specific panel (agents, cost, activity, memory)").action((options) => liveCommand(options));
9969
10147
  program.command("top").description("Live process table (like Unix top) - numbers update in place").action(() => topCommand());
9970
- var memory = program.command("memory").description("Query and manage squad memory").action(() => {
10148
+ var memory = program.command("memory").description("Query and manage squad memory").addHelpText("after", `
10149
+ Examples:
10150
+ $ squads memory query "pricing" Search all memory for "pricing"
10151
+ $ squads memory show engineering View engineering squad's memory
10152
+ $ squads memory update research "Found: MCP adoption at 15%"
10153
+ $ squads memory list List all memory entries
10154
+ $ squads memory sync --push Sync and push to git
10155
+ `).action(() => {
9971
10156
  memory.outputHelp();
9972
10157
  });
9973
10158
  memory.command("query <query>").description("Search across all squad memory").option("-s, --squad <squad>", "Limit search to specific squad").option("-a, --agent <agent>", "Limit search to specific agent").action(memoryQueryCommand);