Repository navigation
fix(extensions): make extension add name optional with --from - #5197
Merged
mnriem merged 1 commit intoOct 30, 2026
Merged
Conversation
The positional extension argument was required, so `specify extension add --from <url>` failed with "Missing argument 'EXTENSION'". Make it optional when --from is given, and print a clear error when neither a name nor a source is provided (also for --dev without a path). Quratulain-bilal/spec-kit-brownfield#1
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are recorded for the URL-based extension installation change.
No open issues 🎉
What changed in this PR
Fixes Specify CLI’s URL-based extension installation so specify extension add --from <url> no longer requires a positional name; the archive manifest supplies the extension ID.
Changes:
- Makes the extension name optional for URL installs and uses the URL in the installation status.
- Adds clear errors and usage examples for missing names, sources, or development paths.
- Adds regression coverage for name-free URL installs and invalid invocations.
Reported test results were not independently rerun.
| File | Description |
|---|---|
tests/specify_cli/extensions/test_command_add.py |
Adds tests for URL-only installation and missing-input errors. |
src/specify_cli/extensions/command_add.py |
Allows an omitted name with --from, validates inputs, and updates status text. |
Review effort: Balanced (auto)
Collaborator
|
Thank you! |
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.
Bug
specify extension add --from <url>failed with "Missing argument 'EXTENSION'", even though the spec-kit-brownfield README documents installing with just--from <url>and no extension name. The positionalextensionargument was always required, including when--fromgave the source.Original report: Quratulain-bilal/spec-kit-brownfield#1
What changed
src/specify_cli/extensions/command_add.py: The positionalextensionargument is now optional. When it's omitted with--from <url>, the extension ID comes from the downloaded archive's manifest.--fromis given, the command prints "Missing extension name or source", shows usage examples and exits with code 1.--devwithout a path is also rejected with a clear error, instead of crashing on the missing path.--frombehave as before.Tests
Three new tests in
tests/specify_cli/extensions/test_command_add.py:--from <url>with no name installs successfully.--devwith no path exits 1 with a clear error.Results on Windows, Python 3.11:
tests/specify_cli/extensions/test_command_add.py: 48 passed, 1 skipped (POSIX-only), 0 failed.tests/specify_cli/extensions/: 230 passed, 10 skipped (platform-specific), 0 failed.