Installation Guide
Prerequisites
Required
-
Rust toolchain (1.85 or later)
Linux / macOS:
rustc --version # VerifyInstallation method:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shWindows:
rustc --version # VerifyInstallation method: Download from rustup.rs
-
GitHub CLI (
gh) - AuthenticatedLinux / macOS:
gh --version # Verify gh auth status # Check authentication statusWindows:
gh --version # Verify gh auth status # Check authentication statusAuthentication method:
gh auth loginInstallation: GitHub CLI
Recommended
- Git (for repository cloning)
Installation Methods
Method 1: Setup Script (Recommended)
Interactively performs all steps.
Linux / macOS
# Clone the repository
git clone https://github.com/7rikazhexde/gist-cache-rs.git
cd gist-cache-rs
# Run the setup script
./script/setup.sh install
Actions performed:
- ✅ Prerequisite check
- 📁 Project directory detection
- 🔨 Release build
- 📦 Select installation method
- ⚙️ Perform installation
- ⚙️ Configuration file setup (optional - v0.8.7+)
- Interactive interpreter selection for each file extension
- Python (.py): uv or python3
- Ruby (.rb): ruby
- JavaScript (.js): node
- TypeScript (.ts): ts-node, deno, or bun
- Shell (.sh): bash, sh, or zsh
- PHP (.php): php
- Perl (.pl): perl
- PowerShell (.ps1): pwsh
- Fallback (*): bash, python3, or sh
- 🔄 Initial cache creation
- ⌨️ Alias setup (optional)
Windows
# Clone the repository
git clone https://github.com/7rikazhexde/gist-cache-rs.git
cd gist-cache-rs
# Run the setup script
.\script\setup.ps1 install
Actions performed:
- ✅ Prerequisite check (Rust, GitHub CLI)
- 🔨 Release build
- 📦 Perform cargo install
- ⚙️ Configuration file setup (optional - v0.8.7+)
- Interactive interpreter selection for each file extension
- Python (.py): uv or python3
- Ruby (.rb): ruby
- JavaScript (.js): node
- TypeScript (.ts): ts-node, deno, or bun
- Shell (.sh): bash, sh, or zsh
- PHP (.php): php
- Perl (.pl): perl
- PowerShell (.ps1): pwsh
- Fallback (*): bash, python3, or sh
- 🔄 Initial cache creation (optional)
Installation location:
- Binary:
%USERPROFILE%\.cargo\bin\gist-cache-rs.exe - Cache:
%LOCALAPPDATA%\gist-cache\
Method 2: cargo install (All platforms)
cargo build --release
cargo install --path .
Installation location:
- Linux/macOS:
~/.cargo/bin/gist-cache-rs - Windows:
%USERPROFILE%\.cargo\bin\gist-cache-rs.exe
PATH setting:
Linux / macOS: Usually set automatically. If not set:
# Add to ~/.bashrc or ~/.zshrc
export PATH="$HOME/.cargo/bin:$PATH"
source ~/.bashrc
Windows: Cargo’s bin directory is automatically added to PATH. If not set:
- Open “Edit the system environment variables”
- Click “Environment Variables…” button
- Edit “Path” under User variables
- Add
%USERPROFILE%\.cargo\bin
Method 3: System directory
cargo build --release
sudo cp target/release/gist-cache-rs /usr/local/bin/
Installation location: /usr/local/bin/gist-cache-rs
Feature: Shared by all users, requires sudo privileges
Method 4: User directory
cargo build --release
mkdir -p ~/bin
cp target/release/gist-cache-rs ~/bin/
Installation location: ~/bin/gist-cache-rs
PATH setting:
# Add to ~/.bashrc or ~/.zshrc
export PATH="$HOME/bin:$PATH"
source ~/.bashrc
Method 5: Symbolic link (for developers)
cargo build --release
# Link to /usr/local/bin (requires sudo)
sudo ln -sf "$(pwd)/target/release/gist-cache-rs" /usr/local/bin/gist-cache-rs
# Or link to ~/bin
mkdir -p ~/bin
ln -sf "$(pwd)/target/release/gist-cache-rs" ~/bin/gist-cache-rs
Feature: Automatically reflected after build, convenient for development
Post-Installation Setup
1. Configuration Setup (Recommended)
If you didn’t set up configuration during installation, you can configure it anytime:
Interactive Setup (Recommended):
# Use interactive configuration with cursor-based UI
gist-cache-rs config setting
This will guide you through:
- Selecting interpreters for each file extension (.py, .rb, .js, .ts, .sh, .php, .pl, .ps1)
- Setting fallback interpreter for unknown extensions (*)
- Configuring execution settings (confirm_before_run)
- Setting cache retention period
Manual Configuration:
# Set interpreter for Python files
gist-cache-rs config set defaults.interpreter.py python3
# Set fallback interpreter
gist-cache-rs config set defaults.interpreter."*" bash
# View configuration
gist-cache-rs config show
For more details, see the Configuration Guide.
2. Initial Cache Creation
gist-cache-rs update
Detailed display:
gist-cache-rs update --verbose
3. Alias Setting (Optional)
Automatic setting (when using setup.sh)
Set interactively during installation:
Use recommended alias names (gcrsu, gcrsr)? [Y/n]: y
Or
Use recommended alias names (gcrsu, gcrsr)? [Y/n]: n
Alias name for gist-cache-rs update: gcu
Alias name for gist-cache-rs run: gcr
Manual setting
# Add to ~/.bashrc or ~/.zshrc
alias gcrsu='gist-cache-rs update'
alias gcrsr='gist-cache-rs run'
# Apply settings
source ~/.bashrc
Installation Verification
# Check version
gist-cache-rs --version
# Display help
gist-cache-rs --help
# Check cache status
gist-cache-rs update --verbose
Troubleshooting
command not found: gist-cache-rs
Cause: PATH is not set
Solution (Linux/macOS):
# Check installation location
which gist-cache-rs
# Check PATH
echo $PATH
# If in ~/.cargo/bin
export PATH="$HOME/.cargo/bin:$PATH"
# If in ~/bin
export PATH="$HOME/bin:$PATH"
# Apply settings
source ~/.bashrc
Solution (Windows):
# Check installation location
where.exe gist-cache-rs
# Check PATH
$env:PATH
# Set environment variable (PowerShell)
$env:PATH += ";$env:USERPROFILE\.cargo\bin"
# For persistent setting
[System.Environment]::SetEnvironmentVariable("Path", $env:PATH, [System.EnvironmentVariableTarget]::User)
Permission error
Cause: No execution permission
Solution:
# Grant execution permission
chmod +x ~/.cargo/bin/gist-cache-rs
# Or
chmod +x /usr/local/bin/gist-cache-rs
# Or
chmod +x ~/bin/gist-cache-rs
Build error
Cause: Outdated Rust version, dependency issues
Solution:
# Update Rust
rustup update
# Update dependencies
cargo update
# Clean build
cargo clean
cargo build --release
GitHub CLI authentication error
Error: GitHub CLI (gh) is not authenticated
Solution:
gh auth login
PowerShell execution policy error (Windows)
Error: This system\'s script execution is disabled...
Solution:
# Allow script execution for current user
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
# Or bypass for specific script only
powershell -ExecutionPolicy Bypass -File .\script\setup.ps1 install
Cache not created
Error: Cache file not found
Solution:
# Initial cache creation
gist-cache-rs update
# Display detailed information
gist-cache-rs update --verbose
Rate limit error
Warning: Rate limit remaining is low
Solution:
- Wait for a while and retry
- Avoid
--forceoption - Use differential update
Uninstallation
Automatic Uninstallation
Linux / macOS
./script/setup.sh uninstall
Interactively select:
- Binary deletion
- Cache directory deletion
- Alias deletion
Windows
.\script\setup.ps1 uninstall
Interactively select:
- Binary deletion
- Cache directory deletion
Manual Uninstallation
Linux / macOS
# If installed with cargo
cargo uninstall gist-cache-rs
# If installed in system directory
sudo rm /usr/local/bin/gist-cache-rs
# If installed in user directory
rm ~/bin/gist-cache-rs
# Delete cache directory
rm -rf ~/.cache/gist-cache/
# Delete config directory
rm -rf ~/.config/gist-cache/
# Remove aliases (delete relevant lines from ~/.bashrc or ~/.zshrc)
# Example:
# alias gcrsu='gist-cache-rs update'
# alias gcrsr='gist-cache-rs run'
Windows
# If installed with cargo
cargo uninstall gist-cache-rs
# Delete cache directory
Remove-Item -Recurse -Force "$env:LOCALAPPDATA\gist-cache"
# Delete config directory
Remove-Item -Recurse -Force "$env:APPDATA\gist-cache"
Next Steps
- Quick Start Guide - Get started in 5 minutes
- Configuration Guide - Customize your settings
- Usage Examples - Practical examples and use cases
- Shell Completions - Setup shell completions