Skip to content

specify init hangs on select_with_arrows prompts in non-interactive environments — no flag reaches them, --force does not bypass them #4152

Description

@victor-bogdan

Summary

When specify init is run in an environment without an interactive TTY (an AI agent harness, CI, or any piped/captured stdin), initialization can hang indefinitely at an arrow-key selection prompt (select_with_arrows). The prompt waits for keypresses that will never arrive, renders nothing useful to the caller, and never times out.

The existing CLI flags do not cover this:

  • --script and other explicit option flags (--here, --integration, --ai) pre-answer their own questions, but any selection not covered by a flag still falls through to select_with_arrows — there is no flag that reaches every prompt.
  • --force suggests "proceed without asking", but it only suppresses confirmation-style prompts; it does not provide a default answer to selection prompts, so the hang is unreachable by --force too.
  • There is no global --non-interactive / --defaults mode, and no TTY detection: with stdin not a TTY, the tool still enters the interactive selector instead of failing fast.

Reproduction

  1. Run specify init --here --integration claude --force (or any invocation that leaves at least one selection unanswered by flags) with stdin/stdout not attached to a TTY — e.g. piped, under CI, or driven by an agent harness.
  2. Initialization reaches the first selection that has no corresponding flag and blocks in select_with_arrows waiting for arrow-key input.
  3. No timeout, no error, no output indicating what is being asked — from the caller's side the process simply hangs.

Expected behavior (any of these would resolve it)

  1. Fail fast when non-interactive: if stdin is not a TTY and a selection has no flag-supplied answer, exit with a clear error naming the missing option and the flag that would supply it — instead of blocking on keyboard input.
  2. A --non-interactive (or --defaults) mode that answers every selection with its documented default, and errors loudly on any selection that has no safe default.
  3. Flag coverage for every select_with_arrows prompt, so a fully scripted init is expressible — at which point --force + explicit flags genuinely means "no prompts".

Why it matters

Spec Kit is a natural fit for agent-driven workflows, and those are precisely the environments with no TTY. Today a scripted specify init is not reliably expressible: whether it completes depends on whether the chosen flag combination happens to pre-answer every prompt, and when it doesn't, the failure mode is a silent hang rather than an actionable error.

Environment

  • specify 0.16.3.dev0
  • Invoked non-interactively (AI agent harness; stdin not a TTY)
  • Workaround used: ran the interactive selection out-of-band and supplied every flag the CLI exposes; the remaining prompt(s) had to be avoided rather than answered.

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