Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
71435b5
feat(cli): implement specify self upgrade
chordpli May 21, 2026
164e5e5
fix(cli): normalize self-upgrade prerelease tags
chordpli May 21, 2026
0182937
fix(cli): tighten self-upgrade diagnostics
chordpli May 21, 2026
c1fddcd
fix(cli): harden self-upgrade verification parsing
chordpli May 21, 2026
3f032a5
fix(cli): sanitize self-check fallback tags
chordpli May 21, 2026
f623484
fix(cli): harden self-check release display
chordpli May 21, 2026
24c06be
fix(cli): validate resolved upgrade tags
chordpli May 21, 2026
9ebc854
fix(cli): tolerate invalid install metadata
chordpli May 21, 2026
15c0292
test(cli): align upgrade network mocks
chordpli May 21, 2026
eb0deb1
fix(cli): respect relative installer paths
chordpli May 21, 2026
1577e5e
fix(cli): tighten upgrade failure handling
chordpli May 21, 2026
b6a357e
fix(cli): align installer path diagnostics
chordpli May 21, 2026
852cab6
fix(cli): validate release and version output
chordpli May 21, 2026
2d7dd8c
fix(cli): clarify source checkout guidance
chordpli May 21, 2026
a2cf35e
fix(cli): harden upgrade detection helpers
chordpli May 21, 2026
f16ede4
fix(cli): avoid echoing invalid release tags
chordpli May 21, 2026
5e53497
fix(cli): tolerate argv path resolve failures
chordpli May 21, 2026
b78d857
chore: remove self-upgrade formatting-only diffs
chordpli May 25, 2026
943f318
fix: address self-upgrade review feedback
chordpli May 26, 2026
4081438
fix: address self-upgrade review followups
chordpli May 26, 2026
b6a7a04
fix: address self-upgrade review edge cases
chordpli May 26, 2026
b02df9c
fix: address self-upgrade review docs
chordpli May 27, 2026
839d029
fix: refine self-upgrade review followups
chordpli May 27, 2026
46ddfa8
fix: address self-upgrade review cleanup
chordpli May 27, 2026
e3ecd2c
fix: handle self-upgrade review edge cases
chordpli May 27, 2026
6609ebe
fix: address self-upgrade review nits
chordpli May 27, 2026
3ff5369
fix: address follow-up self-upgrade review
chordpli May 27, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,24 @@ specify init my-project --integration copilot
cd my-project
```

To check for updates or upgrade the installed CLI, use the self-management commands. See the [Upgrade Guide](./docs/upgrade.md) for detailed scenarios and customization options.

```bash
# Check whether a newer release is available (read-only — does not modify anything)
specify self check

# Preview what would run, without actually upgrading
specify self upgrade --dry-run

# Upgrade in place to the latest stable release (auto-detects uv tool vs pipx install)
specify self upgrade

# Or pin a specific release tag (replace vX.Y.Z[suffix] with your desired release tag)
specify self upgrade --tag vX.Y.Z[suffix]
```
Comment thread
chordpli marked this conversation as resolved.

Bare `specify self upgrade` executes immediately, matching the no-prompt behavior of commands like `pip install -U` and `npm update`. For `uv tool` installs, it runs `uv tool install specify-cli --force --from <git ref>` under the hood so pinned release tags work, including dev, alpha/beta/rc, or build metadata suffixes. `uvx` (ephemeral) runs and source checkouts are detected and produce path-specific guidance instead of running an installer. Set `SPECIFY_UPGRADE_TIMEOUT_SECS` to cap how long the installer subprocess may run (default: no timeout — interrupt with `Ctrl+C` if needed).

### 3. Establish project principles

Launch your coding agent in the project directory. Most agents expose spec-kit as `/speckit.*` slash commands; Codex CLI in skills mode uses `$speckit-*` instead.
Expand Down Expand Up @@ -148,7 +166,7 @@ Run `specify integration list` to see all available integrations in your install

After running `specify init`, your AI coding agent will have access to these slash commands for structured development. For integrations that support skills mode, passing `--integration <agent> --integration-options="--skills"` installs agent skills instead of slash-command prompt files.

#### Core Commands
### Core Commands

Essential commands for the Spec-Driven Development workflow:

Expand Down
2 changes: 2 additions & 0 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ specify version

This helps verify you are running the official Spec Kit build from GitHub, not an unrelated package with the same name.

**Stay current:** Run `specify self check` periodically to learn whether a newer release is available — it is read-only and never modifies your installation. When you are ready to upgrade, follow the [Upgrade Guide](./upgrade.md).

After initialization, you should see the following commands available in your coding agent:

- `/speckit.specify` - Create specifications
Expand Down
48 changes: 39 additions & 9 deletions docs/upgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@

| What to Upgrade | Command | When to Use |
|----------------|---------|-------------|
| **CLI Tool Only** | `uv tool install specify-cli --force --from git+https://github.com/github/spec-kit.git@vX.Y.Z` | Get latest CLI features without touching project files |
| **CLI Tool Only (pipx)** | `pipx install --force git+https://github.com/github/spec-kit.git@vX.Y.Z` | Reinstall/upgrade a pipx-installed CLI to a specific release |
| **CLI Tool (recommended)** | `specify self upgrade` | Latest stable release, in place. Auto-detects whether you installed via `uv tool` or `pipx`. |
| **CLI Tool — pin a version** | `specify self upgrade --tag vX.Y.Z[suffix]` | Upgrade to a specific release tag instead of the latest stable. Suffixes are limited to dev, alpha/beta/rc, or build metadata forms. |
| **CLI Tool — manual fallback** | `uv tool install specify-cli --force --from git+https://github.com/github/spec-kit.git@vX.Y.Z` | When `specify self upgrade` isn't available (older installs) or when you want explicit control. |
| **CLI Tool — manual fallback (pipx)** | `pipx install --force git+https://github.com/github/spec-kit.git@vX.Y.Z` | Same as above, for pipx installs. |
Comment thread
chordpli marked this conversation as resolved.
| **Project Files** | `specify init --here --force --integration <your-agent>` | Update slash commands, templates, and scripts in your project |
| **Both** | Run CLI upgrade, then project update | Recommended for major version updates |

