feat: :sparkles: Remove TTY requirement for the cli in headless mode
Description
I'd noticed that due to TTY specific requirements it wasn't possible to launch the continue CLI locally from the vscode or intelliJ terminal tools. This change allows that to work when the cli is launched in headless mode. This unlocks headless sub agents to be used locally.
I've included a couple of sample prompts in this PR as well which can now unlock running background and foreground subagents.
Nice use cases include launching prettier, or code cleanup tasks in the background while you keep coding. Or perhaps kicking off the generation of tests in a separate agent context off of the main context in the extension.
AI Code Review
- Team members only: AI review runs automatically when PR is opened or marked ready for review
- Team members can also trigger a review by commenting
@continue-review
Checklist
- [X] I've read the contributing guide
- [X] The relevant docs, if any, have been updated or created
- [X] The relevant tests, if any, have been updated or created
Screen recording or screenshot
[ When applicable, please include a short screen recording or screenshot - this makes it much easier for us as contributors to review and understand your changes. See this PR as a good example. ]
Tests
Added new headless tests.
Summary by cubic
Removes the TTY requirement when running the CLI in headless mode (-p), so it works in VSCode/IntelliJ terminals, Docker, and CI without hanging. This enables local headless sub-agents and clean non-interactive runs.
-
New Features
- Headless mode never initializes the TUI; skips stdin when a prompt is supplied (even after flags) and shows clear errors if missing, except when using --resume or --fork.
- TTY detection and safeguards added to prevent TUI in TTY-less environments and test raw-mode support; Ink now receives explicit stdio streams.
- Logger and stdin handling updated for TTY-less runs; supports FORCE_NO_TTY and sets UTF-8 encoding.
- Docs added for TTY-less usage (README + spec) and new e2e tests for TTY-less/headless behavior.
- New sample prompts to launch sub-agents in background or foreground.
Written for commit 45cace703b8e9d1d79ee8a6396c1b000dc066dc5. Summary will update automatically on new commits.
This should be ready for review. The failures in the binary and jetbrains tests are unexpected. Appears maybe the package-lock in the binary directory needs to be updated?
@chezsmithy thanks for the bump, it does look like several prs are failing with those tests. Likely a package lock issue. I'll take a look
@chezsmithy these test issues have been resolved on main!
:tada: This PR is included in version 1.36.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
:tada: This PR is included in version 1.7.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket: