| name | sf-troubleshoot |
| description | Troubleshooting and diagnostics commands including CLI doctor, common error resolution, and CI/CD examples. |
sf Troubleshooting
Diagnostics and common issue resolution for the Salesforce CLI.
sf doctor
Run diagnostics on the CLI and its environment.
sf doctor
sf which
Show which plugin provides a given command.
sf which org list
Common Issues
Clear Auth and Re-authenticate
sf org logout --no-prompt
rm -rf ~/.sf ~/.config/sf
sf org login web --alias myOrg
Reset Configuration
sf config unset target-org --global
sf config unset defaultdevhubusername --global
Enable Debug Logging
SF_DEBUG=1 sf org list
Network and Proxy Issues
export HTTPS_PROXY=http://proxy:port
export HTTP_PROXY=http://proxy:port
sf org list
Disable Telemetry
sf config set disable-telemetry=true --global
CI/CD Integration Examples
GitHub Actions
name: Deploy to Salesforce
on: [push]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Salesforce CLI
run: npm install -g @salesforce/cli
- name: Authenticate
env:
SF_AUTH_URL: ${{ secrets.SF_AUTH_URL }}
run: echo "$SF_AUTH_URL" | sf org login sfdx-url --stdin --alias targetOrg
- name: Deploy
run: sf project deploy start --source-dir force-app --target-org targetOrg --wait 10
GitLab CI
deploy:
image: node:18
stage: deploy
script:
- npm install -g @salesforce/cli
- echo "$SF_AUTH_URL" | sf org login sfdx-url --stdin --alias targetOrg
- sf project deploy start --source-dir force-app --target-org targetOrg --wait 10
only:
- main