Cline Agent Rules

A coding agent available through a CLI, SDK, editor extension, and desktop app.

On this page

Overview

Cline's cloud-agent guide covers the CLI, editor extension, and desktop app. It says which processes start automatically, when compiled packages must be rebuilt, and which checks need a real GUI host.

Documents

├── 
├── apps
│   └── cli
│       └── 
├── sdk
│   ├── packages
│   │   └── llms
│   │       └── 
│   └── 
└── 

Patterns in this file

01

Explain the compiled boundary before running the CLI

SDK exports resolve to dist rather than source. The guide warns that editing SDK code requires both rebuilding and restarting, so a stale process is not mistaken for a failed implementation.

Source excerpt starting at line 11.
- SDK packages (`@cline/shared|llms|agents|core|sdk`) resolve each other through compiled `dist/` (their `exports` point only at `dist/`, with no `development` source condition). You **must** run `bun run build:sdk` after changing SDK dependencies/source before running the CLI or SDK tests, otherwise imports fail with missing `@cline/*` / missing `dist/` errors. Running processes do **not** hot-reload SDK source changes — rebuild and restart.\- Known cloud-env test artifact: `@cline/core` test `src/services/workspace/workspace-manifest.test.ts > readGitWorkspaceState > prefers origin and returns the current branch` fails because cloud VMs configure git `insteadOf` rules that rewrite GitHub remotes to `https://x-access-token:...@github.com/...`. This is an environment artifact, not a code bug.- Some `@cline/cli` e2e assertions (`bun -F @cline/cli test:e2e`) may fail on exact tool-listing string formats; treat as pre-existing test drift, not an environment problem.

02 / Pointing at the source of truth

Separate authentication from startup health

The CLI launches its hub automatically, but a real agent turn still needs provider credentials. The guide describes the unauthenticated behavior and points to the CLI README for configuration.

Source excerpt starting at line 8.
- An actual agent turn requires an **LLM provider credential**. With no credentials the default `cline` provider fails fast with an `Unauthorized` error and the interactive TUI shows a provider sign-in screen. Configure via `cline auth` or provider env vars (e.g. `ANTHROPIC_API_KEY`, `CLINE_API_KEY`, `OPENROUTER_API_KEY`); see `apps/cli/README.md`.

03

Distinguish classes of test failures

The file separately labels remote rewriting in cloud VMs and CLI output-format drift. These are specific explanations of recorded failures, rather than a general instruction to ignore failing tests.

Source excerpt starting at line 12.
- Known cloud-env test artifact: `@cline/core` test `src/services/workspace/workspace-manifest.test.ts > readGitWorkspaceState > prefers origin and returns the current branch` fails because cloud VMs configure git `insteadOf` rules that rewrite GitHub remotes to `https://x-access-token:...@github.com/...`. This is an environment artifact, not a code bug.- Some `@cline/cli` e2e assertions (`bun -F @cline/cli test:e2e`) may fail on exact tool-listing string formats; treat as pre-existing test drift, not an environment problem.

04 / Verification by change type

Identify which tests need an extension host

The extension guide distinguishes unit tests from integration and end-to-end tests that launch a real VS Code host. It lists the build and generated-code prerequisites alongside those commands.

Source excerpt starting at line 23.
- **Test:** `bun run test:unit` (bun-based, ~984 tests, no VS Code host needed). `bun run test:integration` (`@vscode/test-electron`, downloads a VS Code build, runs under the GUI libs) and `bun run test:e2e` (Playwright) exercise a real extension host — heavier, and the GUI libs for them are already installed.- One-time deps (already installed, listed here in case they must be recreated): ripgrep via `bun run download-ripgrep`; VS Code test GUI libs per `CONTRIBUTING.md` (`libnss3`, `libatk*`, `libgbm1`, `xvfb`, etc.).

Ideas for your repo

  1. Explain whether callers load source or compiled output.
  2. Document missing-credential behavior separately from process startup.
  3. Tie known test failures to specific causes and test names.
  4. Distinguish unit checks from tests that require a GUI application.
Sponsored byModem

Give your agents the whole story.

These instructions explain how to work in Cline. Modem shows your agents what customers said, who is affected, and what changed.

See how Modem works