update
Command
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.
Usage
kasl update
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
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
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
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
Basic Update
# Check for and install updates
kasl update
Update Workflow
# 1. Check current version
kasl --version
# 2. Update to latest version
kasl update
# 3. Verify update
kasl --version
Sample Output
No Update Required
âšī¸ kasl is already up to date
Current version: 0.8.0
Latest version: 0.8.0
No update required.
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.1
Backup: kasl.exe.backup
Update Error
â Update failed: Network error
Error: Failed to download release archive
Suggestion: Check your internet connection and try again
Use Cases
Regular Maintenance
# Check for updates weekly
kasl update
# Verify update was successful
kasl --version
System Administration
# Update kasl on multiple systems
for system in system1 system2 system3; do
ssh $system "kasl update"
done
Development and Testing
# Update to latest development version
kasl update
# Test new features
kasl --help
# Rollback if needed (manual process)
# Restore from backup file
Troubleshooting
Common Issues
Network connectivity problems
# Check internet connection
ping github.com
# Try again later
kasl update
Permission 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 space
df -h
# Clean up space and try again
kasl update
Update Failures
Download failed
# Check network connection
curl -I https://github.com
# Try again
kasl update
Extraction failed
# Check if backup exists
ls -la kasl.exe.backup
# Restore from backup manually
cp kasl.exe.backup kasl.exe
Binary replacement failed
# Check if kasl is running
tasklist | grep kasl
# Stop kasl and try again
kasl watch --stop
kasl update
Verification Steps
# 1. Check current version
kasl --version
# 2. Perform update
kasl update
# 3. Verify new version
kasl --version
# 4. Test functionality
kasl --help
Best Practices
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
- 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
- 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
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)