jfvm is a powerful CLI tool that helps you manage multiple versions of the JFrog CLI on your system. It supports auto-installation, version switching, project-specific defaults, local binary linking, aliasing, parallel version comparison, performance benchmarking, and usage analytics β all inspired by tools like nvm
, sdkman
, and volta
.
jfvm-demo-01.mov
jfvm.alias.mov
Managing different versions of the JFrog CLI across multiple projects and environments can be challenging. jfvm
simplifies this by:
- Installing any released version of the
jf
binary - Automatically fetching and using the latest version with
jfvm use latest
- Allowing you to link locally built versions
- Automatically switching versions based on a
.jfrog-version
file - Letting you define named aliases (e.g.,
prod
,dev
) - Providing a smooth
jf
shim for command redirection - Parallel command comparison between versions with diff visualization
- Performance benchmarking across multiple versions
- Usage history tracking and analytics
No more symlink hacking or hardcoded paths.
brew tap jfrog/jfrog-cli-vm
brew install jfvm
brew install https://raw.githubusercontent.com/jfrog/homebrew-jfrog-cli-vm/main/Formula/jfvm.rb
git clone https://github.com/jfrog/jfrog-cli-vm.git
cd jfrog-cli-vm
make install
Note: Use make build
instead of go build
to ensure the executable is named jfvm
(not jfrog-cli-vm
).
Installs the specified version of JFrog CLI (jf
) from JFrog's public release server.
jfvm install 2.74.0
Activates the given version or alias. If .jfrog-version
exists in the current directory, that will be used if no argument is passed. Use latest
to automatically fetch and activate the most recent JFrog CLI version (downloads if not already installed). Automatically sets up PATH priority so jfvm-managed jf
takes precedence over system-installed versions.
jfvm use 2.74.0
jfvm use latest
jfvm use prod
Shows all installed versions and the currently active one.
jfvm list
Removes a specific version of jf
.
jfvm remove 2.72.1
Removes all installed versions.
jfvm clear
Defines an alias for a specific version.
jfvm alias dev 2.74.0
Links a locally built jf
binary to be used via jfvm
.
jfvm link --from /Users/Jfrog/go/bin/jf --name local-dev
jfvm use local-dev
Performs comprehensive health check of jfvm installation with various options.
# Basic health check
jfvm health-check
# Detailed health check with verbose output
jfvm health-check --verbose
# Health check with automatic fixes
jfvm health-check --fix
# Include performance and security checks
jfvm health-check --performance --security
# All options combined
jfvm health-check --verbose --fix --performance --security
Compare JFrog CLI command output between two versions in parallel with git-like diff visualization.
# Compare version output
jfvm compare 2.74.0 2.73.0 -- --version
# Compare command outputs with side-by-side diff
jfvm compare prod dev -- rt ping
# Show unified diff format
jfvm compare 2.74.0 2.73.0 -- config show --unified
# Disable colored output and timing
jfvm compare old new -- rt search "*.jar" --no-color --timing=false
Features:
- Parallel execution for faster results
- Side-by-side and unified diff formats
- Colored output highlighting differences
- Execution timing comparison
- Exit code and error output comparison
Run performance benchmarks across multiple JFrog CLI versions with detailed statistics.
# Benchmark across multiple versions
jfvm benchmark 2.74.0,2.73.0,2.72.0 -- --version
# Custom iterations and detailed output
jfvm benchmark prod,dev,latest -- rt ping --iterations 10 --detailed
# Export results as JSON or CSV
jfvm benchmark 2.74.0,2.73.0 -- config show --format json
jfvm benchmark 2.74.0,2.73.0 -- rt search "*.jar" --format csv
Features:
- Configurable iteration counts
- Statistical analysis (min, max, average, success rate)
- Multiple output formats (table, JSON, CSV)
- Parallel execution across versions
- Detailed execution logs
- Performance ranking and speed comparisons
Track and analyze version usage patterns with comprehensive statistics.
# Show recent usage history
jfvm history
# Show detailed statistics
jfvm history --stats
# Filter by specific version
jfvm history --version 2.74.0
# Limit number of entries
jfvm history --limit 20
# Export as JSON
jfvm history --format json
# Clear history (cannot be undone)
jfvm history --clear
# Reexecute a specific history entry by ID
jfvm history '!2' # Reexecute history entry with ID 2
jfvm history '!5' # Reexecute history entry with ID 5
Features:
- Automatic usage tracking through the shim
- Command execution timing
- Most used versions and commands
- Usage trends and timeline analysis
- Configurable history limits
- History replay: Reexecute any previous command using
!{id}
syntax
Add a .jfrog-version
file to your repo:
echo "2.74.0" > .jfrog-version
Then run:
jfvm use
jfvm automatically configures your shell to ensure jfvm-managed jf
binaries have highest priority over system-installed versions. When you run jfvm use <version>
, it:
- Creates a shim at
~/.jfvm/shim/jf
that redirects to the active version - Updates your PATH to prioritize the jfvm shim directory (prepends to PATH)
- Adds a shell function for enhanced priority handling (similar to nvm)
- Verifies priority to ensure jfvm-managed versions take precedence over Homebrew or system-installed jf
The configuration is automatically added to your shell profile (.zshrc
, .bashrc
, etc.):
# jfvm PATH configuration - ensures jfvm-managed jf takes highest priority
export PATH="$HOME/.jfvm/shim:$PATH"
# jfvm shell function for enhanced priority (similar to nvm approach)
jf() {
# Check if jfvm shim exists and is executable
if [ -x "$HOME/.jfvm/shim/jf" ]; then
# Execute jfvm-managed jf with highest priority
"$HOME/.jfvm/shim/jf" "$@"
else
# Fallback to system jf if jfvm shim not available
command jf "$@"
fi
}
Set JFVM_DEBUG=1
to see detailed shim execution information:
export JFVM_DEBUG=1
# Will show which version is being executed
jf --version
If jf
is still using the system version instead of jfvm-managed version:
-
Run the health check command:
jfvm health-check --fix # This will verify all aspects of jfvm setup and attempt to fix issues
-
Check which jf is being used:
which jf # Should show: /Users/username/.jfvm/shim/jf
-
Verify PATH order:
echo $PATH # ~/.jfvm/shim should appear before /usr/local/bin or /opt/homebrew/bin
-
Re-run use command:
jfvm use <version> source ~/.zshrc # or ~/.bashrc
-
Manual PATH fix:
# Add this to your shell profile export PATH="$HOME/.jfvm/shim:$PATH"
-
Check for shell function conflicts:
type jf # Should show the jfvm shell function, not a system binary
---
## π§ͺ Advanced Examples
### Comparing Configuration Changes
```bash
# Compare configuration differences between versions
jfvm compare 2.74.0 2.73.0 -- config show --format json
# Check if a specific feature works across versions
jfvm compare old new -- rt search "libs-release-local/*.jar" --limit 5
# Benchmark search performance across versions
jfvm benchmark 2.74.0,2.73.0,2.72.0 -- rt search "*" --limit 100 --iterations 3
# Test upload performance
jfvm benchmark prod,dev -- rt upload test.txt my-repo/ --iterations 5 --detailed
# See your most used JFrog CLI commands
jfvm history --stats
# Track version adoption over time
jfvm history --version 2.74.0
# Export benchmark results for CI analysis
jfvm benchmark $OLD_VERSION,$NEW_VERSION -- rt ping --format json > performance.json
# Compare outputs in automated testing
jfvm compare baseline canary -- rt search "*.jar" --unified --no-color
# Always use the latest version in CI/CD pipelines
jfvm use latest
jf --version
rm -rf ~/.jfvm
# if installed via Homebrew
brew uninstall jfvm
- History is automatically tracked in
~/.jfvm/history.json
- Limited to 1000 entries to prevent unlimited growth
- Includes command execution timing and metadata
- System Environment: OS compatibility, architecture support, shell detection
- Installation Status: jfvm directories, shim setup, PATH configuration
- Priority Verification: Ensures jfvm-managed
jf
has highest priority - Binary Execution: Tests both
jfvm
andjf
command execution - Network Connectivity: GitHub API and JFrog releases connectivity
- Performance Benchmarks: Command execution timing and performance analysis
- Security Checks: File permissions and suspicious file detection
- Auto-Fix Capability: Automatically fixes common configuration issues
- JSON Output: Machine-readable output for CI/CD integration
- Commands run in parallel when possible
- Configurable timeouts for long-running operations
- Efficient diff algorithms for large outputs
- Version Testing: Compare behavior across JFrog CLI versions before upgrading
- Performance Monitoring: Track performance regressions between releases
- Usage Analytics: Understand which commands and versions are used most
- Latest Features: Easily switch to the latest version with
jfvm use latest
to test new features
- CI/CD Integration: Automate version comparison in deployment pipelines
- Performance Benchmarks: Ensure new versions meet performance requirements
- Migration Planning: Analyze compatibility before major version upgrades
- Automated Updates: Use
jfvm use latest
in deployment scripts to always use the most recent stable version
- Compliance Tracking: Monitor which versions are being used across teams
- Performance Optimization: Identify and optimize slow operations
- Training Insights: Understand which commands teams use most frequently
PRs and issues welcome! Open source, MIT licensed.