patrol update command updates your Patrol CLI installation to the latest available version from pub.dev.
Synopsis
Description
This command checks for the latest version of Patrol CLI on pub.dev and updates your global installation if a newer version is available. The update process:- Checks the current installed version
- Queries pub.dev for the latest version
- Compares versions
- Downloads and installs the update if available
- Reports the result
Basic Usage
Options
Whether to upgrade the
patrol package in your pubspec.yaml after updating the CLI.Output
When Already Up to Date
If you’re already on the latest version:0
When Update Is Available
If an update is available, the command will download and install it:0
When Update Fails
If the update process encounters an error:0 (command doesn’t fail even if update fails)
Examples
Basic update
Update to the latest version:Update without upgrading pubspec
Update CLI but don’t modifypubspec.yaml:
Check current version
To see your current version before updating:How It Works
Version Check
The command queries the pub.dev API to find the latest published version ofpatrol_cli.
Installation Method
Updates are performed using Dart’spub package manager, equivalent to:
Package Synchronization
When--pub-upgrade is enabled (default), the command also ensures your project’s patrol package matches the CLI version for compatibility.
Update Strategy
Automatic Updates
Patrol CLI does not auto-update. You must explicitly runpatrol update to upgrade.
Version Compatibility
The CLI checks compatibility between:patrol_cli(the command-line tool)patrol(the Dart package in your project)
Run
patrol update regularly to get the latest features, bug fixes, and improvements.When to Update
Regular Maintenance
Check for updates periodically:Before Important Testing
Update before major test runs to ensure stability:After Release Announcements
When new Patrol versions are announced, update to get new features:CI/CD Environments
In CI, pin to specific versions rather than usingpatrol update:
Troubleshooting
Update Check Fails
If the version check fails:- No internet connection
- pub.dev is unavailable
- Network firewall blocking access
- Check your internet connection
- Try again later
- Manually check pub.dev: https://pub.dev/packages/patrol_cli
Update Fails
If installation fails:-
Try manual update:
-
Check Dart installation:
-
Clear pub cache and retry:
Permission Errors
If you see permission errors: macOS/Linux:Permission errors usually indicate Dart pub global bin directory isn’t writable. Consider fixing directory permissions instead of using
sudo.Version Pinning
For reproducible environments, install a specific version:Exit Codes
- 0: Success (even if no update available or update fails)
0 to avoid breaking automation scripts.
Related Commands
- patrol doctor - Check your environment setup
- patrol test - Run integration tests
patrol --version- Show current CLI version
Update Frequency
Patrol follows semantic versioning:- Major versions (e.g., 3.0.0 → 4.0.0): Breaking changes
- Minor versions (e.g., 3.0.0 → 3.1.0): New features, backwards compatible
- Patch versions (e.g., 3.0.0 → 3.0.1): Bug fixes
Patrol aims to maintain backwards compatibility within major versions. Updating minor and patch versions is generally safe.
Checking Release Notes
Before updating to a new major version, review the changelog:Post-Update Steps
After updating:-
Verify installation:
-
Check environment:
-
Run tests:
-
Update project package: