Sidebar workbench for the local Kimi Code (KAP) service: stream any session turn by turn, approve or reject tool calls from the panel, send, steer and cancel runs, and read 5-hour and weekly quota. Also registers six kimi_* tools so the agent can hand work to Kimi and collect the answer. Its HTTP routes have no DSH access check, so a web page open in your browser could call them.
Install
# from a prebuilt release tarball
dsh plugin --profile web add -w "https://github.com/facadefish/dsh-use-kimi/releases/download/v0.2.2/dsh-use-kimi-0.2.2.tgz"
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:facadefish/dsh-use-kimi
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
dsh-use-kimi · Kimi Workbench
Bridge your local Kimi Code into DeepSeek Harness: a live sidebar panel plus six agent tools.
Real v0.2 screenshot; account nickname and quota numbers are masked.
One line: DSH plans and orchestrates, Kimi runs the long tasks. This plugin gives them one shared sidebar — see progress, gate risky tool calls, hand off work.
dsh-use-kimiis a DeepSeek Harness (DSH) plugin that connects to your local Kimi Code (KAP) service and turns it into a live panel with approvals, usage and six agent tools. The KAP token never leaves the DSH host process.
Contents
| Get started | Capabilities | Reference |
|---|---|---|
| WhyFeaturesQuick startSix tools | How it worksSecurityConfiguration | FAQLimitationsDocsRoadmap |
Why this plugin
DSH and Kimi Code are two pipelines that cannot see each other: one is your AI development environment, the other lives in a terminal.
That creates three daily annoyances:
- Window juggling — you cannot tell what Kimi is doing without switching back to the terminal.
- Broken approvals — Kimi pauses before writing a file or running a command, but you are inside DSH and never notice.
- Copy-paste handoffs — sending a DSH task to Kimi means copying the prompt, pasting it, then coming back for the result.
dsh-use-kimi folds all three into one panel:
| Before | With the plugin |
|---|---|
| Terminal ↔ DSH switching | Every turn visible in one sidebar |
| Approvals wait in the terminal | Approval card with tool target and countdown |
| Copy-paste prompts | One kimi_handoff call, result returned |
| Quota unknown until you hit the limit | 5-hour / 7-day usage and pressure tier, always visible |
Features
- Connection health — discovers the local KAP service (token + instance files), starts
kimi webwhen needed, flips to "offline" within seconds and reconnects automatically. - Session list — recent sessions, activity, last outcome, pending-approval markers; search by title/cwd and load more.
- Live timeline — KAP WebSocket frames are relayed over same-origin SSE; reasoning, tool calls and text stream token by token, with scroll anchoring that respects your reading.
- Approval cards —
manualsessions park file writes and commands. The card shows the tool, target path/command and a per-second countdown. Approve / reject / cancel only update after the server acknowledges; failures stay on the card with a refresh action — no fake success. - Usage & models — 5-hour and 7-day windows, reset times, pressure tier (ample / normal / tight / critical) and model suggestions from
/oauth/usage; cross-checks withkap.mjs usage --json. - Send / steer / stop / create — chat from the panel. Drafts are per-session, failed sends keep the text and offer retry, Enter sends when idle and steers while a turn is running.
- Six tools — callable by any DSH agent, see below.
Quick start
Requirements
- Kimi Code ≥ 2.7, signed in (anything that can run
kimi web). - DeepSeek Harness installed, Web UI reachable (default
http://127.0.0.1:3080). - Node.js ≥ 20 (the one bundled with DSH is fine).
Install
Option A — let DSH install it (recommended)
- Clone the repository, e.g.
~/dsh-use-kimi:git clone https://github.com/facadefish/dsh-use-kimi.git - Enable Full access in DSH (installing a plugin writes to the profile).
- Tell DSH: install the directory
~/dsh-use-kimiwithplugin_manager'sinstall_bundle.
Option B — use the UI
- DSH sidebar → Plugins → Add plugin → pick this directory.
- Confirm Kimi Workbench / dsh-use-kimi appears and is enabled.
Option C — install from npm (no clone)
- Add the package to your DSH profile (
webby default — use your own):dsh plugin --profile web add dsh-use-kimi - Restart DSH, or confirm Kimi Workbench / dsh-use-kimi is enabled in the plugin manager.
You can also open Plugins → Discover in DSH and install
dsh-use-kimiwith one click once the marketplace entry is live.
No restart needed. A Workbench entry shows up under the sidebar's global panels.
First run
- Open Workbench from the sidebar.
- The first open discovers KAP; if it is not running and auto-start is on, the plugin spawns
kimi web --host 127.0.0.1 --port 0 --no-open --log-level error. - "Online · live" in the header means connected; recent sessions appear on the left.
- To try approvals: create a manual session, ask it to write a file, and the approval card appears. Reject it — the file is never written.
No Kimi environment? The panel shows "offline" and explains why (token not found / no instance). That is expected behaviour, not an installation failure.
Six tools
| Tool | Purpose |
|---|---|
kimi_usage |
Account, quota ratios and reset times, pressure tier, model suggestions |
kimi_status |
Session activity, pending approvals, latest turn summary |
kimi_send |
Send a prompt to an existing session (optionally wait) |
kimi_handoff |
Create a session + send a task (manual approval by default), optionally wait for the final answer |
kimi_approve |
Answer an approval request (approved / rejected / cancelled) |
kimi_cancel |
Stop the current turn (optionally cancel background tasks) |
Example:
You: Ask Kimi to split the logs under scripts/ by day — plan first, don't touch files.
DSH: → kimi_handoff({ text: "Split logs under scripts/ by day. Plan first.", permissionMode: "manual" })
→ Session created; Kimi requests a file write; the panel shows an approval card.
You: (click "Approve" in the panel)
DSH: → follow up with kimi_status or the timeline
How it works
┌──────────────────────────── DSH host (Node process) ─────────────────────────┐
│ lib/kap.js discovers/starts KAP, holds server.token, wraps REST │
│ lib/ws.js minimal RFC6455 client (KAP WS requires an Authorization hdr)│
│ lib/hub.js connection state, session cache, single-session subscription │
│ lib/routes.js /kimi/api/* (state / events / sessions / timeline / actions) │
│ lib/tools.js the six kimi_* tools │
└───────────────┬──────────────────────────────────────────────┬───────────────┘
│ REST + WebSocket (loopback only) │ SSE (same origin)
▼ ▼
Kimi Code KAP service (random loopback port) React panel in DSH
sidebar entry + main panel
- Credentials stay in the host — the token is read only in Node; the browser talks to same-origin
/kimi/api/*. - Per-session subscription — KAP's WebSocket subscribes per session; the plugin watches one session at a time and re-subscribes on switch.
- Approval round-trip — approve/reject goes back through KAP
interactions; the card updates only after the server confirms.
Security boundary
- Token never leaves the host —
~/.kimi-code/server.tokenis read only bylib/kap.js; the client bundle,/kimi/api/state, SSE, the DOM and web storage never contain it. - Same-origin only — requests carrying a foreign
Originget403 cross-origin request rejected. - Approvals are real — rejecting truly prevents tool execution; the plugin does not cache fake success.
- No profile edits — the plugin does not modify the DSH profile's
package.json/cordis.patch.yml; installation is handled by DSH. - Zero third-party dependencies — both halves use only runtime built-ins, which keeps auditing and offline install simple.
Configuration
Settings live in ~/.dsh/dsh-use-kimi/settings.json (the v0.1 path ~/.dsh/kimi-bridge/ is still read once; the next save writes the new one):
{
"autoStart": true,
"defaultModel": "",
"defaultPermissionMode": "manual",
"defaultCwd": "",
"pollMs": 5000,
"kimiBin": ""
}
| Field | Meaning |
|---|---|
autoStart |
Spawn kimi web when no KAP instance is found |
defaultModel |
Default model for new sessions (empty = KAP default) |
defaultPermissionMode |
manual / auto / yolo |
defaultCwd |
Default working directory (empty = current DSH session) |
pollMs |
Session list poll interval (1000–60000) |
kimiBin |
Path to kimi (empty = auto-detect) |
FAQ
Do I need Kimi Code installed? Yes. The plugin talks to a local KAP service; it does not bundle a model or proxy your login. Without Kimi you can still read the docs and screenshots, but the panel shows "offline".
How is this different from using kimi in a terminal?
A terminal is one session at a time. The plugin puts Kimi inside DSH: multiple sessions visible, approvals in the UI, and tools that let another agent hand work over. They coexist — messages sent from the terminal show up in the panel.
Can the frontend see the token? No. The client only receives sessions, usage, timeline and settings; the token stays in host memory. The repository contains no token.
Why does an approval card not always appear?
Only manual sessions park tool calls. auto / yolo sessions execute by design, and one-shot ACP subagents auto-approve according to their config.
Does it work on Windows, macOS and Linux?
The plugin runs wherever DSH runs; it works as long as that machine can run kimi web.
The panel says "connecting" forever.
Check that the plugin is enabled, then open http://127.0.0.1:3080/kimi/api/state: JSON means the host half is loaded; 404 means it is not. If status is offline, verify kimi web can start manually.
Why is the session list not live? The session you are viewing is live over SSE; the list is polled every 5 seconds to avoid extra load on KAP.
Does it collect data? No. It only talks to your local KAP service — no telemetry, no external reporting.
Known limitations (v0.2)
- One session is subscribed at a time: KAP's WS subscribes per session, and
item/turnframes do not carry a session id. - The session list is polled (5 s by default), not a full event mirror.
- Images and attachments are not rendered; text only.
- Not implemented: export, fork, archive, multi-instance, remote instances, desktop notifications, one-click digest.
- Kimi enforces a concurrency limit;
403 provider.auth_errorsurfaces as a notice, not a plugin bug.
Roadmap
- v0.1 — discovery, session list, live timeline, approvals, usage, six tools
- v0.2 — P0 trust fixes, search/pagination, load earlier turns, first-load states, read-only offline snapshot
- v0.2.1 — terminology unified, settings directory migrated, published to npm and the DSH plugin marketplace
- Parallel multi-session subscriptions (blocked on KAP frame session ids)
- Attachment and image previews
Documentation
| Document | Audience |
|---|---|
| Guide (HTML, Chinese) | First contact: analogies, numbered steps, wireframes, self-check quiz, acceptance log |
| Plugin details | DSH users: connection, panel, approval boundaries, limitations |
| Architecture | Contributors: layout, modules, extension points |
| Changelog | Everyone: what changed per release |
| Contributing | Anyone filing issues or PRs |
Project layout
dsh-use-kimi/
├── index.js # Host entry: create Hub, register routes and tools
├── client.js # Client entry: sidebar entry + main panel (React, no build)
├── lib/
│ ├── kap.js # KAP discovery, spawn, REST wrapper
│ ├── ws.js # minimal RFC6455 client (KAP WS needs the auth header)
│ ├── hub.js # connection state, session cache, SSE broadcast, actions
│ ├── routes.js # /kimi/api/* routes (including SSE)
│ ├── tools.js # the six kimi_* tools
│ └── settings.js # settings read/write
├── locale/{zh,en}.json # marketplace display copy
├── docs/ # details, guide, architecture, screenshots
├── cordis.patch.yml # DSH bundle entry
└── icon.svg
Development
There is no build step: DSH's module loader loads client.js directly — source is the artifact.
# syntax checks (no dependencies)
node --check index.js
for f in lib/*.js; do node --check "$f"; done
node -e "new Function(require('fs').readFileSync('client.js','utf8'))"
After changing host code, disable and re-enable the plugin to hot-reload; editing client.js triggers DSH's client HMR.
See docs/ARCHITECTURE.md for module responsibilities and extension points.
Contributing
Issues and PRs are welcome — start with CONTRIBUTING.md. If this plugin saves you a few window switches, a star is the simplest way to support it.
License
MIT © facadefish
Related
- DeepSeek Harness — the host
- Kimi Code — KAP service and CLI
- awesome-dsh-plugin — curated DSH plugins
Links
More in this category
Tencent/WeKnora#dsh-weknora★ 38608
Four read-only tools over a WeKnora knowledge base: list knowledge bases, hybrid passage search, reassemble one document's chunks in order, and WeKnora's own cited RAG or ReAct-agent answer with a resumable session id.
DayuanJiang/next-ai-draw-io#dsh-plugin★ 37289
Draws draw.io diagrams in DeepSeek Harness through the next-ai-drawio MCP server: the link in the reply opens a live preview in the right sidebar, you can edit the diagram by hand, and each AI change is a version you can restore. Node.js 18+; npx downloads the MCP server on first use.
yikart/AiToEarn#dsh-plugin-aitoearn★ 28947
Generate copy, images and short videos, and publish with one click to Douyin, Kuaishou, Xiaohongshu, WeChat Official, Bilibili, Facebook, TikTok and more, covering the full content lifecycle from creation to publishing and monetization.
superdesigndev/treg★ 10049
Tool catalog for agents: search ~2,600 external endpoints (SEO and SERP, backlinks, social, people and company enrichment, ad libraries, scraping) by the task you want done, read each one's parameters and per-call price, then call it with the credential injected server-side. Ships the skill plus an MCP row that stays disabled until TREG_TOKEN is set.
T-Auto/dsh-ops★ 6112
Provides bash, PowerShell 7, and high-performance Rust tools for DSH on Windows to reduce token usage.
Hithink-Tech-Org/Financial-API#hithink-finance★ 4761
Query Hithink Finance data in DeepSeek Harness, view charts in chat, and save refreshable dashboards.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.