diff --git a/CHANGELOG.md b/CHANGELOG.md index a24ae7f..125a68b 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 e098dec..c1ea551 100644 --- a/README.md +++ b/README.md @@ -156,6 +156,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) | @@ -181,6 +182,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 @@ -287,6 +291,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) @@ -305,6 +311,8 @@ specify init --ai windsurf # 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 d30e2ba..131f6c4 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 0bc419f..bb231f5 100644 --- a/src/specify_cli/__init__.py +++ b/src/specify_cli/__init__.py @@ -753,6 +753,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)"), @@ -783,6 +784,7 @@ def init( specify init --here --ai claude specify init --here --ai codex specify init --here + specify init --here --force # Skip confirmation when current directory not empty """ # Show banner first show_banner() @@ -806,12 +808,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