Merge branch 'main' into codebuddy

This commit is contained in:
King
2025-09-26 09:12:09 +08:00
committed by GitHub
14 changed files with 433 additions and 53 deletions

View File

@@ -14,11 +14,13 @@ Specify CLI - Setup tool for Specify projects
Usage:
uvx specify-cli.py init <project-name>
uvx specify-cli.py init .
uvx specify-cli.py init --here
Or install globally:
uv tool install --from specify-cli.py specify-cli
specify init <project-name>
specify init .
specify init --here
"""
@@ -193,9 +195,9 @@ def get_key():
key = readchar.readkey()
# Arrow keys
if key == readchar.key.UP:
if key == readchar.key.UP or key == readchar.key.CTRL_P:
return 'up'
if key == readchar.key.DOWN:
if key == readchar.key.DOWN or key == readchar.key.CTRL_N:
return 'down'
# Enter/Return
@@ -748,7 +750,7 @@ def ensure_executable_scripts(project_path: Path, tracker: StepTracker | None =
@app.command()
def init(
project_name: str = typer.Argument(None, help="Name for your new project directory (optional if using --here)"),
project_name: str = typer.Argument(None, help="Name for your new project directory (optional if using --here, or use '.' for current directory)"),
ai_assistant: str = typer.Option(None, "--ai", help="AI assistant to use: claude, gemini, copilot, cursor, qwen, opencode, codex, windsurf, kilocode, auggie, roo, or codebuddy"),
script_type: str = typer.Option(None, "--script", help="Script type to use: sh or ps"),
ignore_agent_tools: bool = typer.Option(False, "--ignore-agent-tools", help="Skip checks for AI agent tools like Claude Code"),
@@ -784,7 +786,9 @@ def init(
specify init my-project --ai auggie
specify init my-project --ai codebuddy
specify init --ignore-agent-tools my-project
specify init --here --ai claude
specify init . --ai claude # Initialize in current directory
specify init . # Initialize in current directory (interactive AI selection)
specify init --here --ai claude # Alternative syntax for current directory
specify init --here --ai codex
specify init --here --ai codebuddy
specify init --here
@@ -793,13 +797,18 @@ def init(
# Show banner first
show_banner()
# Handle '.' as shorthand for current directory (equivalent to --here)
if project_name == ".":
here = True
project_name = None # Clear project_name to use existing validation logic
# Validate arguments
if here and project_name:
console.print("[red]Error:[/red] Cannot specify both project name and --here flag")
raise typer.Exit(1)
if not here and not project_name:
console.print("[red]Error:[/red] Must specify either a project name or use --here flag")
console.print("[red]Error:[/red] Must specify either a project name, use '.' for current directory, or use --here flag")
raise typer.Exit(1)
# Determine project directory
@@ -1067,9 +1076,10 @@ def init(
step_num += 1
steps_lines.append(f"{step_num}. Start using slash commands with your AI agent:")
steps_lines.append(" 2.1 [cyan]/constitution[/] - Establish project principles")
steps_lines.append(" 2.2 [cyan]/specify[/] - Create specifications")
steps_lines.append(" 2.3 [cyan]/plan[/] - Create implementation plans")
steps_lines.append(" 2.2 [cyan]/specify[/] - Create baseline specification")
steps_lines.append(" 2.3 [cyan]/plan[/] - Create implementation plan")
steps_lines.append(" 2.4 [cyan]/tasks[/] - Generate actionable tasks")
steps_lines.append(" 2.5 [cyan]/implement[/] - Execute implementation")
@@ -1077,6 +1087,16 @@ def init(
console.print()
console.print(steps_panel)
enhancement_lines = [
"Optional commands that you can use for your specs [bright_black](improve quality & confidence)[/bright_black]",
"",
f"○ [cyan]/clarify[/] [bright_black](optional)[/bright_black] - Ask structured questions to de-risk ambiguous areas before planning (run before [cyan]/plan[/] if used)",
f"○ [cyan]/analyze[/] [bright_black](optional)[/bright_black] - Cross-artifact consistency & alignment report (after [cyan]/tasks[/], before [cyan]/implement[/])"
]
enhancements_panel = Panel("\n".join(enhancement_lines), title="Enhancement Commands", border_style="cyan", padding=(1,2))
console.print()
console.print(enhancements_panel)
if selected_ai == "codex":
warning_text = """[bold yellow]Important Note:[/bold yellow]