You are helping the user install the `sow` CLI tool on their local machine. Follow these steps carefully to ensure a successful installation.
Installs the sow CLI tool using Homebrew or direct binary download.
/plugin marketplace add jmgilman/sow/plugin install sow@sow-marketplaceYou are helping the user install the sow CLI tool on their local machine. Follow these steps carefully to ensure a successful installation.
Guide the user through installing the sow CLI, preferring Homebrew when available, falling back to direct binary download when necessary.
First, gather information about the user's system:
uname -s to determine OS (Darwin=macOS, Linux, MINGW/MSYS=Windows)uname -m to determine architecture (x86_64, arm64, aarch64)which brew to see if Homebrew is installed (macOS/Linux only)curl -s https://api.github.com/repos/jmgilman/sow/releases/latest | grep '"tag_name"' | sed -E 's/.*"([^"]+)".*/\1/'
Based on your detection, present the user with:
Important: Ask the user to confirm they want to proceed with the recommended method before continuing.
If Homebrew is available and user confirmed:
Run the installation command:
brew install jmgilman/apps/sow
Wait for completion and show output to user
Skip to Step 4 (Verification)
If Homebrew is not available or user prefers direct download:
Construct download URL based on detected platform:
Format: https://github.com/jmgilman/sow/releases/download/{VERSION}/sow_{VERSION}_{OS}_{ARCH}.{EXT}
Where:
{VERSION} = latest version (e.g., v1.0.0){OS} = Platform name:
DarwinLinuxWindows{ARCH} = Architecture:
x86_64arm64{EXT} = Archive extension:
tar.gzzipExample URLs:
https://github.com/jmgilman/sow/releases/download/v1.0.0/sow_v1.0.0_Darwin_x86_64.tar.gzhttps://github.com/jmgilman/sow/releases/download/v1.0.0/sow_v1.0.0_Linux_arm64.tar.gzhttps://github.com/jmgilman/sow/releases/download/v1.0.0/sow_v1.0.0_Windows_x86_64.zipDownload and extract:
# Create temp directory
TEMP_DIR=$(mktemp -d)
cd $TEMP_DIR
# Download (replace URL with constructed URL)
curl -L -o archive.tar.gz "https://github.com/jmgilman/sow/releases/download/{VERSION}/{FILENAME}"
# Extract
tar -xzf archive.tar.gz # Use 'unzip archive.zip' for Windows
Install to ~/.local/bin:
# Create directory if it doesn't exist
mkdir -p ~/.local/bin
# Move binary
mv sow ~/.local/bin/sow
# Make executable (Unix-like systems)
chmod +x ~/.local/bin/sow
# Clean up
cd ~
rm -rf $TEMP_DIR
Check PATH and update if needed:
Check if ~/.local/bin is in PATH:
echo $PATH | grep -q "$HOME/.local/bin" && echo "In PATH" || echo "Not in PATH"
If NOT in PATH, ask the user which shell configuration file(s) to update:
.zshrc (Zsh - default on modern macOS).bashrc (Bash on Linux).bash_profile (Bash on macOS).profile (Generic POSIX shell)For each selected file:
# Add to shell config (only if not already present)
if ! grep -q 'export PATH="$HOME/.local/bin:$PATH"' ~/.zshrc; then
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
fi
Inform the user they need to either:
source ~/.zshrc (or whichever file was modified)Run the version command:
sow version
If successful, display:
v1.0.0 (or whatever version)/path/to/sow (from which sow)Show Next Steps:
Next steps:
1. Navigate to your git repository
2. Run: sow init
3. Follow the prompts to initialize sow in your repository
For more information, visit: https://github.com/jmgilman/sow
Handle these common issues gracefully:
Remember: You're helping the user install software on their machine. Be careful, transparent, and always confirm before making system changes.