Compare commits

...

154 Commits

Author SHA1 Message Date
Jose R. Perez c6dd2d5da9 feat: tweaks 2025-12-18 18:47:13 -05:00
Jose R. Perez 0d7c920f46 fix: update CheckmarkControl usage for new checkpoint UI
- Removed apiReqInfo and segmentCost props (not needed in new UI)
- New checkpoint UI has primary action (Restore Files & Task)
- Collapsible More options for granular restore actions
- Checkpoint CTAs now integrated
2025-12-18 14:26:02 -05:00
Jose R. Perez 213daf89ba feat: merge checkpoint-ctas UI improvements from stash
- New checkpoint restore UI with primary/secondary actions
- Restore Files & Task as primary action
- More options toggle for granular restore (Files Only, Task Only)
- Improved visual hierarchy with styled buttons
- Collapsible additional options
2025-12-18 14:24:22 -05:00
Jose R. Perez a80ad01ed8 style: reduce hr opacity to 0.2 in PlanCompletionOutput
- Changed hr opacity from 0.5 to 0.2 for more subtle appearance
- Applies to horizontal rules in Plan Mode markdown content
2025-12-18 14:09:38 -05:00
Jose R. Perez ac62d82e82 style: set PlanCompletionOutput border opacity to 0.5
- Changed borderBottom to rgba(255, 255, 255, 0.5) for 50% opacity
- Provides subtle visual separation in Plan Complete output
2025-12-18 13:51:13 -05:00
Jose R. Perez 1f8e6fec85 feat: use Cline logo instead of Brain icon for thinking states
- Replaced Brain icon from lucide-react with ClineLogoWhite
- ClineLogoWhite matches the logo used on welcome screen
- Used in thinking block (streaming and collapsed states)
- Consistent branding across the UI
2025-12-18 13:36:43 -05:00
Jose R. Perez 55312590bf docs: add documentation for historical tasks rendering bug fix
- Documented the zero-sized element bug that prevented historical tasks from displaying
- Explained root cause: api_req absorption without tool group creation
- Detailed debug process and fix implementation
- Included code examples and testing results
2025-12-18 13:33:36 -05:00
Jose R. Perez cad613991e feat: use CopyButton in PlanCompletionOutput
- Replaced custom copy button with shared CopyButton component
- Consistent copy UI across all completion outputs
2025-12-18 12:36:52 -05:00
Jose R. Perez 7d8e13809b feat: restore PlanCompletionOutput and create ExpandHandle component
- Created ExpandHandle component for reusable expand/collapse UI
- Restored PlanCompletionOutput.tsx from stash for Plan Mode responses
- PlanCompletionOutput now uses ExpandHandle for consistency
- All completion outputs (Task, Plan, Command) now share same expand handle
2025-12-18 12:31:11 -05:00
Jose R. Perez adfea3f341 feat: apply stash changes and clean up debug logs
- Applied stash@{0} with UI improvements to ChatRow
- Kept Brain icon instead of ClineLogoIcon for thinking block
- Kept absorption fix for historical tasks (index < groupedMessages.length - 1)
- Removed all debug console.log statements
- Deleted PlanCompletionOutput.tsx (no longer needed)
- Merged thinking block UI with completion output UI successfully
2025-12-18 12:14:15 -05:00
Jose R. Perez 7b7e61d499 fix: prevent absorption of api_req_started at end of message list
- Fixed issue where historical tasks had api_req absorbed but no tool group created
- Added check to only absorb if index < groupedMessages.length - 1
- This fixes zero-sized element errors for completed/historical tasks
- Includes debug logging to trace message rendering (to be removed later)
2025-12-18 12:04:11 -05:00
Jose R. Perez 2e3d10f29f debug: add console logging to trace zero-sized element issue 2025-12-18 11:08:25 -05:00
Jose R. Perez cecc34e7fa fix: properly merge pr/7975 thinking block with task-completed-ui
- Added missing props: mode, reasoningContent, responseStarted, isRequestInProgress
- Added thinking block components: TypewriterText, BlinkingCursor, ThinkingBlock
- Updated api_req_started rendering to use thinking block instead of ErrorBlockTitle
- Fixed checkpoint_created to include apiReqInfo and segmentCost
- Updated Markdown component to support showCursor prop
- Added clineMessages to useExtensionState destructuring
- Combined thinking block UI from pr/7975 with completion output UI from task-completed-ui
2025-12-18 09:53:49 -05:00
Jose R. Perez 34a173292d Merge jose/task-completed-ui into pr/7975 2025-12-18 09:37:47 -05:00
nickbaumann98 38cb29bceb feat: chat view UI improvements - thinking block, cost badge, scroll fix
- Add streaming ThinkingBlock with instant collapse transition
- Move chevron next to 'Thinking' text for better UX
- Badge-style cost display on checkpoints (segmentCost)
- Fix scroll position jumping when expanding rows
- Add showCursor prop to MarkdownBlock for streaming
- Add retry logic for 'File not found' errors in ReadFileToolHandler
2025-12-18 09:33:12 -05:00
Nick Baumann fa73d60b7a Improve Model Picker Modal UI and provider persistence (#8131)
* Improve Model Picker Modal UI and provider persistence

* Replace fuzzy search with multi-word substring matching in model picker

* feat(model-picker): add thinking slider, provider dropdown portal, and UI improvements

- Add thinking budget slider with min/max constraints
- Render provider dropdown via portal with flip logic for positioning
- Add getProviderInfo helper for settings-only providers
- Use ArrowLeftRight icon for plan/act split toggle
- Close provider list when typing in search
- Fix selection backgrounds with linear-gradient layering
- Improve row heights and icon positioning

* refactor(model-picker): replace Fuse.js with multi-word substring search

---------

Co-authored-by: Saoud Rizwan <7799382+saoudrizwan@users.noreply.github.com>
2025-12-17 21:22:32 -08:00
Robin Newhouse 841bb7f1d7 Disable specifically the Cline extensions in launch.json (#8176)
Replaced the global `--disable-extensions` flag with specific
`--disable-extension` flags for `saoudrizwan.claude-dev` and
`saoudrizwan.claude-dev-nightly`. This allows testing the extension
under development alongside other installed extensions while
preventing conflicts with production or nightly versions of Cline.
2025-12-17 18:01:51 -08:00
Bee f01428884d feat: replace diff edit tools with APPLY_PATCH tool for gpt-5+ native tools (#8167)
* feat: replace diff edit tools with APPLY_PATCH tool for gpt-5+ with native tool calling

Replace FILE_NEW and FILE_EDIT tools with APPLY_PATCH in the native-gpt-5-1 variant configuratiob as that's the format the GPT 5 models are trained on.

* update snapshot

* Update ApplyPatchHandler UI and new line bug
2025-12-17 16:07:47 -08:00
Tomás Barreiro 2ce5548250 [PF-207] Remotely configured OTEL (#8056)
* Remote configured OTEL

* Configure the OpenTelemetryTelemetryProvider for Remote Config and remove it when resetting the confiig

* Address comments

* Fix tests

* Refactor

* Address comments

* Refactor openTelemetryOtlpHeaders and add comment

---------

Co-authored-by: Sarah Fortune <sarah.fortune@gmail.com>
2025-12-17 21:36:35 +01:00
Tomás Barreiro 9f32cd247f fix: Fetch values available in the remote config (#8070)
* Update the StateManager with the new fields

* Add comment

* Add changeset
2025-12-17 21:09:08 +01:00
Max ace48198cc Add slash command auto-complete dropdown to cline cli (#8026) 2025-12-17 11:53:13 -08:00
Tony Loehr 9f0240dfd7 fixed keyboard shortcuts docs (#8116)
* fixed keyboard shortcuts docs

* improved flow of keyboard shortcuts docs

* fixed keyboard shortcuts relevance

* fixed terminal integration keyboard shortcuts relevance
2025-12-17 11:02:55 -08:00
Juan Pablo Flores 5530cfe375 DEVREL-69 docs: update multi-root workspace documentation for clarity and consi… (#8121)
* docs: update multi-root workspace documentation for clarity and consistency

* docs: remove experimental label from multi-root workspace feature

Update documentation to reflect that multi-root workspaces are no
longer considered experimental while still noting the existing
limitations with Cline rules and checkpoints.

* docs: update multi-root workspace examples to clarify workspace config file locations

* docs: add guidance on using VSCode's files.exclude to manage generated folders in multi-root workspaces

---------

Co-authored-by: Tony Loehr <turingxo@gmail.com>
2025-12-17 10:11:22 -08:00
Juan Pablo Flores af4d99e0bc docs: add JSON output section and ClineMessage schema to CLI reference (#8151)
* docs: add JSON output section and ClineMessage schema to CLI reference

* docs: enhance JSON output section with ClineMessage schema details
2025-12-17 10:04:11 -08:00
github-actions[bot] cd011a0e4a v3.45.0 Release Notes (#8159)
Added Gemini 3 Flash Preview model

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-12-17 08:47:05 -08:00
Ara d44184ab03 feat: add Gemini 3 Flash Preview model support (#8160)
- Added Gemini 3 Flash Preview to the recommended models list in the OpenRouter model picker.
- Updated the "What's New" modal to announce the availability of the new model and provide a quick-start button.
2025-12-17 08:39:37 -08:00
Bee 5d96704e92 feat: add new model configuration (#8142)
* feat: add new model configuration

Add support for the new Gemini 3 Flash Preview model with reasoning
capabilities. Updates both vertex and gemini model configurations with
pricing, token limits, and thinking level settings.

* update pricing

---------

Co-authored-by: Arafatkatze <arafat.da.khan@gmail.com>
2025-12-17 08:21:32 -08:00
github-actions[bot] 49812eb332 v3.44.2 Release Notes 2025-12-17 06:47:44 -08:00
Saoud Rizwan 57b72519ae fix(ui): improve model picker and popup modal styling (#8156)
* feat(model-picker): add tooltips to plan/act mode tabs

Show "Plan mode" and "Act mode" tooltips when hovering over the P and A
tabs in the split mode view of the model picker.

* fix(model-picker): remove focus outline from search input

* feat(model-picker): add checkmark to selected model and responsive provider

- Add checkmark icon on the right side of the selected model row
- Hide model provider name on viewports under 280px for better space usage

* fix(model-picker): remove double hover dim on provider row

* fix(model-picker): improve provider list styling consistency

- Reduce vertical padding to match model list rows
- Move checkmark to right side
- Use consistent font size

* fix(modals): add consistent arrow pointers to all popup modals

- Refactor ServersToggleModal to use same fixed positioning as other modals
- Add arrow pointer to ModelPickerModal
- Fix arrow z-index (1001) to seamlessly cover modal border
- Add viewport resize handling to ModelPickerModal for arrow repositioning
- Consistent styling across all three popup modals

* refactor(modals): unify modal styling and structure across components

- Introduce ModalContainer component for consistent styling in ServersToggleModal and ClineRulesToggleModal
- Simplify modal structure by removing unnecessary fragments and applying consistent fixed positioning
- Enhance arrow pointer implementation for better visual alignment across all modals
- Ensure responsive design and maintainability with updated styled components

* fix(modals): align modal widths with chat content and fix z-index

- Reduced modal inset from 15px to 10px to match chat content width
- Lowered modal z-index from 1000 to 49 so tooltips appear on top
- Adjusted modal positioning for consistency across all three modals

* fix(model-picker): update icon usage and tooltip content for thinking and split modes

- Replace Sparkles icon with Brain for extended thinking toggle
- Update tooltip messages to reflect current functionality for thinking and split modes
- Adjust padding in provider list item for better alignment
- Add min-height and box-sizing to search container for improved layout

* fix(model-picker): improve row heights, icons, and selection backgrounds

- Add min-height to search container for consistent row sizing
- Increase provider list padding from 4.5px to 6px
- Swap icon positions and use ArrowLeftRight for plan/act split toggle
- Fix transparent selection background on some themes using linear-gradient

* fix(model-picker): close provider list when typing in search

* fix(modals): adjust modal positioning

* refactor(modals): extract shared PopupModalContainer component

Consolidates duplicated modal container styling into a reusable component.
Removes ~130 lines of redundant code across ModelPickerModal, ServersToggleModal,
and ClineRulesToggleModal.
2025-12-17 06:42:22 -08:00
Saoud Rizwan 1ed4d00a16 fix(ui): improve WhatsNew modal design and responsiveness (#8155)
- Add side spacing for small viewports (calc(100%-2rem) instead of w-full)
- Apply rounded corners at all viewport sizes (not just sm:)
- Remove redundant "NEW" badge (title already says "New in v...")
- Remove redundant "Dismiss" button (X close button is sufficient)
- Reduce excess bottom padding for tighter layout
- Add cursor-pointer to dialog close button for better UX
- Clean up unused imports (PLATFORM_CONFIG, PlatformType, isVscode)
2025-12-17 05:25:33 -08:00
Robin Newhouse c090f5b1a7 fix: skip reasoning for GLM models (#8147)
GLM models output thinking content in text tags when reasoning is enabled, which is not currently supported by the UI. Disabling reasoning for these models ensures cleaner output.
2025-12-17 01:36:23 -08:00
Saoud Rizwan 3c917ec99d fix: disable auto port forwarding in workspace settings (#8149) 2025-12-16 23:19:32 -08:00
Saoud Rizwan b315be397d docs: update release workflow with learnings from first run 2025-12-16 22:15:32 -08:00
github-actions[bot] dc9e7916de v3.44.1 Release Notes 2025-12-16 21:47:26 -08:00
Saoud Rizwan cb9d1e81b8 Add release slash command and reorganize workflow files 2025-12-16 21:42:00 -08:00
Saoud Rizwan eb5a452c9c fix: restore local MCP server connections blocked by enterprise config logic (#8148)
* fix: restore local MCP server connections blocked by enterprise config logic

The enterprise MCP allowlist feature (commit 3409fa744) inadvertently
blocked all local stdio-based MCP servers for regular users.

The bug: the validation logic applied enterprise restrictions to everyone
by default, when it should only apply when enterprise config is present.

* chore: add changeset
2025-12-16 21:05:55 -08:00
Max 6a90294a2a update package-lock.json (#8107) 2025-12-16 19:09:42 -08:00
Bee 2e1334c10a dev: add snapshot tests for native tools content (#8145)
- Add snapshot file for native tools returned by system prompt getter function
- Remove inline comment from test:unit npm script that was breaking the command "npm run test:unit -- --update-snapshots"
2025-12-16 18:10:15 -08:00
mintlify[bot] 18b77ee5e5 DEVREL-59 Add cross-references between hooks and CLI documentation (#8063)
* Update docs/features/hooks/index.mdx

Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>

* Update docs/cline-cli/overview.mdx

Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>

* Update docs/cline-cli/cli-reference.mdx

Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>

* Update docs/cline-cli/cli-reference.mdx

Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>

* Update docs/cline-cli/overview.mdx

Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>

* Update docs/cline-cli/overview.mdx

Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>

---------

Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
2025-12-16 16:58:47 -08:00
Tomás Barreiro 4bf8feecac Remove the remote config auth listener (#8110) 2025-12-16 16:22:01 -08:00
Tomás Barreiro 2f3450f667 Extract Remotely Configured API keys (#8144)
* Extract Remotely Configured API keys

* Add changeset
2025-12-16 16:10:20 -08:00
Robin Newhouse 3e89c28727 feat: implement lazy evaluation for dynamic tool instructions (#8135)
Introduces a "Value or Provider" pattern to tool specifications, allowing the `instruction` field to be either a static string or a function of `SystemPromptContext`. This enables dynamic configuration of tool prompts based on runtime context (e.g., user settings) without hardcoding logic in the prompt builder.

- Updated `ClineToolSpecParameter` to support `string | ((context) => string)`
- Added `resolveInstruction` helper to handle dynamic resolution
- Refactored `PromptBuilder` to resolve instructions using the current context
2025-12-16 15:09:36 -08:00
Ara d065ac7b37 feat: update banner for version 3.44.0 (#8139)
- Update package.json and package-lock.json version from 3.43.1 to 3.44.0
- Add changelog entry for version 3.44.0 with banner update note
2025-12-16 13:59:13 -08:00
github-actions[bot] 5a0a25601a v3.43.1 Release Notes (#8132)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-12-16 13:25:37 -08:00
Ara 48d822a030 fix: update OpenRouter model ID from zai to z-ai for GLM-4.6 (#8138) 2025-12-16 13:16:06 -08:00
Jose R. Perez ce0ebb1a4a feat: copy button fix 2025-12-16 14:00:13 -05:00
github-actions[bot] 417104505c v3.43.0 Release Notes (#8089)
- GLM-4.6
- kat-coder-pro
- Add parsing of env variable patterns to the mcpconfig.json

- TLS Proxy support issues for VSCode
- Add supportsReasoning flag to OpenAI reasoning models
- Fix thinking not available for some models in the OpenAI provider
- Fix invalid signature field issues when switching between Gemini and Anthropic providers
- Extract OpenRouter model filtering into reusable utility and use it in different model pickers
- Fix a11y for auto approve checkbox
- Improve ModelPickerModal provider list layout

- Migrate WhatsNewModal to new shared dialogue component

Co-authored-by: Arafatkatze <arafat.da.khan@gmail.com>
2025-12-16 10:26:36 -08:00
Juan Pablo Flores e21d3ff1bb Update/explain changes (#7977)
* docs: update explanations for Explain Changes feature and command in VS Code

* fix: update Enterprise card link to point to the correct overview page
2025-12-16 09:55:47 -08:00
Jose R. Perez 2865d2ef66 fix: restore api request and thinking 2025-12-16 12:44:26 -05:00
Max da5477f891 added an architecture doc describing cline CLI architecture (#8049)
- this will help the community to onboard to the CLI quicker and me more
open to contributing to it.

Co-authored-by: Max Paulus 🥪 <max@cline.bot>
Co-authored-by: Tony Loehr <turingxo@gmail.com>
2025-12-16 09:30:54 -08:00
Ara 4903dfcb6e feat: add GLM-4.6 and KAT-Coder Pro to free models list (#8128)
- Add Zhipu AI's GLM-4.6 agentic coding model as a free option
- Add KwaiKAT's KAT-Coder Pro model as a free option
- Update filter to preserve kat-coder-pro in Cline provider model list
2025-12-16 09:24:24 -08:00
Ara 37b2f7fbc9 fix: correct IS_STANDALONE env check to use string comparison (#8098)
The IS_STANDALONE environment variable is statically rewritten to
"true" or "false" strings by esbuild. Using a truthy check caused
"false" to be evaluated as true, incorrectly enabling the standalone
proxy configuration.
2025-12-16 09:01:08 -08:00
Bee 11fbe4b21d fix: add supportsReasoning flag to OpenAI reasoning models (#8124) 2025-12-16 06:42:18 -08:00
Bee e0844ac6e2 refactor: migrate WhatsNewModal to new shared dialogue component (#8112)
* feat(webview): migrate WhatsNewModal to new shared component

- Add @radix-ui/react-dialog dependency
- Replace custom modal implementation with Radix Dialog primitives
- Remove commented-out code and unused imports
- Update Storybook stories to include showAnnouncement state
- Add version to mock state for stories

The new Dialog UI component allows us to reuse the component with unified behavior and styles if needed

* replace deprecated VS Code toolkits component with shared components

* Clean up Modal component

* clean up
2025-12-16 06:39:34 -08:00
Bee f28d760675 fix: handle invalid signature fields for Anthropic and Gemini providers (#8122)
- Add dummy thought signature fallback for Gemini API when signature is missing
- Filter out thinking blocks without signatures before sending to Anthropic API
- Update signature field cleaning to apply to non-thinking blocks only
- Remove unused DEFAULT_CACHE_TTL_SECONDS constant

This ensures proper message conversion between providers by using Gemini's
documented dummy signature "skip_thought_signature_validator" when original
signature is unavailable, and prevents invalid thinking blocks from being
sent to Anthropic's API which requires valid signatures.
2025-12-16 06:05:07 -08:00
Ara 8363d090e0 feat(ui): improve ModelPickerModal provider list layout (#8083)
Move provider list inside scrollable container and hide model content
when provider list is expanded. This improves UX by preventing layout
overflow and providing cleaner visual separation between provider
selection and model browsing states.
2025-12-16 00:58:16 -08:00
Zhongying Qiao 3409fa7442 feat: check pre-configured MCP server urls and do not parse unless on the allowed list (#8055)
* feat: add ability for enterprise to disable user from adding MCP servers via remote config

* use a proper type check instead of an as any assertion

* feat: check remote mcp server url against user configured mcp server and do not parse servers not on the allow list if no personal server allowed

* feat: Enforce remote config's local MCP market place settings and filter by allowlist and source (#8068)

* feat: add parse/load enforcement for local mcp market place servers

---------

Co-authored-by: Sarah Fortune <sarah.fortune@gmail.com>
2025-12-16 00:04:46 -08:00
Zhongying Qiao a20685d289 feat: Enable extensions to send os types as query param for banners (#8114)
* feat: enable extensions to send os types as query param for banners

* add tests

* check os type with semantically correct method
2025-12-15 22:34:53 -08:00
Bee 926c5e189e fix: use cursor pointer to model description expand button (#8106)
Added cursor-pointer class to the expand/collapse button in ModelDescriptionMarkdown to provide proper visual feedback on hover.
2025-12-15 12:40:55 -08:00
CandiedUniverse 2a5ca9d312 feat(hooks): Add telemetry for hooks [ENG-999] (#7993)
* feat(hooks): Add telemetry for hooks

feat(hooks): Simplify hooks telemetry implementation and improve safety

feat(hooks): Changes as per Cline's code review

* feat(hooks): Changes as per PR feedback.
2025-12-15 10:06:18 -08:00
Jose R. Perez e19ba8cc33 fix: made last task completed expanded by default 2025-12-15 09:15:00 -05:00
celestial-vault d06717342b add the parsing of env variable patterns to the mcpconfig.json (#8079)
* add the parsing of env variable patterns to the mcpconfig.json

* make sure to expand env variables in the config before validation
2025-12-13 21:50:25 -08:00
Zhongying Qiao c904cfe376 feat: Add ability for enterprise to disable user from adding MCP servers via remote config (#8029)
* feat: add ability for enterprise to disable user from adding MCP servers via remote config

* use a proper type check instead of an as any assertion
2025-12-13 21:34:28 -08:00
lahernandezb 924ca1278c fix: auto approve screen reader a11y (#7901)
* fix: auto approve screen reader a11y

prevoius impl contained 2 tab stops per checkbox and read a generic
"Checkbox" label when focues on the checkbox input. This can be
confusing for a visually impaired person using a screen reader

* chore: changeset

* chore: remove unused imports

---------

Co-authored-by: CandiedUniverse <132302818+candieduniverse@users.noreply.github.com>
2025-12-12 16:39:08 -08:00
github-actions[bot] 2b0c0a659d v3.42.0 Release Notes (#8052)
- Expose `getAvailableSlashCommands` rpc endpoint to UI clients
- Made slash command menu and context menu accessible and screenreader-friendly
- Made expanding/collapsing UI components accessible

- Model identity and routing for devstral-2512 free model
- Extension pricing/UI bug where extension incorrectly shows zero price for devstral-2512

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-12-12 15:16:52 -08:00
Ara f4477e229d fix: update OpenRouter model ID and filter logic for devstral-2512 (#8065)
* fix: update OpenRouter model ID and filter logic for devstral-2512

- Update the model ID for devstral-2512 to include the ':free' suffix
- Modify the filter logic in providerUtils to handle devstral-2512 models
  and ensure they are not excluded when using the Cline provider
- Also ensure the default OpenRouter model is preserved in the filter

* Mistral change

* Mistral change

* Mistral change
2025-12-12 14:25:58 -08:00
Ara 5207d5c68e refactor: extract OpenRouter model filtering into reusable utility (#8064)
- Add filterOpenRouterModelIds function to providerUtils.ts
- Apply consistent filtering logic in ModelPickerModal and OpenRouterModelPicker
- For Cline provider: exclude :free models except Minimax
- For OpenRouter/Vercel: exclude cline/ prefixed models
2025-12-12 12:38:09 -08:00
Mingxuan Zhang 51b535e2d6 accessibility: screen reader support for slash and context menus (#7832)
* accessibility: screen reader support for slash and context menus

* remove unnecessary selection announcement

* changeset run

* chore: clear announcement to avoid interfering with dom queries

* chore: resolve conflict
2025-12-12 11:46:32 -08:00
jgellin-sf 4db61b1b36 chore: make expanding/collapsing ui components accessible (#7828)
* chore: make expanding/collapsing ui components accessible

* chore: changeset

* chore: check isLoading on CodeAccordian key handler

---------

Co-authored-by: CandiedUniverse <132302818+candieduniverse@users.noreply.github.com>
2025-12-12 10:41:32 -08:00
Zhongying Qiao 6baf611322 feat: Make extension use new banner api, keep providers for extension side rules eval (#8022)
* feat: make extension use new banner api, keep providers for extension side banner rules eval
2025-12-12 09:00:27 -08:00
Max 97d635d606 expose a getAvailableSlashCommands rpc endpoint in cline core (#8024) 2025-12-11 16:05:35 -08:00
Ara 8ce476ccaa Refactor Terminal Module (#7966)
* refactor: move terminal integration from core to vscode host

- Relocate terminal-related code from core/integrations to hosts/vscode/terminal
- Move TerminalManager, TerminalProcess, TerminalRegistry, and related utilities
- Update import paths across the codebase to reference new locations
- Remove unused shellIntegrationWarningTracker and shouldShowBackgroundTerminalSuggestion from Controller
- This change better separates VSCode-specific terminal handling from core logic

* Mistral change

* refactor: consolidate terminal types into types.ts

- Move ActiveBackgroundCommand, AskResponse, CommandExecutorCallbacks, CommandExecutorConfig from ICommandExecutor.ts to types.ts
- Move OrchestrationOptions, OrchestrationResult from CommandOrchestrator.ts to types.ts
- Delete ICommandExecutor.ts (all types now in types.ts)
- Update imports in CommandExecutor.ts, CommandOrchestrator.ts, index.ts, and src/core/task/index.ts
- types.ts is now the single source of truth for all terminal-related types

* refactor: consolidate ITerminalProcess into types.ts

- Move ITerminalProcess, TerminalProcessEvents from ITerminalProcess.ts to types.ts
- Delete ITerminalProcess.ts (all types now in types.ts)
- Update imports in VscodeTerminalProcess.ts, StandaloneTerminalProcess.ts
- Update exports in index.ts
- types.ts is now the single source of truth for ALL terminal-related types
2025-12-11 12:11:32 -08:00
Ara bce403476e fix(ui): close WhatsNewModal when selecting model options (#8048)
Close the modal automatically when users click "Try Devstral" or
"Try GPT-5.2" buttons to improve UX flow. Also update Devstral
button text to clarify it's free.
2025-12-11 12:00:46 -08:00
github-actions[bot] ac306c3719 v3.41.0 Release Notes (#7885)
- OpenAI GPT-5.2
- Devstral-2 `devstral-2512` (formerly stealth model "Microwave")
- Improvements to chat modal model picker
- Amazon Nova 2 Lite
- DeepSeek 3.2 to native tool calling allow list
- Responses API support for Codex models in OpenAI provider (requires native tool calling)
- Xmas Special Santa Cline
- Welcome screen UI enhancements

- Initial checkpoint commit now non-blocking for improved responsiveness in large repositories
- Gemini Vertex models erroring when thinking parameters are not supported
- Restrictive file permissions for secrets.json
- Ollama streaming requests not aborting when task is cancelled

- OpenAI provider to centralize temperature configuration and include missing GPT-5 model settings
- OpenAI native handler to use metadata for model capabilities
- Vertex provider to use metadata for model capabilities

Co-authored-by: Arafatkatze <arafat.da.khan@gmail.com>
2025-12-11 11:50:44 -08:00
Ara 1d8a9bf11e Change Stealth model (#8042)
* Mistral change

* Mistral change

* Mistral change
2025-12-11 11:25:31 -08:00
Nick Baumann d811a9d5f3 feat: improve chat modal model picker (#7949)
* feat: add inline model picker modal

* fix: add together to SETTINGS_ONLY_PROVIDERS, remove sapaicore

* Fix bedrock thinking support and add together to dynamic providers

---------

Co-authored-by: Saoud Rizwan <7799382+saoudrizwan@users.noreply.github.com>
2025-12-11 10:53:46 -08:00
Ara 3abeff0379 chore(settings): refresh recommended OpenRouter model labels (#8047)
Update recommended models by switching GPT-5.1 to GPT-5.2 and adjusting "NEW"/"HOT" badges to reflect current recommendations.
2025-12-11 10:38:31 -08:00
Robin Newhouse 2763266424 feat: add GPT-5.2 model support (#8045)
* feat: add GPT-5.2 model support

* Update pricing
2025-12-11 10:30:35 -08:00
Robin Newhouse 0c3dfb6aed Fix parallel tool calling by tracking tool use via call_id (#8036)
Previously, tool results were tracked using the tool name as a key. This caused a critical bug during parallel tool execution: if the same tool (e.g., `read_file`) was called multiple times in a single turn, subsequent calls would overwrite the previous ones in the `toolUseIdMap`. This resulted in missing tool results for all but the last call.

This commit changes the tracking mechanism to use the unique `call_id` provided by the LLM as the key. This ensures that every tool call is tracked independently, regardless of the tool name.

Specific changes:
- Updated `toolUseIdMap` in `Task.ts` to store `call_id -> tool_id` instead of `tool_name -> tool_id`.
- Updated `ToolResultUtils.ts` to retrieve tool IDs using `block.call_id`.
- Removed legacy MCP-specific logic that manually mapped the generic `use_mcp_tool` name to an ID. This is no longer necessary (and would be incorrect) as MCP tools now also use the robust `call_id` tracking, enabling parallel execution for them as well.
2025-12-11 10:17:44 -08:00
Jose R. Perez 0e73cd4c9f feat: fixed glitchy welcome screen issue (#8041) 2025-12-11 07:21:55 -08:00
Robin Newhouse 6bbe5c2499 fix: remove attempt_completion tool from READ_ONLY_TOOLS (#8033)
This was causing tools to be called after task completion.
Removing this terminates the task properly only after other
tool calls are complete.
2025-12-11 00:17:41 -08:00
Saoud Rizwan 00e9d6f523 feat: add experimental parallel tool calling support (#8020)
* feat: add experimental parallel tool calling support

Add a new experimental setting that allows models to call multiple tools
in a single response. This is automatically enabled for GPT-5 models.

- Add enableParallelToolCalling setting (off by default)
- Conditionally enforce didAlreadyUseTool flag based on setting
- Move checkpoint from per-tool to per-response
- Add UI toggle in Feature Settings section

* feat: enable parallel tool calling for GPT-5 in prompts and API (#8028)

* feat: enable parallel tool calling for GPT-5 in prompts and API

Update system prompts for GPT-5 and next-gen variants to instruct
models they may use multiple tools in a single response for independent
operations.

Fix OpenAI API to send parallel_tool_calls: true for GPT-5 models,
which was previously hardcoded to false for all models.

Related: #8020

Changes:
- Updated 5 prompt variant files to allow parallel tool use
- Added enableParallelToolCalls param to getOpenAIToolParams()
- Updated openai-native.ts to enable for GPT-5 model family

* Update system test snapshots for parallel tool calling

* Revert changes to MCP prompts

---------

Co-authored-by: Robin Newhouse <robin@cline.bot>
2025-12-11 00:05:22 -08:00
Toshii 010fd71140 additional prompting for new task command (#8035) 2025-12-10 22:31:01 -08:00
Toshii 17a95f0021 adding xml examples to all newtask calls (#8034) 2025-12-10 19:33:00 -08:00
Jose R. Perez 239f63db4e fix: minor adjustments 2025-12-10 18:02:31 -05:00
Jose R. Perez ce036701f5 Merge branch 'jose/task-completed-ui' of https://github.com/cline/cline into jose/task-completed-ui 2025-12-10 16:03:26 -05:00
Jose R. Perez 686c86306f feature: adjusted embed component styling 2025-12-10 15:59:18 -05:00
Ara 27c9971774 feat(mistral): fix proxy support and add new model definitions (#8018)
* feat: Added Devstral 2 Models

* feat(mistral): fix proxy support and add new model definitions

- Fix HTTPClient fetcher to properly extract URL and options from Request
  objects, enabling proxy support in standalone mode (JetBrains/CLI)
- Add duplex option for body streams required by Node.js/undici
- Rename devstral-small-latest to labs-devstral-small-2512
- Add mistral-large-2512 model (256K context, $0.5/$1.5 pricing)
- Add ministral-14b-2512 model (256K context, $0.2/$0.2 pricing)

---------

Co-authored-by: omercelik <omercelik@users.noreply.github.com>
2025-12-10 12:35:25 -08:00
Robin Newhouse 644d06c487 Fix tool use argument handling in Claude Code provider (#8023)
The Claude Code CLI returns tool arguments as complete objects, but the
StreamResponseHandler expects string chunks for streaming. This caused
tool calls to fail with "missing parameter" errors because the object
was being concatenated with a string, resulting in "[object Object]".

This change stringifies the tool arguments in the Claude Code provider
before yielding them, ensuring they are correctly parsed by the
StreamResponseHandler.
2025-12-10 11:56:49 -08:00
Jose R. Perez 980a1fbd2d feat: enhanced task completed response ui 2025-12-10 14:18:19 -05:00
Tony Loehr 1be314dfed Enterprise docs (#7714)
* enterprise docs

* tested for accuracy

* Reorganize Enterprise docs structure

- Consolidate member management under team-management/
- Unify all configuration under configuration/ with two clear paths:
  - remote-configuration/ for simple cloud-based setup
  - infrastructure-configuration/ for advanced enterprise features
- Create comprehensive overview pages explaining the differences
- Update all internal links to reflect new paths
- Preserve all existing content while eliminating redundancy
- Maintain clear separation between admin and member documentation

* removed trailing backslash

* fix docs.json

* enterprise docs reformat

* monday update

* tidied up managing members section

* fixed deployment guide

* simplify rules

* workflow cleanup

* rules tweak

* Update docs/enterprise-solutions/configuration/overview.mdx

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

* fix other features

* fixed provider docs

* fixed monitoring

* fix providers

* updated cta and rbac

* fix enterprise overview

* enterprise-docs

* hid self-hosted section for now

* addressed format fixed

* docs: restructure monitoring navigation and move telemetry

- Remove unnecessary OpenTelemetry dropdown wrapper in Enterprise navigation
- Move Cline Telemetry from control-other-cline-features to monitoring section
- Update all internal documentation links to new telemetry path
- Simplify Control Other Cline Features section to focus on Yolo Mode only
- Group related monitoring features (overview, telemetry, opentelemetry) together

This creates a more cohesive navigation structure where telemetry-related
features are adjacent and eliminates unnecessary nested dropdowns.

* docs: rename Basic Telemetry to Cline Telemetry and add link

- Rename all instances of 'Basic Telemetry' to 'Cline Telemetry' for consistency
- Add href link to Cline Telemetry card in Monitoring Options section
- Update section headings and subheadings to use 'Cline Telemetry'
- Ensures consistent naming across monitoring documentation

* docs: restructure Enterprise YOLO Mode to focus on administrator controls

- Change title from 'Yolo Mode' to 'YOLO Mode' for consistency
- Add reference link to /features/yolo-mode for general documentation
- Remove duplicate content about basic YOLO Mode functionality
- Focus exclusively on Enterprise administrator configuration and controls
- Add comprehensive policy recommendations by organization size
- Include security implications, monitoring requirements, and compliance considerations
- Provide detailed technical implementation guidance
- Update overview.mdx card description to reflect enterprise focus

* docs: hide self-hosted/infrastructure configuration references

- Remove choosing-your-deployment from Enterprise navigation
- Remove self-hosted references from enterprise-solutions/overview.mdx
- Remove self-hosted comparison and warning from remote-configuration/overview.mdx
- Remove Info boxes linking to infrastructure config from provider pages (AWS, Google, LiteLLM)
- Remove Self-Hosted OpenTelemetry Collector section from opentelemetry.mdx
- Remove self-hosted deployment section from control-other-cline-features/overview.mdx

All self-hosted/infrastructure configuration documentation remains intact but is no longer
navigable or linked from SaaS provider configuration pages. This allows easy restoration
when features become available.

* clarified domain and seat info

* fixed getOpenTabs function

* Update getOpenTabs.ts

* Update package.json

* Revert package-lock files to main

---------

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
Co-authored-by: Juan Pablo Flores <juan@cline.bot>
2025-12-10 11:05:14 -08:00
Saoud Rizwan 91940fbb4a v3.40.2 Release Notes (hotfix)
Hotfix release including:
- 279e371cf: fix: prevent logout on network errors during token refresh (#8021)
2025-12-11 03:37:29 +09:00
Saoud Rizwan 279e371cf5 fix: prevent logout on network errors during token refresh (#8021)
* fix: prevent logout on network errors during token refresh

When network errors occur at startup (e.g., opening laptop while offline),
users were being logged out because the token refresh failed and returned
null to AuthService.

Now on network errors or max retries exceeded, we return the stored auth
data instead of clearing the session. This keeps users logged in with
their existing credentials. If the token is truly invalid, the actual API
request will fail later when the user tries to use Cline, rather than
logging them out preemptively at startup.

* chore: add changeset
2025-12-10 10:33:00 -08:00
Saoud Rizwan 4eda267981 fix(e2e): update auth test to handle Santa Cline logo with multiple paths
The Santa Cline logo has 3 path elements, causing strict mode violation.
Select the container instead of a specific path element.
2025-12-11 03:21:26 +09:00
Robin Newhouse 3441363805 fix: only send thinking params to Gemini models that support them (#8014) 2025-12-09 21:37:53 -08:00
Robin Newhouse 5389be991e Refactor Vertex provider to use metadata for model capabilities (#7999)
This change removes hardcoded switch statements in VertexHandler and moves model-specific configurations (like reasoning support and prompt caching) into the centralized model metadata in src/shared/api.ts.

Benefits:
- Decouples handler logic from specific model IDs
- Centralizes model capabilities for easier maintenance
- Simplifies adding future Vertex models
- Improves type safety

Related: ENG-1408, ENG-1385
2025-12-09 15:36:02 -08:00
Sarah Fortune 41fd610203 Don't enable gRPC debug logs in the cli (#8013)
If you need this for development you can enable them locally, they shouldn't be turned on in the released version; they are spammy af.
2025-12-09 15:10:37 -08:00
Jose R. Perez e1e7470fdd feature: xmas special santa cline (#8010)
* feat: hide whats new modal header image for now

* feature: change set

* feat: xmas special santa cline

* fix: minor change to actual svg

* Fix colors

---------

Co-authored-by: Arafatkatze <arafat.da.khan@gmail.com>
2025-12-09 15:04:11 -08:00
Zhongying Qiao 2f0e0ee56d feat: configure Litellm API key with remote config (#7937)
* feat: configure Litellm API key with remote config
2025-12-09 14:56:23 -08:00
Robin Newhouse 7f89ebf276 fix: make initial checkpoint commit non-blocking but block unsafe tools [#AI-26] (#8008)
* fix: make initial checkpoint commit non-blocking while preventing tool execution races

- Captures the initial checkpoint commit promise in the Task class
- Ensures executeTool waits for the initial commit to complete before running any tools
- Resolves race condition where tools could modify files before the initial state was fully captured

* feat: allow read-only tools to bypass initial checkpoint block

- Defines READ_ONLY_TOOLS allowlist in shared/tools.ts
- Updates Task executor to check tool name against whitelist
- Allows exploration tools (list_files, read_file, browser_action, etc.) to run in parallel with initial commit
- Maintains blocking for state-modifying tools (write_to_file) to ensure data integrity
2025-12-09 14:43:30 -08:00
Jose R. Perez 99ed1b7e86 feat: hide whats new modal header image for now (#8009)
* feat: hide whats new modal header image for now

* feature: change set
2025-12-09 13:49:42 -08:00
Ara 45c9fcf575 Removing unused file in Dify Provider (#7968) 2025-12-09 13:41:42 -08:00
Stewi 4f73f4460b fix(docs): correct broken signup link in installing-cline docs
Fixed a broken link in installing-cline.mdx: replaced https://app.cline.bot/signup with https://authkit.cline.bot/ for account creation.
2025-12-09 12:56:30 -08:00
Ara fb872fd316 feat(banners): add dismiss functionality to banner carousel (#7982)
* feat(banners): add dismiss functionality to banner carousel

- Add onDismiss callback to BannerData interface
- Implement dismiss button (X icon) in BannerCarousel component
- Add onDismiss handlers for info, model, and CLI banners
- Update banner version in state when user dismisses a banner
- Fix carousel index bounds handling when banners are removed
- Refactor carousel handlers with useCallback for better performance

* Fix imports

* feat(banners): show dismiss X only on last card in carousel
2025-12-09 12:46:30 -08:00
Tomás Barreiro 5292242a8e Add loaders to login buttons (#7945)
* Add loaders to login buttons

* Disable the button when loading

* Add changeset

* Remove log

* Fix tests
2025-12-09 20:41:56 +01:00
Jose R. Perez 743191985a feat: enhanced task completed response ui 2025-12-09 14:25:10 -05:00
CandiedUniverse 78b8aed50f feat(hooks): Implement PreCompact hook [ENG-1005] (#7513)
* feat(hooks): Implement PreCompact hook

feat(hooks): Continuing implementation of PreCompact hook

feat(hooks): PreCompact supports contextModification

Fixes as per Cline code reviewing the PreCompact implementation

feat(hooks): Tweaking the PreCompact hook behavior while testing

feat(hooks): Implement PreCompact hook in handleContextWindowExceededError code path

feat(hooks): Implement conversation history temp file in task directory for PreCompact to access

feat(hooks): Implement context window temp file in task history directory for PreCompact to access

feat(hooks): Refactor complex function into helpers

* feat(hooks): Improvements from Cline code reviewing the change set

feat(hooks): Refactor duplicate logic into common utility function

feat(hooks): Improve compaction strategy naming

feat(hooks): Deduplicate a small piece of logic

feat(hooks): DRY for getNextTruncationRange()

feat(hooks): Fix contextModification for PreCompact hook

feat(hooks): Improvements as per Cline's code review feedback

feat(hooks): Improving code quality/reduce complexity

feat(hooks): Further code improvements as per Cline code reviewing

* feat(hooks): Changes as per PR feedback
2025-12-09 11:20:29 -08:00
Tomás Barreiro d01f7b4618 Log session information (#7944)
* Prevent multiple simultaneos refreshes when retrieving auth info

* refactor

* Track logout events

* Add changeset

* Persist the startedAt date

* Fix bug

* Use snake case for event properties

* Log failed refresh request information
2025-12-09 20:10:20 +01:00
CandiedUniverse dec215cd9c feat(hooks): Enable hooks in the CLI [ENG-1375] (#7948)
* feat(cli): Add hooks_enabled support to CLI settings

- Add hooks_enabled field to Settings proto message (field 134)
- Add hooks_enabled parsing to CLI settings parser
- Enables users to toggle hooks via -s hooks_enabled=true/false flag

Fixes missing CLI support for hooks that was available in the VSCode extension

* feat(hooks): Enable hooks in the CLI

* Add include back in after resolving merge conflict

* feat(hooks): Changes as per human code review feedback.

---------

Co-authored-by: NightTrek <Daniels@dual4t.com>
2025-12-09 10:32:18 -08:00
Toshii 8ce7e132d2 add feature flag check to tool handlers (#7997) 2025-12-08 19:48:50 -08:00
Toshii 6ab008b204 adding search models to usage tables in ui (#7996) 2025-12-08 19:18:31 -08:00
Sarah Fortune 769523998d Add the cline distribution type to the telemetry (#7940)
* Add the cline distribution type to the telemetry

In the telemetry we currently have the IDE name, but because there are so many variants of VSCode and JetBrains, it's not easy to group them by VSCode extension or JetBrains plugin. Add this field to the telemetry.

* update unit tests

* Update src/services/telemetry/TelemetryService.ts

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

* Update src/services/telemetry/TelemetryService.ts

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

* Update unit tests

---------

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
2025-12-08 17:14:54 -08:00
Max 64a6bcc39b show mcp messages in cli output (#7989)
Co-authored-by: Max Paulus 🥪 <max@cline.bot>
2025-12-08 13:20:20 -08:00
AJ Juaire 19ceafd4a4 Add Amazon Nova 2 Lite support. (#7987)
https://github.com/cline/cline/discussions/7855
2025-12-08 11:34:24 -08:00
Robin Newhouse 4b5218b3b8 Refactor OpenAI native handler to use metadata for model capabilities (#7947)
This change removes hardcoded switch statements in OpenAiNativeHandler and moves model-specific configurations (like streaming support, system role, and tools support) into the centralized model metadata in src/shared/api.ts.

Benefits:
- Decouples handler logic from specific model IDs
- Centralizes model capabilities for easier maintenance
- Simplifies adding future OpenAI models
- Improves type safety with updated getModel() signature

Related: #7920
2025-12-08 11:07:10 -08:00
Toshii b68d716675 in tests websearch shows up in cline provider prompt (#7976) 2025-12-08 00:00:19 -08:00
Toshii f820c6d00a adding handler for websearch in cli (#7570) 2025-12-08 00:00:05 -08:00
Toshii 1fcbbaa9d0 adding websearch and integrating new handler (#7514)
* implementing prompt injection for web_search and associated web fetch handler

* remove printing of the ms took

* ui showing query user is searching for

* updating the fields we pass in api request

* updating text for search tool
2025-12-07 23:10:44 -08:00
Toshii 4005df6eae updating webfetch and integrating new handler (#7509)
* updating system prompt for webfetch and integrating new handler

* updating tests to match new webfetch tool
2025-12-07 22:37:48 -08:00
Toshii 0e3cdab82b adding webtools to the features menu (#7566)
* adding webtools to the features menu

* telemetry for toggling web tools

* adding feature flag for webtools
2025-12-07 22:34:43 -08:00
Sarah Fortune ada6b0c955 Move terminal impls into the correct package. (#7970)
Move VSCode terminal impls into the src/hosts/vscode package. The VSCode specific code needs to be contained in this directory.
The `src/shared` package is for things shared with the extension and the _webview_; everything in src/ that's _not_ under `src/hosts` is shared with VSCode, JB, CLI implicitly.

ref CLIENTS-34
2025-12-07 20:35:00 -08:00
Jose R. Perez 921dd2ec8c feat: welcome screen ui enhancements (#7878)
* feat: Announcement Cards, Recent Tasks Refresh, Whats new modal

* feat: adjustments to welcome modal functionality

* chore: add changeset for welcome ui enhancements

* refactor: replace inline styles with Tailwind classes where appropriate

* fix: removed close mechanisim for cards fix modal linking issue

* feat: suggested changes

* fix: arias for accessibility

* fix: test modal fix

* feat: e2e test fix

* update e2e tests with new welcome ui

* feat: small arias change

---------

Co-authored-by: abeatrix <beatrix@cline.bot>
2025-12-07 20:32:42 -08:00
Richard 4b212994a8 fix(security): set restrictive file permissions for secrets.json (#7782) 2025-12-07 19:23:29 -08:00
CandiedUniverse 3fe3c866ea fix(hooks): Want TaskCancel to get triggered properly (#7952) 2025-12-07 06:59:19 -08:00
Ara e9136f60cc feat(terminal): Move Standalone terminal Code to Typescript (#7927)
* feat(terminal): add shared terminal types and interfaces

Add shared terminal module with types and interfaces that enable
terminal management across VSCode, CLI, and JetBrains environments.

- Define ITerminal, ITerminalManager, and TerminalInfo interfaces
- Add TerminalProcessResultPromise for async command execution
- Include StandaloneTerminalOptions for non-VSCode environments
- Prepare module structure for standalone implementations

* feat(terminal): export standalone terminal implementations

Enable exports for standalone terminal classes that were previously
commented out as placeholders:
- StandaloneTerminal
- StandaloneTerminalManager
- StandaloneTerminalProcess
- StandaloneTerminalRegistry

These implementations are now ready for use outside the terminal module.

* fix: resolve TerminalInfo type incompatibility in settings update

- Remove unused TerminalInfo import from both updateSettings files
- Use `as any` cast to handle type mismatch between VSCode and standalone TerminalInfo
- Replace busyTerminals array with busyTerminalsCount to avoid type issues
- Add null-safe access when getting busy terminals length

* feat: import StandaloneTerminalManager from bundled cline-core

Replace standalone enhanced-terminal.js with import from the bundled
TypeScript version in cline-core.js. This consolidates terminal
management code and removes the need to separately include the
runtime file in the VS Code extension package.

- Re-export StandaloneTerminalManager from cline-core.ts
- Update vscode-impls.js to import from cline-core.js
- Remove .vscodeignore exception for enhanced-terminal.js

* feat: simplify standalone terminal manager initialization

Replace global injection pattern with environment variable detection
for determining terminal execution mode. The Task class now directly
instantiates StandaloneTerminalManager when IS_STANDALONE=true instead
of relying on a globally injected instance.

- Remove StandaloneTerminalManager re-export from cline-core.ts
- Simplify vscode-impls.js createTerminal to return stub object
- Use IS_STANDALONE env var for terminal manager selection in Task
- Remove global.standaloneTerminalManager injection pattern

* Fix Standalone build

* Fix Standalone build

* fix: use subagentTerminalOutputLineLimit in StandaloneTerminalManager.processOutput

Match the VSCode TerminalManager logic to properly use subagentTerminalOutputLineLimit (2000) for subagent commands instead of always falling back to terminalOutputLineLimit (500).

* feat: add TerminalManager to HostProvider for dependency injection

- Add TerminalManagerCreator type and createTerminalManager to HostProvider
- Extract ITerminalManager interface to shared/terminal/types for abstraction
- Refactor TerminalManager to implement ITerminalManager interface
- Create StandaloneTerminalManager for non-VSCode environments
- Update TerminalRegistry to use ITerminalManager via HostProvider
- Enable terminal management to work across different host environments

* feat: refactor terminal manager to use ITerminalManager interface

- Replace concrete TerminalManager/StandaloneTerminalManager types with ITerminalManager interface
- Use HostProvider.createTerminalManager() for host-agnostic terminal creation
- Simplify terminal execution mode logic in Task constructor
- Add dynamic imports for StandaloneTerminalManager when backgroundExec mode is used
- Improve logging for terminal manager selection
2025-12-07 05:10:25 -08:00
Bee 34bb95e04e refactor: require native tool call for Responses API (#7953)
Add validation to ensure native tool calling is enabled when using
OpenAI Responses API format. Previously, the code would silently fall
back to completion stream when tools were not provided, which could
lead to unexpected behavior.

- Add explicit error when tools are missing for Responses API format
- Update tools parameter type to non-optional in createResponseStream
2025-12-06 05:03:29 -08:00
Saoud Rizwan 7b65db55f1 docs: update hotfix workflow to copy Slack message instead of tag 2025-12-05 16:13:37 -08:00
Saoud Rizwan 07ebc2e4bd docs: improve hotfix release workflow
- Split shell commands to avoid parsing issues with parentheses in author names
- Clarify that hotfixes always use patch version bumps
- Add (hotfix) suffix to release notes commit message format
- Skip npm install step (automation handles lockfile)
- Add pbcopy step to copy tag to clipboard for GitHub Actions
- Add direct link to publish workflow
2025-12-05 15:58:58 -08:00
Saoud Rizwan 0193179597 v3.40.1 Release Notes
Hotfix release including:
- 4df486fa5: fix cost calculation for Anthropic API requests (#7943)
2025-12-05 15:49:42 -08:00
Saoud Rizwan 20c0783c97 feat: add hotfix release workflow documentation
Add a workflow for creating hotfix releases by cherry-picking commits
from main onto release tags. Includes steps for selecting commits,
creating release notes, version bumping, and tagging.
2025-12-05 15:43:31 -08:00
Saoud Rizwan 4df486fa5b fix: restore cost calculation for Anthropic API requests (#7943)
The taskMetrics.totalCost was incorrectly initialized to 0 instead of
undefined in commit 09692d7d3. This broke cost display for providers
like Anthropic that don't return totalCost in their usage chunks.

When totalCost is 0, the fallback to calculateApiCostAnthropic() in
updateApiReqMsg doesn't trigger because the nullish coalescing operator
(??) only falls back for null/undefined, not 0.

By initializing totalCost to undefined:
- Providers that return totalCost (like OpenRouter) use that value
- Providers that don't (like Anthropic) fall back to calculating cost
  from token counts and model pricing info
2025-12-05 13:01:02 -08:00
Zhongying Qiao 5fc6d4e9e3 feat: remote config - add vertex provider (#7913) 2025-12-05 12:58:50 -08:00
Saoud Rizwan 00d3bd8316 refactor(ui): move model capabilities to Advanced section and fix layout
- Move Images, Browser, Prompt Caching badges into collapsible Advanced section
- Use consistent row styling (label: value) for capabilities
- Fix InfoRow vertical spacing when items wrap (column-gap: 16px, row-gap: 4px)
- Add bottom padding to model picker popup for breathing room
- Remove unused Tooltip imports and badge styled components
2025-12-05 12:50:31 -08:00
Robin Newhouse 81d4ff947f Refactor openai-native.ts switch statement to use model metadata (#7920)
* refactor: Move OpenAI temperature to model metadata

- Added `temperature` field to `openAiNativeModels` in `api.ts`.

- Updated `OpenAiNativeHandler` to use `model.info.temperature` instead of hardcoded values in switch cases.

- This allows for centralized configuration of model temperatures.

* refactor: Consolidate OpenAI native streaming logic

- Simplified `createCompletionStream` in `OpenAiNativeHandler` by consolidating duplicated logic for streaming models (`gpt-5`, `o3`, `o4`).

- Introduced `systemRole`, `includeReasoning`, and `includeTools` flags to handle model-specific configurations.

- Preserved distinct handling for non-streaming `o1` models.
2025-12-05 10:48:23 -08:00
Max bcb368d097 display completion messages in processStateUpdate (#7939)
CLINE-84, ENG-1392

Co-authored-by: Max Paulus 🥪 <max@cline.bot>
2025-12-05 10:36:57 -08:00
Alex Ker c1ded819bb new model in static list (#7934) 2025-12-05 09:17:20 -08:00
CandiedUniverse de02befb2f fix(hooks): Doc said the wrong directory for global hooks dir (#7933) 2025-12-05 09:02:54 -08:00
Zhongying Qiao 6617901078 feat: remove mcp marketplace enable setting from cli (#7911)
* feat: remove mcp marketplace enable setting from cli
2025-12-05 08:41:10 -08:00
celestial-vault 31c7176de1 cleanup taskhistory recovery (#7889)
* cleanup recovering by removing unnecessary recursion; rename parameter for reconstructTaskHistory for clarity, and add stdout logging in error blocks

* Don't return empty array on IO error. Instead, continue throwing error because this is indeed an error and not something that can be corrected by data reconciliation.
2025-12-05 10:32:57 -06:00
Bee 3c97c8dc19 dev: add stories for all UI components (#7905)
* dev: add stories for all UI components

* unify styles

* update
2025-12-05 04:03:47 -08:00
Nick Baumann 187e40d2da Redesign model settings page with compact info and Advanced section (#7862)
* Redesign model settings page with compact info and Advanced section

* Fix cache pricing precision to show decimals when needed

* Address PR feedback: fix cache pricing precision, remove duplicate billing link, unify provider routing
2025-12-05 03:26:46 -08:00
Andrei Eternal 8c38b1ccf8 JB Integration Workflow: use pull_request_target to support remote remote PRs (#7917)
* JB Integration Workflow: use pull_request_target to support remote repo PRs

* also sanitize the branch name and title really hard to avoid json injections

* ok lets be extra double paranoid with the sanitization

* ok lets be even more extra safer by also not logging the head_ref

---------

Co-authored-by: Andrei Edell <andrei@nugbase.com>
2025-12-04 21:22:55 -08:00
Toshii 4947a745c2 removing unused legacy context manager (#7924) 2025-12-04 20:54:45 -08:00
Toshii 9e8c6df6b2 context rewriting test cases (#7923)
* alter equality sign

* adding tests for the new file read search
2025-12-04 20:54:36 -08:00
Bee 6586195b2d docs: add contributing guide for model family [CLIENTS-32] (#7916)
* docs: add contributing guide for model family

Add detailed CONTRIBUTING.md documentation for system prompt configuration
and model family management. The guide covers:

- Architecture overview with key concepts (model families, variants, matchers)
- Glossary of terms (native/XML tool calling, API formats, components)
- Step-by-step instructions for creating new model families
- Configuration guides for system prompts and tool calling
- API request/response shape configuration
- Testing procedures and best practices

This documentation helps contributors understand the fallback system design
principle (GENERIC fallback) and provides practical examples for extending
support to new model providers and families.

* fix typo

---------

Co-authored-by: Robin Newhouse <robin@cline.bot>
2025-12-04 14:35:07 -08:00
Toshii 1aa944eff7 fix context rewriting for native tool call format (#7882)
* enable handling of tool_result blocks to fix file read search for context rewriting

* updating loop over inner indices 0-2 inclusive

* spelling
2025-12-04 14:27:14 -08:00
Robin Newhouse 8e7b1c6884 fix(ollama): abort streaming requests when task is cancelled (#7907)
Previously, clicking cancel would break out of the stream loop but
leave the HTTP connection open. Ollama would continue generating in
the background, keeping the GPU busy and blocking subsequent requests
until completion.

Now we call the Ollama SDK's abort() method to immediately close the
connection.

Fixes #7468
2025-12-04 13:56:25 -08:00
Bee ee154826b6 feat: add OpenAI Response API support and Codex model compatibility [CLIENTS-24] (#7912)
* feat: add OpenAI Response API support and Codex model compatibility

- Add ApiFormat enum to proto definitions with OPENAI_RESPONSES format
- Update model info messages to include api_format field across providers
- Refactor OpenAI native handler to conditionally use Response API based on model's api_format
- Add Codex model support in GPT-5 and GPT-5-1 prompt variants with appropriate exclusions
- Remove hardcoded useResponseFormat parameter in favor of model-driven API selection

This enables ChatGPT Codex models to use the Response API format when tools are provided, while maintaining backward compatibility with existing chat completion models.

* add comments

* tabs
2025-12-04 13:23:48 -08:00
Saoud Rizwan 852f307268 Revert "feat(prompt): add command output limiting guidance to capabilities (#…" (#7909)
This reverts commit 7a523fbaf6.
2025-12-04 11:38:10 -08:00
Bee 4e3fe004f4 feat: enable native tool calling for deepseek 3.2 [AI-27] (#7877)
* feat: enable native tool calling for deepseek 3.2

Add isDeepSeek32ModelFamily() function to identify DeepSeek 3.2 models and integrate it into the isNextGenModelFamily() check. This classifies DeepSeek 3.2 as a next-generation model family, enabling native tool calling support.

* typo
2025-12-04 09:59:27 -08:00
Zhongying Qiao 2b63eed85e feat: remove mcp enable setting for individual users (#7879) 2025-12-04 09:36:44 -08:00
Tomás Barreiro 2ffdc50ea1 Prevent simultaneous refreshes when restoring auth info (#7835)
* Prevent multiple simultaneos refreshes when retrieving auth info

* Add changeset

* refactor
2025-12-04 14:45:10 +01:00
celestial-vault 74808431e5 add litellm provider to remote config in the extension (#7775) 2025-12-04 03:01:05 -08:00
Saoud Rizwan 7a523fbaf6 feat(prompt): add command output limiting guidance to capabilities (#7884)
* feat(prompt): add command output limiting guidance to capabilities

Add guidance in the system prompt instructing the model to proactively
limit command output when anticipating large results. Includes examples
like piping to grep/head/tail or using more specific arguments.

Idea by @AraTheBoss

* chore: add changeset

* refactor: move command output limiting guidance to execute_command tool

Move the guidance from capabilities.ts to execute_command.ts where it
belongs. Extract into a shared COMMAND_BEST_PRACTICES constant to avoid
duplication across model variants (GENERIC, NATIVE_GPT_5, NATIVE_NEXT_GEN,
GEMINI_3).
2025-12-03 21:06:07 -08:00
319 changed files with 24236 additions and 5050 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"claude-dev": minor
---
show slash command autocompletion in the cli
+5
View File
@@ -0,0 +1,5 @@
---
"claude-dev": patch
---
fix: Fetch remote config values from the cache
+5
View File
@@ -0,0 +1,5 @@
---
"claude-dev": patch
---
enhanced compact task complete ui
+5
View File
@@ -0,0 +1,5 @@
---
"claude-dev": patch
---
Replace current diff edit tools with Apply Patch tool for GPT-5+ models
+1
View File
@@ -0,0 +1 @@
../../.clinerules/workflows/hotfix-release.md
+1
View File
@@ -0,0 +1 @@
../../.clinerules/workflows/release.md
+194
View File
@@ -0,0 +1,194 @@
# Hotfix Release
Create a hotfix release by cherry-picking specific commits from main onto the latest release tag.
## Overview
This workflow helps you:
1. Select specific commits from main to include in a hotfix
2. Create a release notes commit on main (changelog + version bump)
3. Cherry-pick everything onto the latest release tag
4. Tag and push the new release
## Step 1: Setup and Gather Information
First, ensure we're on main and up to date:
```bash
git checkout main && git pull origin main
```
Get the latest release tag:
```bash
git tag --sort=-v:refname | head -1
```
## Step 2: Present Commits Since Last Release
Show all commits on main since the last release tag:
```bash
LAST_TAG=$(git tag --sort=-v:refname | head -1)
git log ${LAST_TAG}..HEAD --oneline --format="%h %s (%an)"
```
Also get the commit messages already on the tag (to identify previously cherry-picked commits). Note: Run these as separate commands to avoid shell parsing issues with parentheses in author names:
```bash
LAST_TAG=$(git tag --sort=-v:refname | head -1)
PREV_TAG=$(git tag --sort=-v:refname | head -2 | tail -1)
```
```bash
git log $PREV_TAG..$LAST_TAG --oneline --format="%s"
```
**Present the list** to the user in a numbered format with commit hash, subject, and author. For any commits whose subject line already appears in the tag's history (previously cherry-picked in an earlier hotfix) or are "Release Notes" commits, add `(already in previous hotfix)` or `(release notes - skip)` after them so the user knows to skip those.
Ask which commits to include in the hotfix.
Use the ask_followup_question tool to let the user specify which commits they want (by number or hash).
## Step 3: Analyze Selected Commits
For each selected commit:
1. Get the full commit message: `git show --no-patch --format="%B" <hash>`
2. Get the diff to understand the change: `git show <hash> --stat`
3. Find the associated PR if any: `gh pr list --search "<hash>" --state merged --json number,title --jq '.[0]'`
Build a mental model of what these changes do for the changelog.
## Step 4: Determine New Version Number
Parse the current version from package.json and the last tag:
```bash
LAST_TAG=$(git tag --sort=-v:refname | head -1)
echo "Last release: $LAST_TAG"
cat package.json | grep '"version"'
```
Hotfixes always increment the patch version (e.g., 3.40.0 -> 3.40.1, or 3.40.1 -> 3.40.2).
**Ask the user to confirm the new version number.**
## Step 5: Create Release Notes Commit on Main
On the main branch, create a commit that updates:
1. **CHANGELOG.md** - Add a new section for the hotfix version at the top:
```markdown
## [3.40.1]
- Description of fix 1
- Description of fix 2
```
Write clear, user-friendly descriptions based on your analysis of the commits.
2. **package.json** - Update the version field to the new version
3. **Delete changesets** for the commits being included in the hotfix. This prevents the changeset bot from including duplicate entries in the next regular release.
Find and delete the changeset files associated with the selected commits:
```bash
ls .changeset/
```
Each changeset file in `.changeset/` corresponds to a PR. Read them to identify which ones belong to the commits you're hotfixing, then delete those files.
**Skip running `npm run install:all`** - the automation handles outdated lockfiles.
Commit with message format: `v{VERSION} Release Notes (hotfix)`
In the commit body, mention:
- This is for a hotfix release
- List the cherry-picked commits that will be included
```bash
git add CHANGELOG.md package.json .changeset/
git commit -m "v3.40.1 Release Notes (hotfix)
Hotfix release including:
- <commit1-hash>: <description>
- <commit2-hash>: <description>
"
```
Push to main:
```bash
git push origin main
```
## Step 6: Build the Hotfix on the Tag
Checkout the last release tag (detached HEAD):
```bash
LAST_TAG=$(git tag --sort=-v:refname | head -1)
git checkout $LAST_TAG
```
Cherry-pick the selected commits in order:
```bash
git cherry-pick <commit1-hash>
git cherry-pick <commit2-hash>
# ... etc
```
Finally, cherry-pick the release notes commit you just pushed to main:
```bash
# Get the hash of the release notes commit (should be HEAD of main)
RELEASE_NOTES_COMMIT=$(git rev-parse main)
git cherry-pick $RELEASE_NOTES_COMMIT
```
## Step 7: Tag and Push
After all cherry-picks are applied successfully:
```bash
# Tag the new release
git tag v{VERSION}
# Push the tag to remote
git push origin v{VERSION}
```
## Step 8: Return to Main and Summary
Return to main branch:
```bash
git checkout main
```
**Copy a Slack announcement message to clipboard** with the version and PR links for each included fix:
```
VS Code Hotfix v{VERSION} Published
- Description of fix 1 https://github.com/cline/cline/pull/{PR_NUMBER}
- Description of fix 2 https://github.com/cline/cline/pull/{PR_NUMBER}
```
Present a final summary:
- New version: v{VERSION}
- Tag pushed: yes
- Commits included: (list them)
- Slack message copied to clipboard: yes
Remind the user to:
1. Manually trigger the publish release GitHub Action at: https://github.com/cline/cline/actions/workflows/publish.yml (paste `v{VERSION}` as the tag)
2. Post the Slack message to announce the hotfix
## Important Notes
- This workflow does NOT create a release branch - only tags
- The release notes commit goes to main first, then gets cherry-picked to the tag
- This keeps main's history accurate while allowing hotfix releases from tags
- If cherry-pick conflicts occur, resolve them before continuing
+232
View File
@@ -0,0 +1,232 @@
# Release
Prepare and publish a release from the open changeset PR.
## Overview
This workflow helps you:
1. Find and checkout the open changeset PR
2. Clean up the changelog (fix version format, wordsmith entries)
3. Push changes back to the PR branch
4. Merge with proper commit message format
5. Tag and push the release (after verifying the commit)
6. Trigger the publish workflow
7. Update GitHub release notes
8. Provide final summary with Slack announcement
## Step 1: Find the Changeset PR
Look for the open changeset PR:
```bash
gh pr list --search "Changeset version bump" --state open --json number,title,headRefName,url
```
If no PR is found, inform the user there's no changeset PR ready. They may need to:
- Merge PRs with changesets to main first
- Manually trigger the Changeset Converter workflow at: https://github.com/cline/cline/actions/workflows/changeset-converter.yml
## Step 2: Gather PR Information
Get the PR details:
```bash
PR_NUMBER=<number from step 1>
gh pr view $PR_NUMBER --json body,files,headRefName
```
Checkout the PR branch:
```bash
git fetch origin changeset-release/main
git checkout changeset-release/main
```
If the branch has diverged from remote, reset to the remote version:
```bash
git reset --hard origin/changeset-release/main
```
## Step 3: Analyze the Changes
Read the current CHANGELOG.md to see what the automation generated:
```bash
head -50 CHANGELOG.md
```
Get the version from package.json:
```bash
cat package.json | grep '"version"'
```
**Present to the user:**
- The version number that will be released
- The raw changelog entries from the changeset PR
- Whether this is a patch, minor, or major release
## Step 4: Clean Up the Changelog
The changelog needs these fixes:
1. **Add brackets to version number**: Change `## 3.44.1` to `## [3.44.1]`
2. **No category headers**: Don't use `### Added`, `### Fixed`, etc. Just a flat list of bullet points.
3. **Order entries from most important to least important**:
- Lead with major new features or significant fixes users care about
- End with minor fixes or internal changes
4. **Write user-friendly descriptions**:
- This is for end users, not developers—explain what changed in plain language
- Remove commit hashes from the beginning of lines (the automation adds these)
- Look at the actual commit diffs (`git show <hash>`) and PRs to understand what changed
- Write colorful descriptions that explain the value and impact, not just technical details
- Consolidate related changes into single entries when appropriate
**Ask the user** to review the proposed changelog changes before applying them. Show them:
- Current (raw) changelog section
- Proposed (cleaned) changelog section
Once approved, apply the changes to CHANGELOG.md.
## Step 5: Commit and Push Changes
After making changelog edits:
```bash
git add CHANGELOG.md
git commit -m "Clean up changelog formatting"
git push origin changeset-release/main
```
## Step 6: Merge the PR
**Ask the user to confirm** they're ready to merge.
Merge the PR with the proper commit message format:
```bash
VERSION=<version from package.json>
gh pr merge $PR_NUMBER --squash --subject "v${VERSION} Release Notes" --body ""
```
**If merge is blocked by branch protection:**
- Users with admin privileges can add the `--admin` flag to bypass
- Users without admin privileges need to get the PR approved through normal review first before merging
## Step 7: Tag the Release
After the merge completes, checkout main and pull:
```bash
git checkout main
git pull origin main
```
**IMPORTANT: Verify the latest commit is the release commit before tagging:**
```bash
git log -1 --oneline
```
Confirm the commit message matches `v{VERSION} Release Notes` (e.g., `v3.44.1 Release Notes`). Do NOT blindly tag HEAD without verification.
Once verified, tag and push:
```bash
VERSION=<version>
git tag v${VERSION}
git push origin v${VERSION}
```
## Step 8: Trigger Publish Workflow
**Copy the tag to clipboard** so the user can easily paste it into the GitHub Actions workflow:
```bash
echo -n "v{VERSION}" | pbcopy
```
**Tell the user to trigger the publish workflow:**
1. Go to: https://github.com/cline/cline/actions/workflows/publish.yml
2. Select **"release"** for release-type
3. Paste **`v{VERSION}`** as the tag (already in clipboard)
**Wait for the user** to confirm the publish workflow has completed before proceeding.
## Step 9: Update GitHub Release Notes
Once the user confirms the publish workflow is done, fetch the auto-generated release content:
```bash
VERSION=<version>
gh release view v${VERSION} --json body --jq '.body'
```
The auto-generated release has:
- `## What's Changed` - PR list (we'll replace this with our changelog)
- `## New Contributors` - First-time contributors (keep this if present)
- `**Full Changelog**` - Comparison link (keep this)
Build the new release body:
1. Start with `## What's Changed` header
2. Add our changelog content (from CHANGELOG.md for this version)
3. Keep the `## New Contributors` section if it exists
4. Keep the `**Full Changelog**` link
Update the release:
```bash
gh release edit v${VERSION} --notes "<new body content>"
```
Verify the release was updated:
```bash
gh release view v${VERSION}
```
## Step 10: Final Summary
**Copy a Slack announcement message to clipboard** (include the full changelog, not just highlights):
```bash
echo "VS Code v{VERSION} Released
- Changelog entry 1
- Changelog entry 2
- Changelog entry 3" | pbcopy
```
**Present a final summary:**
- Version released: v{VERSION}
- PR merged: #{PR_NUMBER}
- Tag pushed: v{VERSION}
- Release: https://github.com/cline/cline/releases/tag/v{VERSION}
- Slack message copied to clipboard
**Final reminder:**
Post the Slack message to announce the release
## Handling Edge Cases
### No changesets found
If the changeset PR body shows no changes, inform the user they need to merge PRs with changesets first.
### Merge conflicts
If there are conflicts on the changeset branch, help the user resolve them:
```bash
git fetch origin main
git rebase origin/main
# resolve conflicts
git push origin changeset-release/main --force-with-lease
```
### User wants to add more changes
If the user wants to include additional PRs before releasing:
1. Ask them to merge those PRs to main first
2. The changeset automation will update the PR automatically
3. Re-run this workflow after the PR is updated
+21 -5
View File
@@ -1,6 +1,6 @@
name: Trigger Jetbrains Plugin <-> Cline Tests
on:
pull_request:
pull_request_target:
types: [opened, synchronize, reopened]
permissions:
contents: read
@@ -22,7 +22,24 @@ jobs:
owner: cline
repositories: intellij-plugin
- name: Sanitize untrusted inputs
id: sanitize
env:
RAW_BRANCH_NAME: ${{ github.head_ref }}
RAW_PR_TITLE: ${{ github.event.pull_request.title }}
run: |
# Sanitize branch name for JSON
BRANCH_NAME_JSON=$(jq -n --arg b "$RAW_BRANCH_NAME" '$b')
echo "branch_name=$BRANCH_NAME_JSON" >> $GITHUB_OUTPUT
# Sanitize PR title for JSON
PR_TITLE_JSON=$(jq -n --arg t "$RAW_PR_TITLE" '$t')
echo "pr_title=$PR_TITLE_JSON" >> $GITHUB_OUTPUT
- name: Trigger IntelliJ Plugin Integration Test
env:
BRANCH_NAME: ${{ steps.sanitize.outputs.branch_name }}
PR_TITLE: ${{ steps.sanitize.outputs.pr_title }}
run: |
curl -X POST \
-H "Authorization: Bearer ${{ steps.app-token.outputs.token }}" \
@@ -35,10 +52,10 @@ jobs:
"event_type": "cline-pr-check",
"client_payload": {
"pr_number": "${{ github.event.number }}",
"branch_name": "${{ github.head_ref }}",
"branch_name": $BRANCH_NAME,
"action": "${{ github.event.action }}",
"sha": "${{ github.event.pull_request.head.sha }}",
"pr_title": ${{ toJSON(github.event.pull_request.title) }},
"pr_title": $PR_TITLE,
"pr_url": "${{ github.event.pull_request.html_url }}"
}
}
@@ -47,7 +64,6 @@ jobs:
- name: Log trigger details
run: |
echo "Triggered IntelliJ Plugin integration test for:"
echo " PR #${{ github.event.number }}: ${{ github.event.pull_request.title }}"
echo " Branch: ${{ github.head_ref }}"
echo " PR #${{ github.event.number }}"
echo " Action: ${{ github.event.action }}"
echo " SHA: ${{ github.event.pull_request.head.sha }}"
+16 -4
View File
@@ -12,7 +12,10 @@
"args": [
"--extensionDevelopmentPath=${workspaceFolder}",
"--disable-workspace-trust",
"--disable-extensions", // Avoid conflicts with installed extensions
"--disable-extension",
"saoudrizwan.claude-dev", // Avoid conflicts with installed Cline
"--disable-extension",
"saoudrizwan.cline-nightly", // Avoid conflicts with installed Cline Nightly
"${workspaceFolder}"
],
"outFiles": [
@@ -33,7 +36,10 @@
"args": [
"--extensionDevelopmentPath=${workspaceFolder}",
"--disable-workspace-trust",
"--disable-extensions", // Avoid conflicts with installed extensions
"--disable-extension",
"saoudrizwan.claude-dev", // Avoid conflicts with installed Cline
"--disable-extension",
"saoudrizwan.cline-nightly", // Avoid conflicts with installed Cline Nightly
"${workspaceFolder}"
],
"outFiles": [
@@ -54,7 +60,10 @@
"args": [
"--extensionDevelopmentPath=${workspaceFolder}",
"--disable-workspace-trust",
"--disable-extensions", // Avoid conflicts with installed extensions
"--disable-extension",
"saoudrizwan.claude-dev", // Avoid conflicts with installed Cline
"--disable-extension",
"saoudrizwan.cline-nightly", // Avoid conflicts with installed Cline Nightly
"${workspaceFolder}"
],
"outFiles": [
@@ -77,7 +86,10 @@
"--user-data-dir=${workspaceFolder}/dist/tmp/user",
"--profile-temp",
"--sync=off",
"--disable-extensions", // Avoid conflicts with installed extensions
"--disable-extension",
"saoudrizwan.claude-dev", // Avoid conflicts with installed Cline
"--disable-extension",
"saoudrizwan.cline-nightly", // Avoid conflicts with installed Cline Nightly
"--extensionDevelopmentPath=${workspaceFolder}",
"${workspaceFolder}"
],
+3 -1
View File
@@ -27,5 +27,7 @@
"source.removeUnused.biome": "always",
"source.removeUnusedImports": "always",
"source.organizeImports.biome": "always"
}
},
// Disable auto-forwarding ports to prevent Simple Browser from opening the Vite dev server
"remote.autoForwardPorts": false
}
-3
View File
@@ -40,9 +40,6 @@ buf.yaml
.changeset/
.clinerules/
# Include specific file needed for Background Exec mode
!standalone/runtime-files/vscode/enhanced-terminal.js
# Ignore all webview-ui files except the build directory (https://github.com/microsoft/vscode-webview-ui-toolkit-samples/blob/main/frameworks/hello-world-react-cra/.vscodeignore)
webview-ui/src/**
webview-ui/public/**
+97
View File
@@ -1,5 +1,102 @@
# Changelog
## [3.45.0]
- Added Gemini 3 Flash Preview model
## [3.44.2]
- Polished the model picker UI with checkmarks for selected models, tooltips on Plan/Act tabs, and consistent arrow pointers across all popup modals
- Improved WhatsNew modal responsiveness and cleaned up redundant UI elements
- Fixed GLM models outputting garbled text in thinking tags—reasoning is now properly disabled for these models
## [3.44.1]
- Fixed a critical bug where local MCP servers stopped connecting after v3.42.0—all user-configured stdio-based MCP servers should now work again
- Fixed remotely configured API keys not being extracted correctly for enterprise users
- Added support for dynamic tool instructions that adapt based on runtime context, laying groundwork for future context-aware features
## [3.44.0]
## Added
- Updating minor version to show a proper banner for the release
## [3.43.1]
### Patch Changes
- Fix GLM-4.6 Model reference id
## [3.43.0]
### Added
- GLM-4.6
- kat-coder-pro
- Add parsing of env variable patterns to the mcpconfig.json
### Fixed
- TLS Proxy support issues for VSCode
- Add supportsReasoning flag to OpenAI reasoning models
- Fix thinking not available for some models in the OpenAI provider
- Fix invalid signature field issues when switching between Gemini and Anthropic providers
- Extract OpenRouter model filtering into reusable utility and use it in different model pickers
- Fix a11y for auto approve checkbox
- Improve ModelPickerModal provider list layout
### Refactored
- Migrate WhatsNewModal to new shared dialogue component
## [3.42.0]
### Added
- Expose `getAvailableSlashCommands` rpc endpoint to UI clients
- Made slash command menu and context menu accessible and screenreader-friendly
- Made expanding/collapsing UI components accessible
### Fixed
- Devstral OpenRouter model ID and routing issues
- Incorrect pricing display for Devstral model in the extension
## [3.41.0]
### Added
- OpenAI GPT-5.2
- Devstral-2512 (formerly stealth model "Microwave")
- Improvements to chat modal model picker
- Amazon Nova 2 Lite
- DeepSeek 3.2 to native tool calling allow list
- Responses API support for Codex models in OpenAI provider (requires native tool calling)
- Xmas Special Santa Cline
- Welcome screen UI enhancements
### Fixed
- Initial checkpoint commit now non-blocking for improved responsiveness in large repositories
- Gemini Vertex models erroring when thinking parameters are not supported
- Restrictive file permissions for secrets.json
- Ollama streaming requests not aborting when task is cancelled
### Refactored
- OpenAI provider to centralize temperature configuration and include missing GPT-5 model settings
- OpenAI native handler to use metadata for model capabilities
- Vertex provider to use metadata for model capabilities
## [3.40.2]
- Fix logout on network errors during token refresh (e.g., opening laptop while offline)
## [3.40.1]
- Fix cost calculation display for Anthropic API requests
## [3.40.0]
- Fix highlighted text flashing when task header is collapsed
+1
View File
@@ -70,3 +70,4 @@ Apache-2.0 - see [LICENSE](https://github.com/cline/cline/blob/main/LICENSE) for
- Report issues: [GitHub Issues](https://github.com/cline/cline/issues)
- Community: [GitHub Discussions](https://github.com/cline/cline/discussions)
- Documentation: [docs.cline.bot](https://docs.cline.bot)
- Cline CLI Architecture: [architecture.md](./architecture.md)
+292
View File
@@ -0,0 +1,292 @@
# Cline CLI Architecture
The CLI is a **standalone terminal interface** for the Cline AI coding assistant, written in Go. It provides the same autonomous coding capabilities as the VS Code extension but runs entirely in the terminal.
## High-Level Architecture
```
┌─────────────────────────────────────────────────────────────────────────┐
│ User Terminal │
└─────────────────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────────────────┐
│ cline (Go binary) │
│ cmd/cline/main.go │
│ • Cobra CLI commands (task, auth, config, instance, etc.) │
│ • Interactive input via Bubble Tea │
│ • Streaming output with markdown rendering │
└─────────────────────────────────────────────────────────────────────────┘
│ gRPC (50052) │ starts subprocess
▼ ▼
┌─────────────────────────┐ ┌─────────────────────────┐
│ cline-core │◄────────────────►│ cline-host │
│ (Node.js) │ gRPC (51052) │ (Go binary) │
│ │ │ cmd/cline-host/main.go│
│ • AI/LLM orchestration │ │ │
│ • Tool execution │ │ • Workspace paths │
│ • Task state mgmt │ │ • File diff editing │
│ • Message handling │ │ • Clipboard access │
└─────────────────────────┘ │ • Environment info │
│ └─────────────────────────┘
│ SQLite (self-registration)
┌─────────────────────────────────────────────────────────────────────────┐
│ ~/.cline/data/locks/locks.db │
│ (Instance registry - core self-registers on startup) │
└─────────────────────────────────────────────────────────────────────────┘
```
## Entry Points (`cmd/`)
### `cmd/cline/main.go` - Main CLI
Cobra-based CLI with commands:
- **Root**: `cline [prompt]` - Start a task directly
- **task**: Create, send, view, list, pause, restore tasks
- **auth**: Authentication setup and provider configuration
- **config**: Read/write settings
- **instance**: Manage running Cline instances
- **logs**: View and clean log files
- **doctor**: System health check
### `cmd/cline-host/main.go` - Host Bridge Service
Separate gRPC server providing host environment operations to cline-core:
- Workspace paths
- File diff editing
- Clipboard access
- Shutdown coordination
---
## `pkg/cli/` Subsystems
### 1. `auth/` - Authentication System
Handles authentication with Cline service and BYO (Bring Your Own) API providers.
| File | Purpose |
| ------------------------- | ------------------------------------------------------------------------ |
| `auth_cline_provider.go` | OAuth login flow - opens browser, subscribes to auth callback stream |
| `auth_menu.go` | Interactive menu showing auth options based on current state |
| `auth_subscription.go` | gRPC stream subscription for auth status updates |
| `wizard_byo.go` | Interactive wizard for configuring BYO providers |
| `wizard_byo_bedrock.go` | AWS Bedrock-specific credential setup |
| `wizard_byo_oca.go` | Oracle Code Assist setup |
| `providers_list.go` | Retrieves configured providers from core state |
| `providers_byo.go` | Provider selection UI and field configuration |
| `models_*.go` | Model listing (static lists + dynamic fetch from OpenRouter/OpenAI/Ollama) |
**Flow**: User runs `cline auth` → Menu shows options → For BYO: wizard guides through provider/key/model selection → Config saved via gRPC to core.
---
### 2. `clerror/` - Error Handling
Parses and classifies API errors from the Cline service.
**Error Types:**
- `ErrorTypeAuth` - 401, bad API key
- `ErrorTypeBalance` - Insufficient credits
- `ErrorTypeRateLimit` - 429, quota exceeded
- `ErrorTypeNetwork` - Connection issues
- `ErrorTypeUnknown` - Catch-all
Extracts billing details (balance, spent, buy credits URL) from error responses.
---
### 3. `config/` - Configuration Management
| File | Purpose |
| --------------------- | -------------------------------------------------------------------------- |
| `manager.go` | gRPC interface for reading/writing settings via `UpdateSettingsCli` RPC |
| `settings_renderer.go`| Pretty-prints config values, censors sensitive fields (keys, secrets) |
Supports dot-notation paths: `cline config get auto-approval-settings.actions.read-files`
---
### 4. `display/` - Terminal Display System
The most complex subsystem - handles all visual output.
| File | Purpose |
| ----------------------- | -------------------------------------------------------------------- |
| `renderer.go` | Central coordinator with lipgloss styles, color methods, markdown delegation |
| `streaming.go` | Real-time streaming display with deduplication |
| `segment_streamer.go` | Streaming segments (header + body) with context-aware headers |
| `typewriter.go` | Character-by-character animation with variable delays |
| `markdown_renderer.go` | Glamour wrapper for terminal markdown rendering |
| `tool_renderer.go` | Tool operation formatting ("Cline is editing `file.ts`") |
| `tool_result_parser.go` | Parses structured tool results (file lists, search results) |
| `banner.go` | Session startup banner with version/model/workspace |
| `deduplicator.go` | MD5-based deduplication with 2-second window |
| `system_renderer.go` | Rich error/warning boxes for balance errors, auth failures |
| `ansi.go` | TTY detection, line clearing with escape codes |
---
### 5. `global/` - Global State Management
| File | Purpose |
| ------------------ | -------------------------------------------------------------------------- |
| `global.go` | Global config (paths, verbosity, output format), initialization |
| `registry.go` | Instance discovery via SQLite, health checking, default instance management|
| `cline-clients.go` | Starts cline-core + cline-host processes, port allocation, cleanup |
**Instance lifecycle:**
1. Find available port pair
2. Start `cline-host` on port+1000
3. Start `cline-core` on port
4. Wait for core to self-register in SQLite
5. Set as default if first instance
---
### 6. `handlers/` - Message Handlers
Routes incoming messages from cline-core to appropriate renderers.
| File | Purpose |
| ------------------ | --------------------------------------------------------------------- |
| `handler.go` | Handler registry with priority-based routing |
| `ask_handlers.go` | Approval requests: tool, command, followup, api_req_failed, etc. |
| `say_handlers.go` | Status messages: text, reasoning, command_output, tool, checkpoint, etc. |
Uses `DisplayContext` providing renderer access, state, and context flags (isLast, isPartial, isStreamingMode).
---
### 7. `output/` - Output Coordination
| File | Purpose |
| --------------------- | ----------------------------------------------------------------------- |
| `coordinator.go` | Coordinates streaming output with interactive input (saves/restores input state) |
| `input_model.go` | Bubble Tea model for rich input (message, approval, feedback types) |
| `slash_completion.go` | Autocomplete dropdown for slash commands |
**Key pattern:** When output needs to print while input is visible, the coordinator saves input state, clears the form, prints, then restores input.
---
### 8. `slash/` - Slash Command Registry
Central registry for commands like `/plan`, `/act`, `/cancel`:
- **CLI-local commands**: Handled directly by CLI
- **Backend commands**: Fetched from core via gRPC, filtered by `CliCompatible` flag
---
### 9. `sqlite/` - Instance Locking
Manages the distributed locking system:
- **Instance locks**: Track running Cline instances by address
- **File locks**: Coordinate file access across instances
- SQLite database created by cline-core, CLI reads/writes for discovery
---
### 10. `task/` - Task Management
| File | Purpose |
| ----------------------- | -------------------------------------------------------------------- |
| `manager.go` | Core orchestrator: create, cancel, resume, restore tasks; stream handling |
| `stream_coordinator.go` | Deduplication and turn management for dual streams |
| `input_handler.go` | Interactive input during follow mode (polling, approval detection) |
| `history_handler.go` | Direct disk access to `taskHistory.json` |
| `settings_parser.go` | Parse settings from CLI flags |
| `follow_options.go` | Configuration for follow behavior |
**Streaming:** Task manager subscribes to two gRPC streams:
1. `SubscribeToState` - Full state updates
2. `SubscribeToPartialMessage` - Streaming AI responses
---
### 11. `terminal/` - Terminal Handling
Enhanced keyboard protocol support and terminal configuration:
- Enables modifyOtherKeys and Kitty keyboard protocol
- Detects terminal type (VS Code, iTerm, Ghostty, Kitty, etc.)
- Auto-configures shift+enter keybindings for various terminals
---
### 12. `types/` - Type Definitions
| File | Purpose |
| -------------- | ----------------------------------------------------------------- |
| `messages.go` | `ClineMessage`, `AskType`, `SayType`, `ToolType` enums, proto conversion |
| `state.go` | `ConversationState` with thread-safe message access |
| `history.go` | `HistoryItem` matching taskHistory.json format |
---
### 13. `updater/` - Auto-Update
Background auto-update checking:
- 24-hour check interval (cached)
- Queries npm registry for newer versions
- Supports `latest` and `nightly` channels
- Runs `npm install -g cline` to update
---
## `pkg/common/` - Shared Types
| File | Purpose |
| --------------- | ------------------------------------------------------------ |
| `constants.go` | `SETTINGS_SUBFOLDER`, `DEFAULT_CLINE_CORE_PORT` |
| `schema.go` | SQL queries for instance/file locks |
| `types.go` | `CoreInstanceInfo`, `LockRow`, `DefaultCoreInstance` |
| `utils.go` | Port checking, health checks, address normalization, retry logic |
---
## `pkg/generated/` - Auto-Generated
| File | Purpose |
| --------------------- | -------------------------------------------------------------------------------------------------------------------- |
| `providers.go` | Provider definitions (Anthropic, OpenAI, Bedrock, etc.) with field metadata and model specs - generated from TypeScript sources |
| `field_overrides.go` | Manual overrides for field filtering |
---
## `pkg/hostbridge/` - CLI-to-Core Bridge
This is the **reverse bridge** allowing cline-core to request host environment operations:
| File | Purpose |
| ----------------------- | ---------------------------------------------------- |
| `grpc_server.go` | Main server registering all services |
| `simple_workspace.go` | Workspace service: returns CWD as workspace path |
| `diff.go` | In-memory file diff editing with line-based operations |
| `env.go` | Clipboard access, version info, shutdown coordination |
| `window.go` | UI stubs (no-ops or console output) |
**Why this exists:** The same cline-core logic runs in VS Code and CLI. In VS Code, the "host" is the extension with editor APIs. In CLI, hostbridge emulates these capabilities with terminal-appropriate implementations.
---
## Key Design Decisions
1. **Two-process model:** `cline` CLI manages instances; `cline-core` is the actual AI engine (Node.js). This allows reusing the same core as the VS Code extension.
2. **Self-registration via SQLite:** `cline-core` registers itself in a SQLite database on startup. The CLI discovers instances by reading this database, enabling multi-instance support.
3. **Host bridge abstraction:** The `cline-host` process provides platform-specific operations (clipboard, workspace paths) via gRPC, allowing `cline-core` to remain host-agnostic.
4. **Streaming-first UI:** The CLI uses gRPC streaming to display AI responses in real-time with typewriter-style rendering.
5. **Dual stream handling:** Task manager subscribes to both state updates and partial messages, using deduplication to prevent duplicate rendering.
+22
View File
@@ -78,6 +78,28 @@ These options apply to all subcommands:
: Output format. Options: **rich** (default), **json**, **plain**
When you use **-F json**, the CLI prints each client message as JSON.
Each message is a **ClineMessage** object.
Required fields:
- **type**: "ask" or "say"
- **text**: message text
- **ts**: Unix epoch timestamp in milliseconds
Optional fields (omitted when empty):
- **reasoning**: reasoning text
- **say**: say subtype (present when type is "say")
- **ask**: ask subtype (present when type is "ask")
- **partial**: streaming flag
- **images**: list of image URIs
- **files**: list of file paths
- **lastCheckpointHash**: git checkpoint hash
- **isCheckpointCheckedOut**: checkpoint checkout flag
- **isOperationOutsideWorkspace**: workspace safety flag
**-h**, **\--help**
: Display help information for the command.
+1 -1
View File
@@ -92,7 +92,6 @@ func (m *Manager) ListSettings(ctx context.Context) error {
"telemetrySetting",
"planActSeparateModelsSetting",
"enableCheckpointsSetting",
"mcpMarketplaceEnabled",
"shellIntegrationTimeout",
"terminalReuseEnabled",
"mcpResponsesCollapsed",
@@ -111,6 +110,7 @@ func (m *Manager) ListSettings(ctx context.Context) error {
"dictationSettings",
"autoCondenseThreshold",
"autoApprovalSettings",
"hooksEnabled",
}
// Render each field using the renderer
+2 -3
View File
@@ -77,10 +77,9 @@ func RenderField(key string, value interface{}, censor bool) error {
case "mode", "telemetrySetting", "preferredLanguage", "customPrompt",
"defaultTerminalProfile", "mcpDisplayMode", "openaiReasoningEffort",
"planActSeparateModelsSetting", "enableCheckpointsSetting",
"mcpMarketplaceEnabled", "terminalReuseEnabled",
"mcpResponsesCollapsed", "strictPlanModeEnabled",
"terminalReuseEnabled", "mcpResponsesCollapsed", "strictPlanModeEnabled",
"useAutoCondense", "yoloModeToggled", "shellIntegrationTimeout",
"terminalOutputLineLimit", "autoCondenseThreshold":
"terminalOutputLineLimit", "autoCondenseThreshold", "hooksEnabled":
fmt.Printf("%s: %s\n", camelToKebab(key), formatValue(value, key, censor))
return nil
+12 -3
View File
@@ -161,6 +161,14 @@ func (tr *ToolRenderer) generateToolHeader(tool *types.ToolMessage, verbTense st
}
return fmt.Sprintf("### Cline %s `%s`", action, tool.Path)
case string(types.ToolTypeWebSearch):
if verbTense == "wants to" {
action = "wants to search for"
} else {
action = "is searching for"
}
return fmt.Sprintf("### Cline %s `%s`", action, tool.Path)
case string(types.ToolTypeListCodeDefinitionNames):
if verbTense == "wants to" {
action = "wants to list code definitions in"
@@ -207,8 +215,8 @@ func (tr *ToolRenderer) GenerateToolContentPreview(tool *types.ToolMessage) stri
previewMd := fmt.Sprintf("```\n%s\n```", preview)
return tr.renderMarkdown(previewMd)
case string(types.ToolTypeReadFile), string(types.ToolTypeWebFetch), string(types.ToolTypeFileDeleted):
// No preview for read/fetch operations
case string(types.ToolTypeReadFile), string(types.ToolTypeWebFetch), string(types.ToolTypeWebSearch), string(types.ToolTypeFileDeleted):
// No preview for read/fetch/search operations
return ""
default:
@@ -243,7 +251,8 @@ func (tr *ToolRenderer) GenerateToolContentBody(tool *types.ToolMessage) string
string(types.ToolTypeListFilesRecursive),
string(types.ToolTypeListCodeDefinitionNames),
string(types.ToolTypeSearchFiles),
string(types.ToolTypeWebFetch):
string(types.ToolTypeWebFetch),
string(types.ToolTypeWebSearch):
// Use parser for structured output
preview := toolParser.ParseToolResult(tool)
return tr.renderMarkdown(preview)
@@ -224,6 +224,11 @@ func (p *ToolResultParser) ParseWebFetch(content, url string) string {
return ""
}
// ParseWebSearch formats webSearch tool results
func (p *ToolResultParser) ParseWebSearch(content, query string) string {
return ""
}
// detectLanguage returns syntax highlighting language based on file extension
func (p *ToolResultParser) detectLanguage(ext string) string {
langMap := map[string]string{
@@ -289,6 +294,8 @@ func (p *ToolResultParser) ParseToolResult(tool *types.ToolMessage) string {
return p.ParseCodeDefinitions(tool.Content)
case "webFetch":
return p.ParseWebFetch(tool.Content, tool.Path)
case "webSearch":
return p.ParseWebSearch(tool.Content, tool.Path)
default:
return tool.Content
}
+3 -2
View File
@@ -478,8 +478,9 @@ func startClineCore(corePort, hostPort int) (*exec.Cmd, error) {
env = append(env,
fmt.Sprintf("NODE_PATH=%s", nodePath),
"GRPC_TRACE=all",
"GRPC_VERBOSITY=DEBUG",
// These control gRPC debug logging
//"GRPC_TRACE=all",
//"GRPC_VERBOSITY=DEBUG",
"NODE_ENV=development",
)
cmd.Env = env
+74 -22
View File
@@ -9,12 +9,13 @@ import (
"github.com/charmbracelet/bubbles/textarea"
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/lipgloss"
"github.com/cline/cli/pkg/cli/slash"
)
// InputType represents the type of input being collected
type InputType int
const INPUT_WIDTH = 46
const INPUT_WIDTH = 46
const (
InputTypeMessage InputType = iota
@@ -24,11 +25,11 @@ const (
// InputSubmitMsg is sent when the user submits input
type InputSubmitMsg struct {
Value string
InputType InputType
Approved bool // For approval type
NeedsFeedback bool // For approval type
NoAskAgain bool // For approval type - indicates "don't ask again" was selected
Value string
InputType InputType
Approved bool // For approval type
NeedsFeedback bool // For approval type
NoAskAgain bool // For approval type - indicates "don't ask again" was selected
}
// InputCancelMsg is sent when the user cancels input (Ctrl+C)
@@ -36,8 +37,8 @@ type InputCancelMsg struct{}
// ChangeInputTypeMsg changes the current input type
type ChangeInputTypeMsg struct {
InputType InputType
Title string
InputType InputType
Title string
Placeholder string
}
@@ -57,7 +58,7 @@ type InputModel struct {
placeholder string
currentMode string // "plan" or "act"
width int
lastHeight int // Track height for cleanup on submit
lastHeight int // Track height for cleanup on submit
// For approval type
approvalOptions []string
@@ -66,6 +67,9 @@ type InputModel struct {
// Styles (huh-inspired theme)
styles fieldStyles
// Slash command autocomplete dropdown
completion CompletionModel
}
// fieldStyles holds the styling for the input field
@@ -115,12 +119,17 @@ func newFieldStyles() fieldStyles {
// NewInputModel creates a new input model
func NewInputModel(inputType InputType, title, placeholder, currentMode string) InputModel {
return NewInputModelWithRegistry(inputType, title, placeholder, currentMode, nil)
}
// NewInputModelWithRegistry creates a new input model with slash command autocomplete support
func NewInputModelWithRegistry(inputType InputType, title, placeholder, currentMode string, registry *slash.Registry) InputModel {
ta := textarea.New()
ta.Placeholder = placeholder
ta.Focus()
ta.CharLimit = 0
ta.ShowLineNumbers = false
ta.Prompt = "" // Remove prompt prefix (this is what adds the inner border!)
ta.Prompt = "" // Remove prompt prefix (this is what adds the inner border!)
ta.SetHeight(5)
// Don't set width here - let WindowSizeMsg handle it
ta.SetWidth(INPUT_WIDTH)
@@ -138,11 +147,11 @@ func NewInputModel(inputType InputType, title, placeholder, currentMode string)
cursorColor = lipgloss.Color("39") // Blue for act
}
ta.FocusedStyle.CursorLine = lipgloss.NewStyle() // No cursor line highlighting
ta.FocusedStyle.EndOfBuffer = lipgloss.NewStyle() // No end-of-buffer styling
ta.FocusedStyle.CursorLine = lipgloss.NewStyle() // No cursor line highlighting
ta.FocusedStyle.EndOfBuffer = lipgloss.NewStyle() // No end-of-buffer styling
ta.FocusedStyle.Placeholder = styles.placeholder
ta.FocusedStyle.Text = styles.textArea
ta.FocusedStyle.Prompt = lipgloss.NewStyle() // No prompt styling
ta.FocusedStyle.Prompt = lipgloss.NewStyle() // No prompt styling
ta.Cursor.Style = lipgloss.NewStyle().Foreground(cursorColor)
ta.Cursor.TextStyle = styles.textArea
@@ -154,6 +163,7 @@ func NewInputModel(inputType InputType, title, placeholder, currentMode string)
currentMode: currentMode,
width: 0, // Will be set by first WindowSizeMsg
styles: styles,
completion: NewCompletionModel(registry),
}
// For approval type, set up options
@@ -217,13 +227,6 @@ func (m *InputModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
}
return m, nil
default:
// Forward all other messages to textarea (including blink ticks)
if !m.suspended && (m.inputType == InputTypeMessage || m.inputType == InputTypeFeedback) {
m.textarea, cmd = m.textarea.Update(msg)
return m, cmd
}
case tea.KeyMsg:
if m.suspended {
return m, nil
@@ -231,6 +234,31 @@ func (m *InputModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
// Handle keys for text input types (Message/Feedback)
if m.inputType == InputTypeMessage || m.inputType == InputTypeFeedback {
// When completion menu is visible, let it handle navigation keys first
if m.completion.Visible() {
// ctrl+c always cancels, even with dropdown open
if msg.String() == "ctrl+c" {
return m, func() tea.Msg { return InputCancelMsg{} }
}
var handled bool
m.completion, cmd, handled = m.completion.Update(msg)
if handled {
// Check if a completion was selected
if applied := m.completion.Apply(); applied != "" {
m.textarea.SetValue(applied)
m.textarea.CursorEnd()
}
return m, cmd
}
// Key not handled by completion - pass to textarea and update completion
m.textarea, cmd = m.textarea.Update(msg)
m.completion.CheckInput(m.textarea.Value())
return m, cmd
}
// Normal key handling when completion menu is NOT visible
switch msg.String() {
case "ctrl+c":
return m, func() tea.Msg { return InputCancelMsg{} }
@@ -239,6 +267,11 @@ func (m *InputModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
// Open external editor (like huh does)
return m, m.openEditor()
case "tab":
// Tab without dropdown visible - do nothing special
m.textarea, cmd = m.textarea.Update(msg)
return m, cmd
case "enter":
// Intercept enter for submit (textarea handles alt+enter and ctrl+j for newlines)
return m.handleSubmit()
@@ -249,8 +282,9 @@ func (m *InputModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
return m, cmd
}
// Pass all other keys to textarea (including alt+enter, ctrl+j for newlines)
// Pass all other keys to textarea, then check for slash completion
m.textarea, cmd = m.textarea.Update(msg)
m.completion.CheckInput(m.textarea.Value())
return m, cmd
}
@@ -276,6 +310,13 @@ func (m *InputModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
return m, nil
}
}
default:
// Forward all other messages to textarea (including blink ticks)
if !m.suspended && (m.inputType == InputTypeMessage || m.inputType == InputTypeFeedback) {
m.textarea, cmd = m.textarea.Update(msg)
return m, cmd
}
}
return m, nil
@@ -365,6 +406,11 @@ func (m *InputModel) View() string {
case InputTypeMessage, InputTypeFeedback:
parts = append(parts, m.textarea.View())
// Render completion dropdown if visible
if m.completion.Visible() {
parts = append(parts, m.completion.View())
}
case InputTypeApproval:
var options []string
for i, option := range m.approvalOptions {
@@ -411,7 +457,7 @@ func (m *InputModel) Clone() *InputModel {
ta.ShowLineNumbers = false
ta.Prompt = ""
ta.SetHeight(5)
ta.SetWidth(INPUT_WIDTH)
ta.SetWidth(INPUT_WIDTH)
ta.Focus()
// Configure keybindings
@@ -446,6 +492,7 @@ func (m *InputModel) Clone() *InputModel {
selectedOption: m.selectedOption,
pendingApproval: m.pendingApproval, // Preserve approval decision
styles: m.styles,
completion: NewCompletionModel(m.completion.registry), // Preserve registry, start fresh state
}
return clone
@@ -495,3 +542,8 @@ func (m *InputModel) openEditor() tea.Cmd {
return editorFinishedMsg{content: content, err: err}
})
}
// SetSlashRegistry sets the slash command registry for autocomplete
func (m *InputModel) SetSlashRegistry(registry *slash.Registry) {
m.completion.SetRegistry(registry)
}
+265
View File
@@ -0,0 +1,265 @@
package output
import (
"fmt"
"strings"
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/lipgloss"
"github.com/cline/cli/pkg/cli/slash"
)
const maxVisibleCompletions = 7
// completionStyles holds the styling for the completion dropdown
type completionStyles struct {
menu lipgloss.Style
selected lipgloss.Style
normalName lipgloss.Style
description lipgloss.Style
scrollIndicator lipgloss.Style
}
// newCompletionStyles creates the default styles for the completion dropdown
func newCompletionStyles() completionStyles {
return completionStyles{
menu: lipgloss.NewStyle().
Border(lipgloss.RoundedBorder()).
BorderForeground(lipgloss.Color("238")).
Padding(0, 1),
selected: lipgloss.NewStyle().
Background(lipgloss.Color("62")).
Foreground(lipgloss.Color("230")),
normalName: lipgloss.NewStyle().
Foreground(lipgloss.AdaptiveColor{Light: "235", Dark: "252"}),
description: lipgloss.NewStyle().
Foreground(lipgloss.Color("243")),
scrollIndicator: lipgloss.NewStyle().
Foreground(lipgloss.Color("243")),
}
}
// CompletionModel is a Bubbletea model for slash command autocomplete dropdown
type CompletionModel struct {
registry *slash.Registry
visible bool
matches []slash.Command
index int // selected item (0-based)
scroll int // scroll offset for long lists
styles completionStyles
// pendingApply holds the command to apply after selection
pendingApply string
}
// NewCompletionModel creates a new completion model with the given registry
func NewCompletionModel(registry *slash.Registry) CompletionModel {
return CompletionModel{
registry: registry,
styles: newCompletionStyles(),
}
}
// SetRegistry sets the slash command registry
func (m *CompletionModel) SetRegistry(registry *slash.Registry) {
m.registry = registry
}
// Visible returns whether the completion dropdown is currently visible
func (m CompletionModel) Visible() bool {
return m.visible
}
// Update handles key messages for the completion dropdown.
// Returns the updated model, any commands, and whether the key was handled.
// If handled is true, the parent should NOT pass the key to the textarea.
func (m CompletionModel) Update(msg tea.Msg) (CompletionModel, tea.Cmd, bool) {
if !m.visible {
return m, nil, false
}
keyMsg, ok := msg.(tea.KeyMsg)
if !ok {
return m, nil, false
}
switch keyMsg.String() {
case "up":
m.navigateUp()
return m, nil, true
case "down":
m.navigateDown()
return m, nil, true
case "tab", "enter":
// Select the current completion
if len(m.matches) > 0 {
selected := m.matches[m.index]
m.pendingApply = "/" + selected.Name + " "
}
m.Hide()
return m, nil, true
case "esc":
m.Hide()
return m, nil, true
}
// Key not handled by completion - let parent process it
return m, nil, false
}
// CheckInput updates the completion state based on the current input value.
// Call this after each input change to show/hide/update the dropdown.
func (m *CompletionModel) CheckInput(value string) {
if m.registry == nil {
return
}
// Only activate if input starts with "/" (first character requirement)
if !strings.HasPrefix(value, "/") {
m.Hide()
return
}
// Extract the command being typed (everything after "/" until space/newline)
rest := value[1:] // Everything after the "/"
// If there's whitespace, the command is complete - hide dropdown
if idx := strings.IndexAny(rest, " \n\t"); idx != -1 {
m.Hide()
return
}
// Update matches based on prefix
m.updateMatches(rest)
m.visible = len(m.matches) > 0
}
// Apply returns the command string to insert (if any) and clears the pending state.
// The parent should call this after Update returns handled=true for tab/enter.
func (m *CompletionModel) Apply() string {
result := m.pendingApply
m.pendingApply = ""
return result
}
// Hide hides the completion dropdown and resets state
func (m *CompletionModel) Hide() {
m.visible = false
m.matches = nil
m.index = 0
m.scroll = 0
}
// View renders the completion dropdown
func (m CompletionModel) View() string {
if !m.visible || len(m.matches) == 0 {
return ""
}
var lines []string
// Calculate visible range
endIdx := min(m.scroll+maxVisibleCompletions, len(m.matches))
// Show scroll indicator if there are items above
if m.scroll > 0 {
lines = append(lines, m.styles.scrollIndicator.Render(" ↑ more"))
}
// Find the longest command name for alignment
maxNameLen := 0
for _, cmd := range m.matches {
nameLen := len(cmd.Name) + 1 // +1 for the "/"
if nameLen > maxNameLen {
maxNameLen = nameLen
}
}
// Cap at reasonable width
if maxNameLen > 15 {
maxNameLen = 15
}
// Render visible items
for i := m.scroll; i < endIdx; i++ {
cmd := m.matches[i]
name := "/" + cmd.Name
desc := cmd.Description
// Truncate description if too long
maxDescLen := 35
if len(desc) > maxDescLen {
desc = desc[:maxDescLen-3] + "..."
}
// Pad name for alignment
paddedName := fmt.Sprintf("%-*s", maxNameLen, name)
if i == m.index {
// Selected item - highlight the entire line
line := fmt.Sprintf("> %s %s", paddedName, desc)
lines = append(lines, m.styles.selected.Render(line))
} else {
// Normal item
line := fmt.Sprintf(" %s %s", m.styles.normalName.Render(paddedName), m.styles.description.Render(desc))
lines = append(lines, line)
}
}
// Show scroll indicator if there are items below
if endIdx < len(m.matches) {
lines = append(lines, m.styles.scrollIndicator.Render(" ↓ more"))
}
return m.styles.menu.Render(strings.Join(lines, "\n"))
}
// updateMatches filters commands by prefix and updates the matches list
func (m *CompletionModel) updateMatches(prefix string) {
if m.registry == nil {
m.matches = nil
return
}
m.matches = m.registry.GetMatching(prefix)
// Reset selection if out of bounds
if m.index >= len(m.matches) {
m.index = 0
m.scroll = 0
}
m.adjustScroll()
}
// navigateUp moves selection up in the dropdown
func (m *CompletionModel) navigateUp() {
if len(m.matches) == 0 {
return
}
m.index--
if m.index < 0 {
m.index = len(m.matches) - 1
}
m.adjustScroll()
}
// navigateDown moves selection down in the dropdown
func (m *CompletionModel) navigateDown() {
if len(m.matches) == 0 {
return
}
m.index++
if m.index >= len(m.matches) {
m.index = 0
}
m.adjustScroll()
}
// adjustScroll ensures the selected item is visible in the dropdown
func (m *CompletionModel) adjustScroll() {
if m.index < m.scroll {
m.scroll = m.index
} else if m.index >= m.scroll+maxVisibleCompletions {
m.scroll = m.index - maxVisibleCompletions + 1
}
}
+125
View File
@@ -0,0 +1,125 @@
package slash
import (
"context"
"strings"
"sync"
"github.com/cline/grpc-go/client"
"github.com/cline/grpc-go/cline"
)
// Command represents a slash command available for autocomplete
type Command struct {
Name string
Description string
Section string // "default", "custom", or "cli"
CLICompatible bool
}
// Registry holds available slash commands for autocomplete
type Registry struct {
mu sync.RWMutex
commands []Command
}
// CLI-local commands (handled by CLI, not sent to backend)
var cliLocalCommands = []Command{
{Name: "plan", Description: "Switch to plan mode", Section: "cli", CLICompatible: true},
{Name: "act", Description: "Switch to act mode", Section: "cli", CLICompatible: true},
{Name: "cancel", Description: "Cancel the current task", Section: "cli", CLICompatible: true},
{Name: "exit", Description: "Exit follow mode", Section: "cli", CLICompatible: true},
}
// NewRegistry creates a new slash command registry
func NewRegistry() *Registry {
return &Registry{
commands: make([]Command, 0),
}
}
// FetchFromBackend fetches available commands from cline-core backend
func (r *Registry) FetchFromBackend(ctx context.Context, c *client.ClineClient) error {
resp, err := c.Slash.GetAvailableSlashCommands(ctx, &cline.EmptyRequest{})
if err != nil {
return err
}
r.mu.Lock()
defer r.mu.Unlock()
// Start with CLI-local commands
r.commands = append([]Command{}, cliLocalCommands...)
// Add backend commands (only CLI-compatible ones)
for _, cmd := range resp.Commands {
if cmd.CliCompatible {
r.commands = append(r.commands, Command{
Name: cmd.Name,
Description: cmd.Description,
Section: cmd.Section,
CLICompatible: cmd.CliCompatible,
})
}
}
return nil
}
// GetCommands returns all available commands
func (r *Registry) GetCommands() []Command {
r.mu.RLock()
defer r.mu.RUnlock()
// Return a copy to avoid race conditions
result := make([]Command, len(r.commands))
copy(result, r.commands)
return result
}
// GetMatching returns commands that start with the given prefix (case-insensitive)
func (r *Registry) GetMatching(prefix string) []Command {
r.mu.RLock()
defer r.mu.RUnlock()
prefix = strings.ToLower(prefix)
var matches []Command
for _, cmd := range r.commands {
if strings.HasPrefix(strings.ToLower(cmd.Name), prefix) {
matches = append(matches, cmd)
}
}
return matches
}
// IsValid checks if a command name is valid
func (r *Registry) IsValid(name string) bool {
r.mu.RLock()
defer r.mu.RUnlock()
name = strings.ToLower(name)
for _, cmd := range r.commands {
if strings.ToLower(cmd.Name) == name {
return true
}
}
return false
}
// IsCLILocal checks if a command is handled locally by CLI (not sent to backend)
func (r *Registry) IsCLILocal(name string) bool {
name = strings.ToLower(name)
for _, cmd := range cliLocalCommands {
if strings.ToLower(cmd.Name) == name {
return true
}
}
return false
}
// HasCommands returns true if the registry has any commands loaded
func (r *Registry) HasCommands() bool {
r.mu.RLock()
defer r.mu.RUnlock()
return len(r.commands) > 0
}
+18 -14
View File
@@ -38,13 +38,13 @@ type InputHandler struct {
// NewInputHandler creates a new input handler
func NewInputHandler(manager *Manager, coordinator *StreamCoordinator, cancelFunc context.CancelFunc) *InputHandler {
return &InputHandler{
manager: manager,
coordinator: coordinator,
cancelFunc: cancelFunc,
isRunning: false,
pollTicker: time.NewTicker(500 * time.Millisecond),
resultChan: make(chan output.InputSubmitMsg, 1),
cancelChan: make(chan struct{}, 1),
manager: manager,
coordinator: coordinator,
cancelFunc: cancelFunc,
isRunning: false,
pollTicker: time.NewTicker(500 * time.Millisecond),
resultChan: make(chan output.InputSubmitMsg, 1),
cancelChan: make(chan struct{}, 1),
}
}
@@ -251,7 +251,8 @@ func determineAutoApprovalAction(msg *types.ClineMessage) (string, error) {
types.ToolTypeListFilesRecursive,
types.ToolTypeListCodeDefinitionNames,
types.ToolTypeSearchFiles,
types.ToolTypeWebFetch:
types.ToolTypeWebFetch,
types.ToolTypeWebSearch:
return "read_files", nil
case types.ToolTypeEditedExistingFile,
types.ToolTypeNewFileCreated:
@@ -280,11 +281,12 @@ func determineAutoApprovalAction(msg *types.ClineMessage) (string, error) {
func (ih *InputHandler) promptForInput(ctx context.Context) (string, bool, error) {
currentMode := ih.manager.GetCurrentMode()
model := output.NewInputModel(
model := output.NewInputModelWithRegistry(
output.InputTypeMessage,
"Cline is ready for your message...",
"/plan or /act to switch modes\nctrl+e to open editor",
"/plan or /act to switch modes\nctrl+e to open editor\ntab to autocomplete commands",
currentMode,
ih.manager.GetSlashRegistry(),
)
return ih.runInputProgram(ctx, model)
@@ -294,12 +296,13 @@ func (ih *InputHandler) promptForInput(ctx context.Context) (string, bool, error
func (ih *InputHandler) promptForApproval(ctx context.Context, msg *types.ClineMessage) (bool, string, error) {
// Store the approval message for later use in determining auto-approval action
ih.approvalMessage = msg
model := output.NewInputModel(
model := output.NewInputModelWithRegistry(
output.InputTypeApproval,
"Let Cline use this tool?",
"",
ih.manager.GetCurrentMode(),
ih.manager.GetSlashRegistry(), // Pass registry for feedback input after approval
)
message, shouldSend, err := ih.runInputProgram(ctx, model)
@@ -394,7 +397,7 @@ func (ih *InputHandler) runInputProgram(ctx context.Context, model output.InputM
// Need to collect feedback - will be handled by model state change
return "", false, nil
}
// Check if NoAskAgain was selected
if result.NoAskAgain && result.Approved && ih.approvalMessage != nil {
// Determine which auto-approval action to enable
@@ -410,7 +413,7 @@ func (ih *InputHandler) runInputProgram(ctx context.Context, model output.InputM
}
}
}
// Store approval state for when feedback comes back
ih.feedbackApproval = false
ih.feedbackApproved = result.Approved
@@ -440,6 +443,7 @@ func (w *inputProgramWrapper) Init() tea.Cmd {
}
func (w *inputProgramWrapper) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
switch msg := msg.(type) {
case output.InputSubmitMsg:
// Handle input submission - clear the screen before quitting
+63
View File
@@ -14,6 +14,7 @@ import (
"github.com/cline/cli/pkg/cli/display"
"github.com/cline/cli/pkg/cli/global"
"github.com/cline/cli/pkg/cli/handlers"
"github.com/cline/cli/pkg/cli/slash"
"github.com/cline/cli/pkg/cli/types"
"github.com/cline/grpc-go/client"
"github.com/cline/grpc-go/cline"
@@ -36,6 +37,7 @@ type Manager struct {
systemRenderer *display.SystemMessageRenderer
streamingDisplay *display.StreamingDisplay
handlerRegistry *handlers.HandlerRegistry
slashRegistry *slash.Registry
isStreamingMode bool
isInteractive bool
currentMode string // "plan" or "act"
@@ -63,6 +65,7 @@ func NewManager(client *client.ClineClient) *Manager {
systemRenderer: systemRenderer,
streamingDisplay: streamingDisplay,
handlerRegistry: registry,
slashRegistry: slash.NewRegistry(),
currentMode: "plan", // Default mode
}
}
@@ -76,6 +79,10 @@ func NewManagerForAddress(ctx context.Context, address string) (*Manager, error)
manager := NewManager(client)
manager.clientAddress = address
// Fetch slash commands from backend (non-blocking, errors are logged)
manager.fetchSlashCommands(ctx)
return manager, nil
}
@@ -93,9 +100,25 @@ func NewManagerForDefault(ctx context.Context) (*Manager, error) {
manager.clientAddress = global.Clients.GetRegistry().GetDefaultInstance()
}
// Fetch slash commands from backend (non-blocking, errors are logged)
manager.fetchSlashCommands(ctx)
return manager, nil
}
// fetchSlashCommands fetches available slash commands from the backend
// This is non-blocking and errors are logged but don't prevent manager creation
func (m *Manager) fetchSlashCommands(ctx context.Context) {
if err := m.slashRegistry.FetchFromBackend(ctx, m.client); err != nil {
if global.Config.Verbose {
m.renderer.RenderDebug("Failed to fetch slash commands: %v", err)
}
// Non-fatal: CLI-local commands are still available
} else if global.Config.Verbose {
m.renderer.RenderDebug("Loaded %d slash commands", len(m.slashRegistry.GetCommands()))
}
}
// SwitchToInstance switches the manager to use a different Cline instance
func (m *Manager) SwitchToInstance(ctx context.Context, address string) error {
m.mu.Lock()
@@ -984,6 +1007,33 @@ func (m *Manager) processStateUpdate(stateUpdate *cline.State, coordinator *Stre
coordinator.MarkProcessedInCurrentTurn(msgKey)
}
case msg.Say == string(types.SayTypeMcpServerResponse):
msgKey := fmt.Sprintf("%d", msg.Timestamp)
if !coordinator.IsProcessedInCurrentTurn(msgKey) {
fmt.Println()
m.displayMessage(msg, false, false, i)
coordinator.MarkProcessedInCurrentTurn(msgKey)
}
case msg.Say == string(types.SayTypeMcpNotification):
msgKey := fmt.Sprintf("%d", msg.Timestamp)
if !coordinator.IsProcessedInCurrentTurn(msgKey) {
fmt.Println()
m.displayMessage(msg, false, false, i)
coordinator.MarkProcessedInCurrentTurn(msgKey)
}
case msg.Say == string(types.SayTypeUseMcpServer):
msgKey := fmt.Sprintf("%d", msg.Timestamp)
if !coordinator.IsProcessedInCurrentTurn(msgKey) {
fmt.Println()
m.displayMessage(msg, false, false, i)
coordinator.MarkProcessedInCurrentTurn(msgKey)
}
case msg.Say == string(types.SayTypeCheckpointCreated):
msgKey := fmt.Sprintf("%d", msg.Timestamp)
if !coordinator.IsProcessedInCurrentTurn(msgKey) {
@@ -1007,6 +1057,14 @@ func (m *Manager) processStateUpdate(stateUpdate *cline.State, coordinator *Stre
}
}
case msg.Say == string(types.SayTypeCompletionResult):
msgKey := fmt.Sprintf("%d", msg.Timestamp)
if !msg.Partial && !coordinator.IsProcessedInCurrentTurn(msgKey) {
fmt.Println()
m.displayMessage(msg, false, false, i)
coordinator.MarkProcessedInCurrentTurn(msgKey)
}
case msg.Ask == string(types.AskTypeCommandOutput):
msgKey := fmt.Sprintf("%d", msg.Timestamp)
if !coordinator.IsProcessedInCurrentTurn(msgKey) {
@@ -1228,6 +1286,11 @@ func (m *Manager) GetCurrentMode() string {
return m.currentMode
}
// GetSlashRegistry returns the slash command registry
func (m *Manager) GetSlashRegistry() *slash.Registry {
return m.slashRegistry
}
// extractModeFromState extracts the current mode from state JSON
func (m *Manager) extractModeFromState(stateJson string) string {
var rawState map[string]interface{}
+6
View File
@@ -290,6 +290,12 @@ func setSimpleField(settings *cline.Settings, key, value string) error {
return err
}
settings.ActModeAwsBedrockCustomSelected = boolPtr(val)
case "hooks_enabled":
val, err := parseBool(value)
if err != nil {
return err
}
settings.HooksEnabled = boolPtr(val)
// Integer fields
case "request_timeout_ms":
+1
View File
@@ -113,6 +113,7 @@ const (
ToolTypeListCodeDefinitionNames ToolType = "listCodeDefinitionNames"
ToolTypeSearchFiles ToolType = "searchFiles"
ToolTypeWebFetch ToolType = "webFetch"
ToolTypeWebSearch ToolType = "webSearch"
ToolTypeSummarizeTask ToolType = "summarizeTask"
)
+60
View File
@@ -278,6 +278,29 @@ TASK SETTINGS
mode Starting mode (act/plan)
hooks_enabled
Enable or disable hooks for the task (true/false)
HOOKS INTEGRATION
Hooks let you inject custom logic into Cline's workflow at key moments.
They can validate operations before they execute, monitor tool usage,
and shape AI decisions. This allows you to integrate hooks into
automated workflows, CI/CD pipelines, and headless task execution.
Enable hooks for a task:
cline "prompt" -s hooks_enabled=true
Configure hooks globally:
cline config set hooks-enabled=true
cline config get hooks-enabled
Note: Hooks in the CLI are only supported on macOS and Linux.
For complete hooks documentation, see:
<https://docs.cline.bot/features/hooks/index>
NOTES & EXAMPLES
The cline task send and cline task new commands support reading from
stdin, enabling powerful pipeline compositions:
@@ -348,6 +371,43 @@ COPYRIGHT
Copyright © 2025 Cline Bot Inc. Licensed under the Apache License 2.0.
```
## JSON output (-F json)
When you run a command with `-F json` (or `--output-format json`), Cline prints each client message as JSON.
### ClineMessage schema
| Field | Type | Required | Notes |
|-------|------|----------|-------|
| `type` | `"ask" or "say"` | Yes | Top-level message category. |
| `text` | `string` | Yes | Human-readable message content. |
| `ts` | `number` | Yes | Unix epoch timestamp in milliseconds. |
| `reasoning` | `string` | No | Omitted when empty. |
| `say` | `string` | No | Omitted when empty. Present when `type` is `"say"`. |
| `ask` | `string` | No | Omitted when empty. Present when `type` is `"ask"`. |
| `partial` | `boolean` | No | Omitted when false. `true` for streaming updates. |
| `images` | `string[]` | No | Omitted when empty. Image URIs when included with a message. |
| `files` | `string[]` | No | Omitted when empty. File paths when attached to a message. |
| `lastCheckpointHash` | `string` | No | Omitted when empty. Git checkpoint hash when available. |
| `isCheckpointCheckedOut` | `boolean` | No | Omitted when false. `true` if Cline checked out a checkpoint. |
| `isOperationOutsideWorkspace` | `boolean` | No | Omitted when false. `true` if an operation happened outside the workspace. |
<Note>
Most fields are optional and omitted when empty. If you parse this output, treat missing fields as “not present”, not as empty strings.
</Note>
### Example
```json
{
"type": "say",
"text": "Cline is about to run a command.",
"ts": 1760501486669,
"say": "command",
"partial": false
}
```
### Shell Completion
Generate autocompletion scripts for various shells:
+14
View File
@@ -57,6 +57,20 @@ During installation, you'll authenticate and configure your preferred provider u
- Create GitLab pipelines that generate migration scripts from schema changes
- Build Jenkins jobs that use Cline to analyze test failures and suggest fixes
## Hooks integration
[Hooks](/features/hooks/index) let you inject custom logic into Cline's workflow to validate operations and enforce policies. You can enable hooks when running tasks from the command line:
```bash
# Enable hooks for a task
cline "What does this repo do?" -s hooks_enabled=true
# Configure hooks globally via CLI
cline config set hooks-enabled=true
```
This allows you to integrate hooks into automated workflows, CI/CD pipelines, and headless task execution for consistent enforcement across all environments.
## Learn more
<Columns cols={2}>
+43 -6
View File
@@ -278,18 +278,47 @@
"pages": [
"enterprise-solutions/overview",
"enterprise-solutions/onboarding",
"enterprise-solutions/members/roles-and-permissions",
"enterprise-solutions/team-management/managing-members",
{
"group": "Provider Remote Configuration",
"group": "SaaS Provider Configuration",
"pages": [
"enterprise-solutions/configuration/remote-configuration/overview",
{
"group": "AWS Bedrock",
"pages": [
"enterprise-solutions/provider-remote-config/aws-bedrock/admin-configuration",
"enterprise-solutions/provider-remote-config/aws-bedrock/member-configuration"
"enterprise-solutions/configuration/remote-configuration/aws-bedrock/admin-configuration",
"enterprise-solutions/configuration/remote-configuration/aws-bedrock/member-configuration"
]
},
{
"group": "LiteLLM",
"pages": [
"enterprise-solutions/configuration/remote-configuration/litellm/admin-configuration",
"enterprise-solutions/configuration/remote-configuration/litellm/member-configuration"
]
},
{
"group": "Google Vertex AI",
"pages": [
"enterprise-solutions/configuration/remote-configuration/google-vertex/admin-configuration",
"enterprise-solutions/configuration/remote-configuration/google-vertex/member-configuration"
]
}
]
},
{
"group": "Control Other Cline Features",
"pages": [
"enterprise-solutions/configuration/infrastructure-configuration/control-other-cline-features/yolo-mode"
]
},
{
"group": "Monitoring",
"pages": [
"enterprise-solutions/monitoring/overview",
"enterprise-solutions/monitoring/telemetry",
"enterprise-solutions/monitoring/opentelemetry"
]
}
]
}
@@ -367,11 +396,11 @@
},
{
"source": "/enterprise-solutions/configure-AWS-Bedrock-Admin",
"destination": "/enterprise-solutions/provider-remote-config/aws-bedrock/admin-configuration"
"destination": "/enterprise-solutions/configuration/remote-configuration/aws-bedrock/admin-configuration"
},
{
"source": "/enterprise-solutions/configure-AWS-Bedrock-Member",
"destination": "/enterprise-solutions/provider-remote-config/aws-bedrock/member-configuration"
"destination": "/enterprise-solutions/configuration/remote-configuration/aws-bedrock/member-configuration"
},
{
"source": "/enterprise-solutions/configure-workOS-authkit",
@@ -380,6 +409,14 @@
{
"source": "/enterprise-solutions/Onboarding your Organization",
"destination": "/enterprise-solutions/onboarding"
},
{
"source": "/enterprise-solutions/team-management/overview",
"destination": "/enterprise-solutions/team-management/managing-members"
},
{
"source": "/enterprise-solutions/team-management/roles-and-permissions",
"destination": "/enterprise-solutions/team-management/managing-members"
}
],
"search": {
@@ -0,0 +1,105 @@
---
title: "Choosing Your Configuration Path"
sidebarTitle: "Deployment Guide"
description: "Decide between SaaS and Self-Hosted configuration for your Cline Enterprise deployment"
---
Choose the right configuration approach for your organization. Most teams start with SaaS for quick deployment, while enterprises with complex requirements opt for self-hosted infrastructure.
## Configuration Paths
<CardGroup cols={2}>
<Card title="SaaS Provider Configuration" icon="cloud" href="/enterprise-solutions/configuration/remote-configuration/overview">
### Quick Setup via Web Console
✅ No infrastructure required
✅ 5-10 minute configuration
✅ Web-based admin console
✅ Automatic updates
✅ Simplified credential management
**Best for:**
- Small to medium teams (5-50 developers)
- Quick deployment needs
- Limited DevOps resources
- Standard security requirements
- Single region deployments
</Card>
<Card title="Self-Hosted Configuration" icon="server" href="/enterprise-solutions/configuration/infrastructure-configuration/overview">
### Full Infrastructure Control
✅ Your own AWS/GCP/K8s
✅ VPC endpoints & private connectivity
✅ Multi-account setups
✅ Advanced compliance & audit
✅ GitOps workflows
**Best for:**
- Large enterprises (50+ developers)
- Complex security requirements
- Existing cloud infrastructure
- Multi-region deployments
- Custom compliance needs
</Card>
</CardGroup>
## Detailed Comparison
### Feature Comparison
| Feature | SaaS | Self-Hosted |
|---------|------|-------------|
| **Configuration** | Web UI | YAML + Helm/Kubernetes |
| **Infrastructure** | None required | Full AWS/GCP/K8s |
| **VPC Endpoints** | Basic | Full private connectivity |
| **Multi-Account** | ❌ | ✅ |
| **IAM** | Standard RBAC roles | Standard RBAC roles |
| **Compliance** | Standard | Custom frameworks |
| **GitOps** | ❌ | ✅ |
| **Maintenance** | Managed by Cline | Self-managed |
| **Updates** | Automatic (extension) | Automatic (extension) + Infrastructure control |
### Security & Compliance
| Capability | SaaS | Self-Hosted |
|------------|------|-------------|
| **Network Encryption** | HTTPS/TLS | HTTPS/TLS |
| **Network** | Public internet | Private VPC endpoints |
| **Access Control** | Standard RBAC | Standard RBAC |
| **Audit Logs** | OpenTelemetry traces | OpenTelemetry traces + Infrastructure logs |
| **Data Residency** | Cline-managed deployment | Customer-controlled deployment |
### Cost Structure
| Cost Category | SaaS | Self-Hosted |
|---------------|------|-------------|
| **Cline Subscription** | Fixed enterprise fee | Fixed enterprise fee |
| **Inference Provider Costs** | Usage-based | Usage-based |
| **Infrastructure** | ✅ None required | Kubernetes, networking, storage |
| **Personnel** | ✅ None required | DevOps team needed |
| **Total Cost Profile** | Predictable and simple | Variable based on scale |
## Migration Path
<Note>
Most organizations start with SaaS configuration for quick deployment, then migrate to self-hosted later as requirements grow. This minimizes risk and ensures your infrastructure meets actual usage patterns.
</Note>
## Getting Started
<CardGroup cols={2}>
<Card title="Start with SaaS" icon="rocket" href="/enterprise-solutions/configuration/remote-configuration/overview">
Begin with quick SaaS setup
</Card>
<Card title="Deploy Self-Hosted" icon="server" href="/enterprise-solutions/configuration/infrastructure-configuration/overview">
Plan your infrastructure deployment
</Card>
</CardGroup>
## Need Help Deciding?
- [**Contact Cline Enterprise Sales**](https://cline.bot/contact-sales) for a consultation on your specific requirements
- [**Start with SaaS**](/enterprise-solutions/configuration/remote-configuration/overview) if unsure - it's lower risk and you can always migrate later
- [**Review Self-Hosted Requirements**](/enterprise-solutions/configuration/infrastructure-configuration/overview) if you have existing infrastructure that could benefit from self-hosted deployment
@@ -0,0 +1,35 @@
---
title: "Overview"
sidebarTitle: "Overview"
description: "Configure Cline settings for your enterprise deployment"
---
This section covers configuration options for controlling Cline's behavior in enterprise deployments.
## Available Settings
<Card title="YOLO Mode" icon="rocket" href="/enterprise-solutions/configuration/infrastructure-configuration/control-other-cline-features/yolo-mode">
Control enterprise access to autonomous operation mode with complete auto-approval
</Card>
## Configuration Methods
These settings can be configured through:
### Individual Users
- Users can toggle settings in their local Cline interface
- Enterprise policies can restrict certain settings
- Changes apply immediately to new tasks
## Enterprise Controls
Administrators can enforce policies through remote configuration:
```json
{
"yoloModeAllowed": false
}
```
When `yoloModeAllowed` is set to `false`, users cannot enable YOLO Mode in their local Cline interface.
@@ -0,0 +1,233 @@
---
title: "YOLO Mode"
sidebarTitle: "YOLO Mode"
description: "Enterprise controls for YOLO Mode autonomous operation"
---
YOLO Mode enables Cline to operate with complete autonomy, auto-approving all actions without user confirmation. For Enterprise administrators, this page covers how to control access to YOLO Mode across your organization.
<Note>
For complete details about YOLO Mode functionality, risks, and best practices, see [YOLO Mode in Features](/features/yolo-mode).
</Note>
## Overview
When YOLO Mode is enabled, Cline automatically approves all operations including file changes, terminal commands, browser actions, and mode transitions. This provides maximum automation speed but removes all safety guardrails.
<Warning>
YOLO Mode is powerful but potentially dangerous. Administrators should carefully consider which teams or users should have access to this feature.
</Warning>
## Enterprise Administrator Configuration
As an Enterprise administrator, you can control whether users in your organization can enable YOLO Mode through remote configuration.
### Disabling YOLO Mode for All Users
Add the following to your remote configuration JSON:
```json
{
"yoloModeAllowed": false
}
```
When `yoloModeAllowed` is set to `false`:
- The YOLO Mode toggle is disabled in all user interfaces
- Users cannot enable YOLO Mode even in their local settings
- This policy applies immediately to all team members
- Enterprise policy takes precedence over individual preferences
### Enabling YOLO Mode for All Users
```json
{
"yoloModeAllowed": true
}
```
When `yoloModeAllowed` is set to `true` or omitted:
- Users can enable or disable YOLO Mode in their local Cline settings
- Individual users make their own decisions about using YOLO Mode
- No organizational restrictions apply
## Enterprise Policy Recommendations
### Recommended Approach
Most organizations should **disable YOLO Mode by default** for the following reasons:
<AccordionGroup>
<Accordion title="Security & Compliance" icon="shield">
YOLO Mode removes all approval gates, potentially allowing:
- Unreviewed code changes to critical systems
- Execution of commands without oversight
- Automated actions that may violate compliance policies
- Risk of data exposure through unmonitored operations
</Accordion>
<Accordion title="Code Quality Control" icon="code">
Without approval prompts:
- Changes happen too quickly to review in real-time
- Mistakes can compound before detection
- Quality gates are bypassed
- Rollback becomes more complex
</Accordion>
<Accordion title="Audit Requirements" icon="clipboard-check">
Many industries require:
- Documented approval trails for code changes
- Clear accountability for automated actions
- Traceable decision-making processes
- YOLO Mode may conflict with these requirements
</Accordion>
</AccordionGroup>
### Exceptions: When to Allow YOLO Mode
Consider enabling YOLO Mode for:
**Sandbox/Development Environments**
- Isolated testing environments
- Personal development machines
- Proof-of-concept projects
- Temporary exploratory work
**Specialized Roles**
- DevOps automation engineers (with proper monitoring)
- Research & development teams in sandboxed environments
- Teams with robust rollback and recovery procedures
**Controlled Use Cases**
- Scripted CI/CD pipelines with comprehensive logging
- Automated testing scenarios
- Demonstration or training environments
## Enterprise Considerations
### Security Implications
When YOLO Mode is enabled in your organization:
**Risk Factors:**
- All tool executions happen automatically without human review
- Potential for rapid propagation of mistakes across multiple files
- Reduced opportunity to catch security vulnerabilities before implementation
- Automated operations may bypass existing security controls
**Mitigations:**
- Implement comprehensive logging and monitoring
- Restrict YOLO Mode to non-production environments
- Require periodic security reviews for teams using YOLO Mode
- Ensure version control and rollback procedures are in place
### Monitoring Requirements
When allowing YOLO Mode in your organization, implement:
**Mandatory Monitoring:**
1. **Real-time Activity Tracking**
- Monitor which users enable YOLO Mode
- Track when YOLO Mode is active
- Log all automated actions taken
2. **Audit Trail Maintenance**
- Preserve complete history of YOLO Mode sessions
- Document what was automated and when
- Maintain records for compliance purposes
3. **Anomaly Detection**
- Alert on unusual patterns of automated actions
- Flag high-risk operations performed automatically
- Monitor for potential security incidents
### Monitoring YOLO Mode Usage
When YOLO Mode is enabled (by policy), track usage through:
**Telemetry Events:**
- Captures when users toggle YOLO Mode on/off
- Records which tasks were executed with YOLO Mode enabled
- Provides aggregate usage statistics across your organization
**Task History:**
- Task metadata indicates whether YOLO Mode was active
- Complete action logs show automated approvals
- Enables post-action review and analysis
**Audit Logs:**
- Standard logging captures all automated decisions
- Tool executions are recorded with timestamps
- Provides compliance trail for regulated environments
## Recommended Policies by Organization Size
### Small Teams (5-20 developers)
- **Default:** Disabled
- **Exceptions:** Allow for individual sandbox environments
- **Monitoring:** Basic telemetry sufficient
### Medium Organizations (20-100 developers)
- **Default:** Disabled
- **Exceptions:** Permit for designated dev/test environments only
- **Monitoring:** Required telemetry + regular audit reviews
### Large Enterprises (100+ developers)
- **Default:** Strictly disabled
- **Exceptions:** Require security approval for each use case
- **Monitoring:** Comprehensive telemetry + real-time alerting + compliance reporting
## Technical Implementation
### Configuration Management
**Centralized Control through Remote Configuration:**
```json
{
"yoloModeAllowed": false,
// Other policies...
}
```
This setting:
- Applies instantly to all connected clients
- Cannot be overridden by individual users
- Persists across Cline restarts
- Is synchronized across all team members
### Policy Enforcement
The enforcement mechanism:
1. Users authenticate with your enterprise configuration server
2. Remote configuration is downloaded and applied
3. Local UI respects enterprise policy settings
4. YOLO Mode toggle is disabled if policy forbids it
5. Users see a message explaining the enterprise restriction
## Compliance Considerations
For organizations in regulated industries:
**SOC 2 Compliance:**
- YOLO Mode may conflict with change management controls
- Document decision to allow/disallow in security policies
- Implement compensating controls if YOLO Mode is permitted
**GDPR/Data Protection:**
- Automated operations must still respect data handling policies
- Ensure YOLO Mode doesn't bypass data protection safeguards
- Maintain audit trails of automated data processing
**Industry-Specific:**
- Financial services: Generally incompatible with Reg requirements
- Healthcare: May violate HIPAA audit trail requirements
- Government: Often conflicts with approval workflow mandates
## Support & Questions
For help configuring YOLO Mode policies:
- Review [Remote Configuration Overview](/enterprise-solutions/configuration/remote-configuration/overview)
- See [Features: YOLO Mode](/features/yolo-mode) for detailed functionality
- Contact your Enterprise support representative
- Join our [Discord](https://discord.gg/cline) for community discussion
@@ -0,0 +1,565 @@
---
title: "MCP Marketplace"
sidebarTitle: "MCP Marketplace"
description: "Deploy pre-built enterprise MCP servers from the Cline marketplace with one-click configuration"
---
The MCP Marketplace provides curated, enterprise-ready integrations with popular development tools and services. All marketplace servers are built with enterprise security, compliance, and scalability in mind.
## Enterprise Marketplace Benefits
<CardGroup cols={2}>
<Card title="One-Click Deployment" icon="rocket">
Deploy complex integrations instantly with pre-configured enterprise settings.
</Card>
<Card title="Security Hardened" icon="shield-check">
All servers include enterprise security features, audit logging, and compliance controls.
</Card>
<Card title="Maintained & Updated" icon="sync">
Regular security updates and feature enhancements managed by Cline Enterprise team.
</Card>
<Card title="Enterprise Support" icon="headset">
Dedicated support channels for marketplace integration issues and customization.
</Card>
</CardGroup>
## Available Integrations
### Development Tools
<CardGroup cols={3}>
<Card title="GitHub Enterprise" icon="github">
Repository management, issue tracking, PR workflows, and code analysis
</Card>
<Card title="GitLab Enterprise" icon="gitlab">
Project management, CI/CD pipelines, merge requests, and security scanning
</Card>
<Card title="Bitbucket Enterprise" icon="bitbucket">
Source code management, build pipelines, and deployment automation
</Card>
</CardGroup>
### Project Management
<CardGroup cols={3}>
<Card title="Jira Enterprise" icon="jira">
Issue tracking, sprint management, custom fields, and workflow automation
</Card>
<Card title="Azure DevOps" icon="microsoft">
Work items, boards, repos, pipelines, and test management
</Card>
<Card title="Linear" icon="linear">
Issue tracking, project planning, and development workflow integration
</Card>
</CardGroup>
### Communication & Collaboration
<CardGroup cols={3}>
<Card title="Slack Enterprise Grid" icon="slack">
Notifications, bot interactions, file sharing, and workflow automation
</Card>
<Card title="Microsoft Teams" icon="microsoft-teams">
Chat notifications, meeting integration, and collaborative workflows
</Card>
<Card title="Discord" icon="discord">
Community management, bot interactions, and developer notifications
</Card>
</CardGroup>
### Cloud Services
<CardGroup cols={3}>
<Card title="AWS Services" icon="aws">
EC2, S3, Lambda, RDS, CloudWatch, and other AWS service integrations
</Card>
<Card title="Google Cloud" icon="google-cloud">
Compute Engine, Cloud Storage, BigQuery, and GCP service management
</Card>
<Card title="Azure Services" icon="azure">
Virtual Machines, Storage Accounts, Functions, and Azure resource management
</Card>
</CardGroup>
## Installing Marketplace Servers
### Via Cline Enterprise Dashboard
1. **Access Marketplace**: Navigate to `Settings > Enterprise > MCP Marketplace`
2. **Browse Integrations**: Filter by category, popularity, or search by name
3. **Review Details**: Check compatibility, permissions, and configuration requirements
4. **Install**: Click "Install" and configure required settings
5. **Deploy**: Approve deployment to your selected environment
### Via Configuration File
Install marketplace servers through enterprise configuration:
```yaml
# enterprise-mcp-config.yaml
mcp:
marketplace_servers:
- name: "github-enterprise"
package: "@cline/mcp-github-enterprise"
version: "2.1.0"
environment: "production"
config:
github:
base_url: "https://github.company.com/api/v3"
token: "${GITHUB_ENTERPRISE_TOKEN}"
organization: "company"
features:
issue_management: true
pull_request_automation: true
code_analysis: true
security_scanning: true
permissions:
repositories: "read-write"
issues: "write"
pull_requests: "write"
compliance:
audit_logging: true
data_retention_days: 365
encryption_at_rest: true
- name: "jira-enterprise"
package: "@cline/mcp-jira-enterprise"
version: "1.8.3"
environment: "production"
config:
jira:
base_url: "https://company.atlassian.net"
username: "${JIRA_USERNAME}"
api_token: "${JIRA_API_TOKEN}"
projects:
- key: "DEV"
permissions: ["read", "write", "transition"]
- key: "OPS"
permissions: ["read", "comment"]
compliance:
field_encryption: ["description", "comments"]
audit_trail: true
```
### Via CLI
Deploy using the Cline Enterprise CLI:
```bash
# Install GitHub Enterprise integration
cline-enterprise mcp install github-enterprise \
--version 2.1.0 \
--config-file github-config.yaml \
--environment production
# Install Slack Enterprise Grid integration
cline-enterprise mcp install slack-enterprise-grid \
--version 1.5.2 \
--config workspace_id=T1234567890 \
--config bot_token=${SLACK_BOT_TOKEN} \
--environment production
# List installed marketplace servers
cline-enterprise mcp list --environment production
# Check server status
cline-enterprise mcp status github-enterprise --environment production
```
## Configuration Examples
### GitHub Enterprise Integration
```yaml
# github-enterprise-config.yaml
github:
base_url: "https://github.company.com/api/v3"
token: "${GITHUB_ENTERPRISE_TOKEN}"
organization: "company"
# Repository access controls
repositories:
allowed_patterns:
- "company/*"
- "internal/*"
blocked_patterns:
- "*/secrets"
- "*/private-keys"
# Feature configuration
features:
issue_management:
enabled: true
auto_assign: true
labels:
- "ai-generated"
- "cline-task"
pull_requests:
enabled: true
auto_review_request: true
required_approvals: 2
enforce_branch_protection: true
code_analysis:
enabled: true
languages: ["typescript", "python", "go", "rust"]
security_scan: true
# Security and compliance
security:
webhook_secret: "${GITHUB_WEBHOOK_SECRET}"
rate_limiting:
requests_per_hour: 5000
burst_limit: 100
ip_whitelist:
- "10.0.0.0/8"
- "192.168.0.0/16"
audit:
log_level: "INFO"
include_payloads: false
retention_days: 365
destinations: ["datadog", "splunk"]
```
### Jira Enterprise Integration
```yaml
# jira-enterprise-config.yaml
jira:
base_url: "https://company.atlassian.net"
username: "${JIRA_USERNAME}"
api_token: "${JIRA_API_TOKEN}"
# Project access configuration
projects:
- key: "DEV"
name: "Development"
permissions: ["read", "write", "transition", "assign"]
issue_types: ["Story", "Bug", "Task", "Subtask"]
- key: "OPS"
name: "Operations"
permissions: ["read", "comment", "watch"]
# Custom field mappings
custom_fields:
story_points: "customfield_10002"
epic_link: "customfield_10014"
sprint: "customfield_10020"
# Workflow automation
automation:
auto_transition:
enabled: true
rules:
- from_status: "To Do"
to_status: "In Progress"
condition: "assignee_changed"
auto_assign:
enabled: true
rules:
- issue_type: "Bug"
component: "Frontend"
assignee: "frontend-team-lead"
# Security and compliance
security:
encrypt_fields: ["description", "comment"]
mask_sensitive_data: true
audit_changes: true
compliance:
gdpr_compliant: true
data_retention_policy: "365_days"
audit_log_retention: "7_years"
```
### Slack Enterprise Grid Integration
```yaml
# slack-enterprise-config.yaml
slack:
workspace_id: "T1234567890"
bot_token: "${SLACK_BOT_TOKEN}"
signing_secret: "${SLACK_SIGNING_SECRET}"
# Channel management
channels:
notifications:
- name: "#dev-alerts"
types: ["deployments", "errors", "security"]
- name: "#ai-activity"
types: ["cline-tasks", "completions"]
private_channels:
- name: "#security-incidents"
members: ["security-team"]
types: ["security-alerts", "compliance-issues"]
# Bot behavior
bot:
display_name: "Cline Enterprise"
default_channel: "#general"
response_delay_ms: 1000
commands:
- command: "/cline-status"
description: "Check Cline Enterprise status"
permission: "all"
- command: "/cline-deploy"
description: "Trigger deployment"
permission: "admin"
# Enterprise features
enterprise:
app_approval_required: true
data_residency: "US"
compliance_export: true
dlp:
enabled: true
scan_messages: true
block_sensitive_data: true
# Security settings
security:
require_app_approval: true
audit_api_calls: true
encrypt_messages: true
retain_audit_logs_days: 2555 # 7 years
```
## Enterprise Management
### Multi-Environment Deployment
Deploy marketplace servers across environments:
```yaml
# environments-config.yaml
environments:
development:
marketplace_servers:
- github-enterprise:
version: "2.1.0-beta"
config_override:
github:
base_url: "https://github-dev.company.com/api/v3"
organization: "company-dev"
staging:
marketplace_servers:
- github-enterprise:
version: "2.1.0-rc1"
config_override:
github:
base_url: "https://github-staging.company.com/api/v3"
organization: "company-staging"
production:
marketplace_servers:
- github-enterprise:
version: "2.1.0"
config_override:
github:
base_url: "https://github.company.com/api/v3"
organization: "company"
```
### Version Management
Control marketplace server versions:
```bash
# List available versions
cline-enterprise mcp versions github-enterprise
# Upgrade to latest version
cline-enterprise mcp upgrade github-enterprise --version 2.2.0 --environment staging
# Rollback to previous version
cline-enterprise mcp rollback github-enterprise --version 2.1.0 --environment staging
# Pin to specific version (disable auto-updates)
cline-enterprise mcp pin github-enterprise --version 2.1.0
```
### Health Monitoring
Monitor marketplace server health:
```yaml
# monitoring-config.yaml
monitoring:
marketplace_servers:
health_checks:
interval_seconds: 30
timeout_seconds: 10
metrics:
- server_status
- request_latency
- error_rate
- resource_usage
alerts:
- name: "marketplace-server-down"
condition: "server_status != 1"
severity: "critical"
- name: "high-error-rate"
condition: "error_rate > 0.05"
severity: "warning"
- name: "performance-degradation"
condition: "request_latency > 5s"
severity: "warning"
```
## Security & Compliance
### Enterprise Security Features
All marketplace servers include:
- **Authentication Integration**: SSO, SAML, OAuth2 support
- **Authorization Controls**: RBAC and fine-grained permissions
- **Audit Logging**: Comprehensive activity tracking
- **Data Encryption**: At-rest and in-transit encryption
- **Network Security**: VPN, IP whitelisting, private endpoints
- **Compliance**: SOC2, GDPR, HIPAA compliance frameworks
### Data Governance
Configure data handling policies:
```yaml
# data-governance-config.yaml
data_governance:
classification:
public:
retention_days: 90
backup_required: false
internal:
retention_days: 365
backup_required: true
encryption_required: false
confidential:
retention_days: 2555 # 7 years
backup_required: true
encryption_required: true
audit_access: true
restricted:
retention_days: 2555
backup_required: true
encryption_required: true
audit_access: true
approval_required: true
privacy:
pii_detection: true
pii_masking: true
gdpr_compliance: true
data_subject_requests: true
compliance:
frameworks: ["SOC2", "GDPR", "CCPA", "HIPAA"]
audit_frequency: "quarterly"
certification_renewal: "annual"
```
## Best Practices
### Installation
1. **Review Permissions**: Always review required permissions before installation
2. **Test in Staging**: Deploy to staging environment first
3. **Configuration Validation**: Validate configuration files before deployment
4. **Backup Current State**: Create configuration backups before changes
5. **Monitor Deployment**: Watch health metrics during rollout
### Configuration
1. **Environment Separation**: Use different configurations per environment
2. **Secret Management**: Store sensitive data in secure secret stores
3. **Version Pinning**: Pin versions for production deployments
4. **Access Controls**: Implement least-privilege access policies
5. **Regular Updates**: Schedule regular security and feature updates
### Monitoring
1. **Health Checks**: Monitor server health continuously
2. **Performance Metrics**: Track latency and throughput
3. **Error Tracking**: Alert on error rates and failure patterns
4. **Resource Usage**: Monitor CPU, memory, and network usage
5. **Audit Reviews**: Regular review of audit logs and access patterns
## Troubleshooting
### Common Issues
**Installation Failures**:
```bash
# Check marketplace connectivity
cline-enterprise mcp marketplace-status
# Verify authentication
cline-enterprise auth verify --service marketplace
# Check installation logs
cline-enterprise logs mcp-installer --lines 100
```
**Configuration Errors**:
```bash
# Validate configuration
cline-enterprise mcp validate-config --file config.yaml
# Test connectivity
cline-enterprise mcp test-connection github-enterprise --environment staging
# Check server status
cline-enterprise mcp status --all
```
**Performance Issues**:
```bash
# Check server metrics
cline-enterprise mcp metrics github-enterprise --duration 1h
# View recent error logs
cline-enterprise logs github-enterprise --level error --lines 50
```
## Support
For marketplace server issues:
- **Documentation**: Check server-specific documentation in the dashboard
- **Community**: Join the Cline Enterprise community forum
- **Support Tickets**: Create support tickets for critical issues
- **Professional Services**: Engage professional services for custom configurations
Enterprise customers have access to dedicated support channels with SLA guarantees.
@@ -0,0 +1,571 @@
---
title: "MCP Integration"
sidebarTitle: "Overview"
description: "Configure Model Context Protocol (MCP) servers and marketplace integrations for enterprise Cline deployments"
---
Model Context Protocol (MCP) provides standardized communication between AI models and external data sources, tools, and services. Enterprise MCP integration allows you to securely connect Cline to your organization's systems while maintaining governance and compliance.
## Enterprise MCP Benefits
<CardGroup cols={2}>
<Card title="Extensible Architecture" icon="puzzle-piece">
Connect to unlimited external tools, databases, APIs, and services through standardized MCP servers.
</Card>
<Card title="Enterprise Security" icon="shield-alt">
Secure authentication, authorization, and audit trails for all MCP server communications.
</Card>
<Card title="Centralized Management" icon="network-wired">
Manage and deploy MCP servers enterprise-wide with version control and configuration management.
</Card>
<Card title="Compliance Ready" icon="clipboard-check">
Built-in logging, monitoring, and data governance for regulatory compliance requirements.
</Card>
</CardGroup>
## MCP Architecture Overview
```mermaid
graph TB
A[Cline Enterprise] --> B[MCP Hub]
B --> C[MCP Marketplace]
B --> D[Remote MCP Servers]
B --> E[Internal MCP Servers]
C --> F[GitHub Integration]
C --> G[Slack Integration]
C --> H[Jira Integration]
D --> I[Custom APIs]
D --> J[Databases]
D --> K[Cloud Services]
E --> L[Internal Tools]
E --> M[Legacy Systems]
E --> N[Security Systems]
O[Enterprise Admin] --> B
P[Audit Logging] --> B
Q[Authentication] --> B
```
## Core Components
<CardGroup cols={2}>
<Card title="MCP Marketplace" icon="store" href="/enterprise-solutions/configuration/infrastructure-configuration/mcp/mcp-marketplace">
Pre-built, enterprise-ready MCP servers for popular tools and services with one-click deployment.
</Card>
<Card title="Remote MCP Servers" icon="server" href="/enterprise-solutions/configuration/infrastructure-configuration/mcp/remote-mcp-servers">
Deploy and manage custom MCP servers across your infrastructure with centralized configuration.
</Card>
</CardGroup>
## Enterprise Configuration
### Basic MCP Hub Setup
Configure the central MCP hub for your enterprise deployment:
```yaml
# mcp-hub-config.yaml
mcp:
hub:
enabled: true
port: 8080
authentication:
method: "enterprise-sso"
jwt_secret: "${MCP_JWT_SECRET}"
# Server discovery
discovery:
methods: ["marketplace", "remote", "local"]
marketplace_url: "https://mcp.cline.bot/marketplace"
# Security settings
security:
enforce_tls: true
allowed_origins: ["https://*.company.com"]
rate_limiting:
requests_per_minute: 1000
burst_size: 100
# Audit and compliance
audit:
enabled: true
log_level: "INFO"
destinations: ["file", "syslog", "datadog"]
retention_days: 90
```
### Multi-Environment Configuration
Deploy MCP configurations across environments:
<Tabs>
<Tab title="Development">
```yaml
# mcp-dev-config.yaml
mcp:
environment: "development"
servers:
- name: "github-dev"
type: "marketplace"
package: "@cline/mcp-github"
version: "latest"
config:
github_token: "${GITHUB_DEV_TOKEN}"
org: "company-dev"
- name: "local-db"
type: "remote"
url: "http://localhost:3001"
auth:
type: "api-key"
key: "${DEV_DB_API_KEY}"
policies:
allow_experimental: true
auto_update: true
rate_limits:
relaxed: true
```
</Tab>
<Tab title="Production">
```yaml
# mcp-prod-config.yaml
mcp:
environment: "production"
servers:
- name: "github-prod"
type: "marketplace"
package: "@cline/mcp-github"
version: "1.2.3" # Pinned version
config:
github_token: "${GITHUB_PROD_TOKEN}"
org: "company"
- name: "crm-integration"
type: "remote"
url: "https://mcp-crm.internal.company.com"
auth:
type: "mtls"
cert_path: "/certs/mcp-client.pem"
key_path: "/certs/mcp-client-key.pem"
- name: "security-scanner"
type: "remote"
url: "https://security-mcp.company.com"
auth:
type: "oauth2"
client_id: "${SECURITY_CLIENT_ID}"
client_secret: "${SECURITY_CLIENT_SECRET}"
policies:
allow_experimental: false
auto_update: false
strict_versioning: true
monitoring:
metrics: true
health_checks: true
alert_on_failure: true
```
</Tab>
</Tabs>
## Server Management
### Lifecycle Management
Manage MCP server deployments with GitOps:
```yaml
# mcp-server-manifest.yaml
apiVersion: mcp.cline.bot/v1
kind: MCPServer
metadata:
name: custom-api-server
namespace: cline-enterprise
spec:
image: company/custom-mcp-server:v1.0.0
replicas: 3
config:
api_endpoint: "https://api.internal.company.com"
timeout: 30s
retry_attempts: 3
auth:
type: service-account
service_account: mcp-custom-api
resources:
requests:
memory: "256Mi"
cpu: "100m"
limits:
memory: "512Mi"
cpu: "500m"
monitoring:
enabled: true
metrics_port: 9090
health_endpoint: "/health"
security:
network_policy: strict
pod_security_standard: restricted
```
### Configuration Management
Use Helm charts for enterprise MCP deployments:
```yaml
# values-prod.yaml
mcp:
hub:
replicaCount: 3
image:
repository: cline/mcp-hub-enterprise
tag: "1.5.2"
servers:
marketplace:
enabled: true
catalog_url: "https://enterprise-catalog.company.com"
custom:
- name: "salesforce"
enabled: true
image: "company/mcp-salesforce:1.0.0"
config:
instance_url: "https://company.my.salesforce.com"
- name: "jira"
enabled: true
image: "company/mcp-jira:2.1.0"
config:
base_url: "https://company.atlassian.net"
ingress:
enabled: true
className: nginx
annotations:
cert-manager.io/cluster-issuer: "letsencrypt-prod"
hosts:
- host: mcp.company.com
paths:
- path: /
pathType: Prefix
tls:
- secretName: mcp-tls
hosts:
- mcp.company.com
```
## Security & Governance
### Authentication & Authorization
Configure enterprise authentication for MCP servers:
```yaml
# mcp-auth-config.yaml
authentication:
providers:
- name: "enterprise-sso"
type: "oidc"
issuer: "https://sso.company.com"
client_id: "${SSO_CLIENT_ID}"
client_secret: "${SSO_CLIENT_SECRET}"
- name: "service-accounts"
type: "jwt"
signing_key: "${SERVICE_ACCOUNT_KEY}"
authorization:
policies:
- name: "developers"
subjects: ["group:developers"]
resources: ["mcp:servers:read", "mcp:servers:execute"]
- name: "admins"
subjects: ["group:mcp-admins"]
resources: ["mcp:*"]
- name: "security-team"
subjects: ["group:security"]
resources: ["mcp:audit:*", "mcp:servers:security-*"]
rbac:
enabled: true
default_role: "viewer"
```
### Network Security
Implement network policies for MCP communications:
```yaml
# mcp-network-policy.yaml
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: mcp-server-policy
namespace: cline-enterprise
spec:
podSelector:
matchLabels:
app: mcp-server
policyTypes:
- Ingress
- Egress
ingress:
- from:
- namespaceSelector:
matchLabels:
name: cline-enterprise
- podSelector:
matchLabels:
app: cline-core
ports:
- protocol: TCP
port: 8080
egress:
# Allow DNS
- to: []
ports:
- protocol: UDP
port: 53
# Allow HTTPS to external APIs
- to: []
ports:
- protocol: TCP
port: 443
```
## Monitoring & Observability
### Metrics Collection
Configure comprehensive MCP monitoring:
```yaml
# mcp-monitoring.yaml
monitoring:
metrics:
enabled: true
interval: 30s
collectors:
- name: "server-health"
metrics:
- mcp_server_status
- mcp_server_response_time
- mcp_server_error_rate
- name: "hub-performance"
metrics:
- mcp_hub_requests_total
- mcp_hub_request_duration
- mcp_hub_active_connections
- name: "resource-usage"
metrics:
- mcp_memory_usage
- mcp_cpu_usage
- mcp_network_io
alerts:
- name: "server-down"
condition: "mcp_server_status == 0"
severity: "critical"
notification_channels: ["pagerduty", "slack"]
- name: "high-error-rate"
condition: "mcp_server_error_rate > 0.05"
severity: "warning"
notification_channels: ["slack"]
- name: "performance-degradation"
condition: "mcp_server_response_time > 5s"
severity: "warning"
notification_channels: ["email"]
```
### Audit Logging
Implement comprehensive audit trails:
```json
{
"timestamp": "2024-01-15T10:30:00Z",
"event_type": "mcp_server_call",
"user_id": "john.doe@company.com",
"session_id": "sess_abc123",
"server_name": "github-prod",
"method": "github.create_issue",
"request": {
"repository": "company/project",
"title": "Bug fix required",
"sensitive_data_detected": false
},
"response": {
"status": "success",
"issue_id": "12345",
"duration_ms": 234
},
"compliance": {
"data_classification": "internal",
"retention_required": true,
"pii_detected": false
}
}
```
## Custom MCP Server Development
### Development Framework
Create custom MCP servers using the enterprise SDK:
```typescript
// custom-mcp-server.ts
import { MCPServer, Tool, Resource } from '@cline/mcp-enterprise-sdk';
class CustomAPIServer extends MCPServer {
constructor() {
super({
name: 'custom-api-server',
version: '1.0.0',
description: 'Custom API integration server'
});
this.addTool(new DatabaseQueryTool());
this.addResource(new UserDataResource());
}
}
class DatabaseQueryTool implements Tool {
name = 'query_database';
description = 'Query the company database';
async execute(params: any) {
// Implement database query logic
const result = await this.database.query(params.sql);
// Audit log the query
await this.auditLog({
action: 'database_query',
query: params.sql,
user: params.user_id,
results_count: result.length
});
return result;
}
async validate(params: any): Promise<boolean> {
// Implement query validation
return params.sql && !this.containsMaliciousSQL(params.sql);
}
}
```
### Deployment Pipeline
Automate MCP server deployments:
```yaml
# .github/workflows/deploy-mcp-server.yml
name: Deploy MCP Server
on:
push:
branches: [main]
paths: ['mcp-servers/**']
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build MCP Server
run: |
docker build -t company/mcp-server:${{ github.sha }} .
docker push company/mcp-server:${{ github.sha }}
- name: Deploy to Staging
run: |
helm upgrade mcp-server-staging ./helm-chart \
--set image.tag=${{ github.sha }} \
--namespace mcp-staging
- name: Run Integration Tests
run: |
kubectl wait --for=condition=ready pod -l app=mcp-server -n mcp-staging
npm run test:integration
- name: Deploy to Production
if: success()
run: |
helm upgrade mcp-server-prod ./helm-chart \
--set image.tag=${{ github.sha }} \
--namespace mcp-prod
```
## Best Practices
### Security
1. **Authentication**: Always require authentication for MCP servers
2. **Encryption**: Use TLS for all MCP communications
3. **Validation**: Validate all inputs and sanitize outputs
4. **Least Privilege**: Grant minimal required permissions
5. **Audit**: Log all MCP server interactions
### Performance
1. **Caching**: Implement response caching where appropriate
2. **Connection Pooling**: Reuse connections to external services
3. **Async Operations**: Use non-blocking operations for I/O
4. **Resource Limits**: Set appropriate CPU and memory limits
5. **Load Balancing**: Scale MCP servers based on demand
### Reliability
1. **Health Checks**: Implement comprehensive health endpoints
2. **Circuit Breakers**: Fail fast when external services are down
3. **Retry Logic**: Implement exponential backoff for failures
4. **Graceful Degradation**: Provide fallback behavior
5. **Monitoring**: Set up proactive alerting and monitoring
## Production Checklist
Before deploying MCP servers to production:
- [ ] Security review completed
- [ ] Authentication and authorization configured
- [ ] Network policies implemented
- [ ] Monitoring and alerting set up
- [ ] Audit logging enabled
- [ ] Resource limits configured
- [ ] Health checks implemented
- [ ] Integration tests passing
- [ ] Disaster recovery plan documented
- [ ] Compliance requirements validated
## Getting Started
Ready to implement enterprise MCP integration? Start with:
1. [MCP Marketplace](/enterprise-solutions/configuration/infrastructure-configuration/mcp/mcp-marketplace) - Deploy pre-built integrations
2. [Remote MCP Servers](/enterprise-solutions/configuration/infrastructure-configuration/mcp/remote-mcp-servers) - Configure custom servers
3. Review our [MCP Development Guide](/mcp/mcp-overview) for building custom integrations
@@ -0,0 +1,95 @@
---
title: "Self-Hosted Configuration"
sidebarTitle: "Overview"
description: "Deploy and configure Cline on your own infrastructure with enterprise-grade security and compliance"
---
<Warning>
**Self-Hosted Configuration Path**
This section is for enterprises deploying **self-hosted Cline infrastructure** with complex security, compliance, and multi-environment requirements. Configuration is done through YAML files, Kubernetes/Helm deployments, and infrastructure-as-code.
**Looking for simple setup?** See [SaaS Provider Configuration](/enterprise-solutions/configuration/remote-configuration/overview) for quick configuration through the app.cline.bot admin console - no infrastructure deployment required, just web-based settings.
</Warning>
Self-Hosted Configuration provides centralized control over all aspects of your Cline deployment on your own infrastructure, from AI providers to custom workflows. This section covers how to configure, manage, and optimize your enterprise Cline installation with advanced security, compliance, and operational features.
## Configuration Categories
<CardGroup cols={2}>
<Card title="Providers" icon="cloud" href="/enterprise-solutions/configuration/infrastructure-configuration/providers/overview">
Configure AI providers including AWS Bedrock, LiteLLM, and Google Vertex AI with enterprise-grade security and governance.
</Card>
<Card title="MCP Integration" icon="plug" href="/enterprise-solutions/configuration/infrastructure-configuration/mcp/overview">
Manage Model Context Protocol servers, marketplace integrations, and remote MCP server configurations.
</Card>
<Card title="Rules Engine" icon="shield-check" href="/enterprise-solutions/configuration/infrastructure-configuration/rules">
Define and enforce enterprise governance rules, security policies, and compliance requirements.
</Card>
<Card title="Workflows" icon="workflow" href="/enterprise-solutions/configuration/infrastructure-configuration/workflows">
Create automated workflows for development processes, approval chains, and integration pipelines.
</Card>
</CardGroup>
## Advanced Controls
<CardGroup cols={2}>
<Card title="Control Other Cline Features" icon="toggles" href="/enterprise-solutions/configuration/infrastructure-configuration/control-other-cline-features/overview">
Enable or disable specific Cline features across your organization with granular permission controls.
</Card>
<Card title="Monitoring" icon="chart-line" href="/enterprise-solutions/monitoring/overview">
Configure OpenTelemetry integration for comprehensive monitoring, logging, and analytics.
</Card>
</CardGroup>
## Getting Started
1. **Assessment**: Review your current infrastructure and integration requirements
2. **Provider Setup**: Configure your preferred AI providers with enterprise credentials
3. **Security Configuration**: Implement rules and access controls
4. **Monitoring Setup**: Enable telemetry and monitoring for operational visibility
5. **User Onboarding**: Deploy configurations to your development teams
## Enterprise Architecture Considerations
### Security & Compliance
- **Zero Trust Architecture**: All configurations support zero-trust security models
- **Audit Logging**: Complete audit trails for all configuration changes
- **Role-Based Access**: Granular permissions for different administrative roles
- **Data Sovereignty**: Keep sensitive data within your infrastructure boundaries
### Scalability & Performance
- **Multi-Region Support**: Deploy configurations across multiple geographic regions
- **Load Balancing**: Distribute AI provider requests across multiple endpoints
- **Caching Strategies**: Optimize performance with intelligent caching
- **Rate Limiting**: Prevent abuse with configurable rate limits
### Integration & Automation
- **GitOps Integration**: Version control your configurations alongside code
- **CI/CD Pipeline Integration**: Automate configuration deployment
- **Webhook Support**: React to configuration changes with custom automation
- **API-First Design**: Programmatically manage all configurations
## Configuration Management
All enterprise configurations support:
- **Version Control**: Track changes with full revision history
- **Environment Promotion**: Deploy configurations from dev → staging → production
- **Rollback Capabilities**: Quickly revert problematic configurations
- **Configuration Validation**: Automated testing of configuration changes
- **Drift Detection**: Monitor and alert on configuration drift
## Next Steps
Ready to configure your enterprise deployment? Start with:
1. [Provider Configuration](/enterprise-solutions/configuration/infrastructure-configuration/providers/overview) - Set up your AI providers
2. [Security Rules](/enterprise-solutions/configuration/infrastructure-configuration/rules) - Implement governance policies
3. [Monitoring Setup](/enterprise-solutions/monitoring/overview) - Enable operational visibility
For hands-on configuration assistance, contact your Cline Enterprise support team or refer to our implementation guides.
@@ -0,0 +1,182 @@
---
title: "AWS Bedrock Configuration"
sidebarTitle: "AWS Bedrock"
description: "Configure AWS Bedrock for your Cline deployment"
---
<Info>
**Configuration Path: Self-Hosted**
This guide covers Bedrock configuration for self-hosted deployments. For simple web-based setup, see [AWS Bedrock SaaS Configuration](/enterprise-solutions/configuration/remote-configuration/aws-bedrock/admin-configuration).
</Info>
Configure Cline to use AWS Bedrock for enterprise access to Claude and other foundation models through Amazon's managed service.
## Configuration Format
Configure Bedrock through your remote configuration JSON using the `providerSettings.AwsBedrock` section:
```json
{
"providerSettings": {
"AwsBedrock": {
"models": [
{
"id": "anthropic.claude-3-5-sonnet-20241022-v2:0",
"name": "Claude 3.5 Sonnet"
}
],
"awsRegion": "us-east-1"
}
}
}
```
## Configuration Fields
| Field | Type | Description | Required |
|-------|------|-------------|----------|
| `models` | Array | List of model configurations | Yes |
| `awsRegion` | String | AWS region (e.g., `us-east-1`) | Yes |
| `awsUseCrossRegionInference` | Boolean | Enable cross-region inference | No |
| `awsUseGlobalInference` | Boolean | Enable global inference routing | No |
| `awsBedrockUsePromptCache` | Boolean | Enable prompt caching | No |
| `awsBedrockEndpoint` | String | Custom Bedrock endpoint URL | No |
| `customModels` | Array | Custom model configurations | No |
### Model Configuration
Each model in the `models` array requires:
```json
{
"id": "anthropic.claude-3-5-sonnet-20241022-v2:0",
"name": "Claude 3.5 Sonnet",
"info": {
"maxTokens": 8192,
"contextWindow": 200000,
"supportsImages": true,
"supportsPromptCache": true
}
}
```
## Common Model IDs
| Model ID | Description | Context Window |
|----------|-------------|----------------|
| `anthropic.claude-3-5-sonnet-20241022-v2:0` | Latest Claude Sonnet | 200K tokens |
| `anthropic.claude-3-5-haiku-20241022-v1:0` | Latest Claude Haiku | 200K tokens |
| `anthropic.claude-3-opus-20240229-v1:0` | Claude Opus | 200K tokens |
<Note>
Model availability varies by region. See [AWS Bedrock documentation](https://docs.aws.amazon.com/bedrock/latest/userguide/models-regions.html) for region-specific model availability.
</Note>
## Example Configurations
### Basic Configuration
```json
{
"providerSettings": {
"AwsBedrock": {
"models": [
{
"id": "anthropic.claude-3-5-sonnet-20241022-v2:0",
"name": "Claude 3.5 Sonnet"
}
],
"awsRegion": "us-east-1"
}
}
}
```
### With Prompt Caching
```json
{
"providerSettings": {
"AwsBedrock": {
"models": [
{
"id": "anthropic.claude-3-5-sonnet-20241022-v2:0",
"name": "Claude 3.5 Sonnet"
}
],
"awsRegion": "us-east-1",
"awsBedrockUsePromptCache": true
}
}
}
```
### Multiple Models
```json
{
"providerSettings": {
"AwsBedrock": {
"models": [
{
"id": "anthropic.claude-3-5-sonnet-20241022-v2:0",
"name": "Claude 3.5 Sonnet"
},
{
"id": "anthropic.claude-3-5-haiku-20241022-v1:0",
"name": "Claude 3.5 Haiku"
}
],
"awsRegion": "us-east-1"
}
}
}
```
## Prerequisites
Before configuring Cline to use Bedrock, you need:
1. **AWS Account** with Bedrock access enabled
2. **IAM Permissions** for Bedrock API calls (`bedrock:InvokeModel`, `bedrock:InvokeModelWithResponseStream`)
3. **Model Access** enabled for desired models in the Bedrock console
4. **AWS Credentials** configured (IAM role, access keys, or AWS profile)
<Tip>
For AWS account setup and IAM configuration, see the [AWS Bedrock documentation](https://docs.aws.amazon.com/bedrock/latest/userguide/getting-started.html).
</Tip>
## Troubleshooting
**"Access Denied" Errors**
Ensure your AWS credentials have the required Bedrock permissions. See [AWS IAM documentation](https://docs.aws.amazon.com/bedrock/latest/userguide/security-iam.html) for permission requirements.
**"Model Not Found" Errors**
Verify model access is enabled in the AWS Bedrock console and the model is available in your configured region.
**High Latency**
Consider using a region closer to your users or enabling cross-region inference for better performance.
## Related Resources
<CardGroup cols={2}>
<Card title="AWS Bedrock Docs" icon="book" href="https://docs.aws.amazon.com/bedrock/">
Complete AWS Bedrock documentation
</Card>
<Card title="Model Access" icon="key" href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-access.html">
How to enable model access
</Card>
<Card title="IAM Permissions" icon="shield" href="https://docs.aws.amazon.com/bedrock/latest/userguide/security-iam.html">
Required IAM permissions
</Card>
<Card title="Pricing" icon="dollar-sign" href="https://aws.amazon.com/bedrock/pricing/">
AWS Bedrock pricing details
</Card>
</CardGroup>
@@ -0,0 +1,254 @@
---
title: "Custom Provider Configuration"
sidebarTitle: "Custom Providers"
description: "Configure custom OpenAI-compatible providers for your Cline deployment"
---
<Info>
**Configuration Path: Self-Hosted**
This guide covers custom provider configuration for self-hosted deployments.
</Info>
Configure Cline to use any OpenAI-compatible API provider, including Azure OpenAI, self-hosted inference servers, and other third-party services.
## What are Custom Providers?
Custom providers include any API that implements the OpenAI API format:
- **Azure OpenAI Service**: Microsoft's managed OpenAI models
- **vLLM**: Self-hosted inference server
- **Ollama**: Local model runner
- **Text Generation Inference (TGI)**: Hugging Face's inference server
- **LocalAI**: Local OpenAI API replacement
- **Other OpenAI-compatible APIs**: Any custom implementation
## Configuration Format
Configure custom providers through your remote configuration JSON using the `providerSettings.OpenAiCompatible` section:
```json
{
"providerSettings": {
"OpenAiCompatible": {
"models": [
{
"id": "gpt-4-turbo",
"name": "GPT-4 Turbo"
}
],
"openAiBaseUrl": "https://your-api.company.com/v1"
}
}
}
```
## Configuration Fields
| Field | Type | Description | Required |
|-------|------|-------------|----------|
| `models` | Array | List of model configurations | Yes |
| `openAiBaseUrl` | String | API endpoint base URL | Yes |
| `openAiApiKey` | String | API key for authentication | No |
| `openAiModelId` | String | Default model identifier | No |
### Azure OpenAI Specific Fields
For Azure OpenAI, additional fields are available:
| Field | Type | Description |
|-------|------|-------------|
| `azureApiVersion` | String | Azure API version (e.g., `2024-02-15-preview`) |
## Example Configurations
### Azure OpenAI
```json
{
"providerSettings": {
"OpenAiCompatible": {
"models": [
{
"id": "gpt-4-turbo",
"name": "GPT-4 Turbo"
}
],
"openAiBaseUrl": "https://your-resource.openai.azure.com/openai/deployments/gpt-4-turbo",
"openAiApiKey": "your-azure-api-key",
"azureApiVersion": "2024-02-15-preview"
}
}
}
```
### Self-Hosted vLLM
```json
{
"providerSettings": {
"OpenAiCompatible": {
"models": [
{
"id": "meta-llama/Llama-2-70b-chat-hf",
"name": "Llama 2 70B"
}
],
"openAiBaseUrl": "http://vllm.company.com:8000/v1"
}
}
}
```
### Local Ollama
```json
{
"providerSettings": {
"OpenAiCompatible": {
"models": [
{
"id": "codellama",
"name": "Code Llama"
}
],
"openAiBaseUrl": "http://localhost:11434/v1"
}
}
}
```
### Text Generation Inference (TGI)
```json
{
"providerSettings": {
"OpenAiCompatible": {
"models": [
{
"id": "mistralai/Mistral-7B-Instruct-v0.2",
"name": "Mistral 7B Instruct"
}
],
"openAiBaseUrl": "http://tgi.company.com:8080/v1",
"openAiApiKey": "your-tgi-api-key"
}
}
}
```
### LocalAI
```json
{
"providerSettings": {
"OpenAiCompatible": {
"models": [
{
"id": "gpt-3.5-turbo",
"name": "Local GPT-3.5"
}
],
"openAiBaseUrl": "http://localhost:8080/v1"
}
}
}
```
### Internal Network (No Auth)
```json
{
"providerSettings": {
"OpenAiCompatible": {
"models": [
{
"id": "custom-model",
"name": "Custom Model"
}
],
"openAiBaseUrl": "http://internal.api:8000/v1"
}
}
}
```
## Model Configuration
Each model requires basic information:
```json
{
"id": "model-identifier",
"name": "Display Name",
"info": {
"maxTokens": 4096,
"contextWindow": 128000,
"supportsImages": true,
"supportsPromptCache": false
}
}
```
## Prerequisites
Before configuring a custom provider, you need:
1. **API Endpoint**: URL of your OpenAI-compatible API
2. **API Key** (if required): Authentication credentials
3. **Model IDs**: Names of available models
4. **Network Access**: Connectivity from where Cline is being used
## Troubleshooting
**Connection Errors**
Verify the endpoint is accessible:
```bash
curl https://your-api.company.com/v1/models
```
**Authentication Errors**
Test authentication with your API key:
```bash
curl -H "Authorization: Bearer your-api-key" \
https://your-api.company.com/v1/models
```
**Model Not Found**
Ensure the model ID in your configuration matches what the API expects. Check available models:
```bash
curl -H "Authorization: Bearer your-api-key" \
https://your-api.company.com/v1/models
```
**Timeout Issues**
If responses are slow:
- Check network latency
- Verify server has adequate resources
- Consider using faster models
## Provider Documentation
For setup and deployment of these services, see their official documentation:
<CardGroup cols={2}>
<Card title="Azure OpenAI" icon="microsoft" href="https://learn.microsoft.com/en-us/azure/ai-services/openai/">
Microsoft's managed OpenAI service
</Card>
<Card title="vLLM" icon="server" href="https://docs.vllm.ai/">
High-performance inference engine
</Card>
<Card title="Ollama" icon="download" href="https://ollama.ai/">
Run models locally
</Card>
<Card title="Text Generation Inference" icon="code" href="https://huggingface.co/docs/text-generation-inference/">
Hugging Face inference server
</Card>
</CardGroup>
@@ -0,0 +1,185 @@
---
title: "Google Vertex AI Configuration"
sidebarTitle: "Google Vertex"
description: "Configure Google Vertex AI for your Cline deployment"
---
<Info>
**Configuration Path: Self-Hosted**
This guide covers Vertex AI configuration for self-hosted deployments. For simple web-based setup, see [Google Vertex SaaS Configuration](/enterprise-solutions/configuration/remote-configuration/google-vertex/admin-configuration).
</Info>
Configure Cline to use Google Vertex AI for enterprise access to Gemini and other Google AI models through Google Cloud Platform.
## Configuration Format
Configure Vertex AI through your remote configuration JSON using the `providerSettings.Vertex` section:
```json
{
"providerSettings": {
"Vertex": {
"models": [
{
"id": "claude-3-5-sonnet-v2@20241022",
"name": "Claude 3.5 Sonnet"
}
],
"vertexProjectId": "my-project-id",
"vertexRegion": "us-central1"
}
}
}
```
## Configuration Fields
| Field | Type | Description | Required |
|-------|------|-------------|----------|
| `models` | Array | List of model configurations | Yes |
| `vertexProjectId` | String | Google Cloud project ID | Yes |
| `vertexRegion` | String | GCP region (e.g., `us-central1`) | Yes |
### Model Configuration
Each model in the `models` array requires:
```json
{
"id": "claude-3-5-sonnet-v2@20241022",
"name": "Claude 3.5 Sonnet",
"info": {
"maxTokens": 8192,
"contextWindow": 200000,
"supportsImages": true,
"supportsPromptCache": true
}
}
```
## Common Model IDs
| Model ID | Description | Context Window |
|----------|-------------|----------------|
| `claude-3-5-sonnet-v2@20241022` | Claude 3.5 Sonnet | 200K tokens |
| `claude-3-5-haiku@20241022` | Claude 3.5 Haiku | 200K tokens |
| `claude-3-opus@20240229` | Claude 3 Opus | 200K tokens |
| `gemini-2.0-flash-exp` | Gemini Flash (experimental) | 1M tokens |
| `gemini-1.5-pro-002` | Gemini Pro | 2M tokens |
| `gemini-1.5-flash-002` | Gemini Flash | 1M tokens |
<Note>
Model availability varies by region. See [Vertex AI documentation](https://cloud.google.com/vertex-ai/docs/generative-ai/learn/models) for region-specific model availability.
</Note>
## Example Configurations
### Basic Configuration
```json
{
"providerSettings": {
"Vertex": {
"models": [
{
"id": "claude-3-5-sonnet-v2@20241022",
"name": "Claude 3.5 Sonnet"
}
],
"vertexProjectId": "my-company-prod",
"vertexRegion": "us-central1"
}
}
}
```
### Multiple Models
```json
{
"providerSettings": {
"Vertex": {
"models": [
{
"id": "claude-3-5-sonnet-v2@20241022",
"name": "Claude 3.5 Sonnet"
},
{
"id": "gemini-1.5-pro-002",
"name": "Gemini Pro"
}
],
"vertexProjectId": "my-company-prod",
"vertexRegion": "us-central1"
}
}
}
```
### With Extended Thinking
```json
{
"providerSettings": {
"Vertex": {
"models": [
{
"id": "claude-3-5-sonnet-v2@20241022",
"name": "Claude 3.5 Sonnet",
"thinkingBudgetTokens": 1600
}
],
"vertexProjectId": "my-company-prod",
"vertexRegion": "us-central1"
}
}
}
```
## Prerequisites
Before configuring Cline to use Vertex AI, you need:
1. **Google Cloud Project** with Vertex AI API enabled
2. **Service Account** with Vertex AI User role (`roles/aiplatform.user`)
3. **Service Account Credentials** configured for authentication
4. **Model Access** verified in your project and region
<Tip>
For Google Cloud setup and authentication configuration, see the [Vertex AI documentation](https://cloud.google.com/vertex-ai/docs/generative-ai/start/quickstarts/quickstart-multimodal).
</Tip>
## Troubleshooting
**"Permission Denied" Errors**
Ensure your service account has the required Vertex AI permissions. See [Google Cloud IAM documentation](https://cloud.google.com/vertex-ai/docs/general/access-control) for permission requirements.
**"API Not Enabled" Errors**
Verify the Vertex AI API is enabled in your Google Cloud project.
**"Model Not Found" Errors**
Check that the model is available in your configured region and that your project has access to it.
## Related Resources
<CardGroup cols={2}>
<Card title="Vertex AI Docs" icon="book" href="https://cloud.google.com/vertex-ai/docs">
Complete Vertex AI documentation
</Card>
<Card title="Service Accounts" icon="key" href="https://cloud.google.com/iam/docs/service-accounts">
Service account best practices
</Card>
<Card title="Model Guide" icon="brain" href="https://cloud.google.com/vertex-ai/docs/generative-ai/learn/models">
Available models and features
</Card>
<Card title="Pricing" icon="dollar-sign" href="https://cloud.google.com/vertex-ai/pricing">
Vertex AI pricing details
</Card>
</CardGroup>
@@ -0,0 +1,215 @@
---
title: "LiteLLM Configuration"
sidebarTitle: "LiteLLM"
description: "Configure LiteLLM proxy for your Cline deployment"
---
<Info>
**Configuration Path: Self-Hosted**
This guide covers LiteLLM configuration for self-hosted deployments. For web-based setup, see [LiteLLM SaaS Configuration](/enterprise-solutions/configuration/remote-configuration/litellm/admin-configuration).
</Info>
Configure Cline to use an existing LiteLLM proxy for unified access to multiple AI models through a single API endpoint.
## What is LiteLLM?
[LiteLLM](https://github.com/BerriAI/litellm) is an open-source proxy that provides a unified OpenAI-compatible API for accessing 100+ AI models from different providers. Cline connects to your deployed LiteLLM instance.
<Note>
LiteLLM is a separate service you deploy and manage. This guide covers how to configure Cline to connect to an existing LiteLLM deployment.
</Note>
## Configuration Format
Configure LiteLLM through your remote configuration JSON using the `providerSettings.OpenAiCompatible` section:
```json
{
"providerSettings": {
"OpenAiCompatible": {
"models": [
{
"id": "gpt-4-turbo",
"name": "GPT-4 Turbo"
}
],
"openAiBaseUrl": "https://litellm.yourcompany.com/v1"
}
}
}
```
## Configuration Fields
| Field | Type | Description | Required |
|-------|------|-------------|----------|
| `models` | Array | List of model configurations | Yes |
| `openAiBaseUrl` | String | LiteLLM proxy endpoint URL | Yes |
| `openAiApiKey` | String | API key for authentication | No |
### Model Configuration
Each model in the `models` array requires:
```json
{
"id": "gpt-4-turbo",
"name": "GPT-4 Turbo",
"info": {
"maxTokens": 4096,
"contextWindow": 128000,
"supportsImages": true
}
}
```
<Note>
Model IDs must match the model names configured in your LiteLLM proxy deployment.
</Note>
## Example Configurations
### Basic Configuration
```json
{
"providerSettings": {
"OpenAiCompatible": {
"models": [
{
"id": "gpt-4-turbo",
"name": "GPT-4 Turbo"
}
],
"openAiBaseUrl": "https://litellm.company.com/v1"
}
}
}
```
### With Authentication
```json
{
"providerSettings": {
"OpenAiCompatible": {
"models": [
{
"id": "gpt-4-turbo",
"name": "GPT-4 Turbo"
}
],
"openAiBaseUrl": "https://litellm.company.com/v1",
"openAiApiKey": "sk-your-litellm-key"
}
}
}
```
### Multiple Models
```json
{
"providerSettings": {
"OpenAiCompatible": {
"models": [
{
"id": "gpt-4-turbo",
"name": "GPT-4 Turbo"
},
{
"id": "claude-3-5-sonnet",
"name": "Claude 3.5 Sonnet"
},
{
"id": "gemini-pro",
"name": "Gemini Pro"
}
],
"openAiBaseUrl": "https://litellm.company.com/v1",
"openAiApiKey": "sk-your-litellm-key"
}
}
}
```
### Internal Network (No Auth)
```json
{
"providerSettings": {
"OpenAiCompatible": {
"models": [
{
"id": "gpt-4-turbo",
"name": "GPT-4 Turbo"
}
],
"openAiBaseUrl": "http://litellm.internal:4000/v1"
}
}
}
```
## Prerequisites
Before configuring Cline to use LiteLLM, you need:
1. **LiteLLM Proxy** deployed and accessible
2. **LiteLLM Configuration** with desired models enabled
3. **API Key** (if authentication is enabled)
4. **Network Access** from where Cline is being used
<Tip>
For LiteLLM deployment and configuration, see the [LiteLLM documentation](https://docs.litellm.ai/docs/proxy/quick_start).
</Tip>
## Troubleshooting
**Connection Errors**
Verify the LiteLLM proxy is running and accessible:
```bash
curl https://litellm.yourcompany.com/health
```
**Authentication Errors**
Check your API key is valid:
```bash
curl -H "Authorization: Bearer sk-your-key" \
https://litellm.yourcompany.com/v1/models
```
**Model Not Found**
Verify the model is configured in your LiteLLM deployment. Model IDs in Cline's config must match the model names in LiteLLM's configuration.
## Benefits of Using LiteLLM
- **Multi-Provider Access**: Connect to multiple AI providers through one endpoint
- **Load Balancing**: Distribute requests across providers automatically
- **Fallback Support**: Automatic retry with different models on failure
- **Cost Tracking**: Monitor usage and costs across all models
- **Rate Limiting**: Control usage at the proxy level
## Related Resources
<CardGroup cols={2}>
<Card title="LiteLLM Docs" icon="book" href="https://docs.litellm.ai/">
Complete LiteLLM documentation
</Card>
<Card title="LiteLLM GitHub" icon="github" href="https://github.com/BerriAI/litellm">
Source code and deployment examples
</Card>
<Card title="Proxy Setup" icon="server" href="https://docs.litellm.ai/docs/proxy/quick_start">
LiteLLM proxy deployment guide
</Card>
<Card title="Supported Providers" icon="list" href="https://docs.litellm.ai/docs/providers">
List of supported AI providers
</Card>
</CardGroup>
@@ -0,0 +1,144 @@
---
title: "AI Provider Configuration"
sidebarTitle: "Overview"
description: "Configure AI provider settings for your Cline deployment"
---
<Info>
**Configuration Path: Self-Hosted**
This section covers provider configuration for self-hosted deployments. For web-based configuration through app.cline.bot, see [SaaS Provider Configuration](/enterprise-solutions/configuration/remote-configuration/overview).
</Info>
Configure which AI providers your team can use and manage provider credentials centrally. Cline supports major AI providers with enterprise-grade authentication options.
## Supported Providers
<CardGroup cols={2}>
<Card title="AWS Bedrock" icon="aws" href="/enterprise-solutions/configuration/infrastructure-configuration/providers/aws-bedrock">
Amazon's managed service for Claude and other foundation models
</Card>
<Card title="Google Vertex AI" icon="google" href="/enterprise-solutions/configuration/infrastructure-configuration/providers/google-vertex">
Google Cloud's AI platform with Gemini and PaLM models
</Card>
<Card title="LiteLLM" icon="zap" href="/enterprise-solutions/configuration/infrastructure-configuration/providers/litellm">
Universal proxy for accessing 100+ AI models through a unified API
</Card>
<Card title="Custom Providers" icon="plug" href="/enterprise-solutions/configuration/infrastructure-configuration/providers/custom">
OpenAI-compatible APIs and self-hosted models
</Card>
</CardGroup>
## What is Provider Configuration?
Provider configuration in Cline allows administrators to:
1. **Manage Credentials Centrally**: Store API keys and authentication details in one place
2. **Control Model Access**: Specify which models teams can use
3. **Enforce Provider Usage**: Direct all team members to approved providers
## How It Works
Provider settings are configured through your remote configuration JSON file:
```json
{
"providerSettings": {
"provider": "bedrock",
"bedrockRegion": "us-east-1",
"bedrockServiceRole": "arn:aws:iam::..."
}
}
```
When configured, these settings:
- Apply to all team members automatically
- Override individual user settings
- Ensure consistent provider usage across the team
## Configuration Options
### Provider Selection
Choose from supported providers:
- **bedrock**: Use AWS Bedrock
- **vertex**: Use Google Vertex AI
- **openai**: Use OpenAI API
- **azure**: Use Azure OpenAI
- **litellm**: Use a LiteLLM proxy
### Authentication
Each provider supports different authentication methods:
**AWS Bedrock:**
- IAM roles with cross-account access
- Access keys (not recommended for production)
**Google Vertex AI:**
- Service account JSON keys
- Workload Identity (for GKE deployments)
**OpenAI/Azure:**
- API keys
**LiteLLM:**
- Endpoint URL + API key
## Example Configurations
### AWS Bedrock with IAM Role
```json
{
"providerSettings": {
"provider": "bedrock",
"bedrockRegion": "us-east-1",
"bedrockServiceRole": "arn:aws:iam::123456789012:role/ClineBedrockRole"
}
}
```
### Google Vertex AI
```json
{
"providerSettings": {
"provider": "vertex",
"vertexProject": "my-project-id",
"vertexRegion": "us-central1"
}
}
```
### LiteLLM Proxy
```json
{
"providerSettings": {
"provider": "litellm",
"litellmBaseUrl": "https://litellm.company.com",
"litellmApiKey": "sk-..."
}
}
```
## Next Steps
<CardGroup cols={2}>
<Card title="Configure AWS Bedrock" icon="aws" href="/enterprise-solutions/configuration/infrastructure-configuration/providers/aws-bedrock">
Set up AWS Bedrock integration
</Card>
<Card title="Configure Google Vertex" icon="google" href="/enterprise-solutions/configuration/infrastructure-configuration/providers/google-vertex">
Set up Google Vertex AI integration
</Card>
<Card title="Configure LiteLLM" icon="zap" href="/enterprise-solutions/configuration/infrastructure-configuration/providers/litellm">
Set up LiteLLM proxy integration
</Card>
<Card title="Configure Custom Provider" icon="plug" href="/enterprise-solutions/configuration/infrastructure-configuration/providers/custom">
Set up custom OpenAI-compatible provider
</Card>
</CardGroup>
@@ -0,0 +1,239 @@
---
title: "Rules"
sidebarTitle: "Rules"
description: "Custom instruction files that guide Cline's behavior in your enterprise deployment"
---
Rules are custom instruction files that provide Cline with guidelines about your coding preferences, standards, and best practices. These instructions get added to Cline's context when working on tasks.
## What are Rules?
Rules are simple markdown files stored in a `.clinerules/` directory that contain your team's conventions, preferences, and guidelines. They help Cline understand your:
- Coding style and conventions
- Preferred libraries and frameworks
- Architectural patterns
- Testing strategies
- Documentation standards
- Communication preferences
<Tip>
Rules are just `.md` files - no complex configuration needed!
</Tip>
## Quick Example
Here's a simple rule file that guides TypeScript development:
```markdown
# TypeScript Conventions
## Code Style
- Use 2-space indentation
- Prefer `const` over `let`
- Always use explicit return types for functions
- Use named exports instead of default exports
## Testing
- Write unit tests for all utility functions
- Use Vitest as the testing framework
- Aim for 80%+ code coverage
## Dependencies
- Prefer native TypeScript features over external libraries
- Use Zod for runtime type validation
- Use date-fns for date manipulation
```
## Creating Rules
<Tabs>
<Tab title="Using /newrule Command">
The easiest way to create a rule is with the `/newrule` command:
1. During a conversation with Cline, type `/newrule`
2. Cline will analyze your conversation and preferences
3. It creates an appropriately named `.md` file in `.clinerules/`
**Example:**
```
/newrule
Based on our conversation, create a rule for React component structure
```
</Tab>
<Tab title="Manual Creation">
You can also create rule files manually:
1. Create a `.clinerules/` directory in your repository root
2. Add markdown files with your guidelines
3. Use descriptive names like `react-patterns.md` or `api-conventions.md`
**File structure:**
```
your-repo/
├── .clinerules/
│ ├── typescript-style.md
│ ├── testing-standards.md
│ └── code-review-checklist.md
└── src/
```
</Tab>
</Tabs>
## Global vs Workspace Rules
<CardGroup cols={2}>
<Card title="Workspace Rules" icon="folder">
**Location:** `.clinerules/` in your repository
**Scope:** Specific to that project
**Use for:** Project-specific conventions and patterns
</Card>
<Card title="Global Rules" icon="globe">
**Location:** `Documents/Cline/` directory
**Scope:** All your projects
**Use for:** Personal preferences that apply everywhere
</Card>
</CardGroup>
## Managing Rules
### Toggling Rules
You can enable or disable individual rule files:
1. Click the rules icon in Cline's interface
2. Toggle rules on/off as needed
3. Changes apply immediately to new tasks
<Note>
Disabling a rule removes it from Cline's context, but keeps the file intact. You can re-enable it anytime.
</Note>
### Enterprise Remote Rules
<Info>
Enterprise deployments can configure **remote global rules** that apply to all team members. These are managed through your infrastructure configuration and cannot be toggled off by individual developers.
See [Self-Hosted Configuration](/enterprise-solutions/configuration/infrastructure-configuration/overview) for details on remote rules.
</Info>
## Compatible Formats
Cline also respects rules from other AI coding tools:
| File/Directory | Tool | Location |
|----------------|------|----------|
| `.cursorrules` | Cursor | Workspace root (single file) |
| `.cursor/rules/` | Cursor | Workspace directory (`.mdc` files) |
| `.windsurfrules` | Windsurf | Workspace root (single file) |
| `AGENTS.md` | Various | Workspace root + recursive search |
<Note>
**AGENTS.md behavior:** Cline only searches for nested `AGENTS.md` files recursively if a top-level `AGENTS.md` exists in your workspace root. If found, all `AGENTS.md` files are combined with their relative paths as headers.
</Note>
These files work the same way as `.clinerules/` files and can be toggled on/off independently.
## Best Practices
<AccordionGroup>
<Accordion title="Keep Rules Focused" icon="bullseye">
Each rule file should focus on one topic:
- ✅ `typescript-conventions.md`
- ✅ `react-component-structure.md`
- ❌ `everything-about-our-codebase.md`
</Accordion>
<Accordion title="Be Specific, Not Generic" icon="crosshairs">
Base rules on actual team preferences, not assumptions:
- ✅ "We use React Query for server state management"
- ❌ "Use best practices for state management"
</Accordion>
<Accordion title="Update Rules as Projects Evolve" icon="rotate">
Review and update rules periodically:
- When adopting new technologies
- After major architectural changes
- When team conventions evolve
</Accordion>
<Accordion title="Don't Overdo It" icon="gauge-simple-high">
Too many rules can overwhelm Cline's context:
- Start with 3-5 essential rules
- Add more only when truly needed
- Remove outdated rules promptly
</Accordion>
</AccordionGroup>
## Example Rule Files
<AccordionGroup>
<Accordion title="API Design Standards" icon="code">
```markdown
# API Design Standards
## REST Conventions
- Use plural nouns for endpoints (`/users`, not `/user`)
- Use HTTP methods semantically (GET, POST, PUT, DELETE)
- Return appropriate status codes
## Response Format
\`\`\`typescript
{
data: T,
error?: string,
metadata?: {
page: number,
total: number
}
}
\`\`\`
## Error Handling
- Always return error messages in `error` field
- Use 4xx for client errors, 5xx for server errors
- Include request ID in error responses
```
</Accordion>
<Accordion title="Testing Requirements" icon="vial">
```markdown
# Testing Requirements
## Test Organization
- Place tests next to source files (`Button.test.tsx`)
- Use `describe` blocks to group related tests
- Write descriptive test names
## Coverage Requirements
- Unit tests for all utility functions
- Integration tests for API endpoints
- E2E tests for critical user flows
- Minimum 80% coverage for new code
## Mocking Strategy
- Mock external API calls
- Use test fixtures for complex data
- Prefer dependency injection for testability
```
</Accordion>
</AccordionGroup>
## Next Steps
<CardGroup cols={2}>
<Card title="Workflows" icon="diagram-project" href="/enterprise-solutions/configuration/infrastructure-configuration/workflows">
Combine rules with automated workflows
</Card>
<Card title="Remote Configuration" icon="cloud" href="/enterprise-solutions/configuration/remote-configuration/overview">
Deploy global rules for your team
</Card>
</CardGroup>
@@ -0,0 +1,324 @@
---
title: "Workflows"
sidebarTitle: "Workflows"
description: "Reusable instruction sets that can be invoked on-demand via slash commands"
---
Workflows are markdown files containing reusable instructions that you can invoke on-demand using slash commands. Think of them as "rules you can call when needed" rather than always-active guidelines.
## What are Workflows?
Workflows are similar to [Rules](/enterprise-solutions/configuration/infrastructure-configuration/rules), but with one key difference:
<CardGroup cols={2}>
<Card title="Rules" icon="book">
**Always Active**
Automatically applied to every task when toggled on
Example: Coding standards, style guides
</Card>
<Card title="Workflows" icon="diagram-project">
**On-Demand**
Invoked only when you use the slash command
Example: Deployment checklists, review processes
</Card>
</CardGroup>
<Tip>
Workflows are just markdown files, no complex configuration needed!
</Tip>
## Quick Example
Here's a simple deployment workflow:
**File:** `.clinerules/workflows/deploy.md`
```markdown
# Deployment Workflow
Before deploying to production, ensure:
## Pre-Deployment Checklist
1. All tests passing (unit, integration, e2e)
2. Code review approved by 2+ engineers
3. Staging environment tested successfully
4. Database migrations reviewed
5. Rollback plan documented
## Deployment Steps
1. Create deployment branch from main
2. Run final test suite
3. Deploy to production
4. Monitor error rates for 30 minutes
5. Verify key user flows
## Post-Deployment
1. Update deployment log
2. Notify team in #deployments channel
3. Monitor metrics for 24 hours
```
**Usage:**
```
/deploy
I'm ready to deploy the new authentication feature
```
When invoked, Cline adds the workflow instructions to its context for that specific task.
## Creating Workflows
<Tabs>
<Tab title="Manual Creation">
Create workflow files in the `.clinerules/workflows/` directory:
1. Create `.clinerules/workflows/` in your repository root
2. Add markdown files with your workflow instructions
3. Use descriptive names matching your slash command
**File structure:**
```
your-repo/
├── .clinerules/
│ └── workflows/
│ ├── deploy.md
│ ├── code-review.md
│ └── bug-triage.md
└── src/
```
</Tab>
<Tab title="Slash Command">
You can also create workflows during a conversation:
1. Have a conversation about a process you want to codify
2. Type `/newrule` and specify it should be a workflow
3. Cline creates the workflow file in `.clinerules/workflows/`
<Note>
The `/newrule` command can create both rules and workflows - just specify your intent clearly.
</Note>
</Tab>
</Tabs>
## Using Workflows
### Invoking Workflows
Simply type `/` followed by the workflow filename (without `.md`):
```
/deploy
/code-review
/bug-triage
```
The workflow instructions are added to Cline's context for the current task only.
### Workflow Naming
- Use lowercase with hyphens: `deploy.md`, `code-review.md`
- Keep names short and memorable
- Name should indicate the workflow's purpose
<Warning>
Workflow filenames become slash commands, so choose names that are easy to type and remember.
</Warning>
## Global vs Workspace Workflows
<CardGroup cols={2}>
<Card title="Workspace Workflows" icon="folder">
**Location:** `.clinerules/workflows/` in your repository
**Scope:** Specific to that project
**Use for:** Project-specific processes and checklists
</Card>
<Card title="Global Workflows" icon="globe">
**Location:** `Documents/Cline/Workflows/` directory
**Scope:** All your projects
**Use for:** Personal workflows that apply everywhere
</Card>
</CardGroup>
<Info>
**Precedence:** Local workflows override global workflows if they have the same name.
</Info>
## Managing Workflows
### Toggling Workflows
You can enable or disable workflows:
1. Click the rules icon in Cline's interface
2. Switch to the "Workflows" tab
3. Toggle workflows on/off as needed
<Note>
Disabling a workflow prevents it from being invoked, but keeps the file intact. The slash command won't work until you re-enable it.
</Note>
### Enterprise Remote Workflows
<Info>
Enterprise deployments can configure **remote global workflows** that are available to all team members. These are managed through your infrastructure configuration.
See [Self-Hosted Configuration](/enterprise-solutions/configuration/infrastructure-configuration/overview) for details on remote workflows.
</Info>
## Example Workflows
<AccordionGroup>
<Accordion title="Code Review Workflow" icon="code-review">
```markdown
# Code Review Workflow
## Pre-Review Checklist
- [ ] Code follows project style guide
- [ ] All tests pass locally
- [ ] No console.log or debugging code
- [ ] Comments explain "why" not "what"
- [ ] PR description is clear and complete
## Review Focus Areas
1. **Architecture**: Does this fit our existing patterns?
2. **Security**: Any potential vulnerabilities?
3. **Performance**: Any obvious bottlenecks?
4. **Testing**: Are edge cases covered?
5. **Documentation**: Is it clear how to use new features?
## Review Response
- Address all feedback within 24 hours
- Mark conversations as resolved when addressed
- Re-request review after major changes
```
</Accordion>
<Accordion title="Bug Triage Workflow" icon="bug">
```markdown
# Bug Triage Workflow
## Information Gathering
1. Reproduce the bug in local environment
2. Identify affected versions/environments
3. Check if similar issues exist
4. Gather error logs and stack traces
## Priority Assessment
**P0 (Critical)**: Production down, data loss, security breach
**P1 (High)**: Major feature broken, significant user impact
**P2 (Medium)**: Minor feature broken, workaround available
**P3 (Low)**: Cosmetic issue, minimal impact
## Create Ticket
- Use template: "Bug Report"
- Add reproduction steps
- Include screenshots/videos if applicable
- Tag with affected component
- Assign priority label
## Next Steps
- P0/P1: Immediate fix required
- P2: Schedule for current sprint
- P3: Add to backlog
```
</Accordion>
<Accordion title="Feature Planning Workflow" icon="lightbulb">
```markdown
# Feature Planning Workflow
## Requirements Gathering
1. Define the user problem we're solving
2. List success criteria (measurable)
3. Identify edge cases and constraints
4. Document technical dependencies
## Design Considerations
1. How does this fit existing architecture?
2. What data models are needed?
3. What API changes are required?
4. How will this impact performance?
## Implementation Plan
1. Break into smaller, shippable pieces
2. Identify which pieces can be done in parallel
3. Note any feature flags needed
4. Plan for backwards compatibility
## Testing Strategy
1. What unit tests are needed?
2. What integration tests are needed?
3. How will we test edge cases?
4. What manual testing is required?
```
</Accordion>
</AccordionGroup>
## Best Practices
<AccordionGroup>
<Accordion title="Keep Workflows Action-Oriented" icon="list-check">
Workflows should contain **actionable steps**, not general advice:
- ✅ "Run `npm test` and verify all tests pass"
- ❌ "Make sure testing is done properly"
</Accordion>
<Accordion title="Use Checklists" icon="square-check">
Format workflows as checklists when possible:
- Easy to follow step-by-step
- Clear progress tracking
- Reduces missed steps
</Accordion>
<Accordion title="Include Context" icon="circle-info">
Add **why** behind each step:
```markdown
1. Check staging environment first
(Catching issues in staging prevents production incidents)
```
</Accordion>
<Accordion title="Version as Code" icon="code-branch">
Workflows live in your repository:
- Track changes in git
- Review updates in PRs
- Maintain history of process evolution
</Accordion>
</AccordionGroup>
## Workflows vs Rules: When to Use Each
| Use Rules When | Use Workflows When |
|----------------|-------------------|
| Guidance should apply to every task | Process is invoked occasionally |
| Standards that rarely change | Checklist for specific scenarios |
| Always-on coding conventions | On-demand deployment processes |
| General coding style | Specific review procedures |
**Example:**
- **Rule**: "Use TypeScript strict mode and explicit return types"
- **Workflow**: "Follow these 10 steps when deploying to production"
## Next Steps
<CardGroup cols={2}>
<Card title="Rules" icon="book" href="/enterprise-solutions/configuration/infrastructure-configuration/rules">
Learn about always-active rules
</Card>
<Card title="Remote Configuration" icon="cloud" href="/enterprise-solutions/configuration/remote-configuration/overview">
Deploy global workflows for your team
</Card>
</CardGroup>
@@ -0,0 +1,97 @@
---
title: "Configuration Overview"
sidebarTitle: "Overview"
description: "Understanding enterprise configuration options for inference providers and system settings"
---
Cline offers two distinct approaches to configure inference providers and system settings for your organization. Understanding the difference between these approaches will help you choose the right configuration method for your needs.
## Configuration Types
<Info>
**Need help choosing?** See the [Deployment Guide](/enterprise-solutions/configuration/choosing-your-deployment) for a detailed comparison and decision tree.
</Info>
<CardGroup cols={2}>
<Card title="SaaS Provider Configuration" icon="cloud" href="/enterprise-solutions/configuration/remote-configuration/overview">
**Simple cloud-based setup**
Configure inference providers through the Cline [admin console](https://app.cline.bot/dashboard). Ideal for quick organizational deployment with minimal infrastructure requirements.
</Card>
<Card title="Self-Hosted Configuration" icon="server" href="/enterprise-solutions/configuration/infrastructure-configuration/overview">
**Advanced enterprise setup**
Deep infrastructure integration with VPC endpoints, multi-account support, compliance features, and custom workflows on your own infrastructure.
</Card>
</CardGroup>
## Choosing the Right Configuration
### Use SaaS Configuration When:
- **Quick Setup**: You need to get your team up and running quickly
- **Centralized Management**: You want simple, cloud-based provider management
- **Standard Requirements**: Your organization has typical security and compliance needs
- **Small to Medium Teams**: You're managing dozens to hundreds of users
### Use Self-Hosted Configuration When:
- **Enterprise Security**: You need advanced security features and compliance controls
- **Complex Infrastructure**: You have existing AWS/GCP infrastructure to integrate with
- **Custom Workflows**: You need custom rules, workflows, and automation
- **Large Organizations**: You're managing hundreds to thousands of users
- **Air-Gapped Environments**: You need on-premises or restricted network deployment
## Configuration Comparison
| Feature | SaaS Configuration | Self-Hosted Configuration |
|---------|-------------------|---------------------------|
| **Setup Complexity** | Simple | Advanced |
| **Deployment Time** | Minutes | Days to Weeks |
| **Infrastructure Required** | None | AWS/GCP/Azure |
| **Compliance Features** | Basic | Advanced |
| **Custom Rules** | No | Yes |
| **Multi-Account Support** | No | Yes |
| **VPC Integration** | No | Yes |
| **Cost** | Lower | Higher |
## Getting Started
<Steps>
<Step title="Evaluate Your Requirements">
Review your organization's security, compliance, and infrastructure requirements to determine which configuration approach fits your needs.
</Step>
<Step title="Choose Your Path">
Select either SaaS Configuration for simple setup or Self-Hosted Configuration for advanced enterprise features. Use the [Deployment Guide](/enterprise-solutions/configuration/choosing-your-deployment) if you need help deciding.
</Step>
<Step title="Follow Configuration Guide">
Complete the setup process using the detailed guides for your chosen configuration type.
</Step>
<Step title="Onboard Team Members">
Once configured, team members can connect using the provider-specific member guides.
</Step>
</Steps>
---
## Available Providers
Both configuration approaches support the same core inference providers:
<CardGroup cols={3}>
<Card title="AWS Bedrock" icon="aws">
Enterprise AI models with AWS infrastructure integration and security features.
</Card>
<Card title="LiteLLM" icon="layer-group">
Unified proxy for accessing 100+ AI models through a single interface.
</Card>
<Card title="Google Vertex AI" icon="google">
Google Cloud's AI platform with advanced ML capabilities and global infrastructure.
</Card>
</CardGroup>
The main difference lies in how these providers are configured and managed within your organization's infrastructure and security requirements.
@@ -4,7 +4,8 @@ sidebarTitle: "Configure AWS Bedrock (Admin)"
description: "This guide explains how administrators configure AWS Bedrock as the organization-wide LLM provider for Cline."
---
As an administrator, you can add AWS Bedrock as the organization-wide LLM provider for all Cline users. This centralized approach ensures consistent access to Amazon's AI models while maintaining your organization's security and compliance requirements through VPC endpoints, region controls, and prompt caching optimizations.
As an administrator, you can add AWS Bedrock as the organization-wide LLM provider for all Cline users through the hosted admin console. This centralized approach ensures consistent access to Amazon's AI models while maintaining your organization's security and compliance requirements through region controls and basic configuration options.
## Before You Begin
@@ -13,9 +14,6 @@ To get started with setting up AWS Bedrock as your organization's LLM provider,
**Administrator access to the Cline Admin console**
You need admin privileges to enforce provider settings across your organization. If you can navigate to **Settings → Cline Settings** in the admin console at [app.cline.bot](https://app.cline.bot), you have the right access level.
<Info>
**Quick Check**: Try accessing the settings page now. If you can see the provider configuration options, you're good to go.
</Info>
**AWS Bedrock account with the right permissions**
Your AWS account needs specific Bedrock permissions to work with Cline.
@@ -0,0 +1,112 @@
---
title: "Configure Google Vertex AI Provider (Admin)"
sidebarTitle: "Configure Google Vertex (Admin)"
description: "This guide explains how administrators configure Google Vertex AI as the organization-wide LLM provider for Cline."
---
As an administrator, you can add Google Vertex AI as the organization-wide LLM provider for all Cline users through the hosted admin console. This centralized approach ensures consistent access to Google's Gemini models while maintaining your organization's project boundaries and regional settings.
## Before You Begin
To get started with setting up Google Vertex AI as your organization's LLM provider, you'll need a few items in place.
**Administrator access to the Cline Admin console**
You need admin privileges to enforce provider settings across your organization. If you can navigate to **Settings → Cline Settings** in the admin console at [app.cline.bot](https://app.cline.bot), you have the right access level.
**Google Cloud Project with Vertex AI enabled**
You need a Google Cloud project with the Vertex AI API enabled and appropriate models accessible.
<Note>
If you haven't set up Google Cloud or Vertex AI yet, work with your cloud team to enable the Vertex AI API and ensure necessary quotas are configured.
</Note>
**Project configuration details**
You'll need your Google Cloud project ID and preferred region for Vertex AI model access.
<Tip>
Service accounts should have the minimum IAM permissions needed for Vertex AI access to follow security best practices.
</Tip>
## Configuration Steps
<Steps>
<Step title="Access Cline Settings">
Navigate to [app.cline.bot](https://app.cline.bot) and sign in with your administrator account. Go to **Settings → Cline Settings**.
<Info>
You should see the provider configuration options if you have the correct admin access level.
</Info>
</Step>
<Step title="Enable Remote Provider Configuration">
Toggle on **Enable settings** to reveal the remote provider configuration options. This allows you to enforce provider settings across your organization.
</Step>
<Step title="Select Google Vertex AI as the API Provider">
Open the **API Provider** dropdown menu and select **Google Vertex AI**. This will open the Vertex AI configuration panel where you'll configure all your organization-wide settings.
</Step>
<Step title="Configure Vertex AI Settings">
The configuration panel includes settings that control how Vertex AI works for your organization:
<AccordionGroup>
<Accordion title="Project ID (required)">
Enter your Google Cloud project ID where Vertex AI is enabled. This project will be used for all AI model requests from your organization members.
<Tip>
Use a dedicated project for AI workloads to better track usage and costs. Ensure the project has sufficient quotas for your team's expected usage.
</Tip>
</Accordion>
<Accordion title="Region (required)">
Select the Google Cloud region where your Vertex AI models should be accessed. Common options include `us-central1`, `us-east4`, or `europe-west4`.
[View Google Cloud Regions](https://cloud.google.com/docs/geography-and-regions)
<Note>
Choose a region close to your team's location for optimal performance. Some models may not be available in all regions.
</Note>
</Accordion>
</AccordionGroup>
</Step>
<Step title="Save Configuration">
After configuring your settings, close the provider configuration panel and click **Save** on the settings page to persist your changes.
Once saved, all organization members signed into the Cline extension will automatically use Google Vertex AI with your configured settings. They won't be able to select other providers or switch to their personal Cline accounts.
<Warning>
Members can't switch to personal Cline accounts or join other organizations once remote configuration is enabled. This ensures consistent provider usage across your team.
</Warning>
</Step>
</Steps>
## Verification
To verify the configuration:
1. Check that the provider shows as "Google Vertex AI" in the Enabled provider field
2. Confirm the settings persist after refreshing the page
3. Test with a member account to ensure they see only Vertex AI as a provider
4. Verify that Gemini models are available in the model dropdown
## Troubleshooting
**Members don't see the configured provider**
Ensure you clicked Save after closing the configuration panel. Verify the member account belongs to the correct organization and that your Google Cloud project has Vertex AI API enabled.
**Project access errors**
Verify the project ID is correct and that Vertex AI API is enabled. Check that the project has appropriate billing configured and hasn't exceeded quotas.
**Regional availability issues**
Confirm the selected region supports the Gemini models you want to use. Some newer models may only be available in specific regions.
**Configuration changes don't persist**
Make sure to click the Save button on the main settings page, not just close the configuration panel.
**Need to change project or region later**
You can update these settings at any time. Members will need to ensure their local Google Cloud credentials have access to the new project/region.
For further details, consult the [Google Cloud Vertex AI Documentation](https://cloud.google.com/vertex-ai/docs) and coordinate with your internal cloud team.
@@ -0,0 +1,177 @@
---
title: "Configure Google Vertex AI in VS Code (Members)"
sidebarTitle: "Configure Google Vertex (Member)"
description: "Guide for engineers connecting to their organization's Google Vertex AI setup through VS Code after admin setup"
---
As a team member, you can connect your local development environment to your organization's Google Vertex AI setup. This guide walks you through configuring your Google Cloud credentials in VS Code so you can start using Vertex AI models through your organization's configured project and regional settings. Your administrator has already configured the provider settings—you just need to add your credentials to get started.
## Before You Begin
To successfully connect to your organization's Google Vertex AI setup, you'll need a few things ready.
**Cline extension installed and configured**
The Cline extension must be installed in VS Code and you need to be signed into your organization account. If you haven't installed Cline yet, follow our [installation guide](/getting-started/installing-cline).
<Info>
**Quick Check**: Open the Cline panel in VS Code. If you see your organization name in the bottom left, you're signed in correctly.
</Info>
**Google Cloud credentials with Vertex AI access**
You need Google Cloud credentials that have permission to access Vertex AI in your organization's configured project and region.
<Note>
If you're unsure which method to use, check with your administrator or IT team about how your organization has configured Google Cloud access.
</Note>
## Configuration Steps
<Steps>
<Step title="Open Cline Settings">
Open VS Code and access the Cline settings panel using either of these methods:
- Click the settings icon (⚙️) in the Cline panel
- Click on the API Provider dropdown located directly below the chat area (it will display as `vertex_ai/gemini-pro` or similar)
</Step>
<Step title="Select Your Authentication Method">
Choose one of the following credential methods to authenticate with Google Vertex AI:
<AccordionGroup>
<Accordion title="Service Account Key">
Use a service account JSON key file for Vertex AI access.
[Learn more about Service Account Keys](https://cloud.google.com/iam/docs/service-accounts)
1. Select the **Service Account Key** authentication method
2. Upload or paste your service account JSON key content
3. The key should have `aiplatform.user` or similar Vertex AI permissions
4. These credentials are stored locally and used only by the VS Code extension
</Accordion>
<Accordion title="Google Cloud SDK">
Use the Google Cloud SDK installed on your machine with your authenticated account.
[Learn more about Google Cloud SDK](https://cloud.google.com/sdk/docs/install)
1. Select the **Google Cloud SDK** authentication method
2. Ensure you've authenticated with `gcloud auth login`
3. Verify your account has access to the organization's Vertex AI project
4. Cline will use your default Google Cloud credentials automatically
</Accordion>
<Accordion title="Application Default Credentials">
Use Google Cloud's application default credentials (ADC) chain.
1. Select the **Application Default Credentials** method
2. Ensure ADC is properly configured in your environment
3. This works well for environments where Google Cloud credentials are managed centrally
4. Cline will automatically detect credentials from your environment
</Accordion>
</AccordionGroup>
<Note>
The Google Cloud Project ID and Region are preconfigured by your administrator and do not need to be set in the extension.
</Note>
</Step>
<Step title="Verify Configuration">
After selecting your authentication method, the extension will display checkmarks for enabled features:
- ✓ Supports images (for Gemini Pro Vision and similar models)
- ✓ Supports multimodal inputs
- ✓ Supports function calling (for supported models)
The project ID and region settings will be locked (shown with a lock icon 🔒) as they're controlled by your administrator.
</Step>
<Step title="Test the Connection">
Send a test message in Cline to verify your credentials work correctly with the configured Vertex AI project and region.
<Tip>
**Testing Recommendation**
Try a simple test like "Hello" first to verify basic connectivity, then test multimodal capabilities if needed by sharing an image.
</Tip>
</Step>
</Steps>
## Model Usage
### Available Model Families
The models available through your organization's Vertex AI setup typically include:
**Gemini Models:**
- **Gemini Pro**: Advanced reasoning, code generation, and multimodal capabilities
- **Gemini Pro Vision**: Image understanding and visual question answering
- **Gemini Ultra**: Most capable model for complex reasoning tasks
**PaLM Models:**
- **PaLM 2 for Text**: Text generation and completion
- **PaLM 2 for Chat**: Conversational AI interactions
- **Codey**: Specialized for code generation and explanation
**Specialized Models:**
- **Text Embedding**: For semantic search and similarity tasks
- **Custom Models**: Your organization's fine-tuned variants (if available)
### Model Selection Strategy
Choose models based on your development needs:
- **General tasks**: Use Gemini Pro for most text and reasoning tasks
- **Visual content**: Use Gemini Pro Vision when working with images
- **Code-heavy work**: Use Codey models for programming tasks
- **Complex reasoning**: Use Gemini Ultra for sophisticated problem-solving
- **Embedding tasks**: Use Text Embedding models for semantic operations
### Multimodal Capabilities
Take advantage of Vertex AI's multimodal features:
- **Image Analysis**: Upload images directly in Cline for analysis
- **Visual Question Answering**: Ask questions about images
- **Code Screenshots**: Get explanations of code from screenshots
- **Document Processing**: Analyze charts, graphs, and visual data
## Troubleshooting
**Google Vertex AI not available as provider option**
Confirm you're signed into the correct Cline organization. Verify your administrator has saved the Vertex AI configuration and that you have the latest version of the Cline extension.
**Authentication errors ("Access Denied" or "Invalid Credentials")**
Verify your chosen credential method has the necessary IAM permissions to access Vertex AI in the configured project and region. Required permissions include `aiplatform.endpoints.predict` and `aiplatform.models.predict`.
**Project access errors**
Ask your administrator to confirm which Google Cloud project is configured for your organization. Ensure your Google Cloud credentials have access to that specific project.
**Regional access errors**
Verify your credentials have access to Vertex AI in the configured region. Some models may not be available in all regions, so confirm with your administrator about the selected region.
**Google Cloud SDK authentication issues**
Ensure Google Cloud SDK is properly installed and authenticated:
```bash
gcloud auth login
gcloud config set project YOUR_PROJECT_ID
gcloud auth application-default login
```
**Service account key errors**
Verify the service account key is valid and hasn't expired. Check that the service account has the proper Vertex AI permissions in your organization's project. Ensure the JSON key file is properly formatted and contains all required fields.
**Model access errors or "model not found"**
Some models may not be enabled in your organization's project or region. Contact your administrator if specific models are not available. Verify that your organization has enabled the models you're trying to use in the Google Cloud Console.
## Security Best Practices
When configuring your Google Cloud credentials, follow these security guidelines:
- Use service accounts with minimal required permissions for Vertex AI access
- Rotate service account keys regularly (every 90 days recommended)
- Never store credentials in code or version control
- Use Google Cloud SDK where possible for better credential management
- Consider using Workload Identity for containerized development environments
- Report any suspicious activity or unauthorized access attempts
Your organization administrator controls which models and regions are available. The extension will automatically display available models based on your project's configuration and regional availability.
For more information about Google Cloud authentication and Vertex AI permissions, refer to the [Google Cloud IAM Documentation](https://cloud.google.com/iam/docs) and coordinate with your organization's cloud administrator.
@@ -0,0 +1,120 @@
---
title: "Configure LiteLLM Provider (Admin)"
sidebarTitle: "Configure LiteLLM (Admin)"
description: "This guide explains how administrators configure LiteLLM as the organization-wide LLM provider for Cline."
---
As an administrator, you can add LiteLLM as the organization-wide LLM provider for all Cline users through the hosted admin console. This centralized approach provides unified access to multiple AI models through your LiteLLM proxy interface.
## Before You Begin
To get started with setting up LiteLLM as your organization's LLM provider, you'll need a few items in place.
**Administrator access to the Cline Admin console**
You need admin privileges to enforce provider settings across your organization. If you can navigate to **Settings → Cline Settings** in the admin console at [app.cline.bot](https://app.cline.bot), you have the right access level.
<Info>
**Quick Check**: Try accessing the settings page now. If you can see the provider configuration options, you're good to go.
</Info>
**LiteLLM proxy instance running**
You need a deployed LiteLLM proxy that your team can access. This can be self-hosted or managed through a cloud provider.
<Note>
If you haven't deployed LiteLLM yet, work with your infrastructure team to set up a LiteLLM proxy instance.
</Note>
**LiteLLM endpoint details**
You'll need the base URL of your LiteLLM proxy and optionally a master key if your deployment requires authentication.
<Tip>
Ensure your LiteLLM proxy is accessible from your team's development environments and has the models you want to make available configured.
</Tip>
## Configuration Steps
<Steps>
<Step title="Access Cline Settings">
Navigate to [app.cline.bot](https://app.cline.bot) and sign in with your administrator account. Go to **Settings → Cline Settings**.
<Info>
You should see the provider configuration options if you have the correct admin access level.
</Info>
</Step>
<Step title="Enable Remote Provider Configuration">
Toggle on **Enable settings** to reveal the remote provider configuration options. This allows you to enforce provider settings across your organization.
</Step>
<Step title="Select LiteLLM as the API Provider">
Open the **API Provider** dropdown menu and select **LiteLLM**. This will open the LiteLLM configuration panel where you'll configure all your organization-wide settings.
</Step>
<Step title="Configure LiteLLM Settings">
The configuration panel includes settings that control how LiteLLM works for your organization:
<AccordionGroup>
<Accordion title="Base URL (required)">
Enter your LiteLLM proxy endpoint URL. This should be the full URL where your LiteLLM proxy is accessible, such as `https://litellm.yourcompany.com` or `http://your-proxy:4000`.
<Tip>
Use HTTPS endpoints in production for security. Make sure the URL is accessible from your team's development environments.
</Tip>
</Accordion>
<Accordion title="Master Key (optional)">
If your LiteLLM proxy requires authentication, enter the master key here. This will be used to authenticate requests from all organization members.
<Note>
**Centralized API Key Management**: By configuring the Master Key at the organization level, you enable centralized API key management. Organization members won't need to manage their own individual API keys - access is fully managed through this centralized configuration.
</Note>
<Warning>
The master key provides full access to your LiteLLM proxy. Only enter this if your proxy requires authentication and you want centralized key management.
</Warning>
</Accordion>
</AccordionGroup>
</Step>
<Step title="Save Configuration">
After configuring your settings, close the provider configuration panel and click **Save** on the settings page to persist your changes.
Once saved, all organization members signed into the Cline extension will automatically use LiteLLM with your configured settings. They won't be able to select other providers or switch to their personal Cline accounts.
<Warning>
Members can't switch to personal Cline accounts or join other organizations once remote configuration is enabled. This ensures consistent provider usage across your team.
</Warning>
</Step>
</Steps>
## Verification
To verify the configuration:
1. Check that the provider shows as "LiteLLM" in the Enabled provider field
2. Confirm the settings persist after refreshing the page
3. Test with a member account to ensure they see only LiteLLM as a provider
4. Verify that the configured models are available in the model dropdown
## Troubleshooting
**Members don't see the configured provider**
Ensure you clicked Save after closing the configuration panel. Verify the member account belongs to the correct organization and that your LiteLLM proxy is accessible from their network.
**Connection errors to LiteLLM proxy**
Verify the Base URL is correct and accessible. Check that any firewalls or security groups allow access from your team's IP addresses or development environments.
**Authentication failures**
If using a master key, verify it's correctly entered and has proper permissions in your LiteLLM deployment. Check the LiteLLM proxy logs for authentication errors.
**Models not available**
Confirm the models are properly configured in your LiteLLM proxy deployment. The available models depend on how your LiteLLM proxy is configured.
**Configuration changes don't persist**
Make sure to click the Save button on the main settings page, not just close the configuration panel.
**Need to change endpoint or key later**
You can update these settings at any time. Changes take effect immediately for all organization members.
For further details about LiteLLM deployment and configuration, consult the [LiteLLM Documentation](https://docs.litellm.ai/) and coordinate with your infrastructure team.
@@ -0,0 +1,168 @@
---
title: "Configure LiteLLM in VS Code (Members)"
sidebarTitle: "Configure LiteLLM (Member)"
description: "Guide for engineers connecting to their organization's LiteLLM proxy through VS Code after admin setup"
---
As a team member, you can connect your local development environment to your organization's LiteLLM proxy setup. This guide walks you through configuring your connection in VS Code so you can start using multiple AI models through your organization's unified proxy interface. Your administrator has already configured the provider settings—you just need to add your credentials to get started.
## Before You Begin
To successfully connect to your organization's LiteLLM proxy, you'll need a few things ready.
**Cline extension installed and configured**
The Cline extension must be installed in VS Code and you need to be signed into your organization account. If you haven't installed Cline yet, follow our [installation guide](/getting-started/installing-cline).
<Info>
**Quick Check**: Open the Cline panel in VS Code. If you see your organization name in the bottom left, you're signed in correctly.
</Info>
**Access credentials for your organization's LiteLLM proxy**
You need credentials to access your organization's LiteLLM proxy. This might be an API key, or the proxy might be configured for open access within your network.
<Note>
If you're unsure about the credentials needed, check with your administrator or IT team about how to access your organization's LiteLLM proxy.
</Note>
## Configuration Steps
<Steps>
<Step title="Open Cline Settings">
Open VS Code and access the Cline settings panel using either of these methods:
- Click the settings icon (⚙️) in the Cline panel
- Click on the API Provider dropdown located directly below the chat area (it will display as `LiteLLM` or show a specific model name)
</Step>
<Step title="Configure LiteLLM Connection">
The LiteLLM configuration options depend on how your organization has set up the proxy:
<AccordionGroup>
<Accordion title="API Key Authentication">
If your organization requires API key authentication:
1. Select or confirm the **LiteLLM** provider is selected
2. Enter your assigned API key in the **API Key** field
3. The base URL should already be configured by your administrator
4. Click **Save** to store your credentials
<Tip>
API keys are stored locally in VS Code and are only used by the Cline extension.
</Tip>
</Accordion>
<Accordion title="Open Access (No Authentication)">
If your LiteLLM proxy is configured for open access within your network:
1. Select or confirm the **LiteLLM** provider is selected
2. Leave the API key field empty
3. The extension will connect directly to the configured proxy endpoint
4. No additional authentication is required
<Info>
Open access is common when the LiteLLM proxy is deployed within a secure network environment.
</Info>
</Accordion>
<Accordion title="Custom Configuration">
If your organization uses custom authentication or specific connection parameters:
1. Follow any custom instructions provided by your administrator
2. Contact your IT team if you encounter connection issues
3. Additional configuration may be needed outside of VS Code
<Note>
Custom configurations might require specific network settings or additional authentication steps.
</Note>
</Accordion>
</AccordionGroup>
</Step>
<Step title="Select Available Models">
Once connected, you'll see the models available through your organization's LiteLLM proxy:
- View available models in the model dropdown
- Models are determined by your administrator's proxy configuration
- You can switch between models for different types of tasks
- Some models may be restricted based on your access level
<Tip>
**Model Selection**
Choose models based on your task requirements:
- **Fast models** (like GPT-3.5-turbo) for quick responses
- **Powerful models** (like GPT-4) for complex reasoning
- **Specialized models** for code generation or specific domains
</Tip>
</Step>
<Step title="Test the Connection">
Send a test message in Cline to verify your connection works correctly with the LiteLLM proxy.
<Tip>
**Testing Recommendation**
Test the connection in plan mode first to verify everything works correctly before using it for actual development tasks.
</Tip>
</Step>
</Steps>
## Model Usage
### Available Model Categories
The models available through your LiteLLM proxy typically include:
**Text Generation Models:**
- OpenAI GPT-4, GPT-3.5-turbo variants
- Anthropic Claude 3 Sonnet, Haiku, Opus
- Open source models like Llama 2, Mistral
**Code-Specific Models:**
- OpenAI GPT-4 for code
- CodeLlama variants
- Specialized code completion models
**Multimodal Models:**
- GPT-4 Vision for image analysis
- Claude 3 models with vision capabilities
### Model Selection Strategy
Choose models based on your development needs:
- **Quick iterations**: Use faster, cost-effective models
- **Complex problems**: Use more powerful models
- **Code-heavy tasks**: Use code-specialized models
- **Visual content**: Use multimodal models when working with images
## Troubleshooting
**LiteLLM not available as provider option**
Confirm you're signed into the correct Cline organization. Verify your administrator has saved the LiteLLM configuration and that you have the latest version of the Cline extension.
**Connection errors or timeouts**
Verify your network can reach the LiteLLM proxy endpoint. Check with your IT team about firewall rules or VPN requirements. Ensure the proxy endpoint is accessible from your development environment.
**Authentication failures**
If using API key authentication, verify the key is correctly entered and hasn't expired. Contact your administrator to confirm your key is active and has the proper permissions.
**Models not loading or are limited**
The available models depend on your organization's LiteLLM configuration. Contact your administrator if you need access to specific models or if expected models aren't available.
**Slow response times**
Response times depend on the models being used and proxy load. Try switching to faster models for routine tasks. Contact your administrator if performance is consistently poor.
**Error messages from specific models**
Some models may be temporarily unavailable or have specific limitations. Try alternative models or contact your administrator if specific models are consistently failing.
## Security Best Practices
When working with your organization's LiteLLM proxy:
- Keep your API credentials secure and don't share them
- Use appropriate models for the sensitivity of your data
- Follow your organization's usage guidelines
- Report any suspicious activity or unauthorized access attempts
- Regularly update the Cline extension for security patches
Your organization administrator controls which models are available and usage policies. The extension will automatically display available models based on your proxy configuration and access level.
@@ -0,0 +1,102 @@
---
title: "SaaS Provider Configuration"
sidebarTitle: "Overview"
description: "Configure inference providers through the Cline hosted admin console for centralized organization management"
---
SaaS Provider Configuration allows administrators to centrally configure inference providers for their entire organization through the Cline hosted admin console. This approach ensures consistent provider access, security policies, and cost management across all team members without requiring individual developer setup or infrastructure deployment.
## How Remote Configuration Works
Remote configuration operates through Cline's hosted service at [app.cline.bot](https://app.cline.bot), where administrators can:
<CardGroup cols={2}>
<Card title="Centralized Setup" icon="gear">
Configure providers once for the entire organization through the web-based admin console.
</Card>
<Card title="Automatic Enforcement" icon="shield-check">
Team members automatically receive the configured provider settings when signed into their organization.
</Card>
<Card title="Simplified Onboarding" icon="user-plus">
New team members get instant access to inference providers without complex individual configuration.
</Card>
<Card title="Consistent Experience" icon="users">
Ensure all team members use the same models, regions, and settings organization-wide.
</Card>
</CardGroup>
## Supported Providers
Cline supports remote configuration for the following inference providers:
| Provider | Use Case | Configuration | Member Setup |
|----------|----------|---------------|--------------|
| **Cline** | Organizations using Cline's native provider with centralized API key management | API provider selection, model access | No individual API keys needed - fully managed by organization |
| **Amazon Bedrock** | Organizations using AWS infrastructure | Region selection, VPC endpoints, cross-region inference, prompt caching | AWS credential configuration in VS Code |
| **LiteLLM** | Organizations requiring multi-model access through a unified proxy | Proxy endpoint, authentication, model routing | API key or endpoint configuration in VS Code (or centralized with Master Key) |
| **Google Vertex AI** | Organizations using Google Cloud Platform | Project ID, region selection, model access | Service account or credential configuration in VS Code |
## Configuration Process
The typical remote configuration process follows these steps:
<Steps>
<Step title="Administrator Setup">
Access the Cline admin console and configure the desired inference provider with organization-wide settings.
</Step>
<Step title="Automatic Distribution">
Provider configuration is automatically distributed to all organization members signed into Cline.
</Step>
<Step title="Member Credential Setup">
Team members add their individual credentials (API keys, AWS profiles, etc.) to connect to the configured provider.
</Step>
<Step title="Immediate Access">
Once credentials are configured, members can immediately start using the inference provider through Cline.
</Step>
</Steps>
## Benefits of Remote Configuration
### **For Administrators**
- **Centralized Control**: Manage all provider settings from one location
- **Security Compliance**: Ensure consistent security policies across the organization
- **Easy Updates**: Change provider settings organization-wide instantly
### **For Team Members**
- **Simplified Setup**: No need to research provider configuration options
- **Consistent Experience**: Same models and features available to everyone
- **Quick Onboarding**: Get started immediately with pre-configured providers
- **Focus on Development**: Spend time coding instead of configuring inference providers
## Getting Started
To get started with provider remote configuration:
1. **Choose Your Provider**: Select the inference provider that best fits your organization's needs and existing infrastructure
2. **Admin Configuration**: Follow the provider-specific admin configuration guide
3. **Member Onboarding**: Have team members complete the provider-specific member configuration
4. **Start Developing**: Begin using Cline with centrally managed inference provider access
Select your provider below to begin the configuration process:
<CardGroup cols={3}>
<Card title="Amazon Bedrock" icon="aws" href="/enterprise-solutions/configuration/remote-configuration/aws-bedrock/admin-configuration">
AWS-based AI models with enterprise security and compliance features.
</Card>
<Card title="LiteLLM" icon="layer-group" href="/enterprise-solutions/configuration/remote-configuration/litellm/admin-configuration">
Unified proxy for accessing 100+ AI models through a single interface.
</Card>
<Card title="Google Vertex AI" icon="google" href="/enterprise-solutions/configuration/remote-configuration/google-vertex/admin-configuration">
Google Cloud's AI platform with advanced ML capabilities and global infrastructure.
</Card>
</CardGroup>
@@ -1,63 +0,0 @@
---
title: "Managing Members"
sidebarTitle: "Managing Members"
description: "A guide to adding, removing, and editing members in your enterprise organization."
---
This guide covers the practical steps for adding, editing, and removing members from your enterprise dashboard. For a conceptual overview of roles and permissions, see the [Roles and Permissions](/enterprise-solutions/members/roles-and-permissions).
<Frame caption="The Members Dashboard provides a central place to manage your team.">
<img src="https://storage.googleapis.com/cline_public_images/members-dash.png" alt="Members Dashboard" />
</Frame>
## Adding Members
To invite someone to your organization, you must have an open seat available on your organization.
1. Navigate to the **Members** tab in your dashboard.
2. Click the **Add Members** button.
3. Enter one or more email addresses, separated by commas.
4. Select a role for the new member(s). It's best practice to start with the "Member" role unless you know they need admin privileges.
5. Click **Send Invitation**.
Invited users will receive an email with a link to join. You can cancel a pending invitation at any time by clicking the trash icon next to the user's email in the 'Pending Invites' section.
<Tip>
**Managing Users at Scale**
When inviting a large number of users, you can paste a comma-separated list of emails directly into the invitation field. While role changes and removals are performed individually, this bulk invitation feature helps streamline the onboarding process for entire teams.
</Tip>
<Frame caption="Adding members to your organization">
<img src="https://storage.googleapis.com/cline_public_images/adding-members.png" alt="Confirm Member Removal" />
</Frame>
## Editing Member Roles
As your team's needs change, you can adjust member roles directly from the dashboard.
- Find the member in your list.
- Under the "Role" column, click the dropdown menu.
- Select their new role. The change takes effect immediately.
Refer to the [Roles and Permissions](/enterprise-solutions/members/roles-and-permissions) for a detailed breakdown of what each role can do.
## Removing Members
Removing a member immediately revokes their access to all organization-specific resources, including shared API keys and configurations.
1. Go to the **Members Dashboard**.
2. Find the member in the list and click the red trash icon (<Icon icon="trash" iconType="solid" />).
3. Confirm the removal when prompted.
<Frame caption="You will be asked to confirm before a member is permanently removed.">
<img src="https://storage.googleapis.com/cline_public_images/remove-user.png" alt="Confirm Member Removal" />
</Frame>
## Troubleshooting Invitations
If an invited user is having trouble joining, check these common issues:
- **Invitation Not Received**: Ask the user to check their spam or junk mail folder. If it's not there, cancel the pending invitation and try sending it again, verifying the email address is correct.
- **"Invalid Domain" Error**: The user's email address must belong to a domain that has been verified for your organization. Work with your IT administrator to ensure the necessary domains are configured.
@@ -1,63 +0,0 @@
---
title: "Managing Members"
sidebarTitle: "Managing Members"
description: "A guide to adding, removing, and editing members in your enterprise organization."
---
This guide covers the practical steps for adding, editing, and removing members from your enterprise dashboard. For a conceptual overview of roles and permissions, see the [Roles and Permissions](/enterprise-solutions/members/roles-and-permissions).
<Frame caption="The Members Dashboard provides a central place to manage your team.">
<img src="https://storage.googleapis.com/cline_public_images/members-dash.png" alt="Members Dashboard" />
</Frame>
## Adding Members
To invite someone to your organization, you must have an open seat available on your organization.
1. Navigate to the **Members** tab in your dashboard.
2. Click the **Add Members** button.
3. Enter one or more email addresses, separated by commas.
4. Select a role for the new member(s). It's best practice to start with the "Member" role unless you know they need admin privileges.
5. Click **Send Invitation**.
Invited users will receive an email with a link to join. You can cancel a pending invitation at any time by clicking the trash icon next to the user's email in the 'Pending Invites' section.
<Tip>
**Managing Users at Scale**
When inviting a large number of users, you can paste a comma-separated list of emails directly into the invitation field. While role changes and removals are performed individually, this bulk invitation feature helps streamline the onboarding process for entire teams.
</Tip>
<Frame caption="Adding members to your organization">
<img src="https://storage.googleapis.com/cline_public_images/adding-members.png" alt="Confirm Member Removal" />
</Frame>
## Editing Member Roles
As your team's needs change, you can adjust member roles directly from the dashboard.
- Find the member in your list.
- Under the "Role" column, click the dropdown menu.
- Select their new role. The change takes effect immediately.
Refer to the [Roles and Permissions](/enterprise-solutions/members/roles-and-permissions) for a detailed breakdown of what each role can do.
## Removing Members
Removing a member immediately revokes their access to all organization-specific resources, including shared API keys and configurations.
1. Go to the **Members Dashboard**.
2. Find the member in the list and click the red trash icon (<Icon icon="trash" iconType="solid" />).
3. Confirm the removal when prompted.
<Frame caption="You will be asked to confirm before a member is permanently removed.">
<img src="https://storage.googleapis.com/cline_public_images/remove-user.png" alt="Confirm Member Removal" />
</Frame>
## Troubleshooting Invitations
If an invited user is having trouble joining, check these common issues:
- **Invitation Not Received**: Ask the user to check their spam or junk mail folder. If it's not there, cancel the pending invitation and try sending it again, verifying the email address is correct.
- **"Invalid Domain" Error**: The user's email address must belong to a domain that has been verified for your organization. Work with your IT administrator to ensure the necessary domains are configured.
@@ -1,27 +0,0 @@
---
title: "Members Overview"
sidebarTitle: "Overview"
description: "An overview of member management in your enterprise organization."
---
This section provides a comprehensive guide to managing members in your enterprise organization. Here, you'll find everything you need to know about roles, permissions, and the practical steps for adding, editing, and removing members from your dashboard.
## Key Topics
<CardGroup cols={2}>
<Card
title="Roles and Permissions"
icon="user-shield"
href="/enterprise-solutions/members/roles-and-permissions"
>
A detailed breakdown of the available roles and their specific permissions.
</Card>
<Card
title="Managing Members"
icon="users-gear"
href="/enterprise-solutions/members/managing-members"
>
A practical guide to adding, editing, and removing members from your
dashboard.
</Card>
</CardGroup>
@@ -1,83 +0,0 @@
---
title: "Roles and Permissions"
sidebarTitle: "Roles and Permissions"
description: "An overview of member roles, permissions, and best practices for your enterprise organization."
---
Choosing the right role for each member is crucial for maintaining security and ensuring your team can work effectively. This guide provides a detailed breakdown of the available roles, their specific permissions, and best practices for managing your organization.
## Role Definitions
Heres a summary of the available roles and their intended use cases.
<CardGroup cols={1}>
<Card title="Owner" icon="user-crown">
**Best for:** The primary account holder or a small number of designated leaders.
Owners have unrestricted access to all settings, including billing, member management, and security configurations. To maintain tight control over the organization, the number of Owners should be kept to a minimum.
</Card>
<Card title="Admin" icon="user-gear">
**Best for:** Team leads or IT administrators who need to manage users and configurations.
Admins can invite, edit, and remove members, as well as manage provider configurations. They have broad access but cannot manage billing or change the Owner. This is a suitable role for trusted team managers.
</Card>
<Card title="Member" icon="user">
**Best for:** Most developers and individual contributors.
Members can use Cline with the organization's shared resources but cannot change any settings or view other users' activity. This is the safest default role for new users.
</Card>
</CardGroup>
## Permissions Matrix
For a detailed comparison, this matrix outlines the specific capabilities of each role.
| Permission | Member | Admin | Owner |
| --------------------------- | :----: | :----: | :----: |
| **General Usage** | | | |
| Use Cline | ✅ | ✅ | ✅ |
| Access Shared API Providers | ✅ | ✅ | ✅ |
| | | | |
| **Member Management** | | | |
| View Members | ❌ | ✅ | ✅ |
| Invite New Members | ❌ | ✅ | ✅ |
| Edit Member Roles | ❌ | ✅ | ✅ |
| Remove Members | ❌ | ✅ | ✅ |
| Remove Admins | ❌ | ❌ | ✅ |
| | | | |
| **Configuration** | | | |
| Configure API Providers | ❌ | ✅ | ✅ |
| Manage Security Settings | ❌ | ❌ | ✅ |
| | | | |
| **Billing & Ownership** | | | |
| View Billing Information | ❌ | ❌ | ✅ |
| Manage Subscription | ❌ | ❌ | ✅ |
| Transfer Ownership | ❌ | ❌ | ✅ |
## Role Management Best Practices
Effective role management is fundamental to securing your organization.
- **Apply the Principle of Least Privilege**: Always assign the role with the minimum necessary permissions. Most users should be **Members**. Grant **Admin** rights only to those who are responsible for user management or technical configuration.
- **Limit the Number of Owners**: The **Owner** role should be reserved for one or two key individuals who control the account and billing. This centralization of power prevents accidental or malicious changes to critical settings.
- **Regularly Audit Roles**: Periodically review the list of Admins and Owners to ensure the assigned roles are still appropriate. When a team member's responsibilities change, adjust their role accordingly.
## Identity Providers and Domain Verification
For a user to successfully join and sign in to your organization, two conditions must be met:
1. Their email must be managed by your organization's verified **Identity Provider (IDP)**, such as Microsoft Entra ID, Okta, or AWS.
2. Your organization must have a **verified domain** with a provider like Google or Microsoft.
This ensures that only authenticated users from your company can access your Cline organization.
## Seat Management and Invitations
Each user in your organization, regardless of role, consumes one seat from your license.
- When an invitation is sent, a seat is considered "pending."
- If an invited user does not accept, the invitation can be revoked to free up the seat.
- Removing a member from the organization immediately frees up a seat.
Now that you understand the different roles and how to manage them, you can proceed to [configuring provider remote access](/enterprise-solutions/provider-remote-config/aws-bedrock/admin-configuration) for your organization.
@@ -0,0 +1,266 @@
---
title: "OpenTelemetry Integration"
sidebarTitle: "OpenTelemetry"
description: "Export Cline telemetry to your observability platform using OpenTelemetry Protocol (OTLP)"
---
Cline includes opt-in OpenTelemetry support for exporting metrics and logs to your own observability infrastructure using the OpenTelemetry Protocol (OTLP).
<Note>
OpenTelemetry integration is **optional** and intended for advanced users with existing observability infrastructure. Most users won't need this feature.
</Note>
## What is OpenTelemetry?
[OpenTelemetry](https://opentelemetry.io/) is an industry-standard observability framework that provides a unified way to collect and export telemetry data (metrics, logs, and traces).
Cline's OpenTelemetry support allows you to:
- Export telemetry to your own systems
- Integrate with observability platforms like Datadog, New Relic, Grafana Cloud, etc.
- Maintain full control over your monitoring data
- Use your organization's existing monitoring infrastructure
## Supported Features
Cline supports OpenTelemetry's **OTLP (OpenTelemetry Protocol)** export with:
<CardGroup cols={2}>
<Card title="Metrics Export" icon="chart-bar">
Export metrics about Cline usage, performance, and errors
</Card>
<Card title="Logs Export" icon="file-lines">
Export structured logs for debugging and analysis
</Card>
</CardGroup>
### Export Formats
Cline supports three OTLP export protocols:
- **gRPC** (default, recommended)
- **HTTP/protobuf**
- **HTTP/JSON**
### Export Destinations
You can export to:
- **Console** (for testing)
- **OTLP endpoint** (your own collector or observability platform)
## Configuration
OpenTelemetry is configured using environment variables before launching Cline.
### Basic Setup
Enable OpenTelemetry and configure an OTLP endpoint:
```bash
# Enable OpenTelemetry
export OTEL_TELEMETRY_ENABLED=1
# Configure metrics and logs export
export OTEL_METRICS_EXPORTER=otlp
export OTEL_LOGS_EXPORTER=otlp
# Set your OTLP endpoint
export OTEL_EXPORTER_OTLP_ENDPOINT=https://your-collector:4317
# Optional: Set protocol (default is grpc)
export OTEL_EXPORTER_OTLP_PROTOCOL=grpc
```
### Environment Variables
| Variable | Description | Default |
|----------|-------------|---------|
| `OTEL_TELEMETRY_ENABLED` | Enable OpenTelemetry (`1` or `true`) | Disabled |
| `OTEL_METRICS_EXPORTER` | Metrics exporter type (`console`, `otlp`, or both) | None |
| `OTEL_LOGS_EXPORTER` | Logs exporter type (`console`, `otlp`, or both) | None |
| `OTEL_EXPORTER_OTLP_ENDPOINT` | OTLP endpoint URL | None |
| `OTEL_EXPORTER_OTLP_PROTOCOL` | Protocol (`grpc`, `http/protobuf`, `http/json`) | `grpc` |
| `OTEL_EXPORTER_OTLP_INSECURE` | Allow insecure connections | `false` |
| `OTEL_EXPORTER_OTLP_HEADERS` | Custom headers (comma-separated `key=value` pairs) | None |
### Advanced Configuration
**Separate endpoints for metrics and logs:**
```bash
export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=https://metrics-collector:4317
export OTEL_EXPORTER_OTLP_LOGS_ENDPOINT=https://logs-collector:4317
```
**Custom headers for authentication:**
```bash
export OTEL_EXPORTER_OTLP_HEADERS="api-key=your-key,x-custom-header=value"
```
**Multiple exporters (console + OTLP):**
```bash
export OTEL_METRICS_EXPORTER=console,otlp
export OTEL_LOGS_EXPORTER=console,otlp
```
**Export intervals:**
```bash
# Metrics export interval in milliseconds (default: 60000)
export OTEL_METRIC_EXPORT_INTERVAL=30000
# Logs batch size and timeout
export OTEL_LOG_BATCH_SIZE=512
export OTEL_LOG_BATCH_TIMEOUT=5000
export OTEL_LOG_MAX_QUEUE_SIZE=2048
```
## Integration Examples
### Datadog
Export to Datadog using their OTLP endpoint:
```bash
export OTEL_TELEMETRY_ENABLED=1
export OTEL_METRICS_EXPORTER=otlp
export OTEL_LOGS_EXPORTER=otlp
export OTEL_EXPORTER_OTLP_ENDPOINT=https://api.datadoghq.com
export OTEL_EXPORTER_OTLP_HEADERS="dd-api-key=YOUR_DD_API_KEY"
```
### New Relic
Export to New Relic:
```bash
export OTEL_TELEMETRY_ENABLED=1
export OTEL_METRICS_EXPORTER=otlp
export OTEL_LOGS_EXPORTER=otlp
export OTEL_EXPORTER_OTLP_ENDPOINT=https://otlp.nr-data.net:4317
export OTEL_EXPORTER_OTLP_HEADERS="api-key=YOUR_NEW_RELIC_LICENSE_KEY"
```
### Grafana Cloud
Export to Grafana Cloud:
```bash
export OTEL_TELEMETRY_ENABLED=1
export OTEL_METRICS_EXPORTER=otlp
export OTEL_LOGS_EXPORTER=otlp
export OTEL_EXPORTER_OTLP_ENDPOINT=https://otlp-gateway-prod-us-central-0.grafana.net/otlp
export OTEL_EXPORTER_OTLP_HEADERS="Authorization=Basic YOUR_BASE64_CREDENTIALS"
```
## Testing Configuration
Test your configuration with console output before sending to a real endpoint:
```bash
# Enable console output to see what data would be exported
export OTEL_TELEMETRY_ENABLED=1
export OTEL_METRICS_EXPORTER=console
export OTEL_LOGS_EXPORTER=console
```
Then launch Cline and check the console output for metrics and logs.
## Troubleshooting
### No Data Being Exported
1. **Verify OpenTelemetry is enabled:**
```bash
echo $OTEL_TELEMETRY_ENABLED
```
Should output `1` or `true`
2. **Check exporters are configured:**
```bash
echo $OTEL_METRICS_EXPORTER
echo $OTEL_LOGS_EXPORTER
```
3. **Test with console exporter first:**
```bash
export OTEL_METRICS_EXPORTER=console
export OTEL_LOGS_EXPORTER=console
```
### Connection Errors
1. **Verify endpoint is accessible:**
```bash
curl -v https://your-otlp-endpoint:4317
```
2. **Check if insecure mode is needed:**
```bash
export OTEL_EXPORTER_OTLP_INSECURE=true
```
3. **Verify authentication headers:**
Double-check your API keys and authentication headers are correct
### Debug Mode
Enable debug logging to see detailed OpenTelemetry information:
```bash
export TEL_DEBUG_DIAGNOSTICS=true
```
This will output detailed information about:
- Configuration being used
- Exporters being created
- Connection attempts
- Export successes/failures
## What Gets Exported
When Opentelemetry is enabled, Cline exports:
### Metrics
- Feature usage counts
- Task execution metrics
- Error rates and types
- Performance measurements
### Logs
- System events
- Error logs with context
- Operational information
<Warning>
Exported data is already anonymous and doesn't include code content, file paths, or sensitive information. However, you're responsible for securing the data once exported to your systems.
</Warning>
## Limitations
Current OpenTelemetry support in Cline:
- ✅ OTLP metrics export (console, gRPC, HTTP)
- ✅ OTLP logs export (console, gRPC, HTTP)
- ✅ Basic configuration via environment variables
- ❌ Distributed tracing (not yet implemented)
- ❌ Custom instrumentation API (not yet exposed)
- ❌ Sampling configuration (uses defaults)
## Best Practices
1. **Test First**: Always test with console exporter before sending to production
2. **Secure Credentials**: Never hardcode API keys; use secure environment variable management
3. **Monitor Costs**: Be aware of data ingestion costs with your observability platform
4. **Start Simple**: Begin with metrics only, add logs if needed
5. **Use Compression**: OTLP supports compression; check if your endpoint requires it
## Next Steps
<CardGroup cols={2}>
<Card title="Cline Telemetry" icon="chart-simple" href="/enterprise-solutions/monitoring/telemetry">
Configure simple built-in telemetry
</Card>
<Card title="OpenTelemetry Docs" icon="book" href="https://opentelemetry.io/docs/">
Learn more about OpenTelemetry
</Card>
</CardGroup>
@@ -0,0 +1,111 @@
---
title: "Enterprise Monitoring"
sidebarTitle: "Overview"
description: "Optional telemetry and observability for your Cline deployment"
---
Cline includes optional monitoring capabilities for organizations that want to track usage and integrate with their observability infrastructure.
## Monitoring Options
<CardGroup cols={2}>
<Card title="Cline Telemetry" icon="chart-simple" href="/enterprise-solutions/monitoring/telemetry">
Built-in anonymous usage tracking that helps improve Cline (opt-in)
</Card>
<Card title="OpenTelemetry" icon="chart-line" href="/enterprise-solutions/monitoring/opentelemetry">
Export metrics and logs to your own observability backends (advanced)
</Card>
</CardGroup>
## Cline Telemetry
Cline includes opt-in telemetry for anonymous usage tracking:
- Feature usage patterns
- Task completion rates
- Error occurrences
- Performance metrics
Users can enable or disable telemetry in Cline settings. All data is anonymous and does not include code content, file paths, or sensitive information.
See [Cline Telemetry](/enterprise-solutions/monitoring/telemetry) for configuration details.
## OpenTelemetry Integration
For advanced monitoring needs, Cline supports OpenTelemetry's OTLP (OpenTelemetry Protocol) for exporting metrics and logs to your own infrastructure.
This allows you to:
- Export telemetry to your existing observability platforms
- Integrate with tools like Datadog, New Relic, or Grafana Cloud
- Maintain full control over your monitoring data
- Aggregate metrics across your organization
<Note>
OpenTelemetry integration is **optional** and requires additional configuration. Most users don't need this feature.
</Note>
See [OpenTelemetry](/enterprise-solutions/monitoring/opentelemetry) for setup instructions.
## Use Cases
### When to Use Cline Telemetry
- You want to help improve Cline through anonymous usage data
- No additional setup required
- Suitable for most users
### When to Use OpenTelemetry
- You need granular metrics in your own systems
- You're integrating with existing observability infrastructure
- You want detailed logs and metrics for debugging
- You need custom dashboards or alerting
## Getting Started
<Steps>
<Step title="Choose Your Approach">
Decide whether basic telemetry or OpenTelemetry integration fits your needs
</Step>
<Step title="Enable Telemetry">
For basic telemetry, enable it in Cline settings. For OpenTelemetry, see the configuration guide.
</Step>
<Step title="Verify Data Collection">
Confirm telemetry is being collected as expected
</Step>
</Steps>
## Privacy & Security
All Cline monitoring features are designed with privacy in mind:
<CardGroup cols={2}>
<Card title="Anonymous" icon="user-secret">
No personal information collected
</Card>
<Card title="Optional" icon="toggle-on">
Users can disable at any time
</Card>
<Card title="Local First" icon="laptop">
Code never leaves your machine
</Card>
<Card title="Transparent" icon="code">
Open source - see what's collected
</Card>
</CardGroup>
## Next Steps
<CardGroup cols={2}>
<Card title="Configure Telemetry" icon="gear" href="/enterprise-solutions/monitoring/telemetry">
Set up basic telemetry settings
</Card>
<Card title="OpenTelemetry Setup" icon="chart-line" href="/enterprise-solutions/monitoring/opentelemetry">
Advanced monitoring with OpenTelemetry
</Card>
</CardGroup>
@@ -0,0 +1,133 @@
---
title: "Cline Telemetry"
sidebarTitle: "Cline Telemetry"
description: "Configure usage analytics and event tracking"
---
Cline includes telemetry to help understand usage patterns and improve the product. Users can control whether to share this data.
## What is Cline Telemetry?
Telemetry captures anonymous usage events such as:
- Features used (which tools, commands, workflows)
- Task completion rates
- Error occurrences
- Performance metrics
<Info>
All telemetry data is **anonymous** and does not include code content, file contents, or other sensitive information.
</Info>
## User Controls
### Enabling/Disabling Cline Telemetry
Individual users can control telemetry through Cline settings:
1. Open Cline settings
2. Find "Cline Telemetry" toggle
3. Enable or disable as preferred
Changes take effect immediately.
### What Gets Collected
When telemetry is enabled, Cline captures:
<AccordionGroup>
<Accordion title="Feature Usage" icon="cursor-click">
- Tools executed (e.g., read_file, execute_command)
- Slash commands used
- Workflows triggered
- Settings changed
</Accordion>
<Accordion title="Task Metrics" icon="tasks">
- Task started/completed events
- Mode switches (Plan/Act)
- Checkpoint usage
- Task duration
</Accordion>
<Accordion title="Error Events" icon="triangle-exclamation">
- API failures
- Tool execution errors
- System errors
- Error types and frequencies
</Accordion>
</AccordionGroup>
### What Doesn't Get Collected
Cline Telemetry **never** includes:
- Your code or file contents
- File paths or names
- Command arguments or parameters
- Conversation content
- Personal information
- API keys or credentials
## Enterprise Configuration
Administrators can set default telemetry state through remote configuration:
```json
{
"telemetryEnabled": true
}
```
<Note>
Even with enterprise configuration, individual users can still disable Cline Telemetry in their local settings.
</Note>
## Advanced Monitoring
For organizations needing detailed monitoring, Cline supports optional OpenTelemetry integration to export telemetry data to your own observability systems.
See [Enterprise Monitoring](/enterprise-solutions/monitoring/overview) for details on available monitoring options.
## Privacy
Cline's telemetry is designed with privacy in mind:
<CardGroup cols={2}>
<Card title="Anonymous" icon="user-secret">
No personal information is collected
</Card>
<Card title="Optional" icon="toggle-on">
Users can disable at any time
</Card>
<Card title="Local First" icon="laptop">
Code never leaves your machine
</Card>
<Card title="Transparent" icon="eye">
Open source - see exactly what's collected
</Card>
</CardGroup>
## Why Telemetry Matters
Anonymous usage data helps:
- **Identify bugs**: Discover issues affecting users
- **Prioritize features**: Focus on most-used capabilities
- **Improve performance**: Find and fix slow operations
- **Enhance reliability**: Track and reduce error rates
## Related
<CardGroup cols={2}>
<Card title="OpenTelemetry" icon="chart-line" href="/enterprise-solutions/monitoring/opentelemetry">
Enterprise monitoring and observability
</Card>
<Card title="Privacy" icon="shield" href="/more-info/telemetry">
Full telemetry documentation
</Card>
</CardGroup>
+1 -1
View File
@@ -51,7 +51,7 @@ User roles are mapped automatically from your IdP:
- **Member** in IdP → **Member** role in Cline
<Info>
For what each role can access, see the [Roles and Permissions](./members/roles-and-permissions) page.
For what each role can access, see the [Roles and Permissions](/enterprise-solutions/team-management/managing-members) page.
</Info>
If needed, you can configure additional user attributes in the Cline Admin console:
+5 -5
View File
@@ -1,7 +1,7 @@
---
title: "Cline Enterprise"
sidebarTitle: "Overview"
description: "Enterprise security, governance, and observability for the coding agent 3 million developers trust"
description: "Enterprise security, governance, and observability for the coding agent millions of developers trust"
---
Cline Enterprise brings centralized governance to the same open-source architecture that millions of developers already use. Your code stays in your environment, you use your own inference at your negotiated rates, and you get the security and observability capabilities that platform teams need for org-wide deployment.
@@ -57,10 +57,10 @@ Platform teams need central control when thousands of developers use AI. Individ
Enterprise governance provides:
- **SSO authentication**: Corporate credentials instead of personal API keys
- **Role-based access control**: Fine-grained permissions per team and project
- **Role-based access control**: Three-tier hierarchy (Member/Admin/Owner) with organization-scoped permissions
- **Model and tool controls**: Govern which models and tools each team accesses
- **Remote configuration**: Manage settings for all developers from one dashboard
- **Full audit logging**: Every AI interaction tracked with detailed logs
- **Usage tracking and observability**: OpenTelemetry integration for monitoring usage, costs, and performance with selective audit logging for administrative operations
Configure once, deploy everywhere. Developers work how they prefer while you maintain control.
@@ -77,7 +77,7 @@ The same observability standards you require for production systems.
## Deployment
Cline Enterprise connects securely to your infrastructure. Deploy in cloud environments, on-premises, or air-gapped networks. Configure to work with your existing security policies and compliance requirements.
Cline Enterprise connects securely to your infrastructure. Deploy in cloud environments. Configure to work with your existing security policies and compliance requirements.
Rolling out to your organization:
1. Configure Cline Core to connect to your infrastructure
@@ -87,7 +87,7 @@ Rolling out to your organization:
## Next Steps
- Review [security architecture](/enterprise-solutions/security-concerns)
- Review security architecture
- Configure [cloud provider setup](/provider-config/aws-bedrock/api-key) (AWS Bedrock, Vertex AI, Azure)
- Set up [MCP servers](/mcp/mcp-overview) for custom tooling
- Add [custom instructions](/features/cline-rules) for your codebase
@@ -0,0 +1,317 @@
---
title: "Managing Members"
sidebarTitle: "Managing Members"
description: "Complete guide to managing team members, roles, and permissions in your Cline Enterprise organization"
---
Effective member management is essential for maintaining security and enabling your team to work productively. This guide covers everything you need to know about roles, permissions, and day-to-day member administration.
## Understanding Roles
Choose the right role for each team member to balance security with productivity. Here's what each role is designed for:
<CardGroup cols={3}>
<Card title="Owner" icon="crown" color="#9D4EDD">
**Primary account holder**
Unrestricted access to all settings including billing, security, and ownership transfer. Keep this limited to 1-2 key leaders.
</Card>
<Card title="Admin" icon="user-gear" color="#7209B7">
**Team leads & IT managers**
Can manage users and configure providers. Ideal for trusted managers who need operational control without billing access.
</Card>
<Card title="Member" icon="user" color="#560BAD">
**Developers & contributors**
Can use Cline with shared resources but cannot change settings. The safest default for most team members.
</Card>
</CardGroup>
## Permissions Matrix
Understand exactly what each role can do with this comprehensive permissions breakdown:
| Permission | Member | Admin | Owner |
| :--- | :---: | :---: | :---: |
| **General Usage** | | | |
| Use Cline | ✅ | ✅ | ✅ |
| Access Shared API Providers | ✅ | ✅ | ✅ |
| | | | |
| **Member Management** | | | |
| View Members | ❌ | ✅ | ✅ |
| Invite New Members | ❌ | ✅ | ✅ |
| Edit Member Roles | ❌ | ✅ | ✅ |
| Remove Members | ❌ | ✅ | ✅ |
| Remove Admins | ❌ | ❌ | ✅ |
| | | | |
| **Configuration** | | | |
| Configure API Providers | ❌ | ✅ | ✅ |
| Manage Security Settings | ❌ | ❌ | ✅ |
| | | | |
| **Billing & Ownership** | | | |
| View Billing Information | ❌ | ❌ | ✅ |
| Manage Subscription | ❌ | ❌ | ✅ |
| Transfer Ownership | ❌ | ❌ | ✅ |
<Note>
**Quick Reference:** Most users should be **Members**. Grant **Admin** only to those managing users or configs. Reserve **Owner** for 1-2 account leaders.
</Note>
## Member Management Tasks
<Tabs>
<Tab title="Adding Members">
### Inviting New Team Members
1. **Navigate to Members**
- Go to your organization dashboard at app.cline.bot
- Click on "Members" in the sidebar
2. **Send Invitation**
- Click "Invite Member"
- Enter the user's email address (must be from your verified domain)
- Select the appropriate role (Member, Admin, or Owner)
- Click "Send Invite"
3. **Invitation Status**
- Invited users will receive an email with a join link
- Pending invitations show in your member list with "Pending" status
- Each pending invitation holds one seat from your license
<Tip>
**Bulk Invitations:** Need to add multiple users? Contact support@cline.bot for assistance with bulk invite CSV imports.
</Tip>
</Tab>
<Tab title="Editing Roles">
### Changing Member Permissions
1. **Locate the Member**
- Navigate to the Members page
- Find the user you want to modify
2. **Change Role**
- Click the dropdown next to their current role
- Select the new role from the menu
- Confirm the change
3. **Effective Immediately**
- Role changes take effect instantly
- The user may need to sign out and back in to see updated permissions
<Warning>
**Admin to Member:** Downgrading an Admin to Member will immediately revoke their ability to manage users and configurations. Ensure they no longer need these permissions.
</Warning>
</Tab>
<Tab title="Removing Members">
### Offboarding Team Members
1. **Access Member List**
- Navigate to your organization's Members page
- Locate the user to remove
2. **Remove User**
- Click the menu icon (⋮) next to their name
- Select "Remove from Organization"
- Confirm the removal
3. **Immediate Effects**
- User loses access to the organization immediately
- Their seat is freed and can be assigned to someone else
- Audit logs are preserved for compliance
<Info>
**Data Retention:** Removing a member does not delete their historical activity logs. All audit trails remain intact for compliance purposes.
</Info>
</Tab>
<Tab title="Revoking Invites">
### Canceling Pending Invitations
If an invited user hasn't accepted yet, you can revoke the invitation:
1. Find the pending invitation in your Members list
2. Click "Revoke Invitation"
3. The seat is immediately freed for another user
This is useful when:
- The wrong email was used
- The user no longer needs access
- You need to reassign the seat urgently
</Tab>
</Tabs>
## Identity & Access Requirements
For users to successfully join your organization, two conditions must be met:
<Steps>
<Step title="Verified Identity Provider">
Your organization must use a verified **Identity Provider (IDP)** such as:
- Microsoft Entra ID (Azure AD)
- Okta
- Google Workspace
- AWS IAM Identity Center
Users must authenticate through your IDP to access the organization.
</Step>
<Step title="Domain Verification">
Your organization must have a **verified domain**. You'll need to verify ownership of your domain through your domain provider (e.g., Google, Microsoft, Cloudflare).
Only users with email addresses from verified domains can join.
</Step>
</Steps>
<Note>
These requirements ensure that only authenticated users from your company can access your Cline organization, preventing unauthorized access.
</Note>
## Seat Management
Understanding how seats work helps you manage your license effectively:
<AccordionGroup>
<Accordion title="How Seats Are Calculated" icon="chair">
- Each user (Owner, Admin, or Member) consumes **one seat**
- Pending invitations also hold one seat
- Removing a member or revoking an invite immediately frees the seat
- Your license determines the maximum number of seats available
</Accordion>
<Accordion title="When Seats Are Used" icon="user-plus">
A seat is consumed when:
- You send an invitation (marked as "pending")
- An invited user accepts and joins
- An existing user is granted access through SSO
</Accordion>
<Accordion title="Freeing Up Seats" icon="user-minus">
To free a seat:
- Remove an active member from the organization
- Revoke a pending invitation
- Wait for a pending invite to expire (if configured)
</Accordion>
<Accordion title="Upgrading Your License" icon="arrow-up">
Need more seats?
- **Teams Plan:** Contact your account manager or visit app.cline.bot/settings/billing to upgrade your license.
- **Enterprise Plan:** Includes unlimited seats with no per-user restrictions.
</Accordion>
</AccordionGroup>
## Security Best Practices
Follow these guidelines to maintain a secure organization:
<CardGroup cols={2}>
<Card title="Principle of Least Privilege" icon="shield-check">
Always assign the minimum role necessary. Most users should be Members. Only grant Admin or Owner privileges when required for job duties.
</Card>
<Card title="Limit Owner Roles" icon="user-lock">
Keep Owners to 1-2 key individuals who manage billing and security. This centralization prevents accidental or malicious changes to critical settings.
</Card>
<Card title="Regular Audits" icon="clipboard-check">
Review your member list quarterly. Remove inactive users promptly and verify that Admin/Owner roles are still appropriate for each user.
</Card>
<Card title="Offboarding Process" icon="door-open">
Create a standard offboarding checklist: remove from Cline, revoke IDP access, document in audit log, and reassign any critical responsibilities.
</Card>
</CardGroup>
<Warning>
**Owner Accountability:** Since Owners control billing and can transfer ownership, choose these individuals carefully and document the selection in your organization's security policies.
</Warning>
## Advanced Scenarios
<AccordionGroup>
<Accordion title="Transferring Ownership" icon="exchange">
Only the current Owner can transfer ownership:
1. Navigate to Organization Settings
2. Go to the "Ownership" section
3. Select the new Owner from the member list
4. Confirm the transfer with your authentication
5. The new Owner receives immediate control
**Important:** This action cannot be undone by the previous Owner. The new Owner must initiate a reverse transfer if needed.
</Accordion>
<Accordion title="Managing Multiple Admins" icon="users-gear">
When you have multiple Admins:
- Document each Admin's area of responsibility
- Use audit logs to track configuration changes
- Consider creating rotation schedules for large teams
- Establish escalation paths for Owner-level decisions
</Accordion>
<Accordion title="Temporary Access" icon="clock">
For contractors or temporary staff:
- Create them as Members with expiration calendar reminders
- Document their access period in your internal systems
- Set calendar reminders to remove them when the contract ends
- Consider using time-limited IDP accounts if your IDP supports it
</Accordion>
</AccordionGroup>
## Troubleshooting
<AccordionGroup>
<Accordion title="User Can't Accept Invitation" icon="circle-exclamation">
**Common causes:**
- Email domain doesn't match verified domain
- User's IDP access hasn't been granted yet
- Invitation link expired
**Solution:** Verify domain verification is complete and resend the invitation.
</Accordion>
<Accordion title="Can't Remove an Admin" icon="user-slash">
**Cause:** Only Owners can remove Admins.
**Solution:** Ask an Owner to perform the removal, or if you need to remove your organization's sole Owner, contact support@cline.bot.
</Accordion>
<Accordion title="Out of Seats" icon="triangle-exclamation">
**When you've reached your license limit:**
- Remove inactive members to free seats
- Revoke pending invitations that are no longer needed
- Upgrade your license to add more seats
</Accordion>
</AccordionGroup>
## Next Steps
Now that you understand member management, proceed with configuring your organization:
<CardGroup cols={2}>
<Card
title="Configure Providers"
icon="plug"
href="/enterprise-solutions/configuration/choosing-your-deployment"
>
Set up API providers for your team to use
</Card>
<Card
title="Monitor Usage"
icon="chart-line"
href="/enterprise-solutions/monitoring/overview"
>
Track team activity and resource consumption
</Card>
</CardGroup>
<Tip>
**Getting Started Fast?** The quickest path is: 1) Invite your team as Members, 2) Configure one API provider, 3) Let your team start using Cline. You can refine roles and settings later.
</Tip>
@@ -3,94 +3,192 @@ title: "Keyboard Shortcuts"
sidebarTitle: "Keyboard Shortcuts"
---
Cline's keyboard shortcuts let you access AI assistance without taking your hands off the keyboard. Speed up your workflow by using hotkeys for common Cline actions.
Speed up your workflow by accessing Cline's AI assistance without taking your hands off the keyboard.
## Default Keyboard Shortcuts
<Tip>
**The One Shortcut You Need:** `Ctrl+'` (Windows/Linux) or `Cmd+'` (macOS)
Cline comes with the following built-in keyboard shortcuts to streamline your workflow:
This context-aware shortcut handles your most common needs:
- **With text selected:** Adds code to Cline chat
- **Without selection:** Focuses the chat input
| Action | Windows/Linux | macOS | Condition | Description |
| ----------------------- | ------------- | ------- | ---------------------------- | ----------------------------------------- |
| Add to Cline | `Ctrl+'` | `Cmd+'` | When text is selected | Adds selected code to Cline chat |
| Focus Chat Input | `Ctrl+'` | `Cmd+'` | When no text is selected | Focuses the Cline chat input field |
| Generate Commit Message | (unset) | (unset) | When Git is the SCM provider | Available through the Source Control view |
Master this one shortcut, and you're 90% there.
</Tip>
## Available Commands for Custom Shortcuts
## Default Shortcuts
While Cline has only a few default keyboard shortcuts, you can assign your own shortcuts to any of these commands:
Cline has minimal default shortcuts by design, so they won't conflict with your existing VSCode setup:
| Command ID | Description |
| ---------------------------------------------------------------------------------------- | --------------------------------------------- |
| [`cline.addToChat`](/features/commands-and-shortcuts/code-commands) | Adds selected code to Cline chat |
| [`cline.addTerminalOutputToChat`](/features/commands-and-shortcuts/terminal-integration) | Adds terminal output to Cline |
| `cline.focusChatInput` | Focuses the Cline chat input field |
| [`cline.generateGitCommitMessage`](/features/commands-and-shortcuts/git-integration) | Generates a commit message for staged changes |
| [`cline.explainCode`](/features/commands-and-shortcuts/code-commands) | Explains selected code |
| [`cline.improveCode`](/features/commands-and-shortcuts/code-commands) | Suggests improvements for selected code |
| [`cline.fixWithCline`](/features/commands-and-shortcuts/code-commands) | Fixes code with errors |
| `claude-dev.SidebarProvider.focus` | Opens and focuses the Cline sidebar |
| Shortcut | Windows/Linux | macOS | What It Does |
| -------- | ------------- | ----- | ------------ |
| **Add to Chat / Focus Input** | `Ctrl+'` | `Cmd+'` | Context-aware: adds selected code or focuses chat |
## Customizing Keyboard Shortcuts
That's it! Everything else is available for you to customize.
You can customize Cline's keyboard shortcuts to match your preferences:
## Quick Workflow Examples
1. Open the Keyboard Shortcuts editor in VSCode:
Here's how keyboard shortcuts fit into real coding workflows:
- Press `Ctrl+K Ctrl+S` (Windows/Linux) or `Cmd+K Cmd+S` (macOS)
- Or go to File > Preferences > Keyboard Shortcuts
### Debug & Fix Workflow
2. Search for "Cline" to see all available commands
1. **Find error in code** → VSCode highlights it
2. **Select the problematic code** → `Shift+Arrow` or `Ctrl+L` / `Cmd+L`
3. **Send to Cline** → `Ctrl+'` / `Cmd+'`
4. **Ask for help** → Type your question, hit `Enter`
3. Click on the pencil icon next to any command to change its shortcut
### Code Review Workflow
4. Press the keys you want to assign to that command
1. **Review a function** → Select it with `Ctrl+L` / `Cmd+L`
2. **Get AI review** → `Ctrl+'` / `Cmd+'` then ask "Review this"
3. **Iterate** → Apply suggestions and repeat
5. Press Enter to save the new shortcut
### Terminal Integration Workflow
## Suggested Custom Shortcuts
1. **Open terminal** → Press `` Ctrl+` `` / `` Cmd+` ``
2. **Run your command** → Execute in terminal
3. **Capture output** → Press `Alt+T` (after assigning shortcut)
4. **Get help** → Ask Cline to interpret errors or output
Here are some suggested shortcuts you might find useful:
<Info>
**Pro Tip:** Assign `Alt+T` to the `cline.addTerminalOutputToChat` command for quick terminal output capture. Without a shortcut, you can still right-click in the terminal and select "Add to Cline" - but the keyboard approach is much faster for frequent debugging workflows.
</Info>
| Action | Suggested Shortcut | Command ID | Description |
| --------------------- | ------------------------------ | ----------------------------------------- | ----------------------------- |
| Open Cline Sidebar | `Ctrl+Shift+C` / `Cmd+Shift+C` | `claude-dev.SidebarProvider.focus` | Opens the Cline sidebar panel |
| New Task | `Alt+N` | `cline.plusButtonClicked` | Starts a new Cline task |
| Add Terminal to Cline | `Alt+T` | `cline.addTerminalOutputToChat` | Adds terminal output to Cline |
| Clear Current Task | `Alt+C` | (Requires custom keybinding to UI action) | Clears the current task |
## Customizing Shortcuts
## Keyboard-Only Workflow
Want to assign shortcuts to more Cline commands? Here's how:
With the right shortcuts, you can use Cline without ever touching the mouse:
**Step 1:** Open VSCode's Keyboard Shortcuts editor
- Press `Ctrl+K Ctrl+S` (Windows/Linux) or `Cmd+K Cmd+S` (macOS)
- Or: **File → Preferences → Keyboard Shortcuts**
1. Select code with keyboard navigation (`Shift+Arrow` keys)
2. Send to Cline with `Ctrl+'` / `Cmd+'`
3. Type your question and press Enter
4. Review the response and apply suggestions
**Step 2:** Search for "Cline"
## Editor Integration Shortcuts
**Step 3:** Click the ✏️ icon next to any command
Cline's keyboard shortcuts integrate seamlessly with VSCode's built-in shortcuts:
**Step 4:** Press your desired key combo, then `Enter`
- Use VSCode's selection shortcuts (`Ctrl+L` / `Cmd+L` to select line, etc.) before sending code to Cline
- Combine with VSCode's split editor shortcuts to view code and Cline side by side
- Use VSCode's terminal focus shortcut (`` Ctrl+` `` / `` Cmd+` ``) before capturing terminal output
<Warning>
**Avoid Conflicts:** Check that your shortcut doesn't override important VSCode commands. The shortcuts editor will warn you about conflicts.
</Warning>
## Tips for Effective Use
## Available Commands Reference
- **Learn the default shortcut first**: The `Ctrl+'` / `Cmd+'` shortcut is versatile - it adds selected code to chat when text is selected, or focuses the chat input when nothing is selected
- **Create muscle memory**: Use keyboard shortcuts consistently to build habits
- **Customize for your workflow**: Assign shortcuts to commands you use frequently
- **Consider ergonomics**: Choose shortcuts that are comfortable for your keyboard layout
<Accordion title="Task Management Commands">
Keyboard shortcuts may seem like a small optimization, but they can significantly speed up your workflow when using Cline regularly. By keeping your hands on the keyboard, you maintain your coding flow while still getting AI assistance exactly when you need it.
These commands help you navigate and manage Cline tasks:
## How to Find All Available Commands
| Command ID | Description | Suggested Shortcut |
| ---------- | ----------- | ------------------ |
| `cline.plusButtonClicked` | Start a new task | `Ctrl+Shift+N` / `Cmd+Shift+N` |
| `cline.historyButtonClicked` | Open task history | `Ctrl+Shift+H` / `Cmd+Shift+H` |
| `claude-dev.SidebarProvider.focus` | Open Cline sidebar | `Ctrl+Shift+L` / `Cmd+Shift+L` |
To see all Cline commands that can be assigned shortcuts:
**Note:** `claude-dev` prefix is for historical reasons - it works with Cline.
1. Open the Command Palette (`Ctrl+Shift+P` / `Cmd+Shift+P`)
2. Type "Cline" to filter the list
3. Browse the available commands
</Accordion>
<Accordion title="Code Interaction Commands">
Work directly with your code:
| Command ID | Description | Suggested Shortcut |
| ---------- | ----------- | ------------------ |
| `cline.addToChat` | Add selected code to chat | `Ctrl+'` / `Cmd+'` ⭐ (default) |
| `cline.focusChatInput` | Focus chat input | `Ctrl+'` / `Cmd+'` ⭐ (default) |
| `cline.explainCode` | Explain selected code | `Ctrl+Shift+E` / `Cmd+Shift+E` |
| `cline.improveCode` | Suggest code improvements | `Ctrl+Shift+I` / `Cmd+Shift+I` |
⭐ These share the same shortcut - it's context-aware!
</Accordion>
<Accordion title="Terminal Integration Commands">
Connect Cline with your terminal:
| Command ID | Description | Suggested Shortcut |
| ---------- | ----------- | ------------------ |
| `cline.addTerminalOutputToChat` | Add terminal output to Cline | `Alt+T` |
**Tip:** Use this after running commands to get help interpreting output or fixing errors.
</Accordion>
<Accordion title="Git Integration Commands">
Generate commit messages with AI:
| Command ID | Description | Suggested Shortcut |
| ---------- | ----------- | ------------------ |
| `cline.generateGitCommitMessage` | Generate commit message | `Ctrl+Shift+G` / `Cmd+Shift+G` |
| `cline.abortGitCommitMessage` | Stop generation | `Ctrl+Shift+Esc` / `Cmd+Shift+Esc` |
</Accordion>
<Accordion title="Settings & Configuration Commands (Advanced)">
These commands open Cline's configuration panels. Most users access these via the sidebar buttons, but keyboard shortcuts can be useful for:
- **Frequent MCP server developers** who constantly adjust server configurations
- **Demo/presentation scenarios** where you need quick, keyboard-only navigation
- **Accessibility workflows** where mouse usage is minimized
| Command ID | Description | Suggested Shortcut |
| ---------- | ----------- | ------------------ |
| `cline.settingsButtonClicked` | Open Cline settings | `Ctrl+Alt+,` / `Cmd+Opt+,` |
| `cline.mcpButtonClicked` | Open MCP servers config | `Ctrl+Alt+M` / `Cmd+Opt+M` |
| `cline.accountButtonClicked` | Open account settings | `Ctrl+Alt+A` / `Cmd+Opt+A` |
| `cline.openWalkthrough` | Open walkthrough guide | (not recommended) |
**Our take:** Unless you're constantly tweaking settings or building MCP servers, the sidebar buttons are more convenient. But if you find yourself opening these panels frequently, shortcuts can save time.
</Accordion>
## What About "Fix with Cline"?
<Warning>
**You CAN'T assign a keyboard shortcut to "Fix with Cline"**
This command only appears in the **lightbulb menu** (💡) when VSCode detects errors in your code. It needs the error context to work, so it's not available as a standalone command.
**Workarounds:**
- Click the 💡 lightbulb icon that appears next to errors
- Or select code with errors and use `Ctrl+'` / `Cmd+'` to ask Cline to fix them
- Or right-click and select "Add to Cline"
</Warning>
Learn more about code actions in our [Code Commands documentation](/features/commands-and-shortcuts/code-commands).
## Best Practices
<Tip>
**Start Simple**
Don't try to memorize 20 shortcuts on day one. Start with:
1. `Ctrl+'` / `Cmd+'` (the essential one)
2. Add 1-2 more based on your actual usage patterns
3. Build muscle memory over time
</Tip>
**Choose Shortcuts Wisely:**
- **Be ergonomic:** Use comfortable key combinations
- **Create patterns:** Group related commands (e.g., all Cline shortcuts use `Ctrl+Shift+...`)
- **Avoid conflicts:** Don't override VSCode essentials like `Ctrl+C` or `Ctrl+S`
- **Use modifiers:** Combine `Ctrl`/`Cmd` + `Shift` + `Alt` to reduce conflicts
**Build the Habit:**
- Use shortcuts consistently for a week to build muscle memory
- Keep a note of your custom shortcuts until they're automatic
- Review monthly to see if your workflow has changed
## Discovering Commands
Not sure what commands are available? Use VSCode's Command Palette:
1. Press `Ctrl+Shift+P` / `Cmd+Shift+P`
2. Type "Cline" to filter
3. Browse all available commands
4. Assign shortcuts to your favorites
<Frame>
<img
@@ -99,4 +197,8 @@ To see all Cline commands that can be assigned shortcuts:
/>
</Frame>
This helps you discover features you might not have known about and assign shortcuts to the ones you use most frequently.
---
<Info>
**Remember:** The goal isn't to memorize every possible shortcut. Master `Ctrl+'` / `Cmd+'` first, then gradually add shortcuts for commands you use frequently. Quality over quantity!
</Info>
+8 -3
View File
@@ -3,11 +3,13 @@ title: "Explain Changes"
sidebarTitle: "Explain Changes"
---
<Note>
This feature is only available in **VS Code**. The diff view with inline comments requires VS Code's native diff capabilities.
</Note>
Explain Changes is an AI-powered code review feature that adds inline explanations to your code changes. When Cline makes modifications to your codebase, you can click a button to get streaming, contextual explanations that appear directly in VS Code's diff view.
<Note>
Explain Changes requires **[Checkpoints](/features/checkpoints)** to be enabled. Make sure to enable checkpoints in your Cline settings before using this feature.
</Note>
<Frame>
<video
@@ -21,6 +23,9 @@ Explain Changes requires **[Checkpoints](/features/checkpoints)** to be enabled.
## How It Works
<Note>
Explain Changes requires **[Checkpoints](/features/checkpoints)** to be enabled. Make sure to enable checkpoints in your Cline settings before using this feature.
</Note>
After Cline completes a task that involves file changes, you'll see an "Explain Changes" button alongside the "View Changes" button in the completion message. Clicking this button:
+1 -1
View File
@@ -432,6 +432,6 @@ Hooks have a 30 second timeout. As long as your hook completes within this time,
Cline searches for hooks in this order:
1. Project-specific: `.clinerules/hooks/` in workspace root
2. User-global: `~/Documents/Cline/Rules/Hooks/`
2. User-global: `~/Documents/Cline/Hooks/`
Project-specific hooks override global hooks with the same name.
+22 -2
View File
@@ -47,7 +47,7 @@ The interface shows you all available hook types and existing hooks organized by
Hooks are automatically organized by location in the interface:
**Global Hooks** - Apply to all workspaces:
- Stored in `~/Documents/Cline/Rules/Hooks/`
- Stored in `~/Documents/Cline/Hooks/`
- Perfect for personal coding standards and universal rules
**Project-Specific Hooks** - Apply only to current project:
@@ -137,10 +137,30 @@ The key is combining hooks with external tools. A hook can be the glue between C
</Card>
</CardGroup>
## Related Features
## CLI support
Hooks are also available in the [Cline CLI](/cline-cli/overview). You can enable or disable hooks when running tasks from the command line:
```bash
# Enable hooks for a task
cline "What does this repo do?" -s hooks_enabled=true
# Configure hooks globally via CLI
cline config set hooks-enabled=true
cline config get hooks-enabled
```
This allows you to integrate hooks into automated workflows, CI/CD pipelines, and headless task execution.
<Note>
Hooks in the CLI are only supported on macOS and Linux. Windows support is not yet available.
</Note>
## Related features
Hooks complement other Cline features:
- [Cline Rules](/features/cline-rules) define high-level guidance that hooks can enforce
- [Checkpoints](/features/checkpoints) let you roll back changes if a hook didn't catch an issue
- [Auto-Approve](/features/auto-approve) works well with hooks as safety nets for automated operations
- [Cline CLI](/cline-cli/overview) enables hooks in terminal-based and automated workflows
+198 -104
View File
@@ -1,164 +1,258 @@
---
title: "Multiroot Workspace Support"
sidebarTitle: "Multiroot Workspace"
title: "Multi-Root Workspaces"
sidebarTitle: "Multi-Root Workspaces"
---
Cline's Multiroot feature works seamlessly with VSCode's multi-root workspaces, letting you manage multiple project folders in a single workspace.
Cline works with VSCode's multi-root workspaces, letting you manage multiple project folders or repositories in a single window. Whether you're working with a monorepo or separate Git repositories, Cline can read files, write code, and run commands across all of them.
<Frame>
<video
src="https://storage.googleapis.com/cline_public_images/multiworkspace.mp4"
autoPlay
muted
loop
playsInline
controls
/>
</Frame>
<Warning>
Multi-root workspaces have two limitations:
- **Cline rules** only work in the primary workspace folder
- **Checkpoints** are disabled (restored when you return to a single folder)
See [Current Limitations](#current-limitations) for details.
</Warning>
## Understanding Multi-Root Workspaces
Before diving in, it helps to understand the two common patterns for organizing related projects.
### Why Use Multi-Root Workspaces?
Cline can complete tasks that span multiple projects or repositories:
- **Refactoring**: Update an API contract and fix all consumers across repos
- **Feature development**: Implement a feature that touches frontend, backend, and shared code
- **Dependency updates**: Coordinate version bumps across related projects
- **Documentation**: Generate docs that reference code from multiple repositories
**Example prompt:**
```
Update the User type in the contracts repo, then update both the frontend
and backend to use the new fields. Make sure the API validates the new
required field.
```
## Setting Up a Multi-Root Workspace
### Monorepos vs Multiple Repositories
**Monorepo**: One Git repository containing multiple projects or packages. All code shares the same version history.
```
my-company/ # Single Git repo
├── .git/
├── packages/
│ ├── web/ # React frontend
│ ├── api/ # Node.js backend
│ └── shared/ # Common utilities
└── package.json
```
**Multiple Repositories**: Separate Git repositories, each with their own history, opened together in one VSCode workspace.
```
~/projects/
├── fullstack.code-workspace # Workspace config file
├── frontend/ # git@github.com:acme/frontend.git
│ └── .git/
├── backend/ # git@github.com:acme/backend.git
│ └── .git/
└── contracts/ # git@github.com:acme/api-contracts.git
└── .git/
```
Cline supports both patterns, as well as hybrid setups where some folders are Git repositories and others are not. The key difference: with multiple repositories, each folder has its own `.git` directory and Cline tracks them independently.
### Adding Folders to Your Workspace
You can add folders to your workspace in several ways:
- **File menu**: Use `File > Add Folder to Workspace` in VSCode
- **Drag and drop**: Drag folders directly into VSCode's file explorer
- **Workspace file**: Create a `.code-workspace` file (recommended for teams)
- **Command palette**: Run `Workspaces: Add Folder to Workspace`
For detailed instructions, see [Microsoft's multi-root workspace guide](https://code.visualstudio.com/docs/editor/multi-root-workspaces).
## Working with Multiple Repositories
When you open separate Git repositories in one workspace, Cline treats each as an independent project with its own version control.
### What Cline Tracks Per Repository
For each workspace folder, Cline detects:
| Property | Description |
|----------|-------------|
| **Path** | Absolute path to the folder |
| **Name** | Derived from folder name or workspace file |
| **VCS Type** | Git, Mercurial, or None |
| **Commit Hash** | Current HEAD commit (for Git/Mercurial repos) |
This means Cline understands that your frontend and backend might be at different commits, on different branches, or even use different version control systems.
<Note>
**Important:** Multi-root workspaces are currently an experimental feature and have the following limitations:
- **Cline rules** only work in the first workspace folder
- **Checkpoints** are automatically disabled with a warning message
- Both features are restored when you return to a single-folder workspace
While Cline detects VCS information for all workspace folders, certain features only use the **primary workspace** (the first folder): [Cline rules](/features/cline-rules), [workflows](/features/slash-commands/workflows/index), and [Git-related features](/features/at-mentions/git-mentions) like `@git` mentions.
</Note>
## What is multiroot workspace support?
## Referencing Files Across Workspaces
Instead of being limited to one project folder, Cline can read files, write code, and run commands across all folders in your VSCode workspace. This is helpful when working with monorepos, microservices, or when you're working on related projects simultaneously.
### Natural Language References
### How it works
When you open multiple workspace folders in VSCode, Cline automatically:
- Designates one folder as the **primary workspace** (typically the first folder added)
- Tracks all workspace folders and their paths
- Resolves file paths intelligently across workspaces
- Displays workspace information in the environment details for each API request
## Getting Started
### Setting Up Multi-Root Workspaces
1. **Add folders to your workspace:**
- Use `File > Add Folder to Workspace` in VSCode
- Or create a `.code-workspace` file with multiple folder paths
- Drag and drop folders to the File Explorer
- Select multiple folders when opening a new workspace
2. **Start using Cline** - Cline will automatically detect all your workspace folders and interact with them as needed.
For detailed instructions on setting up multi-root workspaces in VS Code, see [Microsoft's official guide](https://code.visualstudio.com/docs/editing/workspaces/multi-root-workspaces).
### Technical behavior
**Workspace detection**
- Cline detects all workspace folders when a task starts
- The first workspace folder becomes the primary workspace by default
- Each workspace can have its own VCS (Git, SVN, etc.)
**Path resolution**
- Relative paths are resolved relative to the primary workspace
- You can use workspace hints to target specific workspaces: `@workspaceName:path/to/file`
- Cline attempts to intelligently determine which workspace a file belongs to
**Command execution**
- Commands execute in the appropriate workspace context
- The working directory is set based on where files are being accessed
## Working across workspaces
### Referencing specific workspaces
You can reference different workspaces naturally in your prompts:
Cline understands natural references to your workspaces:
```
"Read the package.json in my frontend folder and compare it with the backend dependencies"
"Read the package.json in the frontend folder"
```
```
"Create a shared utility function and update both the client and server to use it"
"Compare the user model in backend with the TypeScript types in contracts"
```
```
"Search for TODO comments across all my workspace folders"
"Search for TODO comments across all workspaces"
```
### Workspace hints
### Workspace Hints Syntax
Use workspace hints to explicitly reference files in specific workspaces:
For explicit references, use the `@workspace:path` syntax:
```
@frontend:src/App.tsx
@backend:server.ts
```
| Syntax | Description |
|--------|-------------|
| `@frontend:src/App.tsx` | File in the "frontend" workspace |
| `@backend:server.ts` | File in the "backend" workspace |
| `@contracts:types/` | Folder in the "contracts" workspace |
This syntax helps Cline resolve ambiguity when multiple workspaces contain similarly named files.
This syntax is especially useful when:
- Multiple workspaces have files with the same name
- You want to be explicit about which project you mean
- Cline needs to resolve ambiguity
### How Workspace Names Work
## Common use cases
Workspace names are derived from:
1. The `name` field in your `.code-workspace` file (if specified)
2. The folder name (default)
If two folders have the same name, append numbers or use the workspace file to give them unique names.
## Common Configurations
### Monorepo Development
Perfect for when you have related projects in one repository:
```
my-app.code-workspace
~/projects/my-app/
├── my-app.code-workspace # Workspace config file
├── web/ (React frontend)
├── api/ (Node.js backend)
├── api/ (Node.js backend)
├── mobile/ (React Native)
└── shared/ (Common utilities)
```
Ask Cline: *"Update the API endpoint in both web and mobile apps to match the new backend route"*
All folders share one Git history. Changes across packages are atomic.
### Microservices Architecture
**Example prompt:** *"Update the API endpoint in both web and mobile apps to match the new backend route"*
Manage multiple services from one workspace:
### Microservices with Separate Repos
```
services.code-workspace
├── user-service/
├── payment-service/
├── notifications/
── infrastructure/
~/projects/services/
├── services.code-workspace # Workspace config file
├── user-service/ (git: github.com/acme/user-service)
├── payment-service/ (git: github.com/acme/payment-service)
── gateway/ (git: github.com/acme/api-gateway)
└── proto/ (git: github.com/acme/service-protos)
```
### Full-Stack Development
Each service has its own repository. Cline can update the proto definitions and regenerate clients across all services.
Keep everything together while maintaining separation:
**Example prompt:** *"Add a new field to the UserProfile message in proto, then update user-service and gateway to handle it"*
### Full-Stack with Shared Contracts
```
fullstack.code-workspace
├── client/ (Frontend)
├── server/ (Backend API)
├── docs/ (Documentation)
└── deploy/ (Scripts & config)
~/projects/fullstack/
├── fullstack.code-workspace # Workspace config file
├── client/ (git: github.com/acme/web-client)
├── server/ (git: github.com/acme/api-server)
└── types/ (git: github.com/acme/shared-types)
```
The types repository defines interfaces used by both client and server. When you update a type, Cline can fix both consumers.
### Auto-Approve Integration
### Hybrid Setup
Multiroot workspaces work with [Auto Approve](/features/auto-approve):
```
~/projects/project/
├── project.code-workspace # Workspace config file
├── main-app/ (git: github.com/acme/main-app)
├── vendor/ (no VCS - vendored dependencies)
└── scripts/ (no VCS - local automation)
```
- Enable permissions for operations within workspace folders
- Restrict auto-approve for files outside your workspace(s)
- Configure different levels for different workspace folders
Mix of repositories and plain folders. Cline adapts to each folder's configuration.
### Cross-Workspace Operations
## Current Limitations
Cline can complete tasks spanning multiple workspaces:
Two features have limitations in multi-root workspace mode:
- **Refactoring**: Update imports and references across projects
- **Feature development**: Implement features requiring changes in multiple services
- **Documentation**: Generate docs referencing code from multiple folders
- **Testing**: Build & run tests across all workspaces and analyze results
### Cline Rules
When working with large multiroot workspaces, start in [Plan mode](/features/plan-and-act) to let Cline understand your project structure before making changes.
[Cline rules](/features/cline-rules) (`.clinerules/` directory) only work in the **primary workspace** (the first folder in your workspace). Rules in other workspace folders are ignored.
**Workaround:** Place shared rules in the primary workspace, or use global rules (`~/Documents/Cline/Rules/`) which apply everywhere.
### Checkpoints
[Checkpoints](/features/checkpoints) are disabled in multi-root workspace mode. Cline displays a warning when this happens.
**Why:** Checkpoints use a shadow Git repository to track changes. With multiple repositories, coordinating checkpoints across independent Git histories adds complexity that isn't yet supported.
**Workaround:** Use your normal Git workflow. Commit frequently, or create branches for experimental work.
Both limitations are restored when you return to a single-folder workspace.
## Best Practices
### Organizing Your Workspaces
1. **Group related projects** that often need coordinated changes
2. **Use consistent folder structures** across workspaces when possible
3. **Name folders clearly** so Cline can understand your project structure
2. **Use a workspace file** for reproducible setups across your team
3. **Name folders clearly** so workspace hints are intuitive
4. **Consider the primary workspace** for Cline rules placement
### Effective Prompting & Tips
### Effective Prompting
When working with multiroot workspaces, these approaches work best:
- **Be specific** when it matters: *"Update the user model in the backend workspace"*
- **Reference relationships**: *"The frontend uses types from the contracts workspace"*
- **Describe cross-workspace changes**: *"This needs to update both web and mobile"*
- **Scope searches** for large codebases: *"Search for 'TODO' only in the frontend workspace"*
- **Be specific** about which workspace when it matters: *"Update the user model in the backend workspace"*
- **Reference relationships**: *"The frontend uses the API types from the shared workspace"*
- **Describe cross-workspace operations**: *"This change needs to be reflected in both the web and mobile apps"*
- **Scope your searches** when dealing with large codebases: *"Search for 'TODO' in just the frontend workspace"*
- **Break down large tasks** into workspace-specific operations when possible
- **Consider excluding large folders** like `node_modules` from your workspace search Scope
### Working with Large Workspaces
- Break large tasks into workspace-specific operations when possible
- Use [Plan mode](/features/plan-and-act) to let Cline understand structure first
- Use VSCode's `files.exclude` setting to hide generated folders from the file explorer and search:
```json
// settings.json
"files.exclude": {
"**/node_modules": true,
"**/dist": true,
"**/build": true,
"**/.git": true
}
```
This reduces noise in Cline's file listings and helps it focus on your actual source code rather than generated files or dependencies.
@@ -2,6 +2,9 @@
title: "Explain Changes Command"
sidebarTitle: "/explain-changes"
---
<Note>
This command is only available in **VS Code**. The diff view with inline comments requires VS Code's native diff capabilities.
</Note>
`/explain-changes` is a slash command that generates AI-powered explanations for any git diff. Unlike the [Explain Changes button](/features/explain-changes) which explains changes from a completed task, this command lets you explain changes between any two git references - commits, branches, tags, PRs, staged changes, or your working directory.
+1 -1
View File
@@ -10,7 +10,7 @@ description: "Get Cline up and running in your favorite IDE with these simple in
## Before You Begin
<CardGroup cols={1}>
<Card title="Create Your Account" icon="user-plus" href="https://app.cline.bot/signup">
<Card title="Create Your Account" icon="user-plus" href="https://app.cline.bot/login">
Sign up for a **free Cline account** to get:
- Access to multiple AI models including stealth models
- Seamless setup without managing API keys
+108
View File
@@ -0,0 +1,108 @@
# Historical Tasks Rendering Bug Fix
## Problem Description
Historical (completed) tasks were not displaying their chat history when reopened from the task list. Users would click on a historical task and see an empty chat area with only "Zero-sized element" warnings from react-virtuoso.
### Symptoms
1. **New tasks worked fine** - Chat messages displayed normally during task execution
2. **Historical tasks failed** - After closing and reopening a task, the chat history was blank
3. **React Virtuoso errors** - Console showed repeated "Zero-sized element, this should not happen" warnings
4. **No component rendering** - ChatRow components mounted but returned 0 height
### Root Cause
The bug was in the `MessageRenderer` component's logic for handling `api_req_started` messages. The code had a "Deterministic flash fix" that would absorb (hide) api_req_started messages that were followed by low-stakes tools, expecting them to be included in a tool group.
```typescript
// BEFORE (Buggy code)
if (messageOrGroup.say === "api_req_started" &&
isApiReqAbsorbable(messageOrGroup.ts, modifiedMessages)) {
return null // Hide the message, expecting tool group to show it
}
```
For historical/completed tasks, this created a scenario where:
1. **api_req_started at end of list**`isApiReqAbsorbable` returned `true` (it saw low-stakes tools after it)
2. **MessageRenderer returned null** → The message was hidden
3. **Tool group was never created** → Because the message was at index 6 of 7 messages (near end)
4. **Result: Zero-sized element** → React Virtuoso tried to render a div with no content
### Debug Process
We added logging at multiple levels to trace the issue:
1. **ChatRow level** - No logs appeared (component never called)
2. **MessageRenderer level** - Logged `[MessageRenderer]` showing api_req_started being processed
3. **isApiReqAbsorbable level** - Showed `willAbsorb: true` for historical task messages
4. **ToolGroupRenderer level** - Never appeared (tool group not created)
This confirmed the api_req was being hidden without a replacement, causing the zero-height render.
## The Fix
Added a check to prevent absorption of messages near the end of the message list:
```typescript
// AFTER (Fixed code)
if (messageOrGroup.say === "api_req_started" &&
index < groupedMessages.length - 1 && // NEW: Don't absorb near-end messages
isApiReqAbsorbable(messageOrGroup.ts, modifiedMessages)) {
return null
}
```
### Why This Works
- **For active tasks**: Messages in the middle of the list that are followed by tools still get absorbed correctly (no UI flash)
- **For historical tasks**: The final api_req_started (at or near the end) is NOT absorbed, so it renders normally with its thinking block UI
- **For all tasks**: Prevents hiding messages when there's no subsequent content to create a tool group
## Files Modified
### MessageRenderer.tsx
```typescript
// webview-ui/src/components/chat/chat-view/components/messages/MessageRenderer.tsx
// Added index check before absorbing api_req_started
if (messageOrGroup.say === "api_req_started" &&
index < groupedMessages.length - 1 &&
isApiReqAbsorbable(messageOrGroup.ts, modifiedMessages)) {
return null
}
```
## Testing
After the fix:
-**New tasks continue to work** - Messages display during execution
-**Historical tasks now display** - Chat history shows when reopening tasks
-**No zero-sized element errors** - React Virtuoso renders properly
-**Thinking blocks render** - api_req_started messages show with their UI
## Related Changes
As part of fixing this issue, we also:
1. **Added missing props** to ChatRowProps (mode, reasoningContent, responseStarted, isRequestInProgress)
2. **Added thinking block components** (TypewriterText, BlinkingCursor, ThinkingBlock)
3. **Merged completion output UI** from task-completed-ui branch
4. **Created ExpandHandle component** for consistent expand/collapse UI
## Lessons Learned
1. **Absorption logic needs bounds checking** - Don't absorb messages at the end of a list if there's no subsequent content
2. **Debug logging is essential** - Multi-level logging helped identify exactly where messages disappeared
3. **Tool grouping can cause message loss** - If grouping logic fails to create a group, absorbed messages vanish
4. **Historical vs active tasks behave differently** - Logic that works for streaming may fail for completed tasks
## Commit History
- `7b7e61d49` - fix: prevent absorption of api_req_started at end of message list
- `adfea3f34` - feat: apply stash changes and clean up debug logs
- `7d8e13809` - feat: restore PlanCompletionOutput and create ExpandHandle component
- `cad613991` - feat: use CopyButton in PlanCompletionOutput
+1 -1
View File
@@ -29,7 +29,7 @@ Cline is an open source AI coding agent that brings frontier AI models directly
Master Cline's powerful features and optimize your workflow
</Card>
<Card title="Enterprise" icon="building" href="/enterprise-solutions/security-concerns">
<Card title="Enterprise" icon="building" href="/enterprise-solutions/overview">
Deploy Cline in your organization with confidence
</Card>
</CardGroup>
+1
View File
@@ -38,6 +38,7 @@ For the most updated pricing, please visit: https://www.baseten.co/products/mode
- `deepseek-ai/DeepSeek-R1-0528` - Latest revision of DeepSeek's reasoning model (163K context) - \$2.55/\$5.95 per 1M tokens
- `deepseek-ai/DeepSeek-V3.1` - Hybrid reasoning with advanced tool calling (163K context) - \$0.50/\$1.50 per 1M tokens
- `deepseek-ai/DeepSeek-V3-0324` - Fast general-purpose with enhanced reasoning (163K context) - \$0.77/\$0.77 per 1M tokens
- `deepseek-ai/DeepSeek-V3.2` - Fast general-purpose with enhanced reasoning (163K context) - \$0.77/\$0.77 per 1M tokens
### Production-First Architecture
+1 -1
View File
@@ -125,7 +125,7 @@ const copyWasmFiles = {
const buildEnvVars = {
"import.meta.url": "_importMetaUrl",
"process.env.IS_STANDALONE": JSON.stringify(standalone),
"process.env.IS_STANDALONE": JSON.stringify(standalone ? "true" : "false"),
}
if (production) {
+904 -14
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -2,7 +2,7 @@
"name": "claude-dev",
"displayName": "Cline",
"description": "Autonomous coding agent right in your IDE, capable of creating/editing files, running commands, using the browser, and more with your permission every step of the way.",
"version": "3.40.0",
"version": "3.45.0",
"icon": "assets/icons/icon.png",
"engines": {
"vscode": "^1.84.0"
@@ -378,7 +378,7 @@
"pretest": "npm run compile && npm run compile-tests && npm run compile-standalone && npm run lint",
"test": "npm-run-all test:unit test:integration",
"test:integration": "vscode-test",
"test:unit": "cross-env TS_NODE_PROJECT=./tsconfig.unit-test.json mocha # Use `UPDATE_SNAPSHOTS=true npm run test:unit` to rebuild prompt snapshots",
"test:unit": "cross-env TS_NODE_PROJECT=./tsconfig.unit-test.json mocha",
"test:coverage": "vscode-test --coverage",
"test:sca-server": "npx tsx watch scripts/test-standalone-core-api-server.ts",
"test:tp-orchestrator": "npx tsx scripts/testing-platform-orchestrator.ts",
+2
View File
@@ -113,6 +113,7 @@ message UsageTransaction {
int32 prompt_tokens = 10;
int32 total_tokens = 11;
string user_id = 12;
string operation = 13;
}
message PaymentTransaction {
@@ -135,4 +136,5 @@ message OrganizationUsageTransaction {
int32 prompt_tokens = 10;
int32 total_tokens = 11;
string user_id = 12;
string operation = 13;
}
+41 -3
View File
@@ -77,7 +77,45 @@ message TaskCompleteData {
// Data for PreCompact hook
message PreCompactData {
int64 context_size = 1;
int32 messages_to_compact = 2;
string compaction_strategy = 3;
// Task identification
string task_id = 1;
string ulid = 2;
// Context size information
int64 context_size = 3; // Number of messages in API conversation history
// Compaction strategy indicating how conversation history is managed:
// * auto-condense: AI-powered compression using summarize_task tool
// * standard-truncation-firstpair: Keep only the original task (used during auto-condense)
// * standard-truncation-lasthalf: Keep first pair + most recent 50% of conversation
// * standard-truncation-lastquarter: Keep first pair + most recent 25% of conversation (aggressive)
string compaction_strategy = 4;
// API request tracking
int64 previous_api_req_index = 5; // Index of last API request in clineMessages
// Token usage data from last API request
int64 tokens_in = 6;
int64 tokens_out = 7;
int64 tokens_in_cache = 8;
int64 tokens_out_cache = 9;
// Truncation information (if applicable)
int32 deleted_range_start = 10; // Start index of deleted conversation range
int32 deleted_range_end = 11; // End index of deleted conversation range
// Context JSON file path
// Path to a temporary JSON file containing the full API conversation history
// The file contains an array of message objects with role and content
// Hooks can read this file to analyze conversation contents before compaction
// This file will be automatically cleaned up after the hook completes
string context_json_path = 12;
// Context raw/formatted file path
// Path to a temporary text file containing the complete context window sent to the LLM
// This includes the system prompt, environment details, conversation history, and all formatting
// Represents the actual input the LLM receives (format varies by provider)
// Use this to analyze total context size, overhead, and exactly what the model sees
// This file will be automatically cleaned up after the hook completes
string context_raw_path = 13;
}
+13
View File
@@ -103,6 +103,7 @@ message OpenRouterModelInfo {
optional string name = 13;
optional double temperature = 14;
optional bool supports_reasoning = 15;
optional ApiFormat api_format = 16;
}
// Shared response message for model information
@@ -377,6 +378,8 @@ message OcaModelInfo {
optional string banner = 16;
// Canonical model identifier as reported by OCA
string model_name = 17;
// The API format used by this model
optional ApiFormat api_format = 18;
}
// Aggregated OCA model catalog keyed by model identifier
@@ -431,6 +434,14 @@ enum ApiProvider {
NOUSRESEARCH = 39;
}
enum ApiFormat {
ANTHROPIC_CHAT = 0;
GEMINI_CHAT = 1;
OPENAI_CHAT = 2;
R1_CHAT = 3;
OPENAI_RESPONSES = 4;
}
// Model info for OpenAI-compatible models
message OpenAiCompatibleModelInfo {
optional int64 max_tokens = 1;
@@ -447,6 +458,7 @@ message OpenAiCompatibleModelInfo {
repeated ModelTier tiers = 12;
optional double temperature = 13;
optional bool is_r1_format_required = 14;
optional ApiFormat api_format = 15;
}
// Model info for LiteLLM models
@@ -464,6 +476,7 @@ message LiteLLMModelInfo {
optional string description = 11;
repeated ModelTier tiers = 12;
optional double temperature = 13;
optional ApiFormat api_format = 14;
}
// Main ApiConfiguration message
+17 -1
View File
@@ -8,9 +8,25 @@ option go_package = "github.com/cline/grpc-go/cline";
option java_multiple_files = true;
option java_package = "bot.cline.proto";
// SlashService provides methods for managing slash
// SlashService provides methods for managing slash commands
service SlashService {
// Sends button click message
rpc reportBug(StringRequest) returns (Empty);
rpc condense(StringRequest) returns (Empty);
// Get available slash commands for autocomplete (used by CLI)
rpc getAvailableSlashCommands(EmptyRequest) returns (SlashCommandsResponse);
}
// Slash command definition for autocomplete
message SlashCommandInfo {
string name = 1; // Command name without slash, e.g., "newtask", "smol"
string description = 2; // Human-readable description
string section = 3; // "default", "custom", or "cli"
bool cli_compatible = 4; // false for VS Code-only commands like explain-changes
}
// Response containing all available slash commands
message SlashCommandsResponse {
repeated SlashCommandInfo commands = 1;
}
+4
View File
@@ -227,6 +227,8 @@ message Settings {
optional OpenAiCompatibleModelInfo plan_mode_aihubmix_model_info = 131;
optional string act_mode_aihubmix_model_id = 132;
optional OpenAiCompatibleModelInfo act_mode_aihubmix_model_info = 133;
optional bool cline_web_tools_enabled = 134;
optional bool hooks_enabled = 135;
}
message DictationSettings {
@@ -365,6 +367,8 @@ message UpdateSettingsRequest {
optional string cline_env = 31;
optional bool native_tool_call_enabled = 32;
optional OnboardingModelGroup onboarding_models = 33;
optional bool cline_web_tools_enabled = 34;
optional bool enable_parallel_tool_calling = 35;
}
message UpdateTerminalConnectionTimeoutRequest {
+4
View File
@@ -2,6 +2,7 @@ import * as vscode from "vscode"
import {
cleanupMcpMarketplaceCatalogFromGlobalState,
migrateCustomInstructionsToGlobalRules,
migrateHooksEnabledToBoolean,
migrateTaskHistoryToFile,
migrateWelcomeViewCompleted,
migrateWorkspaceToGlobalStorage,
@@ -62,6 +63,9 @@ export async function initialize(context: vscode.ExtensionContext): Promise<Webv
// Ensure taskHistory.json exists and migrate legacy state (runs once)
await migrateTaskHistoryToFile(context)
// Migrate hooksEnabled from ClineFeatureSetting to boolean (one-time cleanup)
await migrateHooksEnabledToBoolean(context)
// Clean up MCP marketplace catalog from global state (moved to disk cache)
await cleanupMcpMarketplaceCatalogFromGlobalState(context)
+3
View File
@@ -51,6 +51,7 @@ export interface ApiHandler {
createMessage(systemPrompt: string, messages: ClineStorageMessage[], tools?: ClineTool[], useResponseApi?: boolean): ApiStream
getModel(): ApiHandlerModel
getApiStreamUsage?(): Promise<ApiStreamUsageChunk | undefined>
abort?(): void
}
export interface ApiHandlerModel {
@@ -179,6 +180,8 @@ function createHandlerForProvider(
openAiNativeApiKey: options.openAiNativeApiKey,
reasoningEffort: mode === "plan" ? options.planModeReasoningEffort : options.actModeReasoningEffort,
apiModelId: mode === "plan" ? options.planModeApiModelId : options.actModeApiModelId,
thinkingBudgetTokens:
mode === "plan" ? options.planModeThinkingBudgetTokens : options.actModeThinkingBudgetTokens,
})
case "deepseek":
return new DeepSeekHandler({
+1 -1
View File
@@ -121,7 +121,7 @@ export class ClaudeCodeHandler implements ApiHandler {
function: {
id: content.id,
name: content.name,
arguments: content.input,
arguments: JSON.stringify(content.input),
},
},
}
+1 -1
View File
@@ -199,7 +199,7 @@ export class ClineHandler implements ApiHandler {
// @ts-ignore-next-line
let totalCost = (chunk.usage.cost || 0) + (chunk.usage.cost_details?.upstream_inference_cost || 0)
if (["x-ai/grok-code-fast-1", "minimax/minimax-m2", "stealth/microwave"].includes(this.getModel().id)) {
if (["x-ai/grok-code-fast-1", "minimax/minimax-m2"].includes(this.getModel().id)) {
totalCost = 0
}
+21 -20
View File
@@ -16,9 +16,6 @@ import { RetriableError, withRetry } from "../retry"
import { convertAnthropicMessageToGemini } from "../transform/gemini-format"
import { ApiStream } from "../transform/stream"
// Define a default TTL for the cache (e.g., 15 minutes in seconds)
const _DEFAULT_CACHE_TTL_SECONDS = 900
const rateLimitPatterns = [/got status: 429/i, /429 Too Many Requests/i, /rate limit exceeded/i, /too many requests/i]
interface GeminiHandlerOptions extends CommonApiHandlerOptions {
@@ -120,15 +117,17 @@ export class GeminiHandler implements ApiHandler {
const _thinkingBudget = this.options.thinkingBudgetTokens ?? 0
const maxBudget = info.thinkingConfig?.maxBudget ?? 24576
const thinkingBudget = Math.min(_thinkingBudget, maxBudget)
// When ThinkingLevel is defineded, thinking budget cannot be zero
// When ThinkingLevel is defined, thinking budget cannot be zero
// and only level is used to control thinking behavior.
// Only set thinkingLevel for models that support it
let thinkingLevel: ThinkingLevel | undefined
if (this.options.thinkingLevel === "high") {
thinkingLevel = ThinkingLevel.HIGH
} else if (this.options.thinkingLevel === "low" || modelId.includes("gemini-3-pro")) {
// Thinking level is required for Gemini 3 Pro models.
// Set it to LOW by default if not specified but is required.
thinkingLevel = ThinkingLevel.LOW
if (info.thinkingConfig?.supportsThinkingLevel) {
const level = this.options.thinkingLevel || info.thinkingConfig.geminiThinkingLevel
if (level === "high") {
thinkingLevel = ThinkingLevel.HIGH
} else if (level === "low") {
thinkingLevel = ThinkingLevel.LOW
}
}
// Set up base generation config
@@ -141,16 +140,18 @@ export class GeminiHandler implements ApiHandler {
temperature: info.temperature ?? 1,
}
// Add thinking config if the model supports it
requestConfig.thinkingConfig = {
// Turn off thinking:
// thinkingBudget: 0
// Turn on dynamic thinking:
// thinkingBudget: -1
// Turn on fixed thinking budget:
thinkingBudget: thinkingLevel ? undefined : thinkingBudget, // Use budget only if thinkingLevel is not set
thinkingLevel,
includeThoughts: thinkingBudget > 0 || !!thinkingLevel,
// Add thinking config only if the model supports it
if (info.thinkingConfig) {
requestConfig.thinkingConfig = {
// Turn off thinking:
// thinkingBudget: 0
// Turn on dynamic thinking:
// thinkingBudget: -1
// Turn on fixed thinking budget:
thinkingBudget: thinkingLevel ? undefined : thinkingBudget, // Use budget only if thinkingLevel is not set
thinkingLevel,
includeThoughts: thinkingBudget > 0 || !!thinkingLevel,
}
}
// Generate content using the configured parameters
+18 -2
View File
@@ -30,9 +30,25 @@ export class MistralHandler implements ApiHandler {
}
try {
// Create HTTP client with custom fetch for proxy support
// The Mistral SDK's HTTPClient passes a Request object to the fetcher,
// but we need to extract the URL and init options to pass to our fetch wrapper
// which properly handles proxy configuration in standalone mode (JetBrains/CLI)
const httpClient = new HTTPClient({
fetcher: (request) => {
return fetch(request)
fetcher: async (input: RequestInfo | URL, init?: RequestInit) => {
// Handle both string/URL and Request object inputs
if (input instanceof Request) {
return fetch(input.url, {
method: input.method,
headers: input.headers,
body: input.body,
redirect: input.redirect,
signal: input.signal,
// duplex is required when sending a body stream in Node.js/undici
duplex: input.body ? "half" : undefined,
...init,
} as RequestInit)
}
return fetch(input, init)
},
})
+4
View File
@@ -121,4 +121,8 @@ export class OllamaHandler implements ApiHandler {
},
}
}
abort(): void {
this.client?.abort()
}
}
+64 -117
View File
@@ -1,10 +1,18 @@
import { ModelInfo, OpenAiNativeModelId, openAiNativeDefaultModelId, openAiNativeModels } from "@shared/api"
import {
ModelInfo,
OpenAiCompatibleModelInfo,
OpenAiNativeModelId,
openAiNativeDefaultModelId,
openAiNativeModels,
} from "@shared/api"
import { calculateApiCostOpenAI } from "@utils/cost"
import OpenAI from "openai"
import type { ChatCompletionReasoningEffort, ChatCompletionTool } from "openai/resources/chat/completions"
import { Logger } from "@/services/logging/Logger"
import { ClineStorageMessage } from "@/shared/messages/content"
import { fetch } from "@/shared/net"
import { ApiFormat } from "@/shared/proto/cline/models"
import { isGPT5ModelFamily } from "@/utils/model-utils"
import { ApiHandler, CommonApiHandlerOptions } from "../"
import { withRetry } from "../retry"
import { convertToOpenAiMessages } from "../transform/openai-format"
@@ -15,6 +23,7 @@ import { getOpenAIToolParams, ToolCallProcessor } from "../transform/tool-call-p
interface OpenAiNativeHandlerOptions extends CommonApiHandlerOptions {
openAiNativeApiKey?: string
reasoningEffort?: string
thinkingBudgetTokens?: number
apiModelId?: string
}
@@ -61,13 +70,12 @@ export class OpenAiNativeHandler implements ApiHandler {
}
@withRetry()
async *createMessage(
systemPrompt: string,
messages: ClineStorageMessage[],
tools?: ChatCompletionTool[],
useResponseFormat = false,
): ApiStream {
if (useResponseFormat) {
async *createMessage(systemPrompt: string, messages: ClineStorageMessage[], tools?: ChatCompletionTool[]): ApiStream {
// Responses API requires tool format to be set to OPENAI_RESPONSES with native tools calling enabled
if (this.getModel()?.info?.apiFormat === ApiFormat.OPENAI_RESPONSES) {
if (!tools?.length) {
throw new Error("Native Tool Call must be enabled in your setting for OpenAI Responses API")
}
yield* this.createResponseStream(systemPrompt, messages, tools)
} else {
yield* this.createCompletionStream(systemPrompt, messages, tools)
@@ -83,119 +91,57 @@ export class OpenAiNativeHandler implements ApiHandler {
const model = this.getModel()
const toolCallProcessor = new ToolCallProcessor()
switch (model.id) {
case "o1":
case "o1-preview":
case "o1-mini": {
// o1 doesn't support streaming, non-1 temp, or system prompt
const response = await client.chat.completions.create({
model: model.id,
messages: [{ role: "user", content: systemPrompt }, ...convertToOpenAiMessages(messages)],
})
// Handle o1 models separately as they don't support streaming
if (model.info.supportsStreaming === false) {
const response = await client.chat.completions.create({
model: model.id,
messages: [{ role: "user", content: systemPrompt }, ...convertToOpenAiMessages(messages)],
})
yield {
type: "text",
text: response.choices[0]?.message.content || "",
}
yield* this.yieldUsage(model.info, response.usage)
return
}
const systemRole = model.info.systemRole ?? "system"
const includeReasoning = this.options.thinkingBudgetTokens && model.info.supportsReasoningEffort
const includeTools = model.info.supportsTools ?? true
const reasoningEffort = includeReasoning
? (this.options.reasoningEffort as ChatCompletionReasoningEffort) || "medium"
: undefined
const stream = await client.chat.completions.create({
model: model.id,
messages: [{ role: systemRole, content: systemPrompt }, ...convertToOpenAiMessages(messages)],
stream: true,
stream_options: { include_usage: true },
reasoning_effort: reasoningEffort,
...(model.info.temperature !== undefined ? { temperature: model.info.temperature } : {}),
...(includeTools ? getOpenAIToolParams(tools, isGPT5ModelFamily(model.id)) : {}),
})
for await (const chunk of stream) {
const delta = chunk.choices[0]?.delta
if (delta?.content) {
yield {
type: "text",
text: response.choices[0]?.message.content || "",
text: delta.content,
}
yield* this.yieldUsage(model.info, response.usage)
break
}
case "o4-mini":
case "o3":
case "o3-mini": {
const stream = await client.chat.completions.create({
model: model.id,
messages: [{ role: "developer", content: systemPrompt }, ...convertToOpenAiMessages(messages)],
stream: true,
stream_options: { include_usage: true },
reasoning_effort: (this.options.reasoningEffort as ChatCompletionReasoningEffort) || "medium",
})
for await (const chunk of stream) {
const delta = chunk.choices[0]?.delta
if (delta?.content) {
yield {
type: "text",
text: delta.content,
}
}
if (chunk.usage) {
// Only last chunk contains usage
yield* this.yieldUsage(model.info, chunk.usage)
}
if (delta?.tool_calls) {
try {
yield* toolCallProcessor.processToolCallDeltas(delta.tool_calls)
} catch (error) {
console.error("Error processing tool call delta:", error, delta.tool_calls)
}
break
}
case "gpt-5-2025-08-07":
case "gpt-5-mini-2025-08-07":
case "gpt-5-nano-2025-08-07":
case "gpt-5.1-2025-11-13":
case "gpt-5.1-chat-latest":
case "gpt-5.1": {
const stream = await client.chat.completions.create({
model: model.id,
temperature: 1,
messages: [{ role: "developer", content: systemPrompt }, ...convertToOpenAiMessages(messages)],
stream: true,
stream_options: { include_usage: true },
reasoning_effort: (this.options.reasoningEffort as ChatCompletionReasoningEffort) || "medium",
...getOpenAIToolParams(tools),
})
for await (const chunk of stream) {
const delta = chunk.choices[0]?.delta
if (delta?.content) {
yield {
type: "text",
text: delta.content,
}
}
if (delta?.tool_calls) {
try {
yield* toolCallProcessor.processToolCallDeltas(delta.tool_calls)
} catch (error) {
console.error("Error processing tool call delta:", error, delta.tool_calls)
}
}
if (chunk.usage) {
// Only last chunk contains usage - stream is ending
yield* this.yieldUsage(model.info, chunk.usage)
}
}
break
}
default: {
const stream = await client.chat.completions.create({
model: model.id,
// max_completion_tokens: this.getModel().info.maxTokens,
temperature: 0,
messages: [{ role: "system", content: systemPrompt }, ...convertToOpenAiMessages(messages)],
stream: true,
stream_options: { include_usage: true },
...getOpenAIToolParams(tools),
})
for await (const chunk of stream) {
const delta = chunk.choices[0]?.delta
if (delta?.content) {
yield {
type: "text",
text: delta.content,
}
}
if (delta?.tool_calls) {
yield* toolCallProcessor.processToolCallDeltas(delta.tool_calls)
}
if (chunk.usage) {
// Only last chunk contains usage - stream is ending
yield* this.yieldUsage(model.info, chunk.usage)
}
}
if (chunk.usage) {
// Only last chunk contains usage
yield* this.yieldUsage(model.info, chunk.usage)
}
}
}
@@ -203,7 +149,7 @@ export class OpenAiNativeHandler implements ApiHandler {
private async *createResponseStream(
systemPrompt: string,
messages: ClineStorageMessage[],
tools?: ChatCompletionTool[],
tools: ChatCompletionTool[],
): ApiStream {
const client = this.ensureClient()
const model = this.getModel()
@@ -402,15 +348,16 @@ export class OpenAiNativeHandler implements ApiHandler {
}
}
getModel(): { id: OpenAiNativeModelId; info: ModelInfo } {
getModel(): { id: OpenAiNativeModelId; info: OpenAiCompatibleModelInfo } {
const modelId = this.options.apiModelId
if (modelId && modelId in openAiNativeModels) {
const id = modelId as OpenAiNativeModelId
return { id, info: openAiNativeModels[id] }
const info = openAiNativeModels[id]
return { id, info: { ...info } }
}
return {
id: openAiNativeDefaultModelId,
info: openAiNativeModels[openAiNativeDefaultModelId],
info: { ...openAiNativeModels[openAiNativeDefaultModelId] },
}
}
}
+29 -72
View File
@@ -83,84 +83,41 @@ export class VertexHandler implements ApiHandler {
// Claude implementation
const budget_tokens = this.options.thinkingBudgetTokens || 0
const reasoningOn = !!(
(modelId.includes("3-7") ||
modelId.includes("sonnet-4") ||
modelId.includes("opus-4") ||
modelId.includes("haiku-4-5")) &&
budget_tokens !== 0
)
// Use model metadata to determine if reasoning should be enabled
const reasoningOn = (model.info.supportsReasoning ?? false) && budget_tokens !== 0
// Tools are available only when native tools are enabled.
const nativeToolsOn = tools?.length ? tools?.length > 0 : false
let stream
const anthropicMessages = sanitizeAnthropicMessages(messages, model.info.supportsPromptCache ?? false)
switch (modelId) {
case "claude-haiku-4-5@20251001":
case "claude-sonnet-4-5@20250929":
case "claude-sonnet-4@20250514":
case "claude-opus-4-5@20251101":
case "claude-opus-4-1@20250805":
case "claude-opus-4@20250514":
case "claude-3-7-sonnet@20250219":
case "claude-3-5-sonnet-v2@20241022":
case "claude-3-5-sonnet@20240620":
case "claude-3-5-haiku@20241022":
case "claude-3-opus@20240229":
case "claude-3-haiku@20240307": {
const anthropicMessages = sanitizeAnthropicMessages(messages, true)
stream = await clientAnthropic.beta.messages.create(
const stream = await clientAnthropic.beta.messages.create(
{
model: modelId,
max_tokens: model.info.maxTokens || 8192,
thinking: reasoningOn ? { type: "enabled", budget_tokens: budget_tokens } : undefined,
temperature: reasoningOn ? undefined : 0,
system: [
{
model: modelId,
max_tokens: model.info.maxTokens || 8192,
thinking: reasoningOn ? { type: "enabled", budget_tokens: budget_tokens } : undefined,
temperature: reasoningOn ? undefined : 0,
system: [
{
text: systemPrompt,
type: "text",
cache_control: { type: "ephemeral" },
},
],
messages: anthropicMessages,
stream: true,
tools: nativeToolsOn ? (tools as AnthropicTool[]) : undefined,
// tool_choice options:
// - none: disables tool use, even if tools are provided. Claude will not call any tools.
// - auto: allows Claude to decide whether to call any provided tools or not. This is the default value when tools are provided.
// - any: tells Claude that it must use one of the provided tools, but doesnt force a particular tool.
// NOTE: Forcing tool use when tools are provided will result in error when thinking is also enabled.
tool_choice: nativeToolsOn && !reasoningOn ? { type: "any" } : undefined,
text: systemPrompt,
type: "text",
cache_control: model.info.supportsPromptCache ? { type: "ephemeral" } : undefined,
},
{
headers: {},
},
)
break
}
default: {
stream = await clientAnthropic.beta.messages.create({
model: modelId,
max_tokens: model.info.maxTokens || 8192,
temperature: 0,
system: [
{
text: systemPrompt,
type: "text",
},
],
messages: sanitizeAnthropicMessages(messages, false),
stream: true,
tools: tools?.length ? (tools as AnthropicTool[]) : undefined,
// tool_choice options:
// - none: disables tool use, even if tools are provided. Claude will not call any tools.
// - auto: allows Claude to decide whether to call any provided tools or not. This is the default value when tools are provided.
// - any: tells Claude that it must use one of the provided tools, but doesnt force a particular tool.
tool_choice: tools ? { type: "any" } : undefined,
})
break
}
}
],
messages: anthropicMessages,
stream: true,
tools: nativeToolsOn ? (tools as AnthropicTool[]) : undefined,
// tool_choice options:
// - none: disables tool use, even if tools are provided. Claude will not call any tools.
// - auto: allows Claude to decide whether to call any provided tools or not. This is the default value when tools are provided.
// - any: tells Claude that it must use one of the provided tools, but doesnt force a particular tool.
// NOTE: Forcing tool use when tools are provided will result in error when thinking is also enabled.
tool_choice: nativeToolsOn && !reasoningOn ? { type: "any" } : undefined,
},
{
headers: {},
},
)
const lastStartedToolCall = { id: "", name: "", arguments: "" }
+10 -1
View File
@@ -2,6 +2,14 @@ import { Anthropic } from "@anthropic-ai/sdk"
import { Content, GenerateContentResponse, Part } from "@google/genai"
import { ClineStorageMessage } from "@/shared/messages/content"
// Source: https://ai.google.dev/gemini-api/docs/thought-signatures#faqs
// While injecting custom function call blocks into the request is strongly discouraged,
// in cases where it can't be avoided, e.g. providing information to the model on function
// calls and responses that were executed deterministically by the client, or transferring a
// trace from a different model that does not include thought signatures, you can set the following dummy signatures of either
// "context_engineering_is_the_way_to_go" or "skip_thought_signature_validator" in the thought signature field to skip validation.
const GEMINI_DUMMY_THOUGHT_SIGNATURE = "skip_thought_signature_validator"
export function convertAnthropicContentToGemini(content: string | ClineStorageMessage["content"]): Part[] {
if (typeof content === "string") {
return [{ text: content }]
@@ -27,7 +35,8 @@ export function convertAnthropicContentToGemini(content: string | ClineStorageMe
name: block.name,
args: block.input as Record<string, unknown>,
},
thoughtSignature: block.signature,
// Thought signature is required, so provide a dummy one if not present
thoughtSignature: block.signature || GEMINI_DUMMY_THOUGHT_SIGNATURE,
}
case "tool_result":
return {
+1 -1
View File
@@ -187,7 +187,7 @@ export async function createOpenRouterStream(
openRouterProviderSorting = undefined
}
// Skip reasoning for models that don't support it (e.g., microwave, grok-4)
// Skip reasoning for models that don't support it (e.g., devstral, grok-4)
const includeReasoning = !shouldSkipReasoningForModel(model.id)
// @ts-ignore-next-line
@@ -74,12 +74,12 @@ export class ToolCallProcessor {
}
}
export function getOpenAIToolParams(tools?: OpenAITool[]) {
export function getOpenAIToolParams(tools?: OpenAITool[], enableParallelToolCalls: boolean = false) {
return tools?.length
? {
tools,
tool_choice: tools ? ("auto" as ChatCompletionToolChoiceOption) : undefined,
parallel_tool_calls: tools ? false : undefined, // Set to false to force single tool calls
parallel_tool_calls: enableParallelToolCalls ? true : false,
}
: {
tools: undefined,
+4
View File
@@ -24,6 +24,10 @@ export const toolParamNames = [
"url",
"coordinate",
"text",
"query",
"allowed_domains",
"blocked_domains",
"prompt",
"server_name",
"tool_name",
"arguments",
+5 -5
View File
@@ -16,10 +16,10 @@ interface TaskReconstructionResult {
/**
* Reconstructs task history from existing task folders
* @param isManuallyCalled Whether the function was called manually by the user through command palette
* @param showNotifications Whether to show user-facing notifications and dialogs
* @returns Reconstruction result or null if cancelled
*/
export async function reconstructTaskHistory(isManuallyCalled = true): Promise<TaskReconstructionResult | null> {
export async function reconstructTaskHistory(showNotifications = true): Promise<TaskReconstructionResult | null> {
try {
// Show confirmation dialog using HostProvider
const proceed = await HostProvider.window.showMessage({
@@ -35,7 +35,7 @@ export async function reconstructTaskHistory(isManuallyCalled = true): Promise<T
return null
}
if (isManuallyCalled) {
if (showNotifications) {
// Show initial progress message
HostProvider.window.showMessage({
type: ShowMessageType.INFORMATION,
@@ -46,7 +46,7 @@ export async function reconstructTaskHistory(isManuallyCalled = true): Promise<T
const result = await performTaskHistoryReconstruction()
// Show results
if (isManuallyCalled) {
if (showNotifications) {
if (result.errors.length > 0) {
const errorMessage = `Reconstruction completed with warnings:\n- Reconstructed: ${result.reconstructedTasks} tasks\n- Skipped: ${result.skippedTasks} tasks\n- Errors: ${result.errors.length}\n\nFirst few errors:\n${result.errors.slice(0, 3).join("\n")}`
@@ -65,7 +65,7 @@ export async function reconstructTaskHistory(isManuallyCalled = true): Promise<T
return result
} catch (error) {
const errorMessage = error instanceof Error ? error.message : String(error)
if (isManuallyCalled) {
if (showNotifications) {
HostProvider.window.showMessage({
type: ShowMessageType.ERROR,
message: `Failed to reconstruct task history: ${errorMessage}`,
@@ -1,102 +0,0 @@
import { Anthropic } from "@anthropic-ai/sdk"
import { ApiHandler } from "@core/api"
import { ClineApiReqInfo, ClineMessage } from "@shared/ExtensionMessage"
import { getContextWindowInfo } from "./context-window-utils"
class ContextManager {
getNewContextMessagesAndMetadata(
apiConversationHistory: Anthropic.Messages.MessageParam[],
clineMessages: ClineMessage[],
api: ApiHandler,
conversationHistoryDeletedRange: [number, number] | undefined,
previousApiReqIndex: number,
) {
let updatedConversationHistoryDeletedRange = false
// If the previous API request's total token usage is close to the context window, truncate the conversation history to free up space for the new request
if (previousApiReqIndex >= 0) {
const previousRequest = clineMessages[previousApiReqIndex]
if (previousRequest && previousRequest.text) {
const { tokensIn, tokensOut, cacheWrites, cacheReads }: ClineApiReqInfo = JSON.parse(previousRequest.text)
const totalTokens = (tokensIn || 0) + (tokensOut || 0) + (cacheWrites || 0) + (cacheReads || 0)
const { maxAllowedSize } = getContextWindowInfo(api)
// This is the most reliable way to know when we're close to hitting the context window.
if (totalTokens >= maxAllowedSize) {
// Since the user may switch between models with different context windows, truncating half may not be enough (ie if switching from claude 200k to deepseek 64k, half truncation will only remove 100k tokens, but we need to remove much more)
// So if totalTokens/2 is greater than maxAllowedSize, we truncate 3/4 instead of 1/2
// FIXME: truncating the conversation in a way that is optimal for prompt caching AND takes into account multi-context window complexity is something we need to improve
const keep = totalTokens / 2 > maxAllowedSize ? "quarter" : "half"
// NOTE: it's okay that we overwriteConversationHistory in resume task since we're only ever removing the last user message and not anything in the middle which would affect this range
conversationHistoryDeletedRange = this.getNextTruncationRange(
apiConversationHistory,
conversationHistoryDeletedRange,
keep,
)
updatedConversationHistoryDeletedRange = true
}
}
}
// conversationHistoryDeletedRange is updated only when we're close to hitting the context window, so we don't continuously break the prompt cache
const truncatedConversationHistory = this.getTruncatedMessages(apiConversationHistory, conversationHistoryDeletedRange)
return {
conversationHistoryDeletedRange: conversationHistoryDeletedRange,
updatedConversationHistoryDeletedRange: updatedConversationHistoryDeletedRange,
truncatedConversationHistory: truncatedConversationHistory,
}
}
public getNextTruncationRange(
apiMessages: Anthropic.Messages.MessageParam[],
currentDeletedRange: [number, number] | undefined,
keep: "half" | "quarter",
): [number, number] {
// Since we always keep the first message, currentDeletedRange[0] will always be 1 (for now until we have a smarter truncation algorithm)
const rangeStartIndex = 1
const startOfRest = currentDeletedRange ? currentDeletedRange[1] + 1 : 1
let messagesToRemove: number
if (keep === "half") {
// Remove half of remaining user-assistant pairs
// We first calculate half of the messages then divide by 2 to get the number of pairs.
// After flooring, we multiply by 2 to get the number of messages.
// Note that this will also always be an even number.
messagesToRemove = Math.floor((apiMessages.length - startOfRest) / 4) * 2 // Keep even number
} else {
// Remove 3/4 of remaining user-assistant pairs
// We calculate 3/4ths of the messages then divide by 2 to get the number of pairs.
// After flooring, we multiply by 2 to get the number of messages.
// Note that this will also always be an even number.
messagesToRemove = Math.floor(((apiMessages.length - startOfRest) * 3) / 4 / 2) * 2
}
let rangeEndIndex = startOfRest + messagesToRemove - 1
// Make sure the last message being removed is a user message, so that the next message after the initial task message is an assistant message. This preservers the user-assistant-user-assistant structure.
// NOTE: anthropic format messages are always user-assistant-user-assistant, while openai format messages can have multiple user messages in a row (we use anthropic format throughout cline)
if (apiMessages[rangeEndIndex].role !== "user") {
rangeEndIndex -= 1
}
// this is an inclusive range that will be removed from the conversation history
return [rangeStartIndex, rangeEndIndex]
}
public getTruncatedMessages(
messages: Anthropic.Messages.MessageParam[],
deletedRange: [number, number] | undefined,
): Anthropic.Messages.MessageParam[] {
if (!deletedRange) {
return messages
}
const [start, end] = deletedRange
// the range is inclusive - both start and end indices and everything in between will be removed from the final result.
// NOTE: if you try to console log these, don't forget that logging a reference to an array may not provide the same result as logging a slice() snapshot of that array at that exact moment. The following DOES in fact include the latest assistant message.
return [...messages.slice(0, start), ...messages.slice(end + 1)]
}
}
@@ -55,6 +55,44 @@ export class ContextManager {
this.contextHistoryUpdates = new Map()
}
/**
* Extracts text from a content block, handling both regular text blocks and tool_result wrappers.
* For tool_result blocks, extracts text from content[0] (native tool calling format).
* @returns The text content, or null if no text could be extracted
*/
private getTextFromBlock(block: Anthropic.Messages.ContentBlockParam): string | null {
if (block.type === "text") {
return block.text
}
if (block.type === "tool_result" && Array.isArray(block.content)) {
const inner = block.content[0]
if (inner && "type" in inner && inner.type === "text") {
return inner.text
}
}
return null
}
/**
* Sets text in a content block, handling both regular text blocks and tool_result wrappers.
* For tool_result blocks, sets text in content[0] (native tool calling format).
* @returns true if text was set successfully, false otherwise
*/
private setTextInBlock(block: Anthropic.Messages.ContentBlockParam, text: string): boolean {
if (block.type === "text") {
block.text = text
return true
}
if (block.type === "tool_result" && Array.isArray(block.content)) {
const inner = block.content[0]
if (inner && "type" in inner && inner.type === "text") {
inner.text = text
return true
}
}
return false
}
/**
* public function for loading contextHistoryUpdates from disk, if it exists
*/
@@ -490,8 +528,8 @@ export class ContextManager {
if (Array.isArray(message.content)) {
const block = message.content[blockIndex]
if (block && block.type === "text") {
block.text = latestChange[2][0]
if (block) {
this.setTextInBlock(block, latestChange[2][0])
}
}
}
@@ -788,22 +826,29 @@ export class ContextManager {
const message = apiMessages[i]
if (message.role === "user" && Array.isArray(message.content) && message.content.length > 0) {
const firstBlock = message.content[0]
if (firstBlock.type === "text") {
const result = this.parseToolCallWithFormat(firstBlock.text)
// Extract text from either a direct text block or from inside a tool_result wrapper (native tool calling)
const firstBlockText = this.getTextFromBlock(firstBlock)
if (firstBlockText) {
const result = this.parseToolCallWithFormat(firstBlockText)
let foundNormalFileRead = false
if (result) {
const [toolName, filePath, contentBlockIndex, headerText] = result
if (toolName === "read_file") {
// For native tool calling format, we assume contentBlockIndex=0 which is what happens naturally
this.handleReadFileToolCall(i, filePath, fileReadIndices, contentBlockIndex, headerText)
foundNormalFileRead = true
} else if (toolName === "replace_in_file" || toolName === "write_to_file") {
// old format has the file contents in index=1 whereas the new format has it in index=0
// in either case we need to extract the correct contents
// For native tool calling format, the content is assumed to always in the same block (index=0 inside tool_result)
// For the XML format, the old format has the file contents in index=1 whereas the new format has it in index=0
let blockText: string | undefined
if (contentBlockIndex == 0) {
blockText = firstBlock.text
} else if (contentBlockIndex == 1 && message.content.length > 1) {
if (firstBlock.type === "tool_result") {
blockText = firstBlockText
} else if (contentBlockIndex === 0) {
// remaining cases are for type="text"
blockText = firstBlockText
} else if (contentBlockIndex === 1 && message.content.length > 1) {
const secondBlock = message.content[1]
if (secondBlock.type === "text") {
blockText = secondBlock.text
@@ -825,18 +870,20 @@ export class ContextManager {
// file mentions can happen in most other user message blocks
if (!foundNormalFileRead) {
// Search over indices up to 0-2 for file mentions
// Only search index N if there's at least one more element after it
// search over indices 0-2 inclusive for file mentions
// this is a heuristic to catch most occurrences without looping over all inner indices
for (const candidateIndex of [0, 1, 2]) {
if (message.content.length <= candidateIndex + 1) {
if (candidateIndex >= message.content.length) {
break
}
const block = message.content[candidateIndex]
if (block.type === "text") {
// Extract text from either a direct text block or from inside a tool_result wrapper
const blockText = this.getTextFromBlock(block)
if (blockText) {
const [hasFileRead, filePaths] = this.handlePotentialFileMentionCalls(
i,
block.text,
blockText,
fileReadIndices,
thisExistingFileReads, // file reads we've already replaced in this text in the latest version of this updated text
candidateIndex,
@@ -931,7 +978,7 @@ export class ContextManager {
) {
const indices = fileReadIndices.get(filePath) || []
if (contentBlockIndex == 1) {
if (contentBlockIndex === 1) {
// the original tool call format
indices.push([i, EditType.READ_FILE_TOOL, "", formatResponse.duplicateFileReadNotice(), contentBlockIndex])
} else {
@@ -1019,9 +1066,12 @@ export class ContextManager {
// can assume that this content will exist, otherwise it would not have been in fileReadIndices
const messageContent = apiMessages[messageIndex]?.content
if (!baseText && Array.isArray(messageContent) && messageContent.length > innerIndex) {
// contentBlock can either be the type="text" dict or type="tool_result" dict which has its own content array
// but we currently assume the content we will overwrite is at index=0 in this content array
const contentBlock = messageContent[innerIndex]
if (contentBlock.type === "text") {
baseText = contentBlock.text
const extractedText = this.getTextFromBlock(contentBlock)
if (extractedText) {
baseText = extractedText
}
}
@@ -1128,7 +1178,9 @@ export class ContextManager {
// looping over inner indices of messages
const block = message.content[blockIndex]
if (block.type === "text" && block.text) {
// Extract text from either a direct text block or from inside a tool_result wrapper (native tool calling)
const blockText = this.getTextFromBlock(block)
if (blockText) {
// true if we just altered it, or it was altered before
if (hasExistingAlterations) {
const innerTuple = this.contextHistoryUpdates.get(i)
@@ -1144,7 +1196,7 @@ export class ContextManager {
if (updates.length > 1) {
originalTextLength = updates[updates.length - 2][2][0].length // handles case if we have multiple updates for same text block
} else {
originalTextLength = block.text.length
originalTextLength = blockText.length
}
const newTextLength = latestUpdate[2][0].length // replacement text
@@ -1157,11 +1209,11 @@ export class ContextManager {
}
} else {
// reach here if there was one inner index with an update, but now we are at a different index, so updates is not defined
totalCharCount += block.text.length
totalCharCount += blockText.length
}
} else {
// reach here if there's no alterations for this outer index, meaning each inner index won't have any changes either
totalCharCount += block.text.length
totalCharCount += blockText.length
}
} else if (block.type === "image" && block.source) {
if (block.source.type === "base64" && block.source.data) {
@@ -100,6 +100,190 @@ describe("ContextManager", () => {
})
})
describe("applyContextOptimizations", () => {
let contextManager: ContextManager
beforeEach(() => {
contextManager = new ContextManager()
})
it("detects duplicate file reads across write_to_file, replace_in_file, and file mentions (normal tool calling)", () => {
const messages: Anthropic.Messages.MessageParam[] = [
{ role: "user", content: "Initial task" },
{ role: "assistant", content: "Response" },
{
role: "user",
content: [
{
type: "text",
text: "[write_to_file for 'test.txt'] Result:\nThe content was successfully saved to test.txt.\n\nHere is the full, updated content of the file that was saved:\n\n<final_file_content path=\"test.txt\">\ntest\n\n</final_file_content>",
},
{
type: "text",
text: "<environment_details>\n# Visual Studio Code Visible Files\ntest.txt\n\n# Current Mode\nACT MODE\n</environment_details>",
},
],
},
{ role: "assistant", content: "Response" },
{
role: "user",
content: [
{
type: "text",
text: "[replace_in_file for 'test.txt'] Result:\nThe content was successfully saved to test.txt.\n\nHere is the full, updated content of the file that was saved:\n\n<final_file_content path=\"test.txt\">\ntest 2\n\n</final_file_content>",
},
{
type: "text",
text: "<environment_details>\n# Visual Studio Code Visible Files\ntest.txt\n\n# Current Mode\nACT MODE\n</environment_details>",
},
],
},
{ role: "assistant", content: "Response" },
{
role: "user",
content: [
{
type: "text",
text: "[TASK RESUMPTION] This task was interrupted just now. The conversation may have been incomplete.",
},
{
type: "text",
text: "New message to respond to:\n<user_message>\n'test.txt' (see below for file content) tell me whats in this file\n</user_message>\n\n<file_content path=\"test.txt\">\ntest 2\n\n</file_content>",
},
],
},
]
const timestamp = Date.now()
const [didUpdate, indices] = contextManager.applyContextOptimizations(messages, 2, timestamp)
expect(didUpdate).to.equal(true)
expect(indices.size).to.equal(2)
expect(indices.has(2)).to.equal(true)
expect(indices.has(4)).to.equal(true)
expect(indices.has(6)).to.equal(false)
})
it("returns false when no duplicate file reads exist", () => {
const messages: Anthropic.Messages.MessageParam[] = [
{ role: "user", content: "Initial task" },
{ role: "assistant", content: "Response" },
{
role: "user",
content: [
{
type: "text",
text: "[write_to_file for 'test.txt'] Result:\n<final_file_content path=\"test.txt\">\ntest\n\n</final_file_content>",
},
],
},
{ role: "assistant", content: "Response" },
{
role: "user",
content: [
{
type: "text",
text: "[write_to_file for 'other.txt'] Result:\n<final_file_content path=\"other.txt\">\nother content\n\n</final_file_content>",
},
],
},
]
const [didUpdate, indices] = contextManager.applyContextOptimizations(messages, 2, Date.now())
expect(didUpdate).to.equal(false)
expect(indices.size).to.equal(0)
})
it("returns false for empty messages beyond startFromIndex", () => {
const messages: Anthropic.Messages.MessageParam[] = [
{ role: "user", content: "Initial task" },
{ role: "assistant", content: "Response" },
]
const [didUpdate, indices] = contextManager.applyContextOptimizations(messages, 2, Date.now())
expect(didUpdate).to.equal(false)
expect(indices.size).to.equal(0)
})
it("detects duplicate file reads with native tool calling format (tool_result blocks)", () => {
const messages: Anthropic.Messages.MessageParam[] = [
{ role: "user", content: "Initial task" },
{ role: "assistant", content: [{ type: "tool_use", id: "toolu_001", name: "plan_mode_respond", input: {} }] },
{
role: "user",
content: [
{
type: "tool_result",
tool_use_id: "toolu_001",
content: [
{
type: "text",
text: "[plan_mode_respond] Result:\n<user_message>\n'test2.txt' (see below for file content)\n</user_message>\n\n<file_content path=\"/Users/toshi/Desktop/cline_testing_repo/test2.txt\">\ntest\n\n</file_content>",
},
],
},
],
},
{ role: "assistant", content: [{ type: "tool_use", id: "toolu_002", name: "write_to_file", input: {} }] },
{
role: "user",
content: [
{
type: "tool_result",
tool_use_id: "toolu_002",
content: [
{
type: "text",
text: "[write_to_file for '/Users/toshi/Desktop/cline_testing_repo/test2.txt'] Result:\nThe content was successfully saved.\n\n<final_file_content path=\"/Users/toshi/Desktop/cline_testing_repo/test2.txt\">\ntest\n\n</final_file_content>",
},
],
},
{ type: "text", text: "<environment_details>\n# Current Mode\nACT MODE\n</environment_details>" },
],
},
{ role: "assistant", content: [{ type: "tool_use", id: "toolu_003", name: "text", input: {} }] },
{
role: "user",
content: [
{
type: "text",
text: "[TASK RESUMPTION] This task was interrupted just now. The conversation may have been incomplete.",
},
{ type: "text", text: "New message to respond to with plan_mode_respond tool" },
],
},
{ role: "assistant", content: [{ type: "tool_use", id: "toolu_004", name: "replace_in_file", input: {} }] },
{
role: "user",
content: [
{
type: "tool_result",
tool_use_id: "toolu_004",
content: [
{
type: "text",
text: "[replace_in_file for '/Users/toshi/Desktop/cline_testing_repo/test2.txt'] Result:\nThe content was successfully saved.\n\n<final_file_content path=\"/Users/toshi/Desktop/cline_testing_repo/test2.txt\">\ntest2\n\n</final_file_content>",
},
],
},
{ type: "text", text: "<environment_details>\n# Current Mode\nACT MODE\n</environment_details>" },
],
},
]
const timestamp = Date.now()
const [didUpdate, indices] = contextManager.applyContextOptimizations(messages, 2, timestamp)
expect(didUpdate).to.equal(true)
expect(indices.size).to.equal(2)
expect(indices.has(2)).to.equal(true)
expect(indices.has(4)).to.equal(true)
expect(indices.has(8)).to.equal(false)
})
})
describe("getTruncatedMessages", () => {
let contextManager: ContextManager
@@ -45,6 +45,7 @@ export async function getOrganizationCredits(
promptTokens: tx.promptTokens,
totalTokens: tx.totalTokens,
userId: tx.userId,
operation: tx.operation,
}),
) || [],
})
+5 -50
View File
@@ -35,7 +35,6 @@ import { getDistinctId } from "@/services/logging/distinctId"
import { telemetryService } from "@/services/telemetry"
import { getAxiosSettings } from "@/shared/net"
import { ShowMessageType } from "@/shared/proto/host/window"
import type { AuthState } from "@/shared/proto/index.cline"
import { getLatestAnnouncementId } from "@/utils/announcements"
import { getCwd, getDesktopDir } from "@/utils/path"
import { BannerService } from "../../services/banner/BannerService"
@@ -50,7 +49,6 @@ import {
import { fetchRemoteConfig } from "../storage/remote-config/fetch"
import { type PersistenceErrorEvent, StateManager } from "../storage/StateManager"
import { Task } from "../task"
import type { StreamingResponseHandler } from "./grpc-handler"
import { sendMcpMarketplaceCatalogEvent } from "./mcp/subscribeToMcpMarketplaceCatalog"
import { getClineOnboardingModels } from "./models/getClineOnboardingModels"
import { appendClineStealthModels } from "./models/refreshOpenRouterModels"
@@ -81,12 +79,6 @@ export class Controller {
// Flag to prevent duplicate cancellations from spam clicking
private cancelInProgress = false
// Shell integration warning tracker
private shellIntegrationWarningTracker: {
timestamps: number[]
lastSuggestionShown?: number
} = { timestamps: [] }
// Timer for periodic remote config fetching
private remoteConfigTimer?: NodeJS.Timeout
@@ -151,13 +143,6 @@ export class Controller {
this.ocaAuthService = OcaAuthService.initialize(this)
this.accountService = ClineAccountService.getInstance()
const authStatusHandler: StreamingResponseHandler<AuthState> = async (response, _isLast, _seqNumber): Promise<void> => {
if (response.user) {
fetchRemoteConfig(this)
}
}
this.authService.subscribeToAuthStatusUpdate(this, {}, authStatusHandler, undefined)
this.authService.restoreRefreshTokenAndRetrieveAuthInfo().then(() => {
this.startRemoteConfigTimer()
})
@@ -515,38 +500,6 @@ export class Controller {
}
}
/**
* Check if we should show the background terminal suggestion based on shell integration warning frequency
* @returns true if we should show the suggestion, false otherwise
*/
shouldShowBackgroundTerminalSuggestion(): boolean {
const oneHourAgo = Date.now() - 60 * 60 * 1000
// Clean old timestamps (older than 1 hour)
this.shellIntegrationWarningTracker.timestamps = this.shellIntegrationWarningTracker.timestamps.filter(
(ts) => ts > oneHourAgo,
)
// Add current warning
this.shellIntegrationWarningTracker.timestamps.push(Date.now())
// Check if we've shown suggestion recently (within last hour)
if (
this.shellIntegrationWarningTracker.lastSuggestionShown &&
Date.now() - this.shellIntegrationWarningTracker.lastSuggestionShown < 60 * 60 * 1000
) {
return false
}
// Show suggestion if 3+ warnings in last hour
if (this.shellIntegrationWarningTracker.timestamps.length >= 3) {
this.shellIntegrationWarningTracker.lastSuggestionShown = Date.now()
return true
}
return false
}
async handleAuthCallback(customToken: string, provider: string | null = null) {
try {
await this.authService.handleAuthCallback(customToken, provider ? provider : "google")
@@ -989,16 +942,18 @@ export class Controller {
user: this.stateManager.getGlobalStateKey("multiRootEnabled"),
featureFlag: true, // Multi-root workspace is now always enabled
},
hooksEnabled: {
user: this.stateManager.getGlobalStateKey("hooksEnabled"),
featureFlag: featureFlagsService.getHooksEnabled(),
clineWebToolsEnabled: {
user: this.stateManager.getGlobalSettingsKey("clineWebToolsEnabled"),
featureFlag: featureFlagsService.getWebtoolsEnabled(),
},
hooksEnabled: this.stateManager.getGlobalSettingsKey("hooksEnabled"),
lastDismissedInfoBannerVersion,
lastDismissedModelBannerVersion,
remoteConfigSettings: this.stateManager.getRemoteConfigSettings(),
lastDismissedCliBannerVersion,
subagentsEnabled,
nativeToolCallSetting: this.stateManager.getGlobalStateKey("nativeToolCallEnabled"),
enableParallelToolCalling: this.stateManager.getGlobalSettingsKey("enableParallelToolCalling"),
}
}

Some files were not shown because too many files have changed in this diff Show More