FAQ

FAQ 常见问题

Answers sourced from real code, docs, release notes, and GitHub issues. Sources are cited below each answer. If your question isn't covered, open an issue on GitHub.

01What is Codewhale?+
Codewhale is a terminal-native coding agent that works across hosted and local models. It runs from the codewhale command, streams reasoning blocks, edits local workspaces with approval gates, and can route each turn to a configured model and thinking level. DeepSeek is the bundled default route, while OpenRouter, Anthropic, OpenAI-compatible services, and self-hosted runtimes use the same runtime and tools.
02How do I install Codewhale?+

Published channels differ in timing and platform support:

# npm (recommended — no Rust toolchain needed)
npm install -g codewhale

# Cargo (needs Rust 1.88+)
cargo install codewhale-cli --locked
cargo install codewhale-tui --locked

# Homebrew (macOS)
brew tap Hmbown/deepseek-tui && brew install deepseek-tui

# Direct download
# https://github.com/Hmbown/CodeWhale/releases

Run codewhale to start. First run creates ~/.codewhale/ automatically. Legacy ~/.deepseek/ is still read as a compatibility fallback. Android arm64 / Termux is preview support: npm works only when the selected package version has matching Android assets in its GitHub Release. See the full install guide for China mirrors, Docker, and troubleshooting.

03What's the difference between codewhale and codewhale-tui?+
codewhale is the dispatcher CLI — it manages config, auth, updates, and launches the TUI.codewhale-tui is the terminal UI binary that runs the agent loop. When you type codewhale, the dispatcher spawns codewhale-tui for you. npm and release bundles install them together. Cargo users install thecodewhale-cli and codewhale-tui crates separately.
Sources:README.md
04Is Codewhale the same as DeepSeek TUI? What about the rename?+
Yes. Codewhale is the new name for what was previously called DeepSeek TUI. The canonical command is now codewhale. Legacy deepseek and deepseek-tui commands remain as compatibility shims — they still work. Config lives at ~/.codewhale/. Legacy ~/.deepseek/ config is still read as a compatibility fallback, and DEEPSEEK_* env vars continue to work. DeepSeek is not deprecated. The rename reflects a mission idea put in this version: Codewhale as an agentic terminal for open models across providers, not a narrowing away from DeepSeek.
05How do I set my API key?+
# Method 1: Environment variable
export DEEPSEEK_API_KEY=sk-...

# Method 2: Saved config (recommended — survives shell restarts)
codewhale auth set --provider deepseek --api-key sk-...

# Method 3: config.toml
# Add to ~/.codewhale/config.toml:
api_key = "sk-..."

# Check what's active:
codewhale auth status    # shows config, keyring, and env-var state
codewhale doctor         # full connectivity check

Saved config keys take precedence over environment variables. Use codewhale auth clear --provider deepseek to remove a saved key.

06Which providers does Codewhale support?+

Codewhale ships with these built-in providers:

  • DeepSeek — bundled default with a native API route, reasoning streaming, cache metrics, and thinking effort control.
  • OpenRouter — unified API for DeepSeek models and other open-model routes.
  • OpenAI-compatible, NVIDIA NIM, AtlasCloud, Wanjie Ark, Volcengine Ark, Xiaomi MiMo, Novita, Fireworks, SiliconFlow, SiliconFlow CN, Arcee AI, Moonshot/Kimi, Hugging Face, DeepInfra, Together AI, Z.ai, StepFun, MiniMax, OpenAI Codex, Anthropic, SGLang, vLLM, Ollama

Set the corresponding env var (e.g. OPENROUTER_API_KEY) and your provider in ~/.codewhale/config.toml. Self-hosted OpenAI-compatible endpoints are supported through the provider config.

07How do I use OpenRouter with Codewhale?+
# 1. Set your OpenRouter key
export OPENROUTER_API_KEY=sk-or-v1-...

# 2. In ~/.codewhale/config.toml:
[providers.openrouter]
api_key = "sk-or-v1-..."

# 3. Run with an OpenRouter model:
codewhale --model openrouter/deepseek/deepseek-v4-pro

# Or set it as default in config.toml:
default_text_model = "openrouter/deepseek/deepseek-v4-pro"

OpenRouter uses the same reasoning/cache parser as the native DeepSeek provider. Model IDs follow the provider/model-id pattern (e.g. openrouter/deepseek/deepseek-v4-flash).

08Can I use self-hosted or local models (vLLM, Ollama, llama.cpp)?+
Yes. Use the vllm, sglang, or ollama providers with your local endpoint. For OpenAI-compatible endpoints (llama.cpp server, text-generation-webui, Aphrodite, etc.), you can use the openai provider with a custom base_url. Codewhale also respects DEEPSEEK_ALLOW_INSECURE_HTTP=true for local HTTP endpoints. Hugging Face Inference Providers are also available through the huggingface provider. Broader Hub discovery, model cards, datasets, and Jobs belong to Model Lab.
09What are Plan, Act, and Operate modes?+
  • Plan — Read-only investigation. Can grep, read files, list directories, fetch URLs. Cannot write or execute shell.
  • Act — Normal interactive coding. Tool availability and approval prompts follow the active configuration and permission posture.
  • Operate — Direct tools follow the same permission, sandbox, shell, and safety rules as Act. Fleet workers are preferred for independent, parallel, background, or long-running work, but delegation is not mandatory. Workflow is optional for ordered phases and gates.

