promptgarten ๐ŸŒฑ
๐ŸŒ ES

Command reference ยท Cursor CLI

agent create-chat

Creates a new, empty chat and returns its ID, e.g. for use in scripts.

agent create-chat creates an empty chat session and prints its ID to the console, without starting an interactive session directly. The ID can then be targeted again with --resume [chatId], for example from a script.

โœ… WHEN TO USE IT?

Reserve a session ID up front to address it later from a script via --resume

CHAT_ID=$(agent create-chat); agent --resume "$CHAT_ID" -p "start task"

โ›” WHEN NOT TO?

You just want to jump in and start chatting with the agent right away

agent create-chat only creates an empty session, it doesn't start a conversation.

Better: Just use agent or agent "<prompt>"

SOURCES