qwen-code-updater
v1.0.2
Published
Auto-updater wrapper for Qwen Code that checks for updates before execution
Maintainers
Readme
Qwen Code Updater
An auto-updater wrapper for Qwen Code that automatically checks for updates before execution, ensuring you're always running the latest version.
Features
- 🚀 Automatic Updates: Checks for and installs Qwen Code updates before execution
- ⚡ Smart Caching: Avoids redundant update checks with intelligent cooldown periods
- 🔧 Zero Configuration: Works out of the box with sensible defaults
- 📝 Detailed Logging: Comprehensive logging for debugging and monitoring
- 🔄 Rollback Support: Version history tracking for potential rollbacks
- 🛡️ Error Handling: Graceful fallback to current version if updates fail
- 🎯 Drop-in Replacement: Use
qwencommand exactly as before
Installation
Install globally using npm:
npm install -g qwen-code-updaterThis will install the updater and make the qwen command available globally.
Prerequisites
This package is a wrapper around the official Qwen Code CLI. You need to install it separately:
npm install -g @qwen-code/qwen-code@latestUsage
The installer automatically sets up an alias so you can use qwen exactly as before, but with automatic updates:
# The updater will automatically check for updates, then run your command
qwen your-command-here
# Skip update check for this run (useful for automation)
qwen --skip-update your-command-hereExamples
# Start a new chat session (will check for updates first)
qwen
# Run with specific options
qwen --model qwen-plus "Write a hello world function"
# Skip update check for this execution
qwen --skip-update --helpDirect Usage (Alternative)
You can also call the updater directly:
qwen-code-updater your-command-hereHow It Works
- Update Check: Before executing your command, the wrapper checks if a newer version of Qwen Code is available
- Smart Updates: If an update is found, it's automatically downloaded and installed
- Seamless Execution: Your original command is then executed with the updated version
- Intelligent Caching: Update checks are cached for 1 hour to avoid delays
Configuration
The updater creates a configuration directory at ~/.qwen-code-updater/ containing:
config.json: Settings and preferencesupdater.log: Detailed execution logs
Environment Variables
QWEN_UPDATER_DEBUG=true: Enable debug logging for troubleshooting
Logging
Logs are automatically written to ~/.qwen-code-updater/updater.log. Enable debug mode for more detailed logging:
export QWEN_UPDATER_DEBUG=true
qwen your-commandTroubleshooting
Common Issues
Command not found: qwen
# Ensure the package is installed globally
npm install -g qwen-code-updater
# Check if npm global bin is in your PATH
npm config get prefixUpdate check fails
- The wrapper will proceed with your current Qwen Code version
- Check your internet connection
- Enable debug logging to see detailed error information
Qwen Code not found
# Install the official Qwen Code CLI
npm install -g @qwen-code/qwen-code@latestDebug Mode
Enable detailed logging:
export QWEN_UPDATER_DEBUG=true
qwen --versionCheck the log file:
tail -f ~/.qwen-code-updater/updater.logDevelopment
Local Testing
# Clone the repository
git clone https://github.com/0xRaghu/qwen-code-updater.git
cd qwen-code-updater
# Install dependencies
npm install
# Link for local testing
npm link
# Test the command
qwen --versionPackage Structure
qwen-code-updater/
├── bin/
│ └── qwen-code-updater.js # Main CLI entry point
├── lib/
│ ├── config.js # Configuration management
│ ├── logger.js # Logging utilities
│ ├── shell-detector.js # Shell detection and PATH management
│ └── updater.js # Update checking and installation logic
├── scripts/
│ ├── install.js # Post-install setup
│ ├── uninstall.js # Pre-uninstall cleanup
│ └── cleanup.js # General cleanup utilities
├── package.json
├── README.md
└── LICENSEVersion Management
The updater maintains a version history for potential rollback scenarios. This information is stored in the configuration file and can be used for debugging or manual rollbacks if needed.
Security
- All updates are fetched from the official npm registry
- Package integrity is verified before installation
- No sensitive data is logged or transmitted
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Related Projects
- claude-code-updater - Auto-updater for Claude Code
- gemini-cli-updater - Auto-updater for Gemini CLI
Acknowledgments
- Thanks to the Qwen team for creating Qwen Code
- Inspired by similar auto-updater patterns in the developer tools ecosystem
Note: This is an unofficial wrapper around Qwen Code. For official support, please refer to the Qwen Code documentation.
