Skip to main content
CodeWhale (formerly DeepSeek TUI) is a terminal coding agent built for DeepSeek V4. It runs from the codewhale command, streams reasoning blocks, edits local workspaces with approval gates, and includes an auto mode that chooses both model and thinking level per turn. What sets CodeWhale apart is its harness — a system of rules, evidence, and feedback that keeps the model oriented instead of drifting. At its core is a written Constitution with nine tiers of authority: user intent outranks stale instructions, verification outranks confidence, etc. The system also benefits from recursive improvement — V4 helped write the harness, and as the harness improves, V4 becomes more effective. Each turn starts stronger. Now, SiliconFlow is a built-in provider in CodeWhale. With a single command, you can connect to SiliconFlow’s API and run DeepSeek-V4-Pro and DeepSeek-V4-Flash — no custom base URLs or manual config required. This guide walks you through installing CodeWhale and using SiliconFlow APIs in it.

Step 1: Prerequisites

Get Your SiliconFlow API Key

Before you begin, ensure you have a valid SiliconFlow account:
  • Register a SiliconFlow account at https://cloud.siliconflow.com/. You can sign up with Google or GitHub.
  • Log in and navigate to API Keys in the dashboard.
  • Click 🔑Create API Key and add a name to your key to help you identify it later, then confirm to create it.
  • Click the API key to copy it automatically.
⚠️ Note: Keep your API key secure; you will need it in the later configuration.
Codewhale1

Step 2: Install & Configure

  1. Install
Running the following CLI to download the prebuilt binaries for your platform from GitHub Releases and install both codewhale and codewhale-tui. This method requires Node 18+.
If you don’t have Node installed, see Other ways to install for Cargo, Homebrew, prebuilt binaries, or mainland-China mirrors.
  1. Verify
codewhale doctor checks your API key, network, sandbox availability, and MCP servers. Full report is written to ~/.codewhale/doctor.log.
  1. Update
Checks GitHub Releases for a newer version and replaces the binary in place. If you installed via Homebrew or npm, prefer the package manager instead: brew upgrade deepseek-tui or npm update -g codewhale. Cargo users can re-run cargo install codewhale-cli --locked --force.
  1. Configure siliconflow

Step 3: Run CodeWhale

Run CodeWhale in your terminal
On first launch, CodeWhale walks you through a few setup steps:
  • Press Enter to continue past the welcome screen
  • Choose your preferred language
  • Press 1 to trust and continue
  • Press Enter to open the workspace
Codewhale2

Mode

You’re now in CodeWhale — the active mode (Agent), current model (deepseek-ai/DeepSeek-V4-Pro), and provider (SiliconFlow) are shown in the top bar. Plan mode (read-only) is the default. Press Tab to switch to Agent mode, or press again for YOLO.

Quick Reference

Also, there’s a shortcut table for users to have a quick reference For more detailed information on modes, tools, approval & sandbox, MCP integration, and skills, visit the CodeWhale official documentation.

DeepSeek V4 on SiliconFlow

CodeWhale is built for DeepSeek V4 series. SiliconFlow offers two variants — pick the one that fits your task, or let Auto Mode decide for you. Prices shown are for reference only. For real-time pricing, check the SiliconFlow Models page.

Launch with a specific model

Auto Mode

Auto Mode runs a small Flash routing call before each turn to assess task complexity, then picks the right model and thinking level automatically, so you don’t have to choose between speed, cost, and quality each time you use codewhale.

How to enable

  • CLI: codewhale --model auto
  • In-session: /model auto

How model routing works

Before your request is sent, codewhale runs a small routing call to assess task complexity, then selects:
  • Model: deepseek-v4-flash (fast, cheap) or deepseek-v4-pro (powerful, slower)
  • Thinking level: off / high / max

Already Using OpenRouter?

Bring Your Own Key

If you already have an OpenRouter account, you can connect your SiliconFlow API key via BYOK. Once connected:
  • Requests draw from your SiliconFlow balance first
  • Billing and rate limits stay in your SiliconFlow account
  • OpenRouter’s fallback routing still works to improve reliability
Bonus: OpenRouter waives platform fees on your first 1M BYOK requests per month.
Codewhale3

Resources

CodeWhale (DeepSeek-TUI)

OpenRouter

SiliconFlow