Files
cline-multi-mirror/cli
Daniel Steigman 3c1327b115 fix(cli): Fix config set overwriting all settings instead of merging (#6980)
* fix(cli): Fix config set overwriting all settings instead of merging

ENG-1115

This fix resolves the issue where 'cline config set' would overwrite all
settings instead of merging with existing values.

Changes:
1. CLI (cli/pkg/cli/config.go): Changed setCommand to use
   UpdateSettingsPartial() instead of UpdateSettings()

2. Server (src/core/controller/state/updateSettingsCli.ts): Added defensive
   checks for defaultTerminalProfile to prevent undefined errors

3. Added merge.go with proper settings merge logic

The fix follows git-style behavior where 'cline config set key=value'
merges with existing settings, preserving all other values.

Tested and verified:
- Setting max-requests to 999 works
- Setting edit-files-externally preserves max-requests
- Multiple successive config sets preserve all previous values

* fix: use optional proto bools to fix config set field overwrite

Root cause: Non-optional bool fields in AutoApprovalSettings proto were
transmitting zero values (false) even when not set by user, causing the
server-side merge to overwrite existing settings.

Solution: Made 'enabled' and 'enableNotifications' fields optional in proto,
matching the pattern used by AutoApprovalActions fields. This allows proper
server-side merge detection using 'field !== undefined' checks.

Changes:
- proto/cline/state.proto: Added optional keyword to two bool fields
- cli/pkg/cli/task/settings_parser.go: Use boolPtr() for optional fields
- cli/pkg/cli/task/manager.go: Fix UpdateTaskAutoApprovalAction to use boolPtr()
- Removed client-side merge logic (merge.go, UpdateSettingsPartial method)
- Simplified config.go to use UpdateSettings() directly

This approach is simpler and more maintainable than the previous client-side
merge solution, relying on the existing server-side merge logic that already
handles undefined values correctly.

* fix: Address celestial-vault feedback on proto optional fields

- Remove unnecessary error suppression in updateSettingsCli.ts
- Make max_requests optional in AutoApprovalSettings proto
- Update Go parser to use int32Ptr() for optional max_requests
- Remove hardcoded MaxRequests default in UpdateTaskAutoApprovalAction

This prevents the CLI from overwriting user-configured maxRequests values
and maintains consistency with other optional fields (enabled, enableNotifications).

* fix: Remove error suppression for missing terminal manager in updateSettingsCli

Addresses celestial-vault's feedback on ENG-1115 PR.

Previously, the check 'if (controller.task && controller.task.terminalManager)'
silently suppressed errors when a task existed but terminalManager was missing.

Now properly throws an error if task exists without terminalManager (error case),
while allowing terminal profile updates when no task is running (normal case).
2025-10-29 17:40:10 -07:00
..
2025-10-14 20:54:50 -07:00
2025-10-15 01:16:48 -07:00
2025-10-15 03:02:25 -07:00
2025-10-16 11:51:20 -07:00
2025-10-14 20:54:50 -07:00

Cline CLI

/_____/\ /_/\      /_______/\/__/\ /__/\ /_____/\
\:::__\/ \:\ \     \__.::._\/\::\_\\  \ \\::::_\/_
 \:\ \  __\:\ \       \::\ \  \:. `-\  \ \\:\/___/\
  \:\ \/_/\\:\ \____  _\::\ \__\:. _    \ \\::___\/_
   \:\_\ \ \\:\/___/\/__\::\__/\\. \`-\  \ \\:\____/\
    \_____\/ \_____\/\________\/ \__\/ \__\/ \_____\/

Autonomous coding agent CLI - capable of creating/editing files, running commands, using the browser, and more.

Installation

Install Cline globally using npm:

npm install -g cline

Usage

cline

This will start the Cline CLI interface where you can interact with the autonomous coding agent.

Features

  • Autonomous Coding: AI-powered code generation, editing, and refactoring
  • File Operations: Create, read, update, and delete files and directories
  • Command Execution: Run shell commands and scripts
  • Browser Automation: Interact with web pages and applications
  • Multi-Model Support: Works with Anthropic Claude, OpenAI GPT, and other AI models
  • MCP Integration: Extensible through Model Context Protocol servers
  • Project Understanding: Analyzes codebases to provide context-aware assistance

Requirements

  • Node.js 18.0.0 or higher
  • Supported platforms: macOS, Linux. Windows soon
  • Supported architectures: x64, arm64

Configuration

Cline can be configured through:

  • Environment variables
  • Configuration files
  • Command-line arguments

See the main documentation for detailed configuration options.

License

Apache-2.0 - see LICENSE for details.

Support