Skip to content

Commit e0da466

Browse files
Update extensions/cli/src/commands/chat.ts
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
1 parent c081764 commit e0da466

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

extensions/cli/src/commands/chat.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ async function runHeadlessMode(
446446
): Promise<void> {
447447
// Critical validation: Ensure we have a prompt in headless mode
448448
// This prevents the CLI from hanging in TTY-less environments
449-
if (!prompt) {
449+
if (!prompt && !options.prompt?.length && !options.agent) {
450450
throw new Error(
451451
'Headless mode requires a prompt. Use: cn -p "your prompt"\n' +
452452
'Or pipe input: echo "prompt" | cn -p\n' +

0 commit comments

Comments
 (0)