fix(metadata:rename): resolve -o flag collision hiding default org (#443)#449
Merged
Merged
Conversation
) The modern requiredOrgFlagWithDeprecations claims -o for --target-org, but --oldfullname also used char 'o'. So 'sf metadata rename -t X -o A -n B' routed '-o A' to --target-org, producing 'No authorization information found for A' and making it look like the default org was no longer detected (it worked in 0.3.2 when the org flag was -u). Move --oldfullname to char 'd' so -o maps to --target-org. The org flag then auto-detects the configured default org when omitted, restoring the pre-1.0.0 behavior. Updated in-command examples and the README usage. Fixes #443
The plugin targets the modern sf CLI, but every command's examples= still showed the deprecated sfdx executable. Swap '$ sfdx' -> '$ sf' across all 10 commands. Also fix the dxsource example that used the old -u flag (now -o/--target-org). Note: the runtime 'sfdx force:mdapi:*' shell calls in retrieve/* and service/* are intentionally left for a separate migration to 'sf project retrieve/convert' (behavior change, needs org testing).
Merged
msrivastav13
added a commit
that referenced
this pull request
Jun 19, 2026
Minor release bundling the changes merged since 1.1.0: - fix(metadata:rename): resolve -o flag collision hiding default org (#443, #449) - fix(security): patch all known dependency vulnerabilities (#447) - chore(deps): bump @salesforce/core to ^8.31.1 (#448) - docs: use 'sf' instead of 'sfdx' in command examples (#449) Verified: npm ci clean, 0 vulnerabilities, 57 tests passing, prepack builds.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #443 —
sf metadata renameappeared to stop detecting the default org after 1.0.0.Root cause
This is a flag-character collision, not a default-org regression. In
metadata/rename.ts:--target-org(viarequiredOrgFlagWithDeprecations) uses char-o--oldfullnamealso declared char-oSo
sf metadata rename -t Skill -o A -n Brouted-o Ainto--target-org, and the CLI then looked for an org literally namedA:It worked in 0.3.2 because the org flag was
-u(--targetusername), leaving-ofree for the old name. The ESM modernization switched to the-o-based org flag, silently colliding.Fix
--oldfullnameto char-dso-omaps to--target-org(consistent with every other command in this plugin and thesfCLI convention).--target-orgauto-detects the configured default org when omitted — restoring the pre-1.0.0 behavior the issue describes.-u/--targetusernamedocs, now corrected).New usage
Verification
tsc -p . --noEmit— cleannpm test— 57 passingmetadata:rename --helpnow shows-d, --oldfullnameand-o, --target-org("Not required if the target-org configuration variable is already set")Note
metadata:renamewas the only command with this-ocollision — all other commands already reserve-ofor the org flag.