When the composer is idle, press Tab to cycle modes. Press Shift+Tab to cycle the independent Ask / Auto-Review / Full Access permission posture; Plan remains read-only.

10What is model auto-routing? What is Fin?+

Use codewhale --model auto or /model auto to let Codewhale decide how much model power each turn needs.

Fin is the fast non-thinking path (deepseek-v4-flash with thinking off) used for routing decisions, summaries, RLM children, context maintenance, and other coordination work. Before the real turn is sent, Fin makes a small routing call to pick the concrete model and thinking level.

Short/simple turns can stay on Flash with thinking off. Coding, debugging, release work, architecture, or security review can move up to Pro and/or higher thinking. Fin is local to Codewhale — the upstream API never receives model: "auto".

11What does /goal do?+
/goal sets a goal for the current TUI session. App-server clients can also persist a thread-scoped goal through thethread/goal/* methods. It does not add another app mode; the mode switcher remains Plan, Act, and Operate, while permission posture is selected independently. Track progress in #891.
Sources:#891
12Is my code safe? What sandboxing does Codewhale use?+
The Codewhale runtime, workspace state, and audit log stay on your machine; Codewhale has no product telemetry or mandatory hosted relay. The hosted provider you select receives the prompt, project context, tool definitions, and tool results required for that turn. Use a loopback local-model route to keep model inference local. OS command sandboxing is platform-specific: Codewhale uses Seatbelt on macOS when available. On Linux it uses bubblewrap only when prefer_bwrap = true and /usr/bin/bwrap is executable; otherwise commands have no Codewhale OS wrapper. Windows currently reports no OS sandbox. Workspace boundaries default to --workspace. /trust lifts them. Permission posture is configurable per session. Sensitive credential, approval, and elevation events are appended best-effort to $CODEWHALE_HOME/audit.log (default ~/.codewhale/audit.log); write failures are logged.
13How do MCP servers work?+
Codewhale is a bidirectional MCP client and server. Define servers in ~/.codewhale/mcp.json. Tools appear as mcp_<server>_<tool>. You can also expose Codewhale as an MCP server with codewhale mcp. See the docs page for configuration examples.
Sources:docs/MCP.md
14How do I contribute?+
No CLA required. Fork, branch with conventional commits (feat:, fix:, etc.), run the local checks, open a PR. The maintainer reads everything personally. Start with issues labeled good first issue. See the contribute page and CONTRIBUTING.md.
15I'm in China — how do I install? Downloads are slow.+
Use mirror registries:
# npm mirror
npm config set registry https://registry.npmmirror.com
npm install -g codewhale

# Cargo mirror (Tsinghua TUNA)
# Add to ~/.cargo/config.toml:
[source.crates-io]
replace-with = "tuna"
[source.tuna]
registry = "sparse+https://mirrors.tuna.tsinghua.edu.cn/crates.io-index/"

Prebuilt binaries are also available from GitHub Releases. A maintained CNB mirror covers its documented targets; no Gitee mirror is advertised until one exists.

16Is codewhale.net the official site? What about mirrors?+

codewhale.net and www.codewhale.net are the official Codewhale sites, deployed on Cloudflare. The website source is open and lives under web/ in the Hmbown/CodeWhale repository — anyone can self-deploy it as a mirror.

All official releases and SHA-256 checksums are distributed exclusively through GitHub Releases. The npm package downloads verified binaries from GitHub Releases.

A CNB mirror is maintained for users who cannot reliably reach GitHub (docs/CNB_MIRROR.md). Cargo users can use the TUNA mirror for faster downloads in China.

Self-deployed website copies, mirror sites, and third-party packages are not controlled by the Codewhale project. Verify download sources and checksums.

17My API key was rejected or I get auth errors on first run.+

Run codewhale doctor — it checks API key, network, sandbox, and MCP servers. Full report is written to ~/.codewhale/doctor.log.

Common causes:

  • Stale DEEPSEEK_API_KEY in shell startup file — open a fresh shell or use codewhale auth set
  • Key from wrong provider — make sure the key matches the provider you're using
  • Network connectivity — check curl https://api.deepseek.com/v1/models
Sources:#907#1545
18What is Model Lab? What Hugging Face pieces are available?+
The huggingface provider is the shipped OpenAI-compatible route for Hugging Face Inference Providers. Model Lab is the planned open-model infrastructure layer for Hub discovery, model cards, datasets, safetensors adapters, and Jobs. Track broader progress in #1977.
19Why is token consumption so high? / Why is cache hit rate low?+
Codewhale sends substantial context (system prompt, project instructions, tool definitions) with each turn. DeepSeek's prefix cache is used aggressively — the system prompt is layered to maximize cache hits. If you see high token usage, check: are you using deepseek-v4-pro for simple queries better suited to Flash? Model auto-routing (Fin) can help pick the right model per turn. Cache hit rate depends on prompt stability — modifying the system prompt or switching models resets the cache.
20How do I update Codewhale?+
# Release-binary updater (works for npm/release-binary installs)
codewhale update

# npm
npm install -g codewhale@latest

# Cargo
cargo install codewhale-cli --locked --force

# Homebrew
brew update && brew upgrade deepseek-tui

If you installed via npm, codewhale update downloads the latest release binaries. If a mirror is lagging, download directly from GitHub Releases.

Didn't find your question?

Open an issue →