Commit a276345ea91c
Changed files (6)
home
common
dev
shell
tools
shpool-ssh-wrapper
home/common/dev/gh-news.nix
@@ -40,7 +40,7 @@
}
{
name = "Review with Claude";
- command = "ssh aomi.sbr.pm 'shpool attach review-$(echo \"{url}\" | grep -oE \"(pull|issues)/[0-9]+\" | tr \"/\" \"-\") -- cr \"Review {url}, and load the proper skill as needed (e.g. nixpkgs skills and workflows if it is a pr from NixOS/nixpkgs)\"'";
+ 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 '/' '-')\"";
interactive = true;
}
];
home/common/shell/zsh.nix
@@ -125,9 +125,7 @@
map = "xargs -n1";
k = "kubectl";
wget = "wget -c --hsts-file=${config.xdg.dataHome}/wget-hsts";
- cr = "env CLAUDE_CODE_USE_VERTEX=1 CLOUD_ML_REGION=us-east5 ANTHROPIC_VERTEX_PROJECT_ID=itpc-gcp-pnd-pe-eng-claude claude";
- crl = "env CLAUDE_CODE_USE_VERTEX=1 CLOUD_ML_REGION=us-east5 ANTHROPIC_VERTEX_PROJECT_ID=itpc-gcp-pnd-pe-eng-claude claude --model claude-haiku-4-5";
- crf = "env CLAUDE_CODE_USE_VERTEX=1 CLOUD_ML_REGION=us-east5 ANTHROPIC_VERTEX_PROJECT_ID=itpc-gcp-pnd-pe-eng-claude claude --model claude-opus-4-5";
+ # cr, crl, crf are now scripts in pkgs/my/scripts/bin/
};
plugins = [
pkgs/my/scripts/bin/cr
@@ -0,0 +1,10 @@
+#!/usr/bin/env bash
+# Claude Code with Vertex AI environment
+# Usage: cr [args...]
+# This is a script version of the 'cr' alias for use with shpool and other tools
+
+export CLAUDE_CODE_USE_VERTEX=1
+export CLOUD_ML_REGION=us-east5
+export ANTHROPIC_VERTEX_PROJECT_ID=itpc-gcp-pnd-pe-eng-claude
+
+exec claude "$@"
pkgs/my/scripts/bin/crf
@@ -0,0 +1,9 @@
+#!/usr/bin/env bash
+# Claude Code with Vertex AI environment (Opus model - full power)
+# Usage: crf [args...]
+
+export CLAUDE_CODE_USE_VERTEX=1
+export CLOUD_ML_REGION=us-east5
+export ANTHROPIC_VERTEX_PROJECT_ID=itpc-gcp-pnd-pe-eng-claude
+
+exec claude --model claude-opus-4-5 "$@"
pkgs/my/scripts/bin/crl
@@ -0,0 +1,9 @@
+#!/usr/bin/env bash
+# Claude Code with Vertex AI environment (Haiku model - lightweight)
+# Usage: crl [args...]
+
+export CLAUDE_CODE_USE_VERTEX=1
+export CLOUD_ML_REGION=us-east5
+export ANTHROPIC_VERTEX_PROJECT_ID=itpc-gcp-pnd-pe-eng-claude
+
+exec claude --model claude-haiku-4-5 "$@"
tools/shpool-ssh-wrapper/default.nix
@@ -29,6 +29,7 @@ let
# zshenv sets up PATH and other environment variables
exec ${pkgs.zsh}/bin/zsh -c "source ~/.zshenv; exec /etc/profiles/per-user/vincent/bin/claude"
'';
+
in
pkgs.writeScriptBin "shpool-ssh-wrapper" ''
@@ -69,6 +70,17 @@ pkgs.writeScriptBin "shpool-ssh-wrapper" ''
# Use helper script since shpool -c expects a binary, not a shell command
run_with_command "$SESSION_NAME" "${claude-vertex}" "$WORK_DIR"
;;
+ review-*)
+ # Claude Code review session - run with prompt
+ # Usage: ssh host/review-pull-123="Review https://github.com/..."
+ # The WORK_DIR variable holds the prompt (after =)
+ # Uses 'cr' script from PATH (pkgs/my/scripts/bin/cr)
+ if [ -z "$WORK_DIR" ]; then
+ echo "Error: review sessions require a prompt (use session=prompt syntax)" >&2
+ exit 1
+ fi
+ run_with_command "$SESSION_NAME" "cr" "$WORK_DIR"
+ ;;
*)
# If work directory specified, cd into it before attaching
if [ -n "$WORK_DIR" ]; then