Skip to content

DeepSeek CLI v1.2.0 — Agentic AI Terminal & Performance Edition

Choose a tag to compare

@sluisr sluisr released this 17 Aug 10:54
· 16 commits to main since this release

DeepSeek CLI v1.2.0 — Release Notes

DeepSeek CLI v1.2.0 is an extensive architecture upgrade and feature release, introducing native slash commands, atomic unified diff patching, server-side web search with configurable reasoning, dynamic temperature tuning for Flash models, zero-latency system authentication, and comprehensive multi-turn stability fixes for DeepSeek V4.


1. DeepSeek V4 Architecture & Reasoning Engine

Multi-Turn Chain-of-Thought (CoT) Preservation

  • The Problem in Previous Versions: During multi-turn conversations involving tool calls, intermediate reasoning content (reasoning_content) generated by DeepSeek models was dropped by upstream conversion layers. On subsequent turns, the DeepSeek API rejected the message sequence with HTTP Error 400 (Invalid tool response sequence).
  • The Solution in v1.2.0: Implemented _deepseekReasoning smuggling throughout tool execution turns and persistent disk caching in ~/.deepseek/reasoning_cache.json. Reasoning context is seamlessly preserved across complex tool execution cycles.

Strict Tool Sequence Sanitization (sanitizeToolCallSequences)

  • Eliminates orphaned tool response messages that lack a preceding assistant message with a matching tool_call_id.
  • Automatically synthesizes cancellation responses (Tool call was cancelled by the user.) when tool executions are aborted, ensuring DeepSeek API compliance at all times.

Dynamic Reasoning Effort Injection

  • Integrated dynamic payload injection for reasoning_effort (low, medium, high, max) and thinking: { type: 'enabled' }.
  • DeepSeek-V4-Pro dynamically adjusts its internal chain-of-thought token budget per request.

Streaming KV Cache Telemetry (Prompt Cache Hits)

  • Added stream_options: { include_usage: true } to streaming completions.
  • Handled standalone usage chunks emitted at the end of SSE streams to capture prompt_cache_hit_tokens and prompt_cache_miss_tokens.
  • Accurately tracks DeepSeek's 90% prompt cache discount in /stats and session summaries.

2. New Slash Commands

/fim <file> [<line> | <FIM_HOLE>] — Fill-in-the-Middle Code Completion

  • Directly leverages the official DeepSeek Beta completions endpoint (https://api.deepseek.com/beta/completions).
  • Supports marker-based completion (<FIM_HOLE>) as well as line-number-based insertion.
  • Slices target files into prefix and suffix buffers, sends them to the model, and atomically updates the file with the generated code.

/prefix <text> — Chat Prefix Completion

  • Routes chat requests to https://api.deepseek.com/beta/chat/completions with { role: 'assistant', content: prefix, prefix: true }.
  • Forces DeepSeek to continue directly from a specified prefix string (e.g. ````json\n{orexport async function`), eliminating conversational fluff and ensuring deterministic JSON or TypeScript output.
  • Subcommands and aliases: /prefix clear, /prefill, /continue-from.

/balance — Live Account Balance & Credit Lookup

  • Directly calls GET https://api.deepseek.com/user/balance.
  • Displays real-time account status (Active / Exhausted), available funds, topped-up balance, and promotional credits in USD or CNY without redundant metrics.
  • Aliases: /wallet, /credits.

/info — Author & Community Links

  • Displays author attribution for sluisr, version information, and official community links:
    • Website: https://sluisr.com/
    • GitHub: https://github.com/sluisr
    • YouTube: https://www.youtube.com/@sluisr_
  • Aliases: /author, /credits, /links.

3. Native Agent Tools & Performance

apply_patch — Atomic Unified Diff Patching

  • Introduces an atomic diff-based patching tool (packages/core/src/tools/apply-patch.ts).
  • Instead of rewriting entire source code files (which consumes thousands of output tokens and causes latency), DeepSeek outputs compact unified diff blocks (*** begin patch, --- a/file, +++ b/file).
  • Reduces token consumption by up to 80% per modification and eliminates file corruption risks.

web_search — Server-Side Search with Deep Reasoning Control

  • Migrated from client-side scraping to the native DeepSeek Responses API (tools: [{ type: 'web_search' }]).
  • Configurable Search Reasoning Effort: DeepSeek's server-side search engine can be configured with search_reasoning: low | medium | high | max, instructing the model to perform multi-step reasoning and cross-verification across crawled sources before synthesizing responses.
  • Generates structured grounding citations and source attribution links.
  • Seamless fallback keychain key resolution via loadDeepSeekApiKey().

Silent Zero-Latency AskPass for sudo, ssh, and git

  • Created packages/core/src/utils/askpass.ts, reading raw input directly from /dev/tty without echo or delay.
  • Injects SUDO_ASKPASS, SSH_ASKPASS, and GIT_ASKPASS into all spawned shell sub-processes.
  • Embedded custom sudo() wrapper inside BASH_SHOPT_GUARD to guarantee non-blocking root operations.

4. User Interface & Configuration

Interactive /model Dialog & Temperature Tuning

  • Flash Model Temperature & Creativity Control: Dynamic real-time temperature tuning for deepseek-v4-flash (e.g. 0.0 for deterministic syntax and strict coding, or higher values for creative drafting), hot-reloaded in memory without restarting the session.
  • Pro Model Reasoning Configuration: Interactive selector for Reasoning Effort (LOW, MEDIUM, HIGH, MAX).
  • Persistent Storage: Choose whether to save settings permanently to ~/.deepseek/pro_settings.json and ~/.deepseek/flash_settings.json, or apply them only for the active session.

Session Summary & Resume

  • Corrected session resume instructions on exit (/quit):
    To resume this session: deepseek --resume <session_id>
    

Automatic Update Notifications

  • Integrated background version checker against npm package @sluisr/deepseek-cli.
  • Detects the active package manager (npm, pnpm, yarn, bun) and outputs exact update instructions.

5. Summary of Differences (v1.1.1 vs v1.2.0)

Area Feature v1.1.1 v1.2.0
Commands /fim (Fill-in-the-Middle code completion) No Yes
Commands /prefix (Chat prefix completion) No Yes
Commands /balance (Live account balance) No Yes
Commands /info (Author credits and community links) No Yes
Tools apply_patch (Unified diff code patching) No Yes
Tools web_search (Native server-side Responses API) No Yes
Tools web_search reasoning depth control (low - max) No Yes
System Silent 0ms AskPass (sudo, ssh, git) No Yes
Core Multi-Turn CoT transport (_deepseekReasoning) No Yes
Core Tool call sequence sanitization (Error 400 fix) No Yes
Core KV Cache streaming usage metadata capture No Yes
UI Flash model dynamic temperature tuning No Yes
UI Interactive /model Pro & Flash configuration No Yes
Config Hot-reloading & persistence under ~/.deepseek/ No Yes
Branding Corrected deepseek --resume <id> summary No Yes

6. Installation & Upgrade

Install Globally

npm install -g @sluisr/deepseek-cli

Upgrade to Latest

npm install -g @sluisr/deepseek-cli@latest

7. Author & Community