mirror of
https://github.com/tinyhumansai/openhuman.git
synced 2026-07-28 21:44:38 +00:00
64 lines
3.0 KiB
Bash
Executable File
64 lines
3.0 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Dispatcher for `pnpm review <cmd> <args…>`.
|
|
# Commands: sync | review | fix | coverage | merge
|
|
|
|
set -euo pipefail
|
|
here="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
|
|
usage() {
|
|
cat <<EOF
|
|
Usage: pnpm review <command> <pr-number> [args]
|
|
|
|
Commands:
|
|
sync <pr> Check out PR as pr/<num>, merge main, wire remotes
|
|
review <pr> [--agent <tool>] [extra-prompt]
|
|
Sync + pr-reviewer agent (review, comment, approve)
|
|
Default agent: claude
|
|
Trailing extra-prompt is appended to the agent prompt.
|
|
fix <pr> [--agent <tool>] [extra-prompt]
|
|
Sync + pr-reviewer (apply fixes) + pr-manager-lite (push)
|
|
Default agent: claude
|
|
Trailing extra-prompt is appended to the agent prompt.
|
|
coverage <pr> [--agent <tool>] [extra-prompt]
|
|
Sync + gather coverage CI context + agent to fix coverage
|
|
failures, improve coverage, push, and babysit the PR
|
|
Default agent: claude
|
|
Trailing extra-prompt is appended to the agent prompt.
|
|
merge <pr> [--squash|--merge|--rebase] [--dry-run] [--force] [--admin|--auto] [--summary-llm <tool>]
|
|
Merge via gh (default --squash, deletes branch).
|
|
Requires reviewDecision=APPROVED and green required checks
|
|
(mergeStateStatus in CLEAN/UNSTABLE/HAS_HOOKS) — use --force to skip the local gate.
|
|
--admin bypasses branch protection (requires admin rights).
|
|
--auto queues the merge until checks/approvals are satisfied.
|
|
--dry-run prints the squash commit message and exits.
|
|
Default summary LLM: gemini (use 'none' to skip).
|
|
|
|
Env:
|
|
REVIEW_REPO=owner/name Override target repo (default: upstream remote)
|
|
REVIEW_BANNED_COAUTHOR_RE=<regex> Substrings filtered from Co-authored-by lines
|
|
(default includes copilot/codex/cursor/claude/…)
|
|
REVIEW_AGENT_SAFE=1 Run the picked agent CLI bare instead of in
|
|
its "yolo" mode. Default 0 — claude / codex /
|
|
cursor are launched with their skip-permissions
|
|
flag so headless runs don't stall on prompts.
|
|
EOF
|
|
}
|
|
|
|
cmd="${1:-}"
|
|
if [ -z "$cmd" ] || [ "$cmd" = "-h" ] || [ "$cmd" = "--help" ]; then
|
|
usage
|
|
exit 0
|
|
fi
|
|
shift
|
|
|
|
case "$cmd" in
|
|
sync|review|fix|coverage|merge)
|
|
exec "$here/${cmd}.sh" "$@"
|
|
;;
|
|
*)
|
|
echo "[review] unknown command: $cmd" >&2
|
|
usage >&2
|
|
exit 1
|
|
;;
|
|
esac
|