Skip to content

[bug] teamai remove cannot run unattended: no flag to skip the confirmation prompt #591

Description

@SaulMoro

Description

teamai remove cannot be run from a script. askConfirmation returns false when process.stdin.isTTY is false (src/utils/prompt.ts), and the command has no flag to skip the prompt. Piping y does not help, because the answer is never read. Every scripted run prints Cancelled and exits 0, which reads like success.

$ teamai remove agents foo < /dev/null
  Will remove 1 agents:
    - foo
  From: team repo + all local AI tool directories
  Cancelled            (exit code 0)

teamai uninstall takes --force for exactly this, and teamai init takes --force to overwrite without confirming, so the precedent is already in the CLI.

The cost is not only ergonomic. teamai remove has no end-to-end coverage at all, because no test can drive it. Both defects in #576 lived on the removal path, and neither had a test at the command level.

Reproduction

  1. Initialize teamai against a team repo holding at least one rule.
  2. Run teamai remove rules <name> < /dev/null.
  3. The command prints Cancelled and exits 0. Nothing is removed.

Environment

  • OS: macOS 26.5.2
  • Node.js: v22.22.2
  • teamai: built from main at cccbe1d
  • Provider: git, local bare repository
  • AI tool(s): Claude Code, Codex

Proposed fix

Give remove a --force flag that skips askConfirmation, spelled the same way as teamai uninstall --force. That makes the command scriptable and lets an end-to-end test cover it.

Lessons from #576

An untestable command accumulates bugs quietly. #576 was two defects in one removeItem loop, a wrong extension set and a missing exclusion gate. A third, the same missing gate in rules.ts and skills.ts, is #590. None of them had end-to-end coverage, because the command cannot run unattended. The unit tests reach removeItem directly and pass, so the gap is specifically at the command level.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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