Commit d0cee65546cf
Changed files (2)
home
common
dev
pkgs
my
scripts
bin
home/common/dev/gh-news.nix
@@ -40,7 +40,7 @@
}
{
name = "Review with Claude";
- command = "ssh aomi.sbr.pm \"shpool attach -f -c 'cr \\\"Review {url}, and load the proper skill as needed (e.g. nixpkgs skills and workflows if it is a pr from NixOS/nixpkgs)\\\"' review-$(echo '{url}' | grep -oE '(pull|issues)/[0-9]+' | tr '/' '-')\"";
+ command = "gh-news-review {url}";
interactive = true;
}
];
pkgs/my/scripts/bin/gh-news-review
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+# Review a GitHub PR/issue with Claude on a remote machine via shpool
+# Usage: gh-news-review <url>
+
+set -euo pipefail
+
+URL="$1"
+
+# Extract session name from URL (e.g., pull-123 or issues-456)
+SESSION_NAME="review-$(echo "$URL" | grep -oE '(pull|issues)/[0-9]+' | tr '/' '-')"
+
+if [[ -z "$SESSION_NAME" || "$SESSION_NAME" == "review-" ]]; then
+ echo "Error: Could not extract PR/issue number from URL: $URL" >&2
+ exit 1
+fi
+
+PROMPT="Review $URL, and load the proper skill as needed (e.g. nixpkgs skills and workflows if it is a pr from NixOS/nixpkgs)"
+
+# SSH to aomi and run cr in a shpool session
+# Use bash -lc to ensure PATH includes Nix profile paths where cr is located
+exec ssh -t aomi.sbr.pm "shpool attach -f -c 'bash -lc \"cr \\\"$PROMPT\\\"\"' $SESSION_NAME"