Run Salesforce CLI (sf or sfdx) commands from the VS Code command palette and stream output into an Output Channel.
Features
Run common Salesforce CLI commands from a quick pick (eg. list orgs, open org, run anonymous Apex).
Enter a custom CLI command when needed.
Streams stdout/stderr live into the "Salesforce CLI" output channel.
CLI detection and configuration
Configuration key: sfcli.cliPath — if set, the extension uses that path exactly.
If sfcli.cliPath is not configured the extension will attempt to detect a CLI on your PATH:
Try sf --version.
If that fails, try sfdx --version.
If neither is detected the extension falls back to using sf and shows a warning; you can set sfcli.cliPath to a custom executable if needed.
Note: detection is a best-effort check that runs a small --version probe. If you rely on a non-standard install location, set sfcli.cliPath explicitly in your settings.
Safety and privacy
This extension runs arbitrary CLI commands on your machine (including ones you type in the custom command box). Be careful with commands that can modify orgs or delete data. The extension does not transmit any output or credentials off your machine.
Commands
Salesforce CLI: Run Command — open a quick pick to select a preset CLI command or enter a custom one.
Development / build
Open this folder in VS Code.
From the project root run:
Set-Location -LiteralPath 'c:\Users\Charan\VS Workspace\VS Extension\sf-vscode-extension'
npm install
npm run compile
Press F5 in VS Code to launch an Extension Development Host and test the command.
Notes for maintainers
The extension currently uses Node's child_process.spawn to stream CLI output. That approach works for most cases. If you need more robust cross-platform argument/quoting handling consider using a helper like execa or cross-spawn.
The extension will surface non-zero exit codes and termination signals to the user via VS Code notifications.
The package.json includes a compile script (tsc -p ./) that emits files into out/.
If you'd like, I can also add a short section with example commands or update package.json with publisher/repository metadata when you're ready to publish.