Lines 14-54javascript
14import { pollInbox } from './inbox.js';
15import { postRecap } from './recap.js';
16import { runInit } from './scaffold/bootstrap.js';
17function argValue(args, flag) {
18 const i = args.indexOf(flag);
19 return i >= 0 && args[i + 1] ? args[i + 1] : null;
21const HELP = `mergesmith — forge specs into merged PRs
24 mergesmith init Scaffold config + CODEOWNERS + labels + ruleset in this repo
25 mergesmith dispatch <spec-path>|--issue <n> Send a spec or a GitHub issue to the implementer
26 mergesmith tick [--all] [--dry-run] Poll agent-managed PRs (verify green / follow-up red)
27 mergesmith followup --branch <b> --message "<m>" Send a manual follow-up to the agent
28 mergesmith notify "<text>" [--mention] Post to the configured Slack channel
29 mergesmith inbox Poll Slack for !go-finalized threads → GitHub issues
30 mergesmith recap Post a state snapshot (PRs + issues) to Slack
31 mergesmith mark-reviewed <pr> <sha> Mark a PR SHA as processed
32 mergesmith verify-model [--list] [<model>] Get/set the review model (verifier.model)
33 mergesmith dev-model [--list] [<model>] Get/set the implementer model (implementer.model)
34 mergesmith ensure-labels Create the PR state labels in the repo (idempotent)
35 mergesmith pause | resume Stop / restart the loop (kill switch, no crontab edit)
36 mergesmith health Show last-tick heartbeat + pause state
38async function main() {
39 const [cmd, ...rest] = process.argv.slice(2);
42 await runInit(process.cwd());
43 break;
MediumInstall Persistence
Source writes installer persistence such as shell profile or service configuration.
dist/cli.jsView on unpkg · L34 45 const issueArg = argValue(rest, '--issue');
47 await dispatchIssue(loadConfig(), Number(issueArg), argValue(rest, '--base') ?? undefined);
50 const spec = rest.find((a) => !a.startsWith('--'));
52 throw new Error('Uso: mergesmith dispatch <spec-path> | --issue <n>');
53 await dispatchSpec(loadConfig(), spec);