gemini-cli-updater
v1.0.3
Published
Auto-updater wrapper for Gemini CLI that checks for updates before execution
Maintainers
Readme
Gemini CLI Updater
A command-line tool that automatically manages and updates Gemini CLI installations with wrapper functionality.
Overview
Gemini CLI Updater solves the problem of manual Gemini CLI updates by automatically checking for and installing updates before each execution. It provides seamless auto-update functionality with cross-platform support and shell integration.
Features
- ✅ Auto-update Gemini CLI on each execution
- ✅ Cross-platform support (macOS, Linux, Windows)
- ✅ Automatic shell alias configuration (bash, zsh, fish, PowerShell)
- ✅ Smart update caching to avoid delays (1-hour cooldown)
- ✅ Version tracking and rollback capabilities
- ✅ Clean installation and uninstallation
- ✅ Error handling and logging
- ✅ Zero-configuration after installation
Installation
Via npm (Recommended)
npm install -g gemini-cli-updaterThe installation will automatically:
- Set up shell aliases for seamless integration
- Create configuration directories
- Initialize logging
Manual Installation
git clone https://github.com/0xRaghu/gemini-cli-updater.git
cd gemini-cli-updater
npm install
npm linkUsage
After installation, simply use gemini as you normally would:
# Auto-updates and runs Gemini CLI
gemini
# Pass any arguments to Gemini
gemini --help
gemini "Hello, world!"
# Skip update check for faster startup
gemini --skip-update "Quick command"How It Works
- Update Check: When you run
gemini, it first checks for Gemini CLI updates - Smart Caching: Updates are checked at most once per hour to avoid delays
- Auto-Update: If an update is available, it's installed automatically
- Execution: Your original command is passed through to the actual Gemini CLI
Configuration
Config File Location
- macOS/Linux:
~/.gemini-cli-updater/config.json - Windows:
%USERPROFILE%\.gemini-cli-updater\config.json
Settings
{
"settings": {
"updateCooldown": 3600000,
"maxVersionHistory": 10,
"enableLogging": true,
"autoUpdate": true
}
}Environment Variables
GEMINI_UPDATER_DEBUG=true- Enable debug loggingGEMINI_UPDATER_SKIP_UPDATE=true- Skip all update checks
Shell Integration
The installer automatically adds aliases to your shell configuration:
Bash/Zsh
alias gemini='gemini-cli-updater'Fish
alias gemini 'gemini-cli-updater'PowerShell
function gemini { & gemini-cli-updater $args }Commands
Main Command
gemini [arguments] # Auto-update and run Gemini CLIUtility Commands
# Installation validation
npx gemini-cli-updater-install --validate
# Repair installation
npx gemini-cli-updater-install --repair
# Uninstall (preserve user data)
npm uninstall -g gemini-cli-updater
# Complete removal including user data
npx gemini-cli-updater-uninstall --cleanVersion Management
Rollback to Previous Version
const Updater = require('gemini-cli-updater/lib/updater');
const updater = new Updater('@google/gemini-cli', 'gemini');
await updater.rollbackToPreviousVersion();Force Update
# Force update regardless of cooldown
GEMINI_UPDATER_DEBUG=true gemini --force-updateTroubleshooting
Common Issues
1. Gemini not found after installation
# Check if Gemini CLI is installed
gemini --version
# Install Gemini CLI if missing
npm install -g @google/gemini-cli2. Shell alias not working
# Restart terminal or reload shell config
source ~/.zshrc # or ~/.bashrc3. Permission errors
# Fix npm permissions (Unix-like systems)
sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share}Debug Mode
Enable debug logging to troubleshoot issues:
export GEMINI_UPDATER_DEBUG=true
gemini --helpLog Files
Check log files for detailed information:
# View recent logs
tail -f ~/.gemini-cli-updater/updater.log
# Clear logs
rm ~/.gemini-cli-updater/updater.logManual Shell Setup
If automatic shell integration fails, add this alias manually:
# Add to ~/.zshrc, ~/.bashrc, or equivalent
alias gemini='gemini-cli-updater'Uninstallation
Method 1: Standard Uninstall (Recommended)
npm uninstall -g gemini-cli-updaterThis automatically removes:
- ✅ The npm package
- ✅ Shell aliases
- ✅ Binary files (wrapper only, preserves real @google/gemini-cli)
- ⚠️ Preserves user data (
~/.gemini-cli-updater/)
Method 2: Complete Cleanup (If Standard Fails)
If the standard uninstall doesn't work completely, use our cleanup script:
# Download and run the cleanup script
curl -L https://raw.githubusercontent.com/0xRaghu/gemini-cli-updater/main/scripts/cleanup.js -o cleanup.js
node cleanup.js --clean
# Or if you have the package locally
npx gemini-cli-updater --cleanup --cleanMethod 3: Manual Cleanup
If both methods fail, manual cleanup:
# 1. Force remove npm package
npm uninstall -g gemini-cli-updater --force
# 2. Remove wrapper binary files (preserve real @google/gemini-cli)
# Check if ~/.nvm/versions/node/*/bin/gemini contains "gemini-cli-updater" and remove
rm -f ~/.nvm/versions/node/*/bin/gemini-cli-updater
# 3. Remove shell aliases
# Edit ~/.bashrc, ~/.bash_profile, ~/.zshrc
# Remove lines containing "gemini-cli-updater" or "alias gemini="
# 4. Remove user data (optional)
rm -rf ~/.gemini-cli-updater
# 5. Restart terminalImportant: The real @google/gemini-cli package will be preserved during cleanup.
Verification
After uninstallation, verify removal:
# Should show @google/gemini-cli version (not wrapper output)
gemini --version
# Should not list the wrapper package
npm list -g gemini-cli-updater
# Should still show the real Gemini CLI
npm list -g @google/gemini-cliDevelopment
Setup Development Environment
git clone https://github.com/0xRaghu/gemini-cli-updater.git
cd gemini-cli-updater
npm install
npm linkRun Tests
npm testDebug Local Installation
GEMINI_UPDATER_DEBUG=true node bin/gemini-cli-updater.js --helpContributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
Requirements
- Node.js >= 14.0.0
- npm >= 6.0.0
- Internet connection for updates
License
MIT License - see LICENSE file for details.
Support
- Issues: GitHub Issues
- Documentation: GitHub Wiki
- Discussions: GitHub Discussions
Related Projects
- Gemini CLI - The official Gemini CLI
- npm-check-updates - Update package dependencies
Note: This tool is an unofficial wrapper for the Gemini CLI and is not affiliated with Google.
