Created
August 10, 2025 21:33
-
-
Save zbeyens/945c948d7b2507ddf11e092abe1c162d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Flashbacker Installation Script | |
| # Installs or updates Flashbacker globally and sets up the alias | |
| set -e # Exit on error | |
| # Save current directory to return to it later | |
| ORIGINAL_DIR="${PWD}" | |
| echo "π Installing Flashbacker..." | |
| # Clone or update Flashbacker | |
| if [ -d ~/.claude/flashbacker ]; then | |
| echo "π¦ Updating existing Flashbacker installation..." | |
| cd ~/.claude/flashbacker | |
| git pull --quiet | |
| else | |
| echo "π¦ Cloning Flashbacker repository..." | |
| git clone https://github.com/agentsea/flashbacker.git ~/.claude/flashbacker | |
| cd ~/.claude/flashbacker | |
| fi | |
| # Install dependencies and build | |
| echo "π¦ Installing dependencies..." | |
| npm install --silent | |
| echo "π¨ Building Flashbacker..." | |
| npm run build --silent | |
| echo "π Creating npm link..." | |
| npm link --silent | |
| # Add alias to shell config if not already present | |
| SHELL_CONFIG="" | |
| if [ -f ~/.zshrc ]; then | |
| SHELL_CONFIG=~/.zshrc | |
| elif [ -f ~/.bashrc ]; then | |
| SHELL_CONFIG=~/.bashrc | |
| else | |
| echo "β οΈ Could not find .zshrc or .bashrc - please add alias manually:" | |
| echo " alias flashback=\"node ~/.claude/flashbacker/lib/cli.js\"" | |
| cd "${ORIGINAL_DIR}" | |
| exit 1 | |
| fi | |
| if ! grep -q 'alias flashback=' "$SHELL_CONFIG"; then | |
| echo "βοΈ Adding flashback alias to $SHELL_CONFIG..." | |
| echo 'alias flashback="node ~/.claude/flashbacker/lib/cli.js"' >> "$SHELL_CONFIG" | |
| echo "π Alias added. Run 'source $SHELL_CONFIG' to activate it." | |
| else | |
| echo "β Alias already exists in $SHELL_CONFIG" | |
| fi | |
| # Return to original directory | |
| cd "${ORIGINAL_DIR}" | |
| # Verify installation | |
| if [ -f ~/.claude/flashbacker/lib/cli.js ]; then | |
| VERSION=$(node ~/.claude/flashbacker/lib/cli.js --version 2>/dev/null || echo "unknown") | |
| echo "β Flashbacker v${VERSION} installed successfully!" | |
| echo "" | |
| echo "π― Next steps:" | |
| echo " 1. Run: source $SHELL_CONFIG" | |
| echo " 2. Verify: flashback --version" | |
| else | |
| echo "β Installation failed - cli.js not found" | |
| exit 1 | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment