feat: add banner to install Cline for CLI and experimental subagents feature (#6782)

* feat: add banner to install Cline for CLI and experimental subagents feature

* Update snapshots

* Fix copy

* Style fixes

* A few small changes to cli detection, prompting, cleanup

* Prompting tweaks and npm command update

* Prompting, bug fix

* Prompt changes around command syntax

* Command parsing and flag substitution for easier subagent invocation

* Added terminal output slider setting for subagents

* Improved CLI subagent settings injection

* Added max_consecutive_mistakes setting and cli flag

* Terminal line limit added to enchanced terminal, prompting and settings tweaks

* feat: Add OpenTelemetry settings schema and state infrastructure (1/5) (#6826)

* feat: Add OpenTelemetry settings schema and state infrastructure (1/5)

- Add 16 OpenTelemetry configuration fields to Settings interface
- Add 17 OpenTelemetry fields to RemoteConfig schema
- Add state persistence helpers for OpenTelemetry settings
- Foundation for dynamic OpenTelemetry configuration

Part 1 of 5 in the telemetry settings refactor series.

* chore: add changeset for OpenTelemetry schema

* fix: Address PR review feedback for OpenTelemetry settings

- Remove | undefined from 8 OpenTelemetry fields with default values
- Add default values in state-helpers.ts for all non-optional fields
- Add OpenTelemetry field mappings to remote-config/utils.ts
- Add comprehensive test coverage for OpenTelemetry fields in schema.test.ts
- Update changeset terminology from 'Otel' to 'OpenTelemetry'

Addresses feedback from:
- sjf: Remote config transformation and test coverage
- celestial-vault: Type cleanup and default values
- Copilot: Terminology improvement

* Prompting changes

* Fixed system prompt empty sections issue, fixed rebase mistake

* Added telemetry for CLI subagent use in IDEs

* Platform aware banner, fixed settings layout issues

* Post rebase fixes & changes to accomodate new terminal UI

* Cline Icon SVG in ChatRow - WIP

* Fixed outputLine limit issue

* Fixed rebase merge conflict remnant

* Rebase fix

* Cleanup and changes to instructions for new CLI users

* Added CLI documentation link

* Small prompt adjustments

* One more bullet point

* Updated remaining npm install command

* Updated subagent command format for CLI release spec

* Added check to prevent subagents from getting  subagent prompt

* Added subagent slash command

* Apply suggestion from @ellipsis-dev[bot]

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>

* Remove workdir

* Update src/core/prompts/system-prompt/variants/xs/overrides.ts

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>

* removed logging

* Updated expected version output

* Removed checkCliInstallation check in getStateToPostToWebview

* removed more logging

* fix: force subagents to use terminal stuff

---------

Co-authored-by: Kevin Bond <kevin@cline.bot>
Co-authored-by: Daniel Steigman <35793213+NightTrek@users.noreply.github.com>
Co-authored-by: Andrei Eternal <206184+Garoth@users.noreply.github.com>
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
Co-authored-by: canvrno <46584286+canvrno@users.noreply.github.com>
Co-authored-by: Arafatkatze <arafat.da.khan@gmail.com>
This commit is contained in:
authored and GitHub committed 2025-10-15 22:10:08 -07:00
1 parent 78c3664bf3
commit b351a8b92b
39 files changed
+1125 -15

No files matched your search

@@ -0,0 +1,78 @@
/**
* Pattern to match simplified Cline CLI syntax: cline "prompt" or cline 'prompt'
* with optional additional flags after the closing quote
*/
const CLINE_COMMAND_PATTERN = /^cline\s+(['"])(.+?)\1(\s+.*)?$/
/**
* Detects if a command is a Cline CLI subagent command.
*
* Matches the simplified syntax: cline "prompt" or cline 'prompt'
* This allows the system to apply subagent-specific settings like autonomous execution.
*
* @param command - The command string to check
* @returns True if the command is a Cline CLI subagent command, false otherwise
*/
export function isSubagentCommand(command: string): boolean {
// Match simplified syntaxes
// cline "prompt"
// cline 'prompt'
return CLINE_COMMAND_PATTERN.test(command)
}
/**
* Transforms simplified Cline CLI command syntax with subagent settings.
*
* Converts: cline "prompt" or cline 'prompt'
* To: cline "prompt" -s yolo_mode_toggled=true -s max_consecutive_mistakes=6 -F plain -y --oneshot
*
* Preserves additional flags like --workdir:
* cline "prompt" --workdir ./path → cline "prompt" -s ... -F plain -y --oneshot --workdir ./path
*
* This enables autonomous subagent execution with proper CLI flags for automation.
*
* @param command - The command string to potentially transform
* @returns The transformed command if it matches the pattern, otherwise the original command
*/
export function transformClineCommand(command: string): string {
if (!isSubagentCommand(command)) {
return command
}
// Inject subagent-specific command structure and settings
const commandWithSettings = injectSubagentSettings(command)
return commandWithSettings
}
/**
* Injects subagent-specific command structure and settings into Cline CLI commands.
*
* @param command - The Cline CLI command (simplified or full syntax)
* @returns The command with injected flags and settings
*/
function injectSubagentSettings(command: string): string {
// No pre-prompt flags needed - use standard "cline 'prompt'" syntax
const prePromptFlags: string[] = []
// Flags/settings to insert after the prompt
const postPromptFlags = ["-s yolo_mode_toggled=true", "-s max_consecutive_mistakes=6", "-F plain", "-y", "--oneshot"]
const match = command.match(CLINE_COMMAND_PATTERN)
if (match) {
const quote = match[1]
const prompt = match[2]
const additionalFlags = match[3] || ""
const prePromptPart = prePromptFlags.length > 0 ? prePromptFlags.join(" ") + " " : ""
return `cline ${prePromptPart}${quote}${prompt}${quote} ${postPromptFlags.join(" ")}${additionalFlags}`
}
// Already full format: just inject settings after prompt
const parts = command.split(" ")
const promptEndIndex = parts.findIndex((p) => p.endsWith('"') || p.endsWith("'"))
if (promptEndIndex !== -1) {
parts.splice(promptEndIndex + 1, 0, ...postPromptFlags)
}
return parts.join(" ")
}