Merge branch 'main' into feat/add-codex-support

This commit is contained in:
Den Delimarsky
2025-09-20 08:54:00 -07:00
committed by GitHub
3 changed files with 16 additions and 14 deletions

View File

@@ -5,13 +5,19 @@ All notable changes to the Specify CLI will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [0.0.10] - 2025-09-20 ## [0.0.11] - 2025-09-20
### Added ### Added
- Codex CLI support across the Specify CLI, documentation, and bootstrap scripts, including automatic slash-command provisioning and prompt mirroring into `${CODEX_HOME:-~/.codex}/prompts`. - Codex CLI support (thank you [@honjo-hiroaki-gtt](https://github.com/honjo-hiroaki-gtt) for the contribution in [#14](https://github.com/github/spec-kit/pull/14))
- Codex-aware context update tooling (Bash and PowerShell) so feature plans refresh `AGENTS.md` alongside existing assistants without manual edits. - Codex-aware context update tooling (Bash and PowerShell) so feature plans refresh `AGENTS.md` alongside existing assistants without manual edits.
## [0.0.10] - 2025-09-20
### Fixed
- Addressed [#378](https://github.com/github/spec-kit/issues/378) where a GitHub token may be attached to the request when it was empty.
## [0.0.9] - 2025-09-19 ## [0.0.9] - 2025-09-19
### Changed ### Changed
@@ -23,7 +29,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added ### Added
- Windsurf IDE support as additional AI assistant option - Windsurf IDE support as additional AI assistant option
- GitHub token support for API requests to handle corporate environments and rate limiting (contributed by @zryfish in #243) - GitHub token support for API requests to handle corporate environments and rate limiting (contributed by [@zryfish](https://github.com/@zryfish) in [#243](https://github.com/github/spec-kit/pull/243))
### Changed ### Changed

View File

@@ -1,6 +1,6 @@
[project] [project]
name = "specify-cli" name = "specify-cli"
version = "0.0.9" version = "0.0.10"
description = "Specify CLI, part of GitHub Spec Kit. A tool to bootstrap your projects for Spec-Driven Development (SDD)." description = "Specify CLI, part of GitHub Spec Kit. A tool to bootstrap your projects for Spec-Driven Development (SDD)."
requires-python = ">=3.11" requires-python = ">=3.11"
dependencies = [ dependencies = [

View File

@@ -53,17 +53,13 @@ ssl_context = truststore.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
client = httpx.Client(verify=ssl_context) client = httpx.Client(verify=ssl_context)
def _github_token(cli_token: str | None = None) -> str | None: def _github_token(cli_token: str | None = None) -> str | None:
return cli_token or os.getenv("GH_TOKEN") or os.getenv("GITHUB_TOKEN") """Return sanitized GitHub token (cli arg takes precedence) or None."""
return ((cli_token or os.getenv("GH_TOKEN") or os.getenv("GITHUB_TOKEN") or "").strip()) or None
def _github_auth_headers(cli_token: str | None = None) -> dict: def _github_auth_headers(cli_token: str | None = None) -> dict:
"""Headers for GitHub REST API requests. """Return Authorization header dict only when a non-empty token exists."""
- Uses Bearer auth if token present
"""
headers = {}
token = _github_token(cli_token) token = _github_token(cli_token)
if token: return {"Authorization": f"Bearer {token}"} if token else {}
headers["Authorization"] = f"Bearer {token}"
return headers
# Constants # Constants
AI_CHOICES = { AI_CHOICES = {
@@ -598,7 +594,7 @@ def download_template_from_github(ai_assistant: str, download_dir: Path, *, scri
api_url, api_url,
timeout=30, timeout=30,
follow_redirects=True, follow_redirects=True,
headers=_github_auth_headers(github_token) or None, headers=_github_auth_headers(github_token),
) )
status = response.status_code status = response.status_code
if status != 200: if status != 200:
@@ -667,7 +663,7 @@ def download_template_from_github(ai_assistant: str, download_dir: Path, *, scri
download_url, download_url,
timeout=60, timeout=60,
follow_redirects=True, follow_redirects=True,
headers=_github_auth_headers(github_token) or None, headers=_github_auth_headers(github_token),
) as response: ) as response:
if response.status_code != 200: if response.status_code != 200:
body_sample = response.text[:400] body_sample = response.text[:400]