Skip to content

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.

Terminal window
kasl update

The update process performs a complete workflow:

  1. Version Check: Queries GitHub API for the latest release
  2. Platform Detection: Identifies the correct binary for the current OS/architecture
  3. Download: Retrieves the latest release archive
  4. Extraction: Unpacks the new binary from the archive
  5. Replacement: Safely replaces the current executable with backup

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)

Supported platform identifiers:

  • x86_64-pc-windows-msvc - Windows 64-bit
  • x86_64-apple-darwin - macOS Intel
  • aarch64-apple-darwin - macOS Apple Silicon
  • x86_64-unknown-linux-musl - Linux 64-bit

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
Terminal window
# Check for and install updates
kasl update
Terminal window
# 1. Check current version
kasl --version
# 2. Update to latest version
kasl update
# 3. Verify update
kasl --version
ℹ️ kasl is already up to date
Current version: 0.8.0
Latest version: 0.8.0
No update required.
🔄 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 failed: Network error
Error: Failed to download release archive
Suggestion: Check your internet connection and try again
Terminal window
# Check for updates weekly
kasl update
# Verify update was successful
kasl --version
Terminal window
# Update kasl on multiple systems
for system in system1 system2 system3; do
ssh $system "kasl update"
done
Terminal window
# Update to latest development version
kasl update
# Test new features
kasl --help
# Rollback if needed (manual process)
# Restore from backup file

Network connectivity problems

Terminal window
# Check internet connection
ping github.com
# Try again later
kasl update

Permission errors

Terminal window
# 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

Terminal window
# Check available disk space
df -h
# Clean up space and try again
kasl update

Download failed

Terminal window
# Check network connection
curl -I https://github.com
# Try again
kasl update

Extraction failed

Terminal window
# Check if backup exists
ls -la kasl.exe.backup
# Restore from backup manually
cp kasl.exe.backup kasl.exe

Binary replacement failed

Terminal window
# Check if kasl is running
tasklist | grep kasl
# Stop kasl and try again
kasl watch --stop
kasl update
Terminal window
# 1. Check current version
kasl --version
# 2. Perform update
kasl update
# 3. Verify new version
kasl --version
# 4. Test functionality
kasl --help
  1. Regular updates: Check for updates weekly or monthly
  2. Test after update: Verify functionality after each update
  3. Keep backups: Don’t delete backup files immediately
  4. Monitor for issues: Watch for any problems after updates
  1. Update during maintenance windows: Choose appropriate times for updates
  2. Update all systems: Keep all installations on the same version
  3. Document update process: Keep track of update procedures
  4. Test in staging: Test updates on non-critical systems first
  1. Preserve backups: Keep backup files for potential rollback
  2. Clean up old backups: Remove backups older than a few versions
  3. Verify backup integrity: Test backup restoration periodically
  4. Document rollback procedures: Know how to restore from backup

The update command works with other kasl commands:

  • autostart: Updates preserve autostart configuration
  • init: Configuration settings are preserved during updates
  • watch: Monitoring continues after update (if autostart is enabled)
  • autostart - Autostart settings are preserved during updates
  • init - Configuration is maintained during updates
  • watch - Monitoring continues after successful updates