spec-kit icon indicating copy to clipboard operation
spec-kit copied to clipboard

feat(cli): add --local-templates option for local development testing

Open serhiishtokal opened this issue 11 months ago • 1 comments

Summary

Adds a --local-templates CLI 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-locally

Motivation

Currently, testing local template changes requires manually copying packages (step 2 in CONTRIBUTING.md). This feature allows developers to test directly with:

specify init . --local-templates ".genreleases"

Changes

  • Added load_template_from_local() function in src/specify_cli/__init__.py
  • Added --local-templates parameter to the init command
  • Local template files are preserved after extraction (not deleted)
  • Updated README.md with CLI option documentation and usage example
  • Updated CONTRIBUTING.md local testing section with --local-templates workflow

Testing

I have personally tested these changes:

  • ✅ Verified with specify init . --ai claude --local-templates ".genreleases"
  • ✅ Confirmed template extraction works correctly
  • ✅ Confirmed local zip files are preserved after use
  • ✅ Tested error handling with invalid directory paths

AI Disclosure

This PR was developed with assistance from Antigravity IDE powered by Claude Opus 4.5 (Anthropic's AI coding assistant).

serhiishtokal avatar Dec 25 '25 00:12 serhiishtokal

This pull request has been automatically marked as stale because it has not had any activity for 150 days. It will be closed in 30 days if no further activity occurs.

github-actions[bot] avatar May 24 '26 01:05 github-actions[bot]