mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-22 16:11:34 +01:00
gstack now tells you in one line what it's about to add, where you'll see it and how to remove it, before anything that keeps running or shows up goes onto your machine. This follows the standing rule that nothing gets added to Garry's devices without that line and a name he'd recognize. Nothing to do: behavior of the jobs themselves is unchanged. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> Review-Finding: p1/specialist-batched#1 reader=testing
68 lines
2.3 KiB
Bash
Executable File
68 lines
2.3 KiB
Bash
Executable File
#!/bin/bash
|
|
# gstack-extension — helper to install the Chrome extension
|
|
#
|
|
# When using $B connect, the extension auto-loads. This script is for
|
|
# installing it in your regular Chrome (not the Playwright-controlled one).
|
|
|
|
set -e
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
|
|
# Find the extension directory
|
|
EXT_DIR=""
|
|
if [ -f "$REPO_ROOT/extension/manifest.json" ]; then
|
|
EXT_DIR="$REPO_ROOT/extension"
|
|
elif [ -f "$HOME/.claude/skills/gstack/extension/manifest.json" ]; then
|
|
EXT_DIR="$HOME/.claude/skills/gstack/extension"
|
|
fi
|
|
|
|
if [ -z "$EXT_DIR" ]; then
|
|
echo "Error: extension/ directory not found."
|
|
echo "Expected at: $REPO_ROOT/extension/ or ~/.claude/skills/gstack/extension/"
|
|
exit 1
|
|
fi
|
|
|
|
# Copy path to clipboard
|
|
echo -n "$EXT_DIR" | pbcopy 2>/dev/null
|
|
|
|
# Get browse server port
|
|
PORT=""
|
|
STATE_FILE="$REPO_ROOT/.gstack/browse.json"
|
|
if [ -f "$STATE_FILE" ]; then
|
|
PORT=$(grep -o '"port":[0-9]*' "$STATE_FILE" | grep -o '[0-9]*')
|
|
fi
|
|
|
|
echo "gstack Chrome Extension Setup"
|
|
echo "=============================="
|
|
echo ""
|
|
echo "Extension path (copied to clipboard):"
|
|
echo " $EXT_DIR"
|
|
echo ""
|
|
|
|
if [ -n "$PORT" ]; then
|
|
echo "Browse server port: $PORT"
|
|
echo ""
|
|
fi
|
|
|
|
echo "Quick install (if using \$B connect):"
|
|
echo " The extension auto-loads when you run \$B connect."
|
|
echo " No manual installation needed!"
|
|
echo ""
|
|
echo "Manual install (for your regular Chrome):"
|
|
echo ""
|
|
echo " Adding a Chrome extension called gstack browse that adds the gstack side panel to your regular Chrome. You'll see it as the gstack browse icon in Chrome's toolbar and on chrome://extensions. Remove it with: chrome://extensions → gstack browse → Remove"
|
|
echo ""
|
|
echo " 1. Opening chrome://extensions now..."
|
|
|
|
# Open chrome://extensions
|
|
osascript -e 'tell application "Google Chrome" to open location "chrome://extensions"' 2>/dev/null || \
|
|
open "chrome://extensions" 2>/dev/null || \
|
|
echo " Could not open Chrome. Navigate to chrome://extensions manually."
|
|
|
|
echo " 2. Toggle 'Developer mode' ON (top-right)"
|
|
echo " 3. Click 'Load unpacked'"
|
|
echo " 4. In the file picker: Cmd+Shift+G → paste (path is in your clipboard) → Enter → Select"
|
|
echo " 5. Click the gstack puzzle icon in toolbar → enter port: ${PORT:-<check \$B status>}"
|
|
echo " 6. Click 'Open Side Panel'"
|