mirror of
https://github.com/cline/cline.git
synced 2026-08-28 19:48:08 +08:00
359e771ab3
* docs: add Cursor Cloud dev environment setup notes (AGENTS.md) * docs: document VS Code extension + desktop app dev setup (AGENTS.md) * docs: trim AGENTS.md cloud agent instructions --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com>
5.2 KiB
5.2 KiB
This is the Cline monorepo. Toolchain is Bun 1.3.13 (package manager + task runner) with Node >=22 as the runtime. Do not use npm/yarn/pnpm.
Cloud Agent Instructions
Cline CLI
- Run from source:
bun run cli(interactive:bun run cli -i; one-shot: append a prompt). This resolves toapps/cliand auto-spawns the@cline/cline-hubdaemon — you do not start the hub separately. - Inspect local health with
bun run cli doctor;bun run cli versionprints the version. - An actual agent turn requires an LLM provider credential. With no credentials the default
clineprovider fails fast with anUnauthorizederror and the interactive TUI shows a provider sign-in screen. Configure viacline author provider env vars (e.g.ANTHROPIC_API_KEY,CLINE_API_KEY,OPENROUTER_API_KEY); seeapps/cli/README.md.
Build / Lint / test
- SDK packages (
@cline/shared|llms|agents|core|sdk) resolve each other through compileddist/(theirexportspoint only atdist/, with nodevelopmentsource condition). You must runbun run build:sdkafter changing SDK dependencies/source before running the CLI or SDK tests, otherwise imports fail with missing@cline/*/ missingdist/errors. Running processes do not hot-reload SDK source changes — rebuild and restart.\ - Known cloud-env test artifact:
@cline/coretestsrc/services/workspace/workspace-manifest.test.ts > readGitWorkspaceState > prefers origin and returns the current branchfails because cloud VMs configure gitinsteadOfrules that rewrite GitHub remotes tohttps://x-access-token:...@github.com/.... This is an environment artifact, not a code bug. - Some
@cline/clie2e 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.
GUI display
- A virtual X display is live at
DISPLAY=:1(the same desktop used for screenshots). GUI apps (VS Code, the Tauri desktop window) launched withDISPLAY=:1render there and can be screenshotted — no need to start your ownxvfb. Prefer starting long-running GUI/dev processes in atmuxsession (see the tmux guidance) so they survive.
VS Code extension (apps/vscode, package claude-dev)
Toolchain is pre-installed and persisted in the VM: generated gRPC/proto code, the bundled ripgrep binaries (apps/vscode/bin/), the built webview (webview-ui/build), the esbuild bundle (dist/extension.js), VS Code itself (/usr/bin/code), and the GUI system libraries its tests need.
- Codegen prerequisite:
bun run protos(fromapps/vscode) regeneratessrc/generated/*and the webview grpc client. Thedev,build:webview, andcheck-typesscripts already run it, so proto changes are picked up by those commands; run it manually only if you edit.protofiles without a full build. - Build:
bun run build:webview(webview UI, ~15s) thenbun esbuild.mjs(extension bundle).bun run packagedoes the full production build. - Run it (dev host):
DISPLAY=:1 code --no-sandbox --user-data-dir=/tmp/vscode-userdata --extensionDevelopmentPath=/workspace/apps/vscode <some-folder>, then click the Cline icon in the Activity Bar to open the webview. (--no-sandboxis required in this container.) - 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) andbun 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 perCONTRIBUTING.md(libnss3,libatk*,libgbm1,xvfb, etc.).
Desktop app (apps/examples/desktop-app, package @cline/code)
A Tauri v2 (Rust) shell + Next.js webview + a Bun "sidecar" backend. Rust and the Tauri Linux system libs are pre-installed and persisted.
- Headless (no Rust/window): run the backend and UI separately —
bun run dev:sidecar(Bun backend on127.0.0.1:3126, servesws://.../transport) andbun run dev:web(Next.js UI onhttp://localhost:3125). - Native window:
bun run dev(tauri dev) — itsbeforeDevCommandbuilds the sidecar binary and startsdev:web(:3125), then Rustmain.rsspawns the sidecar; so free ports3125/3126first. Launch withDISPLAY=:1to see the window. AlibEGL: DRI3 errorwarning is benign (software rendering) — the WebKitGTK window still renders. - Rust version caveat: the crate graph needs Cargo's
edition2024feature, so Rust ≥1.85 is required (the VM's base 1.83 fails with "featureedition2024is required"). The toolchain here was updated viarustup default stable(currently 1.97). Firstcargobuild downloads/compiles the full Tauri crate graph (a few minutes); subsequent builds are cached. - System libs (already installed):
libwebkit2gtk-4.1-dev,libgtk-3-dev,libayatana-appindicator3-dev,librsvg2-dev,libxdo-dev,libssl-dev,build-essential. - Test/typecheck:
bun run typecheck,bun run test:chat-ui(Vitest). Both triggerbuild:uifirst.