Skip to content

stash init ignores its non-interactive contract (blocks on prompts in non-TTY); no --yes; doesn't scaffold stash.config.ts #600

Description

@coderdan

Summary

npx stash manifest --json documents init as "Every prompt has a non-interactive escape hatch, so init never blocks waiting on a TTY (CI, agents, pipes)." In practice, run non-interactively (stdin from /dev/null, output piped) init renders each prompt and exits 0 without acting. There is no --yes / --non-interactive flag, and CI=1 doesn't change it. This makes init unusable from an agent/CI without out-of-band knowledge of how to satisfy each prompt.

Environment

stash 0.17.1

Repro

npx stash init --supabase --no-proxy --region ap-southeast-2 < /dev/null
...
◆  Install @cipherstash/stack (prod), stash (dev)?
│  ● Yes / ○ No
└
# (exits 0, nothing installed)

Each successive prompt (install deps → overwrite src/encryption/index.ts → "Install the EQL extension now?") stops the same way, so init never reaches the EQL-install step it advertises. Setting CI=1 did not help; init --help shows no non-interactive flag.

Related gap — stash.config.ts never scaffolded

Even after writing the encryption placeholder + context.json, init does not scaffold stash.config.ts. The read-only status commands then fail:

stash eql status   ->  Could not find stash.config.ts
stash status       ->  Could not find stash.config.ts

stash eql install --help claims it "Scaffold[s] stash.config.ts (if missing)", but a DATABASE_URL/--database-url-driven install did not leave one on disk either.

Suggested fix

Honour the documented non-interactive contract: when stdin is not a TTY (or CI / a --yes flag is set), auto-select each prompt's default and continue end-to-end (scaffold → install deps → install EQL → hand off), rather than rendering the prompt and exiting. Also scaffold stash.config.ts during init so the status commands work immediately afterwards.

Workaround

Pre-satisfy each prompt's precondition so it never fires: pre-install the exact deps init prints (npm install @cipherstash/stack && npm install -D stash), keep src/encryption/index.ts absent, drive EQL via stash eql install directly, and hand-write stash.config.ts from the snippet the CLI prints in its error.


Found via a CipherStash integration eval on cipherstash/supabase-nextjs-starter (hono-pg surface). Full report: https://github.com/cipherstash/supabase-nextjs-starter/blob/feat/multi-surface-starters/docs/evals/hono-pg/2026-07-09-bug-init-noninteractive-prompts.md

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions