-
Notifications
You must be signed in to change notification settings - Fork 5.1k
feat(cli): add --local-templates option for local development testing #1386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(cli): add --local-templates option for local development testing #1386
Conversation
Add support for loading templates from a local directory instead of GitHub releases. This enables testing template and CLI changes locally before publishing. - New load_template_from_local() function with input validation - Validates directory exists and is accessible - Preserves local template files (doesn't delete after extraction) - Displays [DEV MODE] indicator in output
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds a --local-templates CLI option to enable loading templates from a local directory instead of GitHub releases, improving the development workflow for contributors testing local template changes.
Key Changes
- Added
load_template_from_local()function to load templates from local.genreleasesdirectory - Modified
download_and_extract_template()to support local template loading via optionallocal_dirparameter - Updated CLI documentation in README.md and CONTRIBUTING.md with usage examples
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/specify_cli/init.py | Implements local template loading functionality with new function and parameter integration |
| README.md | Documents the new --local-templates CLI option with example usage |
| CONTRIBUTING.md | Updates local testing workflow to use --local-templates instead of manual copying |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/specify_cli/__init__.py
Outdated
Copilot
AI
Dec 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The alphabetical sorting of version strings may not work correctly for all semantic version formats. For example, "v1.10.0" would sort before "v1.9.0" alphabetically, which is incorrect. Consider using a more robust version sorting method, such as extracting the version numbers and comparing them numerically, or using a library like packaging.version for proper semantic version comparison.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. I removed the sorting since we usually only have one file locally anyway. Keeps it simple and avoids the sorting bug.
Summary
Adds a
--local-templatesCLI option to enable loading templates from a local directory instead of GitHub releases. This improves the development workflow described in the "Testing template and command changes locally" section of CONTRIBUTING.md https://github.com/github/spec-kit/blob/main/CONTRIBUTING.md#testing-template-and-command-changes-locallyMotivation
Currently, testing local template changes requires manually copying packages (step 2 in CONTRIBUTING.md). This feature allows developers to test directly with:
Changes
load_template_from_local()function insrc/specify_cli/__init__.py--local-templatesparameter to theinitcommandREADME.mdwith CLI option documentation and usage exampleCONTRIBUTING.mdlocal testing section with--local-templatesworkflowTesting
I have personally tested these changes:
specify init . --ai claude --local-templates ".genreleases"AI Disclosure
This PR was developed with assistance from Antigravity IDE powered by Claude Opus 4.5 (Anthropic's AI coding assistant).