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