diff --git a/CHANGELOG.md b/CHANGELOG.md index a24ae7fd..125a68b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,18 @@ # Changelog + + 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/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.0.16] - 2025-09-22 + +### Added + +- `--force` flag for `init` command to bypass confirmation when using `--here` in a non-empty directory and proceed with merging/overwriting files. + ## [0.0.15] - 2025-09-21 ### Added diff --git a/README.md b/README.md index b6aed441..47e0c720 100644 --- a/README.md +++ b/README.md @@ -39,12 +39,38 @@ Spec-Driven Development **flips the script** on traditional software development ### 1. Install Specify -Initialize your project depending on the coding agent you're using: +Choose your preferred installation method: + +#### Option 1: Persistent Installation (Recommended) + +Install once and use everywhere: + +```bash +uv tool install specify-cli --from git+https://github.com/github/spec-kit.git +``` + +Then use the tool directly: + +```bash +specify init +specify check +``` + +#### Option 2: One-time Usage + +Run directly without installing: ```bash uvx --from git+https://github.com/github/spec-kit.git specify init ``` +**Benefits of persistent installation:** + +- Tool stays installed and available in PATH +- No need to create shell aliases +- Better tool management with `uv tool list`, `uv tool upgrade`, `uv tool uninstall` +- Cleaner shell configuration + ### 2. Establish project principles Use the **`/constitution`** command to create your project's governing principles and development guidelines that will guide all subsequent development. @@ -131,6 +157,7 @@ The `specify` command supports the following options: | `--ignore-agent-tools` | Flag | Skip checks for AI agent tools like Claude Code | | `--no-git` | Flag | Skip git repository initialization | | `--here` | Flag | Initialize project in the current directory instead of creating a new one | +| `--force` | Flag | Force merge/overwrite when using `--here` in a non-empty directory (skip confirmation) | | `--skip-tls` | Flag | Skip SSL/TLS verification (not recommended) | | `--debug` | Flag | Enable detailed debug output for troubleshooting | | `--github-token` | Option | GitHub token for API requests (or set GH_TOKEN/GITHUB_TOKEN env variable) | @@ -156,6 +183,9 @@ specify init my-project --ai copilot --script ps # Initialize in current directory specify init --here --ai copilot +# Force merge into current (non-empty) directory without confirmation +specify init --here --force --ai copilot + # Skip git initialization specify init my-project --ai gemini --no-git @@ -262,6 +292,8 @@ Or initialize in the current directory: ```bash specify init --here +# Skip confirmation when the directory already has files +specify init --here --force ``` ![Specify CLI bootstrapping a new project in the terminal](./media/specify_cli.gif) @@ -281,6 +313,8 @@ specify init --ai codebuddy # Or in current directory: specify init --here --ai claude specify init --here --ai codex +# Force merge into a non-empty current directory +specify init --here --force --ai claude ``` The CLI will check if you have Claude Code, Gemini CLI, Cursor CLI, Qwen CLI, opencode, or Codex CLI installed. If you do not, or you prefer to get the templates without checking for the right tools, use `--ignore-agent-tools` with your command: diff --git a/pyproject.toml b/pyproject.toml index d30e2ba3..131f6c40 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "specify-cli" -version = "0.0.15" +version = "0.0.16" description = "Specify CLI, part of GitHub Spec Kit. A tool to bootstrap your projects for Spec-Driven Development (SDD)." requires-python = ">=3.11" dependencies = [ diff --git a/src/specify_cli/__init__.py b/src/specify_cli/__init__.py index e7f9032f..2d5ff51b 100644 --- a/src/specify_cli/__init__.py +++ b/src/specify_cli/__init__.py @@ -754,6 +754,7 @@ def init( ignore_agent_tools: bool = typer.Option(False, "--ignore-agent-tools", help="Skip checks for AI agent tools like Claude Code"), no_git: bool = typer.Option(False, "--no-git", help="Skip git repository initialization"), here: bool = typer.Option(False, "--here", help="Initialize project in the current directory instead of creating a new one"), + force: bool = typer.Option(False, "--force", help="Force merge/overwrite when using --here (skip confirmation)"), skip_tls: bool = typer.Option(False, "--skip-tls", help="Skip SSL/TLS verification (not recommended)"), debug: bool = typer.Option(False, "--debug", help="Show verbose diagnostic output for network and extraction failures"), github_token: str = typer.Option(None, "--github-token", help="GitHub token to use for API requests (or set GH_TOKEN or GITHUB_TOKEN environment variable)"), @@ -786,6 +787,8 @@ def init( specify init --here --ai claude specify init --here --ai codex specify init --here --ai codebuddy + specify init --here + specify init --here --force # Skip confirmation when current directory not empty """ # Show banner first show_banner() @@ -809,12 +812,14 @@ def init( if existing_items: console.print(f"[yellow]Warning:[/yellow] Current directory is not empty ({len(existing_items)} items)") console.print("[yellow]Template files will be merged with existing content and may overwrite existing files[/yellow]") - - # Ask for confirmation - response = typer.confirm("Do you want to continue?") - if not response: - console.print("[yellow]Operation cancelled[/yellow]") - raise typer.Exit(0) + if force: + console.print("[cyan]--force supplied: skipping confirmation and proceeding with merge[/cyan]") + else: + # Ask for confirmation + response = typer.confirm("Do you want to continue?") + if not response: + console.print("[yellow]Operation cancelled[/yellow]") + raise typer.Exit(0) else: project_path = Path(project_name).resolve() # Check if project directory already exists