export declare const USAGE: { readonly default: string; readonly apply: `pr-shepherd apply Apply review mutations, mark selected changed files as viewed, or append a PR journal item. Usage: pr-shepherd apply review [PR] [review-flags] pr-shepherd apply files [PR] [files...] [--tests] [--match REGEX] pr-shepherd apply journal [PR] [--dry-run] [--format text|json] pr-shepherd apply journal [PR] --file [--dry-run] [--format text|json] Run 'pr-shepherd apply --help' for command-specific details. --help, -h Print this help and exit before GitHub I/O.`; readonly "apply review": `pr-shepherd apply review Apply user-directed GitHub review-state mutations after fixes. Supplied IDs are forwarded to GitHub; GitHub accepts or rejects each mutation. Usage: pr-shepherd apply review [PR] --reply-thread-ids A,B --message MSG pr-shepherd apply review [PR] --resolve-thread-ids A,B [--minimize-comment-ids X,Y] [--dismiss-review-ids Q] [--message MSG] [--require-sha SHA] [--format text|json] Flags: --resolve-thread-ids Comma-separated review thread IDs (PRRT_*) to resolve. --reply-thread-ids Comma-separated review thread IDs to reply to. --minimize-comment-ids Comma-separated issue/review comment IDs to minimize. --dismiss-review-ids Comma-separated review IDs to dismiss. --message Reply/dismiss message. Required with reply or dismiss IDs. --require-sha Wait for this full 40-character lowercase PR head SHA. --format text|json Output format. Default: text. At least one action flag is required. --help, -h Print this help and exit before GitHub I/O.`; readonly "apply files": `pr-shepherd apply files Mark selected changed files as viewed. Usage: pr-shepherd apply files [PR] [files...] [--tests] [--match REGEX] [--format text|json] Selectors: files... Exact changed-file paths from the PR diff. --tests Select changed test files. --match Select changed files whose paths match a case-insensitive JavaScript regex. May be repeated. --help, -h Print this help and exit before GitHub I/O.`; readonly "apply journal": `pr-shepherd apply journal Append a list item to the Shepherd Journal details block of a PR body. Usage: pr-shepherd apply journal [PR] [--dry-run] [--format text|json] pr-shepherd apply journal [PR] --file [--dry-run] [--format text|json] pr-shepherd apply journal [PR] --file - [--dry-run] [--format text|json] PR may be a number or GitHub pull request URL. An item must start with '- ' followed by text. Use --file to read an item from a file, or --file - to read it from stdin. Exactly one item source is required. --dry-run previews the resulting body without writing it. --help, -h Print this help and exit before GitHub I/O.`; readonly "build-suggestion-patches": `pr-shepherd build-suggestion-patches Build an ordered list of patches and commit instructions from GitHub review suggestions. The command does not edit files or mutate git history. Usage: pr-shepherd build-suggestion-patches [PR] --thread-id ID --message MSG [--description DESC] [--thread-id ID --message MSG [--description DESC] ...] [--format text|json] Each --thread-id starts a suggestion group. Its following --message and optional --description belong to that suggestion. Groups are validated and returned in command-line order. The current branch must match the PR head ref. Local HEAD may equal or descend from the PR head; every generated patch is dry-run in order with git apply --check before output. --help, -h Print this help and exit before GitHub, git, config, or log I/O.`; readonly "build-suggestion-patch": `pr-shepherd build-suggestion-patch Deprecated one-suggestion adapter. Use build-suggestion-patches. Usage: pr-shepherd build-suggestion-patch [PR] --thread-id ID --message MSG [--description DESC] [--format text|json] Flags: --thread-id Review thread containing exactly one suggestion block. Required. --message Suggested commit subject. Required and non-empty. --description Optional longer commit body. --format text|json Output format. Default: text. The current branch must match the PR head ref. Local HEAD may equal or descend from the PR head. --help, -h Print this help and exit before GitHub, git, config, or log I/O.`; readonly admin: `pr-shepherd admin Administrative state and diagnostics commands. Usage: pr-shepherd admin clean [value] [flags] pr-shepherd admin log-file [--format text|json] Run 'pr-shepherd admin --help' for command-specific details. --help, -h Print this help and exit before any I/O.`; readonly "admin clean": `pr-shepherd admin clean Remove pr-shepherd state files from PR_SHEPHERD_STATE_DIR. Usage: pr-shepherd admin clean pr [number] [--dry-run] [--format text|json] pr-shepherd admin clean branch [name] [--dry-run] [--format text|json] pr-shepherd admin clean current [--dry-run] [--format text|json] pr-shepherd admin clean repo [--dry-run] [--format text|json] pr-shepherd admin clean all [--dry-run] [--format text|json] Variants remove state for one PR, branch, current branch, repository, or all repositories. Use --dry-run to preview paths without removing them. --help, -h Print this help and exit before any cleanup.`; readonly "admin log-file": string; readonly resolve: `pr-shepherd resolve Deprecated compatibility alias for user-directed GitHub review-state mutations. Supplied IDs are forwarded to GitHub; GitHub accepts or rejects each mutation. Usage: pr-shepherd resolve [PR] --reply-thread-ids A,B --message MSG pr-shepherd resolve [PR] --resolve-thread-ids A,B [--minimize-comment-ids X,Y] [--dismiss-review-ids Q] [--message MSG] [--require-sha SHA] [--format text|json] Flags: --resolve-thread-ids Comma-separated review thread IDs (PRRT_*) to resolve. Note: comment IDs (PRRC_*) from gh api are not thread IDs and will fail. --reply-thread-ids Comma-separated review thread IDs to reply to. --minimize-comment-ids Comma-separated issue/review comment IDs to minimize. --dismiss-review-ids Comma-separated review IDs to dismiss. --message Reply/dismiss message. Required with --reply-thread-ids or --dismiss-review-ids. --require-sha Wait until GitHub reports this PR head SHA before mutating. Must be a full 40-character lowercase hex SHA. Local HEAD is valid only when it equals the current remote PR head. --format text|json Output format. Default: text. --help, -h Print this help and exit before GitHub I/O. At least one non-empty action flag is required: --reply-thread-ids, --resolve-thread-ids, --minimize-comment-ids, or --dismiss-review-ids. PR may be a number or GitHub pull request URL. When omitted, the current branch PR is inferred. Exit code: 0 on success; nonzero on failure (sysexits.h — see docs/exit-codes.md).`; readonly "commit-suggestion": `pr-shepherd commit-suggestion Build a patch and commit instructions for one GitHub review thread containing a suggestion block. The command does not edit files or mutate git history. Usage: pr-shepherd commit-suggestion [PR] --thread-id ID --message MSG [--description DESC] [--format text|json] Flags: --thread-id Review thread ID containing exactly one suggestion to apply. Required. --message Suggested commit subject. Required and must be non-empty. --description Optional longer commit body. --format text|json Output format. Default: text. --help, -h Print this help and exit before GitHub, git, config, or log I/O. Preconditions: The current branch must match the PR head ref. Local HEAD may equal or descend from the PR head. Exit codes: 0 suggestion patch and instructions produced 64 usage error (missing/invalid flag) 69 precondition unmet (thread ineligible, branch/SHA mismatch, no open PR) See docs/exit-codes.md for the full sysexits.h table.`; readonly "mark-files-as-viewed": `pr-shepherd mark-files-as-viewed Deprecated compatibility alias for marking selected PR files as viewed. Usage: pr-shepherd mark-files-as-viewed [PR] [files...] [--tests] [--match REGEX] [--format text|json] Selectors: files... Exact changed-file paths from the PR diff. --tests Select changed test files. --match Select changed files whose paths match a case-insensitive JavaScript regex. May be repeated. Flags: --format text|json Output format. Default: text. --help, -h Print this help and exit before GitHub I/O. PR may be a number or GitHub pull request URL. When omitted, the current branch PR is inferred. Exit code: 0 on success; nonzero on failure (sysexits.h — see docs/exit-codes.md).`; readonly iterate: "pr-shepherd iterate\n\nRun one iterate tick for a pull request. The no-subcommand form polls; use this subcommand for a single tick.\nThe output contains one action and an action-specific ## Instructions section.\n\nUsage:\n pr-shepherd iterate [PR] [iterate-flags]\n\nIterate flags:\n --ready-delay Settle window before a clean PR cancels. Bare number = minutes. Example: 15m.\n --stall-timeout Escalate repeated unchanged failures after this duration. Bare number = minutes. 0 disables.\n --no-auto-mark-ready Do not convert draft PRs to ready for review.\n --no-auto-cancel-actionable Legacy no-op; workflow runs are never cancelled.\n --merge Shepherd through readiness, then emit a merge or merge-queue command.\n --format text|json Output Markdown text or JSON. Default: text.\n --verbose Include verbose iterate fields.\n --help, -h Print this help and exit before GitHub, git, config, or log I/O.\n\nDurations accept s/m/h suffixes: 30s, 4.5m, 1h. A bare number is minutes; decimals are allowed only with an explicit unit (4.5m).\n\nActions:\n WAIT No immediate action; continue with the next poll.\n MARK_READY Draft PR was marked ready; continue with the next poll.\n FIX_CODE Agent action is required; follow the instructions, then continue polling.\n CANCEL Stop polling: merged/closed or ready-delay elapsed.\n ESCALATE Stop polling until a human provides direction.\n MERGE Run the emitted merge/queue command, then continue monitoring.\n\nExit codes:\n 0 CANCEL (merged or ready-delay elapsed)\n 10 WAIT\n 11 MARK_READY\n 12 FIX_CODE\n 13 ESCALATE\n 14 CANCEL (closed without merging)\n 15 MERGE\n A command/validation/GitHub failure exits with a sysexits.h code instead (see docs/exit-codes.md)."; readonly poll: "pr-shepherd poll\n\nRun iterate repeatedly for one PR, or read compact summaries for an explicit PR set or native\nGitHub stack. Aggregate mode returns when any row needs work, every row is terminal, or timeout.\nPoll exits as soon as iterate returns MARK_READY, CANCEL, or ESCALATE, or when timeout\nreturns the last WAIT result. FIX_CODE starts a --debounce settle window (default:\npoll.debounceSeconds; built-in 1m): poll keeps\niterating at --interval, then runs one more tick after the window and returns that result.\nWith --until-terminal or --merge, poll also continues through MARK_READY.\n\nUsage:\n pr-shepherd poll [PR ...] [poll-flags] [iterate-flags]\n pr-shepherd poll --stack PR [poll-flags] [iterate-flags]\n\nPoll flags:\n --stack PR Select all entries in PR's native GitHub stack, bottom to top.\n --interval Sleep between WAIT ticks. Bare number = seconds. Default: poll.intervalSeconds (built-in 60s).\n --timeout Maximum wall-clock wait for WAIT ticks. Bare number = seconds. Default: poll.timeoutSeconds (built-in 4.5m).\n --debounce Settle window after first FIX_CODE before returning. Bare number = seconds. Default: poll.debounceSeconds (built-in 60s). 0 disables.\n --quiet-status Print only changed WAIT snapshots. Overrides poll.quietStatus.\n --no-quiet-status Print every WAIT snapshot. Overrides poll.quietStatus.\n --until-terminal Continue through WAIT/MARK_READY until FIX_CODE/CANCEL/ESCALATE.\n\nForwarded iterate flags:\n --ready-delay Settle window before a clean PR cancels. Bare number = minutes. Example: 15m.\n --stall-timeout Escalate repeated unchanged failures after this duration. Bare number = minutes. 0 disables.\n --no-auto-mark-ready Do not convert draft PRs to ready for review.\n --no-auto-cancel-actionable Legacy no-op; workflow runs are never cancelled.\n --merge Shepherd through readiness, then emit a merge or merge-queue command.\n --format text|json Output Markdown text or JSON. Default: text.\n --verbose Include verbose iterate fields and detailed per-tick lines.\n --help, -h Print this help and exit before GitHub, git, config, or log I/O.\n\nDurations accept s/m/h suffixes: 30s, 4.5m, 1h. A bare number uses each flag's default unit (seconds\nfor --interval/--timeout/--debounce, minutes for --ready-delay/--stall-timeout); decimals are allowed only with\nan explicit unit (4.5m).\nEach WAIT tick writes an explicit still-running line to stderr by default; poll.quietStatus can change that default, --quiet-status/--no-quiet-status override it, and --verbose emits detailed per-tick lines.\nFIX_CODE debounce writes a remaining-seconds line to stderr. --timeout does not cut an in-flight debounce short.\nWith --until-terminal, --timeout is ignored for WAIT ticks and polling continues until FIX_CODE, MERGE, CANCEL, or ESCALATE. With --merge, --timeout still bounds WAIT ticks; it only continues through MARK_READY while polling remains within that timeout.\n\nExit codes: same as iterate (the final tick's action/reason decides the code).\n 0 CANCEL (merged or ready-delay elapsed)\n 10 WAIT (including a WAIT returned by --timeout)\n 11 MARK_READY\n 12 FIX_CODE\n 13 ESCALATE\n 14 CANCEL (closed without merging)\n 15 MERGE\n A command/validation/GitHub failure exits with a sysexits.h code instead (see docs/exit-codes.md)."; readonly clean: `pr-shepherd clean Remove pr-shepherd state files from PR_SHEPHERD_STATE_DIR. Usage: pr-shepherd clean pr [number] [--dry-run] [--format text|json] pr-shepherd clean branch [name] [--dry-run] [--format text|json] pr-shepherd clean current [--dry-run] [--format text|json] pr-shepherd clean repo [--dry-run] [--format text|json] pr-shepherd clean all [--dry-run] [--format text|json] Variants: pr [number] Remove state for one PR. Defaults to current branch PR. branch [name] Resolve a branch to its open PR, then remove that PR's state. Defaults to current branch. current Alias for branch against the current branch. repo Remove all state for the current repository, including worktree logs. all Remove all pr-shepherd state. Flags: --dry-run Preview paths without removing them. --format text|json Output format. Default: text. --help, -h Print this help and exit before any cleanup. Exit code: 0 on success (including a no-op --dry-run on a nonexistent target); nonzero on failure (sysexits.h — see docs/exit-codes.md).`; readonly journal: `pr-shepherd journal Append a list item to the Shepherd Journal details block of a PR body. Creates the section at the end if absent. Idempotent — duplicate items are skipped. Usage: pr-shepherd journal [PR] [--dry-run] [--format text|json] pr-shepherd journal [PR] --file [--dry-run] [--format text|json] pr-shepherd journal [PR] --file - [--dry-run] [--format text|json] PR PR number or GitHub pull request URL. Defaults to current branch PR. item Markdown list item: must start with "- " followed by non-whitespace text. Example: '- Rejected suggestion: kept existing pattern for consistency.' Provide it as a positional argument, or via --file to avoid shell-escaping backticks and multi-line Markdown. Exactly one of the two is required. Flags: --file Read the entry from a file instead of a positional argument. Pass --file - to read from stdin. --dry-run Preview the new PR body without writing it to GitHub. --format text|json Output format. Default: text. --help, -h Print this help and exit before any GitHub I/O. Exit code: 0 on success (including no-change no-op); nonzero on failure (sysexits.h — see docs/exit-codes.md).`; readonly "journal extract": `pr-shepherd journal extract Extract one visible, structurally valid Shepherd Journal from a local PR-body file. This command performs no GitHub, configuration, or log I/O. Usage: pr-shepherd journal extract --body-file The output is exactly one JSON line: the typed result from extractShepherdJournal. Malformed or unrecognized journal content is returned as {"ok":false,...} with exit code 0. On POSIX, the final body-file path entry must be a readable regular file in a trusted parent directory; symlinks, FIFOs, devices, and unreadable paths exit 66. Unsupported platforms fail closed with exit 66. --help, -h Print this help and exit before any I/O.`; readonly "log-file": "pr-shepherd log-file\n\nPrint the per-worktree append-only debug log path for the current repository.\nThe log is created by the first non-help pr-shepherd command that initializes logging.\n\nUsage:\n pr-shepherd log-file [--format text|json]\n\nFlags:\n --format text|json Print a raw path or {\"path\": \"...\"} JSON. Default: text.\n --help, -h Print this help and exit before logging setup.\n\nEnvironment:\n PR_SHEPHERD_LOG_DISABLED=1 disables logging.\n PR_SHEPHERD_STATE_DIR overrides the base state directory.\n\nExit code: 0 on success; 1 if repository identity cannot be resolved."; readonly top: "pr-shepherd\n\nAutonomous PR CI monitor and review-comment resolver for agentic coding tools.\n\nUsage:\n pr-shepherd --version | -v\n pr-shepherd --help | -h\n pr-shepherd [PR ...] [poll-flags] [iterate-flags]\n pr-shepherd --stack PR [poll-flags] [iterate-flags]\n pr-shepherd iterate [PR] [iterate-flags]\n pr-shepherd apply review [PR] [review-flags]\n pr-shepherd apply files [PR] [files...] [--tests] [--match REGEX]\n pr-shepherd apply journal [PR] [--dry-run] [--format text|json]\n pr-shepherd journal extract --body-file \n pr-shepherd build-suggestion-patches [PR] --thread-id ID --message MSG [groups...]\n pr-shepherd admin clean [value] [flags]\n pr-shepherd admin log-file [--format text|json]\n\nCommands:\n [PR ...] Poll one PR, an explicit same-repository set, or a native stack.\n iterate Run one iterate tick (single-tick alias).\n apply review Apply review-state mutations after fixes.\n apply files Mark selected changed files as viewed.\n apply journal Append a list item to the Shepherd Journal details block of a PR body.\n journal extract Extract a validated Shepherd Journal from a local PR-body file as JSON.\n build-suggestion-patches\n Convert ordered GitHub suggestion threads into patches and commit instructions.\n admin clean Remove pr-shepherd state files.\n admin log-file Print the per-worktree debug log path.\n\nPR argument:\n PR may be a number, owner/repo#number, or a GitHub pull request URL.\n Multiple PRs must name one repository. --stack PR selects every entry in PR's native stack.\n When omitted, pr-shepherd infers the current branch's pull request.\n\nCommon flags:\n --format text|json Output Markdown text or JSON. Default: text.\n --verbose Include verbose iterate fields and detailed poll-tick lines.\n --help, -h Print help and exit before any GitHub, git, config, or log I/O.\n\nIterate flags:\n --ready-delay Settle window before a clean PR cancels. Bare number = minutes. Example: 15m.\n --stall-timeout Escalate repeated unchanged failures after this duration. Bare number = minutes. 0 disables.\n --no-auto-mark-ready Do not convert draft PRs to ready for review.\n --no-auto-cancel-actionable Legacy no-op; workflow runs are never cancelled.\n --merge Shepherd through readiness, then emit a merge or merge-queue command.\n\nPolling flags:\n --interval Delay between WAIT ticks. Bare number = seconds. Default: poll.intervalSeconds (built-in 60s).\n --timeout Poll wall-clock cap for WAIT ticks. Bare number = seconds. Default: poll.timeoutSeconds (built-in 4.5m).\n --debounce Settle window after first FIX_CODE before returning. Bare number = seconds. Default: poll.debounceSeconds (built-in 60s). 0 disables.\n --quiet-status Print only changed WAIT snapshots. Overrides poll.quietStatus.\n --no-quiet-status Print every WAIT snapshot. Overrides poll.quietStatus.\n --until-terminal Continue through WAIT/MARK_READY until FIX_CODE/CANCEL/ESCALATE.\n\nClean variants:\n pr [number] Remove state for one PR. Defaults to current branch PR.\n branch [name] Remove state for a branch's PR. Defaults to current branch.\n current Alias for branch against the current branch.\n repo Remove all state for the current repository.\n all Remove all pr-shepherd state.\n\nExit codes: 0 done, 10-19 PR state, 64-78 shepherd failed (sysexits.h).\n 0 CANCEL (merged or ready-delay elapsed)\n 10 WAIT\n 11 MARK_READY\n 12 FIX_CODE\n 13 ESCALATE\n 14 CANCEL (closed without merging)\n 15 MERGE\nSee docs/exit-codes.md for the full sysexits.h error-code table.\n\nDuration examples: 30s, 4.5m, 1h. A bare number uses each flag's default unit (see above); decimals are allowed with an explicit unit (4.5m).\n\nRun 'pr-shepherd --help' for command-specific details."; }; /** Resolve help keys for nested public commands before any command I/O. */ export declare function helpKeyForArgs(args: string[]): keyof typeof USAGE; /** Prints usage for `key` to stdout and returns true if `--help` or `-h` is in args. */ export declare function maybePrintHelp(args: string[], key: keyof typeof USAGE): boolean;