Skip to content

fix(extensions): make extension add name optional with --from - #5197

Merged
mnriem merged 1 commit into
github:mainfrom
Quratulain-bilal:fix/extension-add-optional-name
Oct 30, 2026
Merged

mnriem merged 1 commit into
github:mainfrom
Quratulain-bilal:fix/extension-add-optional-name

Conversation

@Quratulain-bilal

Copy link
Copy Markdown
Contributor

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 positional extension argument was always required, including when --from gave the source.

Original report: Quratulain-bilal/spec-kit-brownfield#1

What changed

  • src/specify_cli/extensions/command_add.py: The positional extension argument is now optional. When it's omitted with --from <url>, the extension ID comes from the downloaded archive's manifest.
  • If neither a name nor --from is given, the command prints "Missing extension name or source", shows usage examples and exits with code 1.
  • --dev without a path is also rejected with a clear error, instead of crashing on the missing path.
  • With no name, the install status line shows the source URL.
  • Installs that pass both a name and --from behave as before.

Tests

Three new tests in tests/specify_cli/extensions/test_command_add.py:

  • --from <url> with no name installs successfully.
  • No name and no source exits 1 with the new error and installs nothing.
  • --dev with 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.

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
@mnriem mnriem added the triage-must-have Verdict: high-value, important work for Spec Kit — do first label Oct 30, 2026
@mnriem
mnriem requested an auto review from Copilot October 30, 2026 13:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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)

@mnriem
mnriem merged commit 7370e59 into github:main Oct 30, 2026
16 checks passed
@mnriem

mnriem commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

triage-must-have Verdict: high-value, important work for Spec Kit — do first

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants