The leo update command updates your Leo CLI installation to the latest version or a specific release.
Syntax
Options
List all available releases without updating.
Update to a specific named release (e.g., v2.0.0).
Suppress download logs and progress output.
Examples
Update to Latest Version
Output:
🔄 Checking for updates...
📦 Downloading Leo v2.1.0...
⬇️ [========================================] 100%
✅ Leo has updated to version 2.1.0
List Available Versions
Output:
📋 Available Leo Releases
──────────────────────────────────────────────
v2.1.0 (latest)
v2.0.0
v1.9.5
v1.9.4
v1.9.3
...
Update to Specific Version
Output:
🔄 Updating to Leo v2.0.0...
📦 Downloading Leo v2.0.0...
⬇️ [========================================] 100%
✅ Leo has updated to version 2.0.0
Quiet Update
No output unless there’s an error or completion:
✅ Leo has updated to version 2.1.0
Check If Already Up to Date
Output:
✅ Leo is already on the latest version (2.1.0)
Update Process
-
Check Current Version:
Output:
leo 2.0.0
-
Check for Updates:
Leo queries GitHub releases for the latest version.
-
Download New Version:
If a newer version exists:
- Downloads binary for your platform
- Verifies integrity
- Shows progress
-
Install New Version:
- Replaces current Leo binary
- Preserves configuration and cache
- Updates symlinks
-
Verify Installation:
Output:
leo 2.1.0
Version Management
Check Current Version
Output:
View Release Notes
After listing versions:
Visit GitHub for release notes:
https://github.com/AleoHQ/leo/releases/tag/v2.1.0
Install Specific Version
Useful for:
- Testing compatibility
- Reverting to stable version
- Matching team’s Leo version
Installation Locations
Leo binary locations by platform:
Linux / macOS
In PATH via:
~/.bashrc or ~/.zshrc
export PATH="$HOME/.leo/bin:$PATH"
Windows
C:\Users\<username>\.leo\bin\leo.exe
In PATH via:
Environment Variables > System Variables > Path
Update Strategies
Stay on Latest (Recommended)
# Check for updates regularly
leo update
Benefits:
- Latest features
- Bug fixes
- Security patches
- Performance improvements
Pin to Specific Version
# Install specific version
leo update --name v2.0.0
Benefits:
- Consistent builds
- Predictable behavior
- Team synchronization
Periodic Updates
# Update monthly or per sprint
leo update --list
leo update --name v2.1.0
Benefits:
- Balance stability and features
- Planned migration
- Controlled updates
Breaking Changes
When updating across major versions:
Check Compatibility
- Read release notes
- Test in development
- Update dependencies
- Rebuild projects
Example: v1.x to v2.x
# Current version
leo --version # 1.9.5
# Check what's new
leo update --list
# Update to v2.0.0
leo update --name v2.0.0
# Rebuild projects
cd my_project
leo clean
leo build
Migration Workflow
# 1. Backup current version
cp ~/.leo/bin/leo ~/.leo/bin/leo-backup
# 2. Update
leo update --name v2.0.0
# 3. Test projects
leo build
leo test
# 4. If issues, rollback
cp ~/.leo/bin/leo-backup ~/.leo/bin/leo
# 5. Otherwise, remove backup
rm ~/.leo/bin/leo-backup
Troubleshooting
Update Failed
Failed to update Leo to the latest version
Solutions:
-
Check internet connection:
-
Check GitHub access:
curl -I https://api.github.com/repos/AleoHQ/leo/releases
-
Manual download:
Visit https://github.com/AleoHQ/leo/releases
Download binary for your platform
Replace
~/.leo/bin/leo
-
Reinstall Leo:
curl -sSf https://raw.githubusercontent.com/AleoHQ/leo/refs/heads/mainnet/install.sh | sh
Permission Denied
Permission denied: cannot replace Leo binary
Solutions:
-
Check file permissions:
-
Fix permissions:
-
Run with elevated permissions (if needed):
Binary Not Found After Update
Solutions:
-
Check PATH:
-
Add to PATH:
echo 'export PATH="$HOME/.leo/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
-
Verify installation:
ls ~/.leo/bin/leo
~/.leo/bin/leo --version
Version Mismatch After Update
leo --version # Shows old version
Solutions:
-
Reload shell:
source ~/.bashrc # or ~/.zshrc
-
Check which Leo:
-
Use absolute path:
Automated Updates
Cron Job (Linux/macOS)
Update weekly:
# Add to crontab
crontab -e
# Run every Monday at 2 AM
0 2 * * 1 $HOME/.leo/bin/leo update --quiet
Task Scheduler (Windows)
Create scheduled task:
schtasks /create /tn "Leo Update" /tr "C:\Users\<username>\.leo\bin\leo.exe update --quiet" /sc weekly /d MON /st 02:00
CI/CD Integration
# GitHub Actions example
name: Update Leo
on:
schedule:
- cron: '0 2 * * 1' # Weekly on Monday at 2 AM
workflow_dispatch: # Manual trigger
jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Update Leo
run: |
curl -sSf https://raw.githubusercontent.com/AleoHQ/leo/refs/heads/mainnet/install.sh | sh
echo "$HOME/.leo/bin" >> $GITHUB_PATH
- name: Verify version
run: leo --version
Best Practices
1. Check Before Major Updates
leo update --list
# Read release notes for breaking changes
2. Test After Updating
leo update
cd my_project
leo clean && leo build && leo test
3. Update All Projects
After updating Leo:
for dir in ~/projects/*/; do
(cd "$dir" && leo clean && leo build)
done
4. Document Leo Version
In README.md:
## Requirements
- Leo v2.0.0 or higher
## Installation
\`\`\`bash
leo update --name v2.0.0
\`\`\`
5. Pin Version in CI
- name: Install Leo
run: |
curl -sSf https://raw.githubusercontent.com/AleoHQ/leo/refs/heads/mainnet/install.sh | sh
leo update --name v2.0.0 --quiet
Comparison with Installation
| Method | Command | Use Case |
|---|
| Install | curl ... | sh | First-time setup |
| Update Latest | leo update | Get newest version |
| Update Specific | leo update --name v2.0.0 | Install exact version |
| List Versions | leo update --list | Check available releases |
Release Channels
Leo follows semantic versioning:
- Major (v2.0.0): Breaking changes
- Minor (v2.1.0): New features, backward compatible
- Patch (v2.0.1): Bug fixes, backward compatible
Stable Releases
Recommended for production.
Pre-releases
v2.1.0-beta.1, v2.1.0-rc.1
For testing and early access.
Next Steps