WEIPING_WHALE CLI
A small terminal coding agent for DeepSeek: edits arrive as patches, and a snapshot before each turn allows undo.
- 131 ★ on the repository
- Last commit
- MIT
Broad access
Why this level
- Runs shell commands with the user's permissions: an approved command is not sandboxed.
- Writes files into the workspace and keeps a hidden snapshot git repository in `~/.weiping-whale`.
Install
- Works in
Manual install
git clone https://github.com/appleweiping/WEIPING_WHALE.git && cd WEIPING_WHALE && npm ci && npm linkNo npm package. Requires Node.js 22.18 or newer and git. Keyless check: `npm run demo`.
Access and checks
How we reviewBroad accessThe tool can change data, run commands or handle secrets.
- Runs shell commands with the user's permissions: an approved command is not sandboxed.
- Writes files into the workspace and keeps a hidden snapshot git repository in `~/.weiping-whale`.
This is third-party code. Review the repository files before installing.
What it does
WEIPING_WHALE reads a repository, runs commands only after confirmation and proposes edits as patches that you apply with `/apply`. Before and after each turn the workspace is committed to a separate git repository under `~/.weiping-whale`, so `/undo` rolls back one turn without touching your own `.git`. A session also has conversation fork and backtrack, history compaction, cost tracking that prices cache hits separately, auto-routing between the flash and pro models by keywords, sub-agents, MCP servers through the official SDK and LSP diagnostics after edits. The project ports the CodeWhale architecture to TypeScript, and the source runs to about 8,500 lines.
Who it is for. Developers who want to read and change a coding-agent loop.
Good fit when
- You want to study how an agent loop, snapshots and an approval queue work in about 8,500 lines of code.
- You need a terminal agent on DeepSeek with the cost of each turn in the footer.
- Every edit must be reviewed as a patch before it lands, and any turn must be undoable.
- You want to try connecting MCP servers to a small TypeScript agent.
Not a fit when
- You need a production agent with OS-level sandboxing: the author points to CodeWhale, Aider or vendor CLIs.
- You need an npm install: the package is not published there and is installed from a clone.
- You need other providers' models: endpoints set through `base_url` are untested.
Example request
Find out why test.mjs fails, prepare a patch and show it to me before applying.Limitations
Shell protection rests on approval prompts and regex lists. There is no OS sandbox, and an approved command runs with your permissions. The client targets the OpenAI-compatible DeepSeek chat API, other endpoints are untested, and the prices in `src/cost.ts` will drift, so override them with a `[pricing]` block in the config. LSP diagnostics cover TypeScript, JavaScript and Python when language servers are installed. The demo and tests prove the plumbing, not the quality of the model's edits. Node.js 22.18 or newer and git are required.
How to disable. Delete the clone and unlink: `npm unlink` removes the `wwhale` and `weiping-whale` commands from PATH. Session and snapshot data live in `~/.weiping-whale` and can be deleted.
FAQ
How do I install WEIPING_WHALE?
There is no npm package: clone the repository, run `npm ci`, then `npm link`, and the `wwhale` and `weiping-whale` commands appear. Node.js 22.18 or newer and git are required.
How do I undo a bad turn?
`/undo` restores the workspace to the snapshot taken before the last turn. Snapshots live in a separate git repository, so your own `.git` stays untouched. `/snapshots` lists them.
How is WEIPING_WHALE different from CodeWhale?
It is a small TypeScript port of the CodeWhale design, meant for reading and study. The author recommends CodeWhale itself when you need a working agent with OS sandboxing and more providers.
Do I need a DeepSeek key to try it?
No, `npm run demo` starts a fake DeepSeek endpoint with scripted replies and replays a session. For real work set DEEPSEEK_API_KEY.
Which shell commands are blocked?
Broad recursive deletes, disk and shutdown commands are always blocked. Deletes, moves, redirections, package installs, force-pushes and `ssh` wait for `/approve`. Everything else runs at once.
Discussion
No questions or reviews yet.
Related
CLI toolsAn open terminal coding agent in Rust: reads the project, edits files and runs commands on any model, including a local one through Ollama
Hands bounded code and test tasks to a headless CLI executor in a separate git worktree and returns a result with the real diff
An MCP server that runs DeepSeek or your own local model as a sub-agent in Claude Code and Codex with its own tool loop.
A Go coding agent for open models: it turns a chat into tasks on separate branches, checks and merges the result and runs all projects in one window
DevChain runs a team of AI coding agents on your own machine with a shared board, chat, code review and live terminals.
A ready OpenCode v2 setup on one DeepSeek Flash model: agents, commands and 23 skills, with roles told apart by thinking tier.
README in short
The README opens with a demo session where the agent fixes a failing test and walks through the agent loop in eight steps: prompt, snapshot, routing, loop, tools, cost, sessions, sub-agents. A separate section lists limitations, and the tests run eighteen end-to-end scenarios against a mock model.