-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
Milestone
Description
Summary
The dev design specifies a spfx-cli list-templates command that lists all available templates from registered sources. This command does not exist today — only create is implemented.
Requirements
Command signature
spfx list-templates [options]
Flags
| Flag | Type | Required | Description |
|---|---|---|---|
--local-source PATH |
string (repeatable) | No | Path(s) to local template folder(s) to include |
--remote-source URL |
string (repeatable) | No | Public GitHub repo URL(s) to include as template sources |
Behavior
- Fetches templates from all registered sources (default GitHub source + any additional local/remote sources)
- Displays a formatted list of templates with: name, description, version, spfxVersion, component category (once Add unit tests for scaffolding API #9 lands)
- Groups or labels by source origin (local vs. remote)
Existing infrastructure
SPFxTemplateRepositoryManageralready supports multiple sources and concurrent fetchingSPFxTemplateCollectionhas atoString()method with formatted outputLocalFileSystemRepositorySourceandPublicGitHubRepositorySourceare both implemented in@microsoft/spfx-template-api
Implementation notes
- Add a new
ListTemplatesActionclass inapps/spfx-cli/src/actions/extendingCommandLineActionfrom@rushstack/ts-command-line - Register it in
SPFxCommandLineParseralongside the existingCreateAction - Wire up the repository manager with default + user-specified sources
Acceptance criteria
-
spfx list-templateslists all templates from default source -
--local-sourceadds local templates to output -
--remote-sourceadds remote GitHub templates to output - Multiple
--local-sourceand--remote-sourceflags can be combined - Output is human-readable with template metadata
Reactions are currently unavailable