Luban

A side-bar coding agent for VS Code and VSCodium. Describe what you want — it edits files in your workspace, runs a script or the build to verify, then tells you what changed. No patched editor, no takeover of the native chat: a normal extension that installs from the Marketplace.
中文简介:装在侧边栏里的编码 agent。说人话 → 它改文件、跑命令、自己验证,然后告诉你改了什么。零源码补丁,可从 VS Code 市场 / Open VSX / VSIX 安装,也能用脚本装成 App 的内置扩展。完整中文说明 →


Highlights
- Plan first, execute after you approve — Plan mode is read-only by construction (write tools are not registered, commands are checked). The plan is saved as a Markdown file you can edit; executing it re-reads that file. You can also pick a Cursor plan (
~/.cursor/plans/*.plan.md) from the command palette and execute it with Luban.
- Review in the editor, not in chat — every write opens a real diff: accept or reject hunk by hunk from CodeLens or the diff title bar.
- Context without ceremony —
@file, @folder/, #selection, or right-click a file or folder in the Explorer → Add File / Folder to Luban Chat (drops the token into the current chat) or Add File / Folder to Luban New Chat (opens a fresh session first, then inserts the token and focuses the input); select code in the editor and it shows Add to Chat / Add to New Chat right above the selection (CodeLens), or right-click Add Selection to Luban Chat (or Cmd/Ctrl+Alt+A) to drop a #selection path:start-end token that carries its own position, so several selections can stack, or Add Selection to Luban New Chat to open a fresh session first, then insert the token and focus the input; plus automatic context from the editor around your cursor; a local BM25 index backs search_code, with glob for filenames and grep for regex.
- Real edits, reversible —
write_file / replace_in_file / apply_patch (multi-file add/update/delete), plus delete_file / move_file; every change lands in REVIEW with per-hunk accept/undo, and read_lints lets the agent see type/syntax errors right after writing.
- Any OpenAI-compatible provider — DeepSeek, Ollama, llama.cpp, vLLM and friends via
~/.luban/providers.json. API keys go to SecretStorage, never to disk.
- Sessions that survive a reload — history on disk, several concurrent tabs, a message queue while a turn is running, opt-in multi-turn memory. Sent prompts can be edited in place (
✎): pressing Send truncates everything after it and reruns the turn with the edited text. The history popup has a search box: titles filter as you type, 2+ characters also scan message text, tool results and file references.
- Built for cheap multi-turn — message layout is aligned to token prefix caching (typically 95%+ cache hits after the second turn); each turn shows input / output / cache / context usage, and a local ledger feeds a token dashboard.
- Extensible — local stdio MCP servers,
SKILL.md skills and in-process plugins join the same tool loop; Plan mode only sees tools declared read-only.
- Plugins without a protocol — drop a
plugin.json + index.js into ~/.luban/plugins or <workspace>/.luban/plugins and its tools show up as pl__<plugin>__<tool> (off by default via luban.plugins.enabled; they run in-process, so the first load and any content change ask for confirmation).
- Cloud backup over WebDAV — its own ☁ Backup tab in the settings panel (next to General / Settings / Usage) takes a server URL, username and app password (the password lives in SecretStorage, never on disk) and uploads sessions, image attachments, plans, provider config and
mcp.json to your own WebDAV server. You can inspect the remote manifest and restore by sha1 diff; files about to be overwritten are snapshotted into ~/.luban/backups/ first, and providers.json is merged rather than replaced (API keys never come back from the remote side).
- Optional real-browser view —
browser drives a local headless Chrome/Edge over CDP (open, accessibility snapshot, screenshot, console, failed requests; plus click / type / scroll to drive the page in Agent mode — not available in Plan mode, first use asks for confirmation). Off by default via luban.browser.enabled; screenshots are only visible to models with vision enabled.
- Optional desktop control (macOS and Windows) —
computer screenshots the real screen, reads on-screen text via OCR (macOS; on Windows it falls back to viewing the screenshot), lists windows, and can click / double-click / drag / scroll / type / send key combos. Off by default via luban.computer.enabled; the first action that touches mouse or keyboard asks for confirmation; unavailable in Plan mode; models without vision automatically fall back to OCR text.
- Optional tab completion — DeepSeek FIM completion, off by default.
- Status-bar light — one line in the status bar:
(o.o) run_command npm test. The little carpenter's ASCII face plus what the agent is doing right now (thinking / writing / running a tool / waiting / done / error) — the same face you see in the terminal. Hover for the full picture of this turn, click to open the panel, and it falls asleep (-_-) when idle for a while. Turn it off with luban.statusBar.enabled.
CLI
This package also ships the luban command — a headless entry point that reuses the extension's agent tool loop (same ~/.luban/providers.json config).
npm i -g @luban-code/luban-code
luban --plan "调研 src/ 的目录结构并给出重构建议" # read-only plan (default)
luban --agent --apply "新建 utils.js 并写测试" # full agent with writes
luban # interactive multi-turn (TTY)
With --apply, every write shows a unified diff and asks before touching disk (--yes skips the prompt). In interactive mode, Enter sends, Ctrl-J / Alt+Enter inserts a newline, / completes commands, @ completes workspace paths, and Esc cancels the running turn. Run luban --help for all flags (--model, --root, --json, --max-rounds, …).
Plugins install from the registry (registry/registry.json; sources live in eppen/luban-plugins):
luban plugin list # entries: signature, review status, permissions
luban plugin add demo --dry-run # verify only, nothing written
luban plugin add demo # verify signature → check review → fetch tag → check sourceSha256 → install
luban plugin remove demo # moves it to the trash, restorable
Skills (type: "skill" entries: plain SKILL.md, no code, no permission prompt):
luban skill list # only skill entries
luban skill add changelog-draft # → ~/.luban/skills/changelog-draft (visible on the next turn)
luban skill remove changelog-draft # moves it to ~/.luban/skills-trash, restorable
Install never auto-trusts: after enabling luban.plugins.enabled, the first load lists the tools and asks once more, and any content change asks again. The registry shipped with the package is the default; override with --registry <path|URL> or LUBAN_REGISTRY (mirror / local entries).
Install
| Where |
How |
| VS Code |
Extensions panel → search Luban → install, or use the Marketplace page |
| VSCodium / Open VSX |
Extensions panel → search Luban → install |
| VSIX |
Download luban-v*.vsix from Releases, then ⋯ → Install from VSIX… |
| Built-in extension |
./install-into-vscodium.sh — installs Luban as an app-level extension (VSCodium only, re-run after every app upgrade) |
Requirements: VS Code / VSCodium 1.100+, plus at least one provider (a remote one needs an API key; a loopback endpoint such as Ollama / llama.cpp / vLLM runs without one).
Quick start
- Configure a provider — click ⚙ at the bottom of the panel (or run
Provider settings), fill in base URL, models and API key, then hit Test connection.
- Open the panel — Luban icon in the activity bar, or
Cmd+Shift+L.
- Ask for something — e.g.
新建 utils.js,导出 debounce(fn, ms) 和 throttle(fn, ms),然后用 node 测一下两者行为.
Editing ~/.luban/providers.json by hand works too (run Reload providers.json after):
{
"defaultModel": "deepseek::deepseek-flash",
"providers": [
{
"id": "deepseek",
"name": "DeepSeek",
"baseUrl": "https://api.deepseek.com/v1",
"apiKeyEnv": "DEEPSEEK_API_KEY",
"models": [
{ "id": "deepseek-flash", "name": "DeepSeek Flash",
"maxInputTokens": 65536, "maxOutputTokens": 8192, "toolCalling": true }
]
}
]
}
Modes
| Mode |
What it can do |
| Agent |
Read / write files and run commands, then verify the result. |
| Plan |
Read-only investigation; produces a plan file and touches nothing until you press Execute. |
| Chat |
Plain Q&A, no file access. Add @web to search first. |
Luban models in the VS Code Chat / Agents window
VS Code's standalone Agents window (and the sidebar Chat view) only lists models registered through
vscode.lm — an extension's own webview cannot appear there. Luban registers every model from
providers.json as a language model provider (vendor luban), so the same endpoint can be used from
that window:
- Reload the window after installing the extension.
- Chat / Agents window → model picker → Manage Models… → Luban → tick the models you want.
- Pick “«model» · Luban”.
The tool loop, edits and terminal in that window are VS Code's own; Luban's sidebar, sessions and
per-hunk review are not involved. See configuration.
Documentation
The Marketplace only renders this page, so the details live on GitHub:
|
|
| Usage and features |
Shortcuts, three modes, plan files, @ # references, web search |
| Tools, MCP and skills |
Every built-in tool, stdio MCP servers, SKILL.md |
| Reviewing changes |
Editor diff, per-hunk accept / reject |
| Sessions and memory |
History layout, tabs, multi-turn memory, message queue |
| How it works |
Request flow, tool-loop budgets, prefix caching, usage, dashboard |
| Configuration |
Provider panel, providers.json, all settings, code layout |
| Known limitations |
What is deliberately not supported |
| Troubleshooting |
Symptom → cause → fix |
| Verification |
Test results per release |
| Debugging and release |
Headless op channel, release pipeline |
| Changelog |
Per-version changes |
Safety
run_command executes in your own shell — there is no OS-level sandbox. Plan mode adds a heuristic read-only check on commands, and file tools may touch paths outside the workspace (luban.fs.allowOutsideWorkspace=false restricts them). MCP servers run as child processes with your user's permissions: only configure servers you trust. Local plugins are even closer to home — they are required into the extension process, gated only by "off by default + confirm on first load + confirm again when the plugin's contents change". See known limitations.
License
Apache-2.0 © 2026 eppen (liuhualiang). See LICENSE and NOTICE.
The Luban name and icon are not licensed under Apache-2.0.
| |