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