update
The update command handles checking for and installing newer versions of kasl from GitHub releases. It provides automatic binary replacement with backup and rollback capabilities.
kasl updateHow It Works
Section titled “How It Works”The update process performs a complete workflow:
- Version Check: Queries GitHub API for the latest release
- Platform Detection: Identifies the correct binary for the current OS/architecture
- Download: Retrieves the latest release archive
- Extraction: Unpacks the new binary from the archive
- Replacement: Safely replaces the current executable with backup
Update Sources
Section titled “Update Sources”Updates are fetched from GitHub releases at:
https://github.com/{owner}/{repo}/releases/latest
The updater automatically selects the appropriate asset based on:
- Architecture: x86_64, aarch64, etc.
- Operating System: Windows (MSVC), macOS (Darwin), Linux (musl)
Platform Support
Section titled “Platform Support”Supported platform identifiers:
x86_64-pc-windows-msvc- Windows 64-bitx86_64-apple-darwin- macOS Intelaarch64-apple-darwin- macOS Apple Siliconx86_64-unknown-linux-musl- Linux 64-bit
Safety Features
Section titled “Safety Features”The update process is designed to be safe and atomic:
- Backup Creation: Creates backups of the current executable before replacement
- Archive Validation: Validates downloaded archives before extraction
- Clear Feedback: Provides detailed information about the update process
- Error Handling: Handles network errors and other issues gracefully
- Rollback Capability: Can restore from backup if update fails
Examples
Section titled “Examples”Basic Update
Section titled “Basic Update”# Check for and install updateskasl updateUpdate Workflow
Section titled “Update Workflow”# 1. Check current versionkasl --version
# 2. Update to latest versionkasl update
# 3. Verify updatekasl --versionSample Output
Section titled “Sample Output”No Update Required
Section titled “No Update Required”ℹ️ kasl is already up to dateCurrent version: 0.8.0Latest version: 0.8.0No update required.Update Available
Section titled “Update Available”🔄 Checking for updates...✅ New version available: 0.8.1
📥 Downloading update...├── Platform: x86_64-pc-windows-msvc├── Size: 2.5 MB└── Progress: 100%
🔧 Installing update...├── Creating backup: kasl.exe.backup├── Extracting binary└── Replacing executable
✅ Update completed successfully!Version: 0.8.1Backup: kasl.exe.backupUpdate Error
Section titled “Update Error”❌ Update failed: Network errorError: Failed to download release archiveSuggestion: Check your internet connection and try againUse Cases
Section titled “Use Cases”Regular Maintenance
Section titled “Regular Maintenance”# Check for updates weeklykasl update
# Verify update was successfulkasl --versionSystem Administration
Section titled “System Administration”# Update kasl on multiple systemsfor system in system1 system2 system3; do ssh $system "kasl update"doneDevelopment and Testing
Section titled “Development and Testing”# Update to latest development versionkasl update
# Test new featureskasl --help
# Rollback if needed (manual process)# Restore from backup fileTroubleshooting
Section titled “Troubleshooting”Common Issues
Section titled “Common Issues”Network connectivity problems
# Check internet connectionping github.com
# Try again laterkasl updatePermission errors
# Run with elevated privileges (Windows)# Right-click Command Prompt -> "Run as Administrator"kasl update
# Check file permissions (Unix)ls -la $(which kasl)Insufficient disk space
# Check available disk spacedf -h
# Clean up space and try againkasl updateUpdate Failures
Section titled “Update Failures”Download failed
# Check network connectioncurl -I https://github.com
# Try againkasl updateExtraction failed
# Check if backup existsls -la kasl.exe.backup
# Restore from backup manuallycp kasl.exe.backup kasl.exeBinary replacement failed
# Check if kasl is runningtasklist | grep kasl
# Stop kasl and try againkasl watch --stopkasl updateVerification Steps
Section titled “Verification Steps”# 1. Check current versionkasl --version
# 2. Perform updatekasl update
# 3. Verify new versionkasl --version
# 4. Test functionalitykasl --helpBest Practices
Section titled “Best Practices”Update Strategy
Section titled “Update Strategy”- Regular updates: Check for updates weekly or monthly
- Test after update: Verify functionality after each update
- Keep backups: Don’t delete backup files immediately
- Monitor for issues: Watch for any problems after updates
System Management
Section titled “System Management”- Update during maintenance windows: Choose appropriate times for updates
- Update all systems: Keep all installations on the same version
- Document update process: Keep track of update procedures
- Test in staging: Test updates on non-critical systems first
Backup Management
Section titled “Backup Management”- Preserve backups: Keep backup files for potential rollback
- Clean up old backups: Remove backups older than a few versions
- Verify backup integrity: Test backup restoration periodically
- Document rollback procedures: Know how to restore from backup
Integration with Other Commands
Section titled “Integration with Other Commands”The update command works with other kasl commands:
autostart: Updates preserve autostart configurationinit: Configuration settings are preserved during updateswatch: Monitoring continues after update (if autostart is enabled)