github/spec-kit · error · BundlerError

Bundle '{bundle_id}' is not installed.

Error message

Bundle '{bundle_id}' is not installed.

What it means

remove_bundle() was asked to uninstall a bundle whose bundle_id does not appear in the installed-bundle records under .specify. The lookup `next((r for r in records if r.bundle_id == bundle_id), None)` returned None, so there is nothing to remove and the operation aborts before touching any component.

Source

Thrown at src/specify_cli/bundler/services/installer.py:189

        components=contributed,
        # Preserve the original install time across refresh/update so
        # ``bundle list`` keeps reporting when the bundle was first installed.
        installed_at=existing.installed_at if existing is not None else None,
    )
    save_records(project_root, upsert_record(records, record))
    return result


def remove_bundle(
    project_root: Path,
    bundle_id: str,
    installer: PrimitiveInstaller,
) -> InstallResult:
    """Remove a bundle, uninstalling only components no other bundle still needs."""
    records = load_records(project_root)
    target = next((r for r in records if r.bundle_id == bundle_id), None)
    if target is None:
        raise BundlerError(f"Bundle '{bundle_id}' is not installed.")

    still_needed = components_still_needed(records, exclude_bundle_id=bundle_id)
    result = InstallResult(bundle_id=bundle_id)
    remove_attempted = False

    try:
        for component in target.contributed_components:
            key = (component.kind, component.id)
            if key in still_needed:
                result.skipped.append(component)
                continue
            if installer.is_installed(project_root, component):
                remove_attempted = True
                installer.remove(project_root, component)
                result.uninstalled.append(component)
        save_records(project_root, remove_record(records, bundle_id))
    except Exception as exc:  # noqa: BLE001
        if result.uninstalled:

View on GitHub (pinned to bf88c9f9a8)

Solutions

  1. List installed bundles first (`specify bundle list`) and copy the exact bundle_id from the output.
  2. Confirm you are running the command from the correct project root — records are per-project under .specify.
  3. If the record is genuinely gone but components remain, uninstall the leftover components directly (e.g. `specify preset remove <id>`) instead of via the bundle.
  4. If you expected the record to exist, check whether .specify/ was reset by a re-init and reinstall the bundle.
Defensive patterns

Strategy: validation

Validate before calling

from specify_cli.bundler.services.installer import load_records
from pathlib import Path

installed = {r.bundle_id for r in load_records(project_root)}
if bundle_id not in installed:
    print(f"available bundles: {sorted(installed) or '(none)'}")
    return

Try / catch

from specify_cli.bundler.core import BundlerError

try:
    remove_bundle(project_root, bundle_id, installer)
except BundlerError as exc:
    if "is not installed" in str(exc):
        pass  # already gone — treat as success (idempotent remove)

Prevention

When it happens

Trigger: Calling remove_bundle(project_root, bundle_id) or `specify bundle remove <id>` with an id that was never installed, was already removed, was installed under a different id spelling, or whose records file was deleted/reset.

Common situations: Typos in the bundle id on the command line; running remove twice; the project's .specify bundle records were wiped (fresh init over an existing tree); the bundle was installed in a different project root / working directory than the one remove runs in.

Related errors


AI-assisted analysis of github/spec-kit@bf88c9f9a8 (2026-08-14). Data as JSON: /api/errors/0a22d136ef57b4cf. Report an issue: GitHub.