Files
cline/.github/copilot-instructions.md
T
Saoud Rizwan 1f5e2086a1 chore: remove legacy cli/ source and adjacent dead glue (#10658)
* chore: remove legacy cli/ source and direct references

The legacy React Ink CLI in cli/ has been superseded by the new SDK
CLI at sdk/apps/cli/ (published as cline@nightly today, taking over
the cline npm package on the next latest cut).

This commit deletes the cli/ source tree (~9.5MB, 142 files) and the
remaining references that point at it:
- .clinerules/cli.md (the per-area tribal-knowledge file for working
  in cli/)
- package.json workspaces: drop the "cli" entry (root no longer
  publishes a workspace from there)
- package.json coverage excludes: drop the stale **/evals/cli/**
  paths (the directory does not exist)
- tsconfig.json: drop "cli/src/**/*" from the include list so the
  root typecheck stops trying to walk into a missing tree
- .github/copilot-instructions.md: drop the CLI architecture bullet
  and the cli/src/components/ModelPicker.tsx mention from the
  add-API-provider checklist

Intentionally left alone:
- .claude/hooks/claude-code-for-web-setup.sh references
  github.com/cli/cli (the gh CLI), not our deleted cli/
- src/core/locks/SqliteLockManager.ts comments mention
  cli/pkg/common/schema.go which is the Go-based cline-core schema,
  a different component
- .github/workflows/cline-evals-regression.yml is already disabled
  pending rewire at the new SDK CLI

* chore: remove orphaned legacy CLI distribution scripts

With cli/ gone, the public-install path (curl | bash → install.sh →
download CLI binaries from cline/cline GitHub releases) and the
enterprise endpoint-bundling helpers no longer have anything to
install or bundle:

- scripts/install.sh — curl-bash installer that downloaded the old
  CLI binary from cline/cline GH releases. The new install path is
  npm i -g cline.
- scripts/test-install.sh — only tested install.sh.
- scripts/test-bundled-endpoints.sh — built a VSIX *and* CLI tgz with
  bundled staging endpoints for enterprise distribution. The CLI half
  is dead; the VSIX half can be done with vsce + add-endpoints-to-vsix.sh
  directly. The script as a whole was niche test infra, not production.
- scripts/add-endpoints-to-npm.sh — injected endpoints.json into the
  old CLI's npm tarball. Companion add-endpoints-to-vsix.sh and
  add-endpoints-to-jetbrains.sh stay (they target the extension and
  JetBrains plugin).
- package.json: drop the orphaned `test:install` root script that
  wrapped scripts/test-install.sh.

If install.cline.bot (or any public URL) was still serving
scripts/install.sh as a curl|bash target, that URL will 404 after
this lands. Worth checking and either redirecting or stubbing with
a `npm i -g cline` hint.

* chore: clean up legacy CLI references

* chore: disable legacy smoke eval workflow

* Revert "chore: disable legacy smoke eval workflow"

This reverts commit 193ee78718.

* chore: remove disabled smoke eval workflow

* docs: clarify disabled smoke eval CI
2026-05-13 22:13:58 -07:00

3.7 KiB

Copilot Instructions for Cline

This is a VS Code extension. Read .clinerules/general.md for tribal knowledge and nuanced patterns.

Architecture

  • Core (src/): extension.tsWebviewProviderController (single source of truth) → Task (agent loop).
  • Webview (webview-ui/): React/Vite app. State via ExtensionStateContext.tsx, synced through message passing.
  • Communication: Protobuf-defined gRPC-like protocol over VS Code message passing. Schemas in proto/.
  • MCP: src/services/mcp/McpHub.ts.

Build & Test (Critical — non-obvious commands)

  • Build: npm run compile — NOT npm run build.
  • Watch: npm run watch (extension + webview).
  • Protos: npm run protos — run immediately after any .proto change. Generates into src/shared/proto/, src/generated/.
  • Tests: npm run test:unit. After prompt/tool changes: UPDATE_SNAPSHOTS=true npm run test:unit.

Protobuf RPC Workflow (4 steps)

  1. Define in proto/cline/*.proto. Naming: PascalCaseService, camelCase RPCs, PascalCase Messages. Use common.proto shared types for simple data.
  2. Generate: npm run protos.
  3. Backend handler: src/core/controller/<domain>/.
  4. Frontend call: UiServiceClient.myMethod(Request.create({...})).
  • Adding enums (e.g. ClineSay) → also update src/shared/proto-conversions/cline-message.ts.

Adding API Providers (silent failure risk)

Three proto conversion updates are required or the provider silently resets to Anthropic:

  1. proto/cline/models.proto — add to ApiProvider enum.
  2. convertApiProviderToProto() in src/shared/proto-conversions/models/api-configuration-conversion.ts.
  3. convertProtoToApiProvider() in the same file.

Also update: src/shared/api.ts, src/shared/providers/providers.json, src/core/api/index.ts, webview-ui/.../providerUtils.ts, webview-ui/.../validate.ts, webview-ui/.../ApiOptions.tsx.

For Responses API providers: add to isNextGenModelProvider() in src/utils/model-utils.ts and set apiFormat: ApiFormat.OPENAI_RESPONSES on models.

Adding Tools to System Prompt (5+ file chain)

  1. Add enum to ClineDefaultTool in src/shared/tools.ts.
  2. Create definition in src/core/prompts/system-prompt/tools/ (export [GENERIC] minimum).
  3. Register in src/core/prompts/system-prompt/tools/init.ts.
  4. Whitelist in src/core/prompts/system-prompt/variants/*/config.ts for each model family.
  5. Handler in src/core/task/tools/handlers/, wire in ToolExecutor.ts.
  6. If tool has UI: add ClineSay enum in proto → ExtensionMessage.tscline-message.tsChatRow.tsx.
  7. Regenerate snapshots: UPDATE_SNAPSHOTS=true npm run test:unit.

Modifying System Prompt

Modular: components/ (shared) + variants/ (model-specific) + templates/ ({{PLACEHOLDER}}). Variants override components via componentOverrides in config.ts or custom template.ts. XS variant is heavily condensed inline. Always regenerate snapshots after changes.

Global State Keys (silent failure risk)

Adding a key requires: type in src/shared/storage/state-keys.ts, read via context.globalState.get() in src/core/storage/utils/state-helpers.ts readGlobalStateFromDisk(), and add to return object. Missing the .get() call compiles fine but value is always undefined.

Slash Commands (3 places)

  • src/core/slash-commands/index.ts — definitions.
  • src/core/prompts/commands.ts — system prompt integration.
  • webview-ui/src/utils/slash-commands.ts — webview autocomplete.

Conventions

  • Paths: Always use src/utils/path helpers (toPosixString) for cross-platform compatibility.
  • Logging: src/shared/services/Logger.ts.
  • Feature flags: See PR #7566 as reference pattern.