Where does the bug appear (feature/product)?
Background Agent (GitHub, Slack, Web, Linear)
Describe the Bug
I’m experiencing an issue where the agent is not able to properly interact with Drizzle CLI in interactive mode. It seems the agent cannot handle drizzle-kit generate (or likely any other TTY-based command).
I asked the Cursor web agent (https://cursor.com/agents/…) the following:
Was this SQL file created via
drizzle-kit generate?
The agent replied:
No.
0024_class_schema_refactoring.sqlwas not created bybun drizzle-kit generate. It was written manually.
Reason:drizzle-kit generateruns Drizzle Kit in interactive mode and waits for input, for example:
# drizzle-kit interactive prompt
Is classes table created or renamed from another table?
> classes create table
user_classes > classes rename table
Because that prompt can’t be answered automatically, the migration was hand-written using:
- The new
classesandclass_membersschemas- The PRD and plan docs
- The existing
user_classesschema and migrations 0018 and 0020
I tested the same scenario with Claude. Initially, the response was similar. After I insisted, it answered:
The interactive TTY can’t be piped. Let me use
--custom, which creates a blank file and properly updates the journal/snapshot, then I’ll fill in the SQL.
Both agents ended up using --custom to generate the migration file. However, the generated migration is not executed when running:
drizzle-kit migrate
It seems that:
- The agent cannot properly interact with TTY-based CLI prompts.
- The workaround using
--customproduces a migration file that is not picked up or executed as expected, could be a drizzle’s bug… - There may be an issue with how agents simulate or handle interactive CLI flows.
Has anyone experienced similar behavior with TTY-based tools in Cursor agents?
Is there a recommended way to handle interactive CLIs like drizzle-kit generate within the agent environment?
Steps to Reproduce
- Create a 1:N schema (
User→UserAddress) and rundrizzle-kit generate+migrate. - Refactor it to N:N (
User↔AddressviaUserAddressjoin table). - Ask the agent to generate the new migration.
- The agent cannot handle the interactive TTY and falls back to
--custom. - Run
drizzle-kit migrateand observe the migration is not executed.
Expected Behavior
-
The agent should be able to handle interactive CLI tools like
drizzle-kit generate, either by properly interacting with the TTY prompt or by using a fully supported non-interactive alternative. -
If
--customis used as a fallback, the generated migration must:- Be correctly registered in Drizzle’s journal/snapshot.
- Be detected by
drizzle-kit migrate. - Be executed normally when running:
drizzle-kit migrate
Operating System
MacOS
Version Information
Cloud Agents
For AI issues: which model did you use?
sonnet 4.5
composer.1.5
Does this stop you from using Cursor
No - Cursor works, but with this issue