Expand All @@ -19,12 +21,32 @@

The CLI tool (`specify`) is separate from your project files. Upgrade it to get the latest features and bug fixes.

Before upgrading, you can check whether a newer released version is available:
### Recommended: `specify self upgrade`

The CLI ships with two self-management commands that handle the common case automatically:

```bash
# Check whether a newer release is available (read-only — does not modify anything)
specify self check

# Preview what would run, without actually upgrading
specify self upgrade --dry-run

# Upgrade in place to the latest stable release (auto-detects uv tool vs pipx install)
specify self upgrade

# Or pin a specific release tag (replace vX.Y.Z[suffix] with the tag you want)
specify self upgrade --tag vX.Y.Z[suffix]
```

Bare `specify self upgrade` executes immediately, matching the no-prompt behavior of commands like `pip install -U` and `npm update`. The CLI classifies your runtime into one of: `uv tool`, `pipx`, `uvx (ephemeral)`, source checkout, or unsupported. Only `uv tool` and `pipx` are upgraded automatically; for `uv tool` installs, it runs `uv tool install specify-cli --force --from <git ref>` under the hood so pinned release tags work. The other paths print path-specific guidance and exit 0 without touching anything.

Pinned tags must start with `vMAJOR.MINOR.PATCH`. Optional suffixes are limited to dev, alpha/beta/rc, or build metadata forms such as `v1.0.0-rc1`, `v0.8.0.dev0`, or `v0.8.0+build.42`; branch names, hash refs, `latest`, and bare versions without `v` are rejected.

Set `SPECIFY_UPGRADE_TIMEOUT_SECS` to cap how long the installer subprocess may run (default: no timeout — interrupt with `Ctrl+C` if needed). If that internal timeout fires, `specify self upgrade` exits 124 and reports that it timed out while waiting for the installer subprocess, including the configured timeout and manual retry command. A real installer exit code 124 is propagated with `Upgrade failed. Installer exit code: 124.`, so scripts should treat exit 124 as ambiguous and inspect the message when they need to distinguish the two cases.

If your installed CLI is older than the release that introduced `specify self upgrade`, use the manual equivalents below. These commands are also useful when you want explicit control over the installer command.

### If you installed with `uv tool install`

Upgrade to a specific release (check [Releases](https://github.com/github/spec-kit/releases) for the latest tag):
Expand Down Expand Up @@ -54,10 +76,14 @@ pipx install --force git+https://github.com/github/spec-kit.git@vX.Y.Z
### Verify the upgrade

```bash
# Confirms the CLI is working and shows installed tools
specify check

# Confirms the installed version against the latest GitHub release
specify self check
```

This shows installed tools and confirms the CLI is working. Use `specify version` to confirm which persistent CLI version is currently on your `PATH`.
`specify check` shows the surrounding tool environment; `specify self check` is read-only and tells you whether you're now on the latest release (`Up to date: X.Y.Z`) or if a newer one became available between releases.

---

Expand Down Expand Up @@ -186,8 +212,8 @@ Restart your IDE to refresh the command list.
### Scenario 1: "I just want new slash commands"

```bash
# Upgrade CLI (if using persistent install)
uv tool install specify-cli --force --from git+https://github.com/github/spec-kit.git
# Upgrade CLI (auto-detects uv tool vs pipx install)
specify self upgrade

# Update project files to get new commands
specify init --here --force --integration copilot
Expand All @@ -204,7 +230,7 @@ cp .specify/memory/constitution.md /tmp/constitution-backup.md
cp -r .specify/templates /tmp/templates-backup

# 2. Upgrade CLI
uv tool install specify-cli --force --from git+https://github.com/github/spec-kit.git
specify self upgrade

# 3. Update project
specify init --here --force --integration copilot
Expand Down Expand Up @@ -388,15 +414,19 @@ Only Spec Kit infrastructure files:

### "CLI upgrade doesn't seem to work"

If a command behaves like an older Spec Kit version, first check for local CLI drift:
If a command behaves like an older Spec Kit version, first ask the CLI itself:

```bash
# Read-only — prints "Up to date: X.Y.Z" or "Update available: X.Y.Z → vY.Z.W"
specify self check

# Preview the install method, current version, and target tag the upgrade would use
specify self upgrade --dry-run
```

`specify check` is an offline environment scan; `specify self check` is the CLI version lookup.

Verify the installation:
If `self check` shows the wrong version, verify the installation:

```bash
# Check installed tools
Expand Down
Loading