Skip to content

remove: prompt for purge interactively + offer to clean up the appended .gitignore line #1

Description

@isingh

Problem

After install → remove in a project, the experience leaves cruft and the purge option is hard to discover.

  • Purge is flag-only. truecast remove <name> confirms the detach, but there's no interactive prompt for purge — you have to already know --purge.
  • The appended .gitignore line is never cleaned up. On install we append .truecast/agents/*/core to the project .gitignore; remove never offers to revert it, so git status shows a stray modified .gitignore even after you've removed everything.

Context: surfaced as "not the best experience" — after install then remove in a project, git status shows a modified .gitignore plus a leftover .truecast/.

Desired interactive flow

truecast remove <name> (no --yes):

  1. Remove <name>? [y/N]
  2. Also delete instance/ (purge)? [y/N]
    • purge = yes → remove the core symlink (detach) and delete instance/, then ask Remove the ".truecast/agents/*/core" line from .gitignore? [y/N] and remove it if confirmed.
    • purge = no → detach only (remove the core symlink + lock entry, keep instance/); do not touch .gitignore.

--yes skips the prompts; --purge preselects purge.

Notes / open questions

  • The .gitignore line is a shared glob covering every .truecast/agents/*/core. Only offer to remove it when no other persona still needs it (i.e. this is the last attached persona) — otherwise removing it breaks siblings.
  • Keep the programmatic Confirm/consent gate as the single owner. This is a CLI-prompt-shape change (two questions) feeding the existing remove-project consent, plus a new (gated) gitignore-cleanup step.
  • Decide whether --purge should still require --yes non-interactively, or whether the interactive purge prompt supersedes that.

Acceptance

  • Interactive remove asks remove → purge (two steps).
  • Purge offers the .gitignore-line cleanup; declining leaves it.
  • Non-purge detach leaves .gitignore untouched.
  • --yes / --purge flags preserve current non-interactive behavior.
  • Covered by tests (extend the consent conformance + a CLI prompt test).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions