Description
When running sf plugins install <tarball-url> (installing a plugin from a GitHub release tarball URL), the command overwrites the last entry in ~/.local/share/sf/package.json's oclif.plugins array instead of creating a new entry with the correct package name.
The npm package files are installed correctly in node_modules/, but the oclif plugin registry entry retains the previous plugin's name, so the installed plugin is never recognized by sf.
Steps to reproduce
- Have an sf CLI installation with existing user plugins
- Run:
sf plugins install https://github.com/scolladon/sfdx-git-delta/releases/download/dev-pr-1266/sfdx-git-delta-dev-pr-1266.tgz
- Check
~/.local/share/sf/package.json
Expected behavior
A new entry should be added to oclif.plugins:
{
"name": "sfdx-git-delta",
"type": "user",
"url": "https://github.com/scolladon/sfdx-git-delta/releases/download/dev-pr-1266/sfdx-git-delta-dev-pr-1266.tgz"
}
Actual behavior
The last existing entry in oclif.plugins is overwritten with the URL but retains the old plugin's name:
{
"name": "@j-schreiber/sf-cli-security-audit", // <-- wrong name, was the last entry before install
"type": "user",
"url": "https://github.com/scolladon/sfdx-git-delta/releases/download/dev-pr-1266/sfdx-git-delta-dev-pr-1266.tgz"
}
The actual package files (sfdx-git-delta) ARE correctly installed in node_modules/, but sf doesn't recognize the plugin because the registry name is wrong.
Notes
- This does NOT happen in CI with a fresh sf CLI installation (no pre-existing user plugins) — the first entry is created correctly.
- Reproduced with
@salesforce/cli@2.128.5, @oclif/plugin-plugins@5.4.58, Node v22.21.1, macOS arm64.
- Tested multiple times — consistently overwrites the last entry regardless of which plugin it is.
Description
When running
sf plugins install <tarball-url>(installing a plugin from a GitHub release tarball URL), the command overwrites the last entry in~/.local/share/sf/package.json'soclif.pluginsarray instead of creating a new entry with the correct package name.The npm package files are installed correctly in
node_modules/, but the oclif plugin registry entry retains the previous plugin's name, so the installed plugin is never recognized by sf.Steps to reproduce
sf plugins install https://github.com/scolladon/sfdx-git-delta/releases/download/dev-pr-1266/sfdx-git-delta-dev-pr-1266.tgz~/.local/share/sf/package.jsonExpected behavior
A new entry should be added to
oclif.plugins:{ "name": "sfdx-git-delta", "type": "user", "url": "https://github.com/scolladon/sfdx-git-delta/releases/download/dev-pr-1266/sfdx-git-delta-dev-pr-1266.tgz" }Actual behavior
The last existing entry in
oclif.pluginsis overwritten with the URL but retains the old plugin's name:{ "name": "@j-schreiber/sf-cli-security-audit", // <-- wrong name, was the last entry before install "type": "user", "url": "https://github.com/scolladon/sfdx-git-delta/releases/download/dev-pr-1266/sfdx-git-delta-dev-pr-1266.tgz" }The actual package files (
sfdx-git-delta) ARE correctly installed innode_modules/, but sf doesn't recognize the plugin because the registry name is wrong.Notes
@salesforce/cli@2.128.5,@oclif/plugin-plugins@5.4.58, Node v22.21.1, macOS arm64.