Instruction file imported from jlondrejcka/cursor-rules-sfdx (
.cursor/rules/sf_dx/troubleshoot/cli_version_information.mdc). Copyright stays with the author.
description: How to retrieve and use CLI version information for troubleshooting Salesforce DX issues globs: alwaysApply: false
CLI Version Information
Overview
This rule provides guidance on how to retrieve and use Salesforce CLI version information for troubleshooting and resolving compatibility issues.
Key Concepts
- CLI version checking
- Plugin management
- Version compatibility
- CLI updating
Checking Version Information
Basic Version Check
The most basic way to check your Salesforce CLI version:
sf version
This shows you the main CLI version but doesn't provide detailed information about plugins.
Detailed Version Information
For more comprehensive information about your CLI installation:
sf plugins --core
This command lists all installed core plugins and their versions.
Plugin-Specific Information
To see information about specific plugins:
sf plugins
This shows all installed plugins, including custom ones.
Troubleshooting with Version Information
Identifying Outdated Components
If you're experiencing issues, check if any components are outdated:
sf update
This will show if there are any available updates for the CLI or plugins.
Version Mismatch Issues
Common problems tied to version issues:
- Command Not Found: A command might not be available in your version
- Unexpected Behavior: Commands might work differently between versions
- Deprecation Warnings: Older commands might show deprecation warnings
Resolving Version-Related Issues
Update the CLI
To update the Salesforce CLI:
sf update
Reinstall the CLI
If updating doesn't resolve the issue:
# For npm installation
npm uninstall -g @salesforce/cli
npm install -g @salesforce/cli
# For other installation methods, reinstall via the installer
Check for Deprecated Commands
Reference the Salesforce CLI Command Reference to see if commands have been deprecated or changed.
Using Version Information for Support
When seeking help:
- Always include your CLI version information
- Specify which commands are causing issues
- Include any error messages exactly as shown
- Mention recent updates or changes to your environment
Example support information:
CLI Version: @salesforce/cli 2.x.x
Node Version: v16.x.x
OS: Windows/macOS/Linux
Command run: sf org create scratch
Error message: <exact error message>
Best Practices
- Regularly update the CLI using
sf update - Check release notes for breaking changes before updating
- Keep all plugins updated
- For critical environments, test CLI updates in a non-production environment first
- Document your CLI version in project documentation for team consistency