Skip to content

Commit 11376cd

Browse files
mnriemgithub-actions[bot]
authored andcommitted
Fix parameter ordering issues in CLI (github#1669)
* chore: bump version to v0.0.6 [skip ci] * Fix parameter ordering issues in CLI (github#1641) - Add validation to detect when option flags are consumed as values - Provide clear error messages with helpful hints and examples - Add 5 comprehensive tests to prevent regressions - Update CODEOWNERS to @mnriem - Bump version to 0.1.6 with changelog entry Fixes: github#1641 * Fix ruff linting errors: remove f-string prefix from strings without placeholders --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 24296ef commit 11376cd

5 files changed

Lines changed: 727 additions & 7 deletions

File tree

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Global code owner
2-
* @localden
2+
* @mnriem
33

CHANGELOG.md

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,23 @@
22

33
<!-- markdownlint-disable MD024 -->
44

5-
All notable changes to the Specify CLI and templates are documented here.
5+
Recent changes to the Specify CLI and templates are documented here.
66

77
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
88
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
99

10-
## [0.1.5] - Unreleased
10+
## [0.1.6] - 2026-02-23
11+
12+
### Fixed
13+
14+
- **Parameter Ordering Issues (#1641)**: Fixed CLI parameter parsing issue where option flags were incorrectly consumed as values for preceding options
15+
- Added validation to detect when `--ai` or `--ai-commands-dir` incorrectly consume following flags like `--here` or `--ai-skills`
16+
- Now provides clear error messages: "Invalid value for --ai: '--here'"
17+
- Includes helpful hints suggesting proper usage and listing available agents
18+
- Commands like `specify init --ai-skills --ai --here` now fail with actionable feedback instead of confusing "Must specify project name" errors
19+
- Added comprehensive test suite (5 new tests) to prevent regressions
20+
21+
## [0.1.5] - 2026-02-21
1122

1223
### Fixed
1324

@@ -16,13 +27,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1627
- Affected agents now work correctly: copilot (`.github/agents/`), opencode (`.opencode/command/`), windsurf (`.windsurf/workflows/`), codex (`.codex/prompts/`), kilocode (`.kilocode/workflows/`), q (`.amazonq/prompts/`), and agy (`.agent/workflows/`)
1728
- The `install_ai_skills()` function now uses the correct path for all agents instead of assuming `commands/` for everyone
1829

19-
## [0.1.4] - Unreleased
30+
## [0.1.4] - 2026-02-20
2031

2132
### Fixed
2233

2334
- **Qoder CLI detection**: Renamed `AGENT_CONFIG` key from `"qoder"` to `"qodercli"` to match the actual executable name, fixing `specify check` and `specify init --ai` detection failures
2435

25-
## [0.1.3] - Unreleased
36+
## [0.1.3] - 2026-02-20
2637

2738
## [0.1.0] - 2026-01-28
2839

@@ -157,6 +168,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
157168
- Fixed jq injection vulnerability in `configure-worktree.sh` by using `--arg` for user input
158169
- Fixed PowerShell temp file leak in writability checks with proper `try/finally` cleanup
159170
- Moved `WORKTREE_DESIGN.md` into `specs/001-git-worktrees/` to keep design docs with their spec
171+
- Add stale workflow for 180-day inactive issues and PRs (#1594)
160172

161173
## [0.0.22] - 2025-11-07
162174

@@ -184,7 +196,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
184196
- Filters out common stop words (I, want, to, the, for, etc.)
185197
- Removes words shorter than 3 characters (unless they're uppercase acronyms)
186198
- Takes 3-4 most meaningful words from the description
187-
- **Enforces GitHub's 244-byte branch name limit** with automatic truncation and warnings
199+
- **Enforces GitHub's 244-byte limit** with automatic truncation and warnings
188200
- Examples:
189201
- "I want to create user authentication" → `001-create-user-authentication`
190202
- "Implement OAuth2 integration for API" → `001-implement-oauth2-integration-api`

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "specify-cli"
3-
version = "0.1.5"
3+
version = "0.1.6"
44
description = "Specify CLI, part of GitHub Spec Kit. A tool to bootstrap your projects for Spec-Driven Development (SDD)."
55
requires-python = ">=3.11"
66
dependencies = [

src/specify_cli/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1694,6 +1694,20 @@ def init(
16941694

16951695
show_banner()
16961696

1697+
# Detect when option values are likely misinterpreted flags (parameter ordering issue)
1698+
if ai_assistant and ai_assistant.startswith("--"):
1699+
console.print(f"[red]Error:[/red] Invalid value for --ai: '{ai_assistant}'")
1700+
console.print("[yellow]Hint:[/yellow] Did you forget to provide a value for --ai?")
1701+
console.print("[yellow]Example:[/yellow] specify init --ai claude --here")
1702+
console.print(f"[yellow]Available agents:[/yellow] {', '.join(AGENT_CONFIG.keys())}")
1703+
raise typer.Exit(1)
1704+
1705+
if ai_commands_dir and ai_commands_dir.startswith("--"):
1706+
console.print(f"[red]Error:[/red] Invalid value for --ai-commands-dir: '{ai_commands_dir}'")
1707+
console.print("[yellow]Hint:[/yellow] Did you forget to provide a value for --ai-commands-dir?")
1708+
console.print("[yellow]Example:[/yellow] specify init --ai generic --ai-commands-dir .myagent/commands/")
1709+
raise typer.Exit(1)
1710+
16971711
if project_name == ".":
16981712
here = True
16991713
project_name = None # Clear project_name to use existing validation logic

0 commit comments

Comments
 (0)