MCP tools now have context-aware permissions: - In headless mode: automatically allowed (no user to ask) - In TUI mode: require user confirmation (ask permission) Previously, MCP tools fell under the wildcard '*' policy which defaults to 'ask' permission. In headless mode, tools with 'ask' permission are filtered out to prevent the AI from seeing tools it cannot call. This caused MCP tools to be unavailable in headless mode unless explicitly allowed via command-line flags or agent file configuration. Implementation: - Added generateHeadlessPolicies() method to ToolPermissionService - Headless policies inject 'mcp__*' allow policy before other policies - Default policies keep MCP tools as 'ask' (appropriate for TUI mode) - Headless policy only applies when isHeadless flag is true Benefits: - ✅ MCP tools work in headless mode without explicit --allow flags - ✅ MCP tools still require confirmation in TUI mode for safety - ✅ Consistent with agent file behavior - ✅ Maintains security for other unmatched tools Changes: - Added generateHeadlessPolicies() in ToolPermissionService - Updated initializeSync to include headless policies - Added comprehensive tests for headless mode behavior - Updated documentation to reflect context-aware permissions Co-authored-by: dallin <dallin@continue.dev> Generated with [Continue](https://continue.dev) Co-Authored-By: Continue <noreply@continue.dev> |
||
|---|---|---|
| .. | ||
| .github | ||
| docs | ||
| media | ||
| spec | ||
| src | ||
| stubs | ||
| test-fixtures | ||
| .env.example | ||
| .gitignore | ||
| .npmignore | ||
| .releaserc.json | ||
| AGENTS.md | ||
| BUILD.md | ||
| build.mjs | ||
| CHANGELOG.md | ||
| demo.expect | ||
| eslint.config.js | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| smoke-test.mjs | ||
| tsconfig.build.json | ||
| tsconfig.json | ||
| validate-aliases.mjs | ||
| vitest.config.ts | ||
| vitest.e2e.config.ts | ||
| vitest.setup.ts | ||
Continue CLI
The Continue CLI (cn) is a customizable command line coding agent.
Installation
npm i -g @continuedev/cli
Usage
cn
Headless Mode
Headless mode (-p flag) runs without an interactive terminal UI, making it perfect for:
- Scripts and automation
- CI/CD pipelines
- Docker containers
- VSCode/IntelliJ extension integration
- Environments without a TTY
# Basic usage
cn -p "Generate a conventional commit name for the current git changes."
# With piped input
echo "Review this code" | cn -p
# JSON output for scripting
cn -p "Analyze the code" --format json
# Silent mode (strips thinking tags)
cn -p "Write a README" --silent
TTY-less Environments: Headless mode is designed to work in environments without a terminal (TTY), such as when called from VSCode/IntelliJ extensions using terminal commands. The CLI will not attempt to read stdin or initialize the interactive UI when running in headless mode with a supplied prompt.
Session Management
The CLI automatically saves your chat history for each terminal session. You can resume where you left off:
# Resume the last session in this terminal
cn --resume
# List recent sessions and choose one to resume
cn ls
# List sessions in JSON format (for scripting)
cn ls --json
Command Line Options
-p: Run in headless mode (no TUI)--config <path>: Specify agent configuration path--resume: Resume the last session for this terminal<prompt>: Optional prompt to start with
Environment Variables
CONTINUE_CLI_DISABLE_COMMIT_SIGNATURE: Disable adding the Continue commit signature to generated commit messagesFORCE_NO_TTY: Force TTY-less mode, prevents stdin reading (useful for testing and automation)
Commands
cn: Start an interactive chat sessioncn ls: List recent sessions with TUI selector to choose one to resumecn login: Authenticate with Continuecn logout: Sign out of current sessioncn remote: Launch a remote instancecn serve: Start HTTP server mode
Session Listing (cn ls)
Shows recent sessions, limited by screen height to ensure it fits on your terminal.
--json: Output in JSON format for scripting (always shows 10 sessions)
TTY-less Support
The CLI fully supports running in environments without a TTY (terminal):
# From Docker without TTY allocation
docker run --rm my-image cn -p "Generate docs"
# From CI/CD pipeline
cn -p "Review changes" --format json
# From VSCode/IntelliJ extension terminal tool
cn -p "Analyze code" --silent
The CLI automatically detects TTY-less environments and adjusts its behavior:
- Skips stdin reading when a prompt is supplied
- Disables interactive UI components
- Ensures clean stdout/stderr output
For more details, see spec/tty-less-support.md.
