<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>Rust on KnightLi Blog</title>
        <link>https://knightli.com/en/tags/rust/</link>
        <description>Recent content in Rust on KnightLi Blog</description>
        <generator>Hugo -- gohugo.io</generator>
        <language>en</language>
        <lastBuildDate>Wed, 27 May 2026 13:52:01 +0800</lastBuildDate><atom:link href="https://knightli.com/en/tags/rust/index.xml" rel="self" type="application/rss+xml" /><item>
        <title>RTK: A CLI Proxy That Saves Tokens for AI Coding Agents</title>
        <link>https://knightli.com/en/2026/05/27/rtk-ai-cli-proxy-token-savings/</link>
        <pubDate>Wed, 27 May 2026 13:52:01 +0800</pubDate>
        
        <guid>https://knightli.com/en/2026/05/27/rtk-ai-cli-proxy-token-savings/</guid>
        <description>&lt;p&gt;&lt;code&gt;rtk-ai/rtk&lt;/code&gt; is a command-line proxy for AI coding agents. The idea is straightforward: many agents repeatedly call &lt;code&gt;ls&lt;/code&gt;, &lt;code&gt;cat&lt;/code&gt;, &lt;code&gt;grep&lt;/code&gt;, &lt;code&gt;git status&lt;/code&gt;, &lt;code&gt;git diff&lt;/code&gt;, test commands, and build commands while working on a project, and the raw output from those commands is often long and repetitive. RTK filters and compresses command output before it enters the LLM context, so the model sees shorter and more useful results.&lt;/p&gt;
&lt;p&gt;Project: &lt;a class=&#34;link&#34; href=&#34;https://github.com/rtk-ai/rtk&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;rtk-ai/rtk&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&#34;what-problem-it-solves&#34;&gt;What Problem It Solves
&lt;/h2&gt;&lt;p&gt;The real cost of AI coding tools is not only the number of model calls. It is also the useless information pushed into the context window.&lt;/p&gt;
&lt;p&gt;For example:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;ls -la&lt;/code&gt; may output lots of permissions, timestamps, and irrelevant files.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;git diff&lt;/code&gt; may include a lot of repeated context.&lt;/li&gt;
&lt;li&gt;When &lt;code&gt;pytest&lt;/code&gt;, &lt;code&gt;cargo test&lt;/code&gt;, or &lt;code&gt;npm test&lt;/code&gt; fails, the important part is the failing case and stack trace, not every passing case.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;docker ps&lt;/code&gt;, &lt;code&gt;kubectl pods&lt;/code&gt;, and &lt;code&gt;aws&lt;/code&gt; commands often expose many fields, while the agent only needs a few key details.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If all of that output enters the model context unchanged, it burns tokens quickly. RTK does not replace those commands. It adds a compression layer between them and the AI coding agent.&lt;/p&gt;
&lt;h2 id=&#34;how-rtk-works&#34;&gt;How RTK Works
&lt;/h2&gt;&lt;p&gt;RTK&amp;rsquo;s README positions it as a tool that filters and compresses command results before they reach the LLM context. It is a single Rust binary, supports many common development commands, and emphasizes low overhead.&lt;/p&gt;
&lt;p&gt;It mainly applies four strategies:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Smart Filtering&lt;/strong&gt;: removes comments, whitespace, boilerplate, and low-value noise.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Grouping&lt;/strong&gt;: aggregates similar items, such as by directory, error type, or status.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Truncation&lt;/strong&gt;: keeps the relevant context and cuts repeated or unimportant parts.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Deduplication&lt;/strong&gt;: collapses repeated log lines into shorter counted output.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;From the agent&amp;rsquo;s perspective, the commands are still familiar development commands. The difference is that the result returned to the model is shorter.&lt;/p&gt;
&lt;h2 id=&#34;supported-commands&#34;&gt;Supported Commands
&lt;/h2&gt;&lt;p&gt;RTK focuses on everyday development workflows:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Files: &lt;code&gt;rtk ls&lt;/code&gt;, &lt;code&gt;rtk read&lt;/code&gt;, &lt;code&gt;rtk find&lt;/code&gt;, &lt;code&gt;rtk grep&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Git: &lt;code&gt;rtk git status&lt;/code&gt;, &lt;code&gt;rtk git log&lt;/code&gt;, &lt;code&gt;rtk git diff&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;GitHub CLI: &lt;code&gt;rtk gh pr list&lt;/code&gt;, &lt;code&gt;rtk gh pr view&lt;/code&gt;, &lt;code&gt;rtk gh issue list&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Tests: &lt;code&gt;rtk pytest&lt;/code&gt;, &lt;code&gt;rtk go test&lt;/code&gt;, &lt;code&gt;rtk cargo test&lt;/code&gt;, &lt;code&gt;rtk vitest&lt;/code&gt;, &lt;code&gt;rtk playwright test&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Build and lint: &lt;code&gt;rtk lint&lt;/code&gt;, &lt;code&gt;rtk tsc&lt;/code&gt;, &lt;code&gt;rtk next build&lt;/code&gt;, &lt;code&gt;rtk cargo clippy&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Containers and cloud: &lt;code&gt;rtk docker ps&lt;/code&gt;, &lt;code&gt;rtk docker logs&lt;/code&gt;, &lt;code&gt;rtk kubectl pods&lt;/code&gt;, &lt;code&gt;rtk aws sts get-caller-identity&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Data and logs: &lt;code&gt;rtk json&lt;/code&gt;, &lt;code&gt;rtk deps&lt;/code&gt;, &lt;code&gt;rtk env&lt;/code&gt;, &lt;code&gt;rtk log&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This kind of tool is most useful when an agent reads command output frequently. It does not write code for you. It helps the agent read less noise.&lt;/p&gt;
&lt;h2 id=&#34;installation-and-integration&#34;&gt;Installation and Integration
&lt;/h2&gt;&lt;p&gt;The README lists several installation options.&lt;/p&gt;
&lt;p&gt;Homebrew:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;brew install rtk
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Quick install on Linux/macOS:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;curl -fsSL https://raw.githubusercontent.com/rtk-ai/rtk/refs/heads/master/install.sh &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; sh
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Cargo:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;cargo install --git https://github.com/rtk-ai/rtk
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;After installation, check the version and stats:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;2
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;rtk --version
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;rtk gain
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;To integrate it with AI coding tools, use the init commands:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;2
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;3
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;4
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;5
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;6
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;rtk init -g
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;rtk init -g --gemini
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;rtk init -g --codex
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;rtk init -g --agent cursor
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;rtk init --agent windsurf
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;rtk init --agent cline
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Restart the corresponding AI tool after initialization. For hook-based agents, Bash commands are rewritten before execution. For example, &lt;code&gt;git status&lt;/code&gt; becomes &lt;code&gt;rtk git status&lt;/code&gt;, and the agent receives compressed output.&lt;/p&gt;
&lt;h2 id=&#34;what-to-watch-out-for&#34;&gt;What To Watch Out For
&lt;/h2&gt;&lt;p&gt;RTK&amp;rsquo;s benefit depends on whether the agent actually reads information through shell commands.&lt;/p&gt;
&lt;p&gt;The README specifically notes that built-in tools such as Claude Code&amp;rsquo;s &lt;code&gt;Read&lt;/code&gt;, &lt;code&gt;Grep&lt;/code&gt;, and &lt;code&gt;Glob&lt;/code&gt; do not pass through the Bash hook, so they are not automatically rewritten by RTK. To make RTK participate, use shell commands such as &lt;code&gt;cat&lt;/code&gt;, &lt;code&gt;head&lt;/code&gt;, &lt;code&gt;tail&lt;/code&gt;, &lt;code&gt;rg&lt;/code&gt;, &lt;code&gt;grep&lt;/code&gt;, and &lt;code&gt;find&lt;/code&gt;, or call &lt;code&gt;rtk read&lt;/code&gt;, &lt;code&gt;rtk grep&lt;/code&gt;, and &lt;code&gt;rtk find&lt;/code&gt; directly.&lt;/p&gt;
&lt;p&gt;That point matters. RTK is not a globally transparent compressor for all agent I/O. It is closer to a proxy at the shell-command layer.&lt;/p&gt;
&lt;p&gt;Windows users should also note that the README recommends placing &lt;code&gt;rtk.exe&lt;/code&gt; in PATH and running it from Command Prompt, PowerShell, or Windows Terminal instead of double-clicking it. It also says WSL is more natural if you want the full hook experience.&lt;/p&gt;
&lt;h2 id=&#34;who-should-use-it&#34;&gt;Who Should Use It
&lt;/h2&gt;&lt;p&gt;RTK is useful for three groups:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Heavy AI coding users&lt;/strong&gt;: people who ask agents to run many &lt;code&gt;git&lt;/code&gt;, &lt;code&gt;rg&lt;/code&gt;, test, and build commands every day.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Large-repository users&lt;/strong&gt;: teams whose command output often reaches hundreds of lines and drowns the agent in irrelevant context.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;People who care about token cost and context windows&lt;/strong&gt;: users who want the model to focus on failures, changes, and key files.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;If your project is small, or if your agent mostly reads files through IDE-native tools, RTK may feel less impactful. It shines when command-line output is both long and frequent.&lt;/p&gt;
&lt;h2 id=&#34;my-take&#34;&gt;My Take
&lt;/h2&gt;&lt;p&gt;RTK points in a practical direction. Many AI coding workflows focus on stronger models, larger context windows, and longer tasks, but there is still a plain development problem: agents often read far more than they need.&lt;/p&gt;
&lt;p&gt;Compressing command output before handing it to the model can reduce token usage and lower the chance that noise steers the model in the wrong direction.&lt;/p&gt;
&lt;p&gt;It is not a magic switch, though. To use RTK well, the agent workflow needs to lean on shell commands, and you need to confirm that the hook actually works in your current tool. For Codex, Claude Code, Gemini CLI, Cursor, and Windsurf, RTK is a useful context throttle to test: it does not change the development commands themselves, but it gives the agent cleaner results to read.&lt;/p&gt;
</description>
        </item>
        <item>
        <title>wx-cli Explained: Query Local WeChat Chat History from the Command Line</title>
        <link>https://knightli.com/en/2026/05/18/wx-cli-wechat-local-data-command-line-tool/</link>
        <pubDate>Mon, 18 May 2026 21:02:21 +0800</pubDate>
        
        <guid>https://knightli.com/en/2026/05/18/wx-cli-wechat-local-data-command-line-tool/</guid>
        <description>&lt;p&gt;&lt;code&gt;wx-cli&lt;/code&gt; is a local WeChat data command-line tool written in Rust. Its goal is to let you query your own WeChat sessions, chat history, contacts, group members, favorites, Moments, official account articles, attachments, and statistics from the terminal.&lt;/p&gt;
&lt;p&gt;It is not a cloud-based WeChat sync service, and it is not a chatbot. It is closer to a local read-only data retrieval layer: WeChat still runs on your machine, the data still stays on your machine, and &lt;code&gt;wx-cli&lt;/code&gt; decrypts, caches, and queries local databases on demand before returning YAML or JSON output for humans or agents.&lt;/p&gt;
&lt;p&gt;Two points make this project worth watching. First, it turns local WeChat data access into a cross-platform CLI. Second, it explicitly considers AI Agent workflows for tools such as Claude Code, Cursor, and Codex, providing a &lt;code&gt;SKILL.md&lt;/code&gt; file and structured output with &lt;code&gt;meta&lt;/code&gt; fields.&lt;/p&gt;
&lt;h2 id=&#34;what-wx-cli-can-do&#34;&gt;What wx-cli Can Do
&lt;/h2&gt;&lt;p&gt;According to the project README, &lt;code&gt;wx-cli&lt;/code&gt; covers a fairly complete set of features:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;View recent sessions and unread sessions.&lt;/li&gt;
&lt;li&gt;Query chat history for a contact or group.&lt;/li&gt;
&lt;li&gt;Search keywords across the whole local database.&lt;/li&gt;
&lt;li&gt;View newly arrived messages.&lt;/li&gt;
&lt;li&gt;Query contacts, group members, and group nicknames.&lt;/li&gt;
&lt;li&gt;Query favorites.&lt;/li&gt;
&lt;li&gt;Query Moments notifications, timelines, and post bodies.&lt;/li&gt;
&lt;li&gt;Query official account article pushes.&lt;/li&gt;
&lt;li&gt;List and extract image attachments from chats.&lt;/li&gt;
&lt;li&gt;Generate chat statistics.&lt;/li&gt;
&lt;li&gt;Export chat history as Markdown or JSON.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;These capabilities make it more than a &amp;ldquo;chat history search&amp;rdquo; tool. It turns local WeChat data into a searchable, analyzable, and exportable personal knowledge source.&lt;/p&gt;
&lt;h2 id=&#34;why-it-fits-ai-agents&#34;&gt;Why It Fits AI Agents
&lt;/h2&gt;&lt;p&gt;Many CLI tools are designed only for people: their output is just a block of text. &lt;code&gt;wx-cli&lt;/code&gt; clearly takes agent consumption into account.&lt;/p&gt;
&lt;p&gt;The README notes that commands such as &lt;code&gt;history&lt;/code&gt;, &lt;code&gt;search&lt;/code&gt;, &lt;code&gt;sessions&lt;/code&gt;, &lt;code&gt;unread&lt;/code&gt;, &lt;code&gt;new-messages&lt;/code&gt;, &lt;code&gt;stats&lt;/code&gt;, and &lt;code&gt;attachments&lt;/code&gt; include &lt;code&gt;meta&lt;/code&gt; information. That metadata contains result status, unknown shards, the latest timestamp in matched data, the latest session timestamp, and similar fields.&lt;/p&gt;
&lt;p&gt;This is useful for agents. AI does not only need to know &amp;ldquo;what was found&amp;rdquo;; it also needs to know whether the result is fresh, whether messages may be missing, and whether it should run &lt;code&gt;init&lt;/code&gt; again. For example:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;status&lt;/code&gt; can indicate whether the result is &lt;code&gt;ok&lt;/code&gt; or &lt;code&gt;possibly_stale&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;unknown_shards&lt;/code&gt; can indicate whether there are database shards for which the daemon currently has no key.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;chat_latest_timestamp&lt;/code&gt; tells the agent the latest message time in the matched data.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;session_last_timestamp&lt;/code&gt; helps determine whether the local session record is clearly newer than the query result.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This kind of metadata reduces AI misjudgment and makes tools such as Claude Code, Cursor, and Codex more reliable when working with WeChat data.&lt;/p&gt;
&lt;h2 id=&#34;installation&#34;&gt;Installation
&lt;/h2&gt;&lt;p&gt;The project recommends cross-platform installation via npm:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;npm install -g @jackwener/wx-cli
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;It also supports curl installation on macOS / Linux:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;curl -fsSL https://raw.githubusercontent.com/jackwener/wx-cli/main/install.sh &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; bash
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;On Windows, run this in an administrator PowerShell:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-powershell&#34; data-lang=&#34;powershell&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;irm &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;https&lt;/span&gt;&lt;span class=&#34;err&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;//&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;raw&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;py&#34;&gt;githubusercontent&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;com&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;/&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;jackwener&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;/&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;wx-cli&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;/&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;main&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;/&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;install&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;py&#34;&gt;ps1&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;iex
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;If you want to build from source, you can use Rust directly:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;2
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git clone git@github.com:jackwener/wx-cli.git &lt;span class=&#34;o&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;cd&lt;/span&gt; wx-cli
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;cargo build --release
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;The build artifact is &lt;code&gt;target/release/wx&lt;/code&gt;, or &lt;code&gt;wx.exe&lt;/code&gt; on Windows.&lt;/p&gt;
&lt;h2 id=&#34;relationship-with-agent-skills&#34;&gt;Relationship with Agent Skills
&lt;/h2&gt;&lt;p&gt;&lt;code&gt;wx-cli&lt;/code&gt; also provides a Skill for AI Agents. You can install it into Claude Code, Cursor, Codex, and other Skills-compatible environments through the skills CLI:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;npx skills add jackwener/wx-cli
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Install it globally:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;npx skills add jackwener/wx-cli -g
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;After installation, the agent reads the repository&amp;rsquo;s &lt;code&gt;SKILL.md&lt;/code&gt; and learns how to install, initialize, and call &lt;code&gt;wx-cli&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;That means you can ask an agent to help with local information organization tasks such as:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Find keywords discussed in a group chat during a specific period.&lt;/li&gt;
&lt;li&gt;Summarize recent unread messages.&lt;/li&gt;
&lt;li&gt;Export recent chat history from a specific session.&lt;/li&gt;
&lt;li&gt;Search official account article links.&lt;/li&gt;
&lt;li&gt;Analyze posting statistics in a group chat.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The premise is unchanged: the data must be your own WeChat data on your own machine.&lt;/p&gt;
&lt;h2 id=&#34;basic-usage&#34;&gt;Basic Usage
&lt;/h2&gt;&lt;p&gt;Before initialization, keep WeChat running. Requirements differ by platform.&lt;/p&gt;
&lt;p&gt;On Linux:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;sudo wx init
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;On Windows, use an administrator PowerShell:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-powershell&#34; data-lang=&#34;powershell&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;wx&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;init&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;macOS is more involved. The README explains that, with the default path, you first need to ad-hoc sign WeChat so the tool can scan process memory. After re-signing, you also need to clean old TCC authorization records, otherwise permissions such as screen capture, video calls, and microphone access may look enabled while actually being denied. The project documentation also warns that re-signing may cause macOS to repeatedly prompt for access to other apps&amp;rsquo; data.&lt;/p&gt;
&lt;p&gt;After initialization, verify the setup with:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;wx sessions
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;If you can see recent sessions, the basic path is working. The daemon starts automatically on the first call.&lt;/p&gt;
&lt;h2 id=&#34;common-command-examples&#34;&gt;Common Command Examples
&lt;/h2&gt;&lt;p&gt;View recent sessions:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;wx sessions
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;View unread sessions:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;wx unread
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Show only human unread sessions while filtering out official accounts and folded entries:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;wx unread --filter private,group
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;View recent chat history for a session:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;wx &lt;span class=&#34;nb&#34;&gt;history&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;张三&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Fetch more history:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;wx &lt;span class=&#34;nb&#34;&gt;history&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;张三&amp;#34;&lt;/span&gt; -n &lt;span class=&#34;m&#34;&gt;2000&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Query a group chat by time range:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;wx &lt;span class=&#34;nb&#34;&gt;history&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;AI群&amp;#34;&lt;/span&gt; --since 2026-04-01 --until 2026-04-15
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Search the whole database:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;wx search &lt;span class=&#34;s2&#34;&gt;&amp;#34;关键词&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Search for a keyword inside a group:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;wx search &lt;span class=&#34;s2&#34;&gt;&amp;#34;会议&amp;#34;&lt;/span&gt; --in &lt;span class=&#34;s2&#34;&gt;&amp;#34;工作群&amp;#34;&lt;/span&gt; --since 2026-01-01
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Export chat history:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;2
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;wx &lt;span class=&#34;nb&#34;&gt;export&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;张三&amp;#34;&lt;/span&gt; --format markdown -o chat.md
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;wx &lt;span class=&#34;nb&#34;&gt;export&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;AI群&amp;#34;&lt;/span&gt; --since 2026-01-01 --format json
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;These commands are well suited for scripts or agents, especially when combined with &lt;code&gt;--json&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&#34;moments-and-official-account-articles&#34;&gt;Moments and Official Account Articles
&lt;/h2&gt;&lt;p&gt;&lt;code&gt;wx-cli&lt;/code&gt; does not only query chats.&lt;/p&gt;
&lt;p&gt;Moments-related commands are split into notifications and posts:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;2
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;3
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;wx sns-notifications
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;wx sns-feed
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;wx sns-search &lt;span class=&#34;s2&#34;&gt;&amp;#34;关键词&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Note that Moments data only covers content that has appeared locally. The WeChat client downloads data on demand; if something has never appeared locally, the tool cannot retrieve it out of thin air.&lt;/p&gt;
&lt;p&gt;Official account articles are queried through separate commands:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;2
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;3
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;4
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;wx biz-articles
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;wx biz-articles --account &lt;span class=&#34;s2&#34;&gt;&amp;#34;返朴&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;wx biz-articles --since 2026-05-01 --until 2026-05-10
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;wx biz-articles --json &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; jq &lt;span class=&#34;s1&#34;&gt;&amp;#39;.[].url&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;It returns fields such as account name, title, URL, summary, cover image, and timestamp. This is useful for people who organize references, collect articles, or build local knowledge bases.&lt;/p&gt;
&lt;h2 id=&#34;attachment-extraction&#34;&gt;Attachment Extraction
&lt;/h2&gt;&lt;p&gt;Image attachments in WeChat chats are usually not ordinary readable image files. They are often &lt;code&gt;.dat&lt;/code&gt; files under &lt;code&gt;xwechat_files/&amp;lt;wxid&amp;gt;/msg/attach/...&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;wx-cli&lt;/code&gt; provides a two-step flow:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;2
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;wx attachments &lt;span class=&#34;s2&#34;&gt;&amp;#34;张三&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;wx attachments &lt;span class=&#34;s2&#34;&gt;&amp;#34;AI群&amp;#34;&lt;/span&gt; --kind image -n &lt;span class=&#34;m&#34;&gt;100&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;After getting an &lt;code&gt;attachment_id&lt;/code&gt;, extract it:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;wx extract &amp;lt;attachment_id&amp;gt; -o ~/Desktop/photo.jpg
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;The output report includes fields such as &lt;code&gt;md5&lt;/code&gt;, &lt;code&gt;dat_path&lt;/code&gt;, &lt;code&gt;dat_size&lt;/code&gt;, &lt;code&gt;output&lt;/code&gt;, &lt;code&gt;format&lt;/code&gt;, and &lt;code&gt;decoder&lt;/code&gt;. The README says it supports decoding modes such as legacy XOR, V1 fixed-AES, and V2 AES + XOR, while image key extraction differs across platforms.&lt;/p&gt;
&lt;p&gt;This capability is powerful, but it requires extra care: only process your own data, and do not use it for unauthorized data access.&lt;/p&gt;
&lt;h2 id=&#34;why-the-daemon-architecture-matters&#34;&gt;Why the Daemon Architecture Matters
&lt;/h2&gt;&lt;p&gt;The performance story of &lt;code&gt;wx-cli&lt;/code&gt; comes from its daemon.&lt;/p&gt;
&lt;p&gt;The README describes the structure roughly as:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;2
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;3
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;4
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;5
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;wx (CLI) ──Unix socket──▶ wx-daemon (background process)
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;                              │
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;                    ┌─────────┴──────────┐
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;               DBCache               contact cache
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;           (mtime-aware reuse)
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;After the first decryption, the daemon persists database and mtime information under &lt;code&gt;~/.wx-cli/cache/&lt;/code&gt;. If the database file mtime has not changed, later calls can reuse the cache without decrypting everything again.&lt;/p&gt;
&lt;p&gt;This is important for command-line queries and agent loops. An agent may query several sessions, search multiple keywords, then run statistics and exports. If every call had to rescan and decrypt everything, the experience would be poor. The daemon cache makes it feel closer to a local query service.&lt;/p&gt;
&lt;h2 id=&#34;a-brief-look-at-the-principle&#34;&gt;A Brief Look at the Principle
&lt;/h2&gt;&lt;p&gt;The project README explains the principle directly: WeChat 4.x encrypts local databases with SQLCipher 4, and WCDB caches the derived raw key in process memory.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;wx-cli&lt;/code&gt; uses platform-specific methods to scan WeChat process memory, match key patterns, extract the key, and then let the daemon decrypt and cache databases on demand.&lt;/p&gt;
&lt;p&gt;The underlying mechanism differs by platform:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;macOS uses the Mach VM API.&lt;/li&gt;
&lt;li&gt;Linux uses &lt;code&gt;/proc/&amp;lt;pid&amp;gt;/mem&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Windows uses &lt;code&gt;VirtualQueryEx&lt;/code&gt; and &lt;code&gt;ReadProcessMemory&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;These details explain why initialization usually requires elevated permissions, and why macOS involves signing and privacy authorization.&lt;/p&gt;
&lt;h2 id=&#34;boundaries-and-risks&#34;&gt;Boundaries and Risks
&lt;/h2&gt;&lt;p&gt;Tools like this must start with boundaries.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;wx-cli&lt;/code&gt; README disclaimer is clear: the tool is only for learning and research, for decrypting your own WeChat data, and it requires users to comply with applicable laws and regulations. It must not be used for unauthorized data access.&lt;/p&gt;
&lt;p&gt;In practice, it is also wise to keep these points in mind:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Use it only on your own computer and your own WeChat account.&lt;/li&gt;
&lt;li&gt;Do not casually upload exported chat history to cloud models.&lt;/li&gt;
&lt;li&gt;When using an agent to analyze chat history, first confirm the API provider and cross-border data risks.&lt;/li&gt;
&lt;li&gt;After exporting Markdown / JSON, pay attention to file permissions and backup locations.&lt;/li&gt;
&lt;li&gt;On company or shared devices, confirm compliance and authorization first.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A local tool does not mean there is no privacy risk. It reduces the default path for data to leave your machine, but if you hand the output to a cloud model, cloud drive, or third-party script, the risk comes back.&lt;/p&gt;
&lt;h2 id=&#34;who-it-is-for&#34;&gt;Who It Is For
&lt;/h2&gt;&lt;p&gt;&lt;code&gt;wx-cli&lt;/code&gt; fits these scenarios:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Quickly search your own historical WeChat messages locally.&lt;/li&gt;
&lt;li&gt;Export a session as Markdown or JSON.&lt;/li&gt;
&lt;li&gt;Analyze posting activity in a group chat over a time range.&lt;/li&gt;
&lt;li&gt;Let Claude Code, Cursor, Codex, and similar agents organize local WeChat material.&lt;/li&gt;
&lt;li&gt;Collect official account article links into a local knowledge base.&lt;/li&gt;
&lt;li&gt;Study WeChat&amp;rsquo;s local database structure and decryption flow.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;It is less suitable for these scenarios:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;You want cloud-based WeChat sync.&lt;/li&gt;
&lt;li&gt;You want to bypass someone else&amp;rsquo;s device or account permissions.&lt;/li&gt;
&lt;li&gt;You want a point-and-click GUI and do not want to touch the command line.&lt;/li&gt;
&lt;li&gt;You do not want to deal with macOS permissions, Windows administrator rights, or Linux sudo.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;summary&#34;&gt;Summary
&lt;/h2&gt;&lt;p&gt;The value of &lt;code&gt;wx-cli&lt;/code&gt; is not merely &amp;ldquo;searching WeChat chat history from the command line.&amp;rdquo; More precisely, it turns local WeChat data into a local data source that can be queried, exported, and consumed by agents.&lt;/p&gt;
&lt;p&gt;Its daemon architecture solves repeated decryption and query performance issues; the &lt;code&gt;meta&lt;/code&gt; wrapper helps AI Agents judge whether results are fresh; and &lt;code&gt;SKILL.md&lt;/code&gt; lets tools such as Claude Code, Cursor, and Codex understand how to install and use it.&lt;/p&gt;
&lt;p&gt;If you often need to find information in WeChat, organize group chats, export records, or build a personal knowledge base, &lt;code&gt;wx-cli&lt;/code&gt; is worth watching. But one bottom line should always remain clear: only process your own data, and manage exported results carefully.&lt;/p&gt;
&lt;h2 id=&#34;references&#34;&gt;References
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;&lt;a class=&#34;link&#34; href=&#34;https://github.com/jackwener/wx-cli&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;jackwener/wx-cli GitHub repository&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
        </item>
        <item>
        <title>DeepSeek-TUI: Run a DeepSeek Coding Agent in Your Terminal</title>
        <link>https://knightli.com/en/2026/05/08/deepseek-tui-terminal-coding-agent/</link>
        <pubDate>Fri, 08 May 2026 13:41:15 +0800</pubDate>
        
        <guid>https://knightli.com/en/2026/05/08/deepseek-tui-terminal-coding-agent/</guid>
        <description>&lt;p&gt;DeepSeek-TUI is an AI coding agent that runs in the terminal. It is built around DeepSeek V4 models and starts from the &lt;code&gt;deepseek&lt;/code&gt; command. Inside a keyboard-driven TUI, it can read and edit files, run shell commands, search the web, manage git, connect to MCP servers, and coordinate sub-agents.&lt;/p&gt;
&lt;p&gt;It is closer to a terminal workbench than a simple chat CLI. The goal is not only to send a question to a model, but to combine code reading, file edits, commands, diagnostics, session recovery, and workspace rollback in one local workflow.&lt;/p&gt;
&lt;p&gt;The repository is mainly written in Rust and uses the MIT license. Its GitHub description is: “Coding agent for DeepSeek models that runs in your terminal.”&lt;/p&gt;
&lt;h2 id=&#34;who-it-is-for&#34;&gt;Who It Is For
&lt;/h2&gt;&lt;p&gt;DeepSeek-TUI fits developers who prefer terminal workflows and want to use DeepSeek models for real local development tasks.&lt;/p&gt;
&lt;p&gt;It is useful when you want to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Use DeepSeek models for code changes and project analysis.&lt;/li&gt;
&lt;li&gt;Work without opening a full IDE.&lt;/li&gt;
&lt;li&gt;Let an AI tool read and modify a local workspace.&lt;/li&gt;
&lt;li&gt;Switch between Plan, Agent, and YOLO modes.&lt;/li&gt;
&lt;li&gt;Save sessions and resume long tasks.&lt;/li&gt;
&lt;li&gt;Roll back workspace changes.&lt;/li&gt;
&lt;li&gt;Connect MCP, LSP diagnostics, HTTP/SSE runtime APIs, and skills.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you only need simple Q&amp;amp;A, a web client or lightweight CLI is enough. DeepSeek-TUI is better when the model should become part of your local development loop.&lt;/p&gt;
&lt;h2 id=&#34;installation&#34;&gt;Installation
&lt;/h2&gt;&lt;p&gt;DeepSeek-TUI ships Rust binaries. The common entry command is &lt;code&gt;deepseek&lt;/code&gt;, and the companion TUI binary is &lt;code&gt;deepseek-tui&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Using npm:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;2
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;3
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;npm install -g deepseek-tui
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;deepseek --version
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;deepseek --model auto
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;The npm package is an installer and wrapper that downloads prebuilt Rust binaries. It requires Node.js &lt;code&gt;&amp;gt;=18&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Using Cargo:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;2
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;cargo install deepseek-tui-cli --locked
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;cargo install deepseek-tui --locked
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Using Homebrew:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;2
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;brew tap Hmbown/deepseek-tui
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;brew install deepseek-tui
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;You can also download prebuilt binaries from GitHub Releases. The README lists Linux x64/ARM64, macOS x64/ARM64, and Windows x64 builds.&lt;/p&gt;
&lt;p&gt;Docker:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;2
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;3
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;4
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;docker run --rm -it &lt;span class=&#34;se&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  -e DEEPSEEK_API_KEY &lt;span class=&#34;se&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  -v &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$PWD&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;:/workspace&amp;#34;&lt;/span&gt; &lt;span class=&#34;se&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  ghcr.io/hmbown/deepseek-tui:latest
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;In mainland China, use npm or Cargo mirrors, or download release binaries manually.&lt;/p&gt;
&lt;h2 id=&#34;configure-the-api-key&#34;&gt;Configure the API Key
&lt;/h2&gt;&lt;p&gt;On first launch, DeepSeek-TUI asks for your DeepSeek API key and saves it to:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;~/.deepseek/config.toml
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;You can also configure it explicitly:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;2
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;deepseek auth &lt;span class=&#34;nb&#34;&gt;set&lt;/span&gt; --provider deepseek
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;deepseek auth status
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Or use an environment variable:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;2
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;export&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;DEEPSEEK_API_KEY&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;YOUR_KEY&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;deepseek
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Check the setup:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;deepseek doctor
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;If the wrong key source is used, run &lt;code&gt;deepseek auth status&lt;/code&gt;. Saved config keys take precedence over the keyring and environment variables.&lt;/p&gt;
&lt;p&gt;Clear a saved key:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;deepseek auth clear --provider deepseek
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;h2 id=&#34;auto-mode&#34;&gt;Auto Mode
&lt;/h2&gt;&lt;p&gt;Auto mode:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;deepseek --model auto
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Inside the TUI:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;/model auto
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Auto mode chooses both:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Model: &lt;code&gt;deepseek-v4-flash&lt;/code&gt; or &lt;code&gt;deepseek-v4-pro&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Thinking: &lt;code&gt;off&lt;/code&gt;, &lt;code&gt;high&lt;/code&gt;, or &lt;code&gt;max&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Before the real request, DeepSeek-TUI makes a small routing call to analyze the latest request and recent context. Simple tasks can stay on Flash with thinking off; coding, debugging, architecture, release, security review, or ambiguous multi-step work can move to Pro or higher thinking.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;auto&lt;/code&gt; is local to DeepSeek-TUI. The upstream API receives the concrete model and thinking setting chosen for that turn. For benchmarks, strict cost control, or fixed behavior, use an explicit model.&lt;/p&gt;
&lt;h2 id=&#34;modes&#34;&gt;Modes
&lt;/h2&gt;&lt;table&gt;
  &lt;thead&gt;
      &lt;tr&gt;
          &lt;th&gt;Mode&lt;/th&gt;
          &lt;th&gt;Use&lt;/th&gt;
      &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
      &lt;tr&gt;
          &lt;td&gt;Plan&lt;/td&gt;
          &lt;td&gt;Read-only exploration and planning&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;Agent&lt;/td&gt;
          &lt;td&gt;Default interactive mode with approval gates&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;YOLO&lt;/td&gt;
          &lt;td&gt;Auto-approve tools in a trusted workspace&lt;/td&gt;
      &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Plan is for investigation. Agent is safer for everyday coding. YOLO is fast but risky and should only be used in trusted workspaces and low-risk branches.&lt;/p&gt;
&lt;h2 id=&#34;tooling&#34;&gt;Tooling
&lt;/h2&gt;&lt;p&gt;The README lists a broad tool set:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;File reads/writes and apply patch.&lt;/li&gt;
&lt;li&gt;Shell execution.&lt;/li&gt;
&lt;li&gt;Git operations.&lt;/li&gt;
&lt;li&gt;Web search and browse.&lt;/li&gt;
&lt;li&gt;Sub-agents.&lt;/li&gt;
&lt;li&gt;MCP servers.&lt;/li&gt;
&lt;li&gt;LSP diagnostics.&lt;/li&gt;
&lt;li&gt;Session save/resume.&lt;/li&gt;
&lt;li&gt;Workspace rollback.&lt;/li&gt;
&lt;li&gt;Durable task queue.&lt;/li&gt;
&lt;li&gt;HTTP/SSE runtime API.&lt;/li&gt;
&lt;li&gt;Skills system.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;LSP diagnostics are especially useful because errors from rust-analyzer, pyright, typescript-language-server, gopls, clangd, and similar tools can be fed back after edits.&lt;/p&gt;
&lt;p&gt;Workspace rollback uses side-git snapshots and provides &lt;code&gt;/restore&lt;/code&gt; and &lt;code&gt;revert_turn&lt;/code&gt;. It does not touch the repository’s own &lt;code&gt;.git&lt;/code&gt;, but normal git commits are still the safest baseline.&lt;/p&gt;
&lt;h2 id=&#34;common-commands&#34;&gt;Common Commands
&lt;/h2&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt; 1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 2
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 3
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 4
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 5
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 6
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 7
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 8
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 9
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;10
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;11
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;12
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;13
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;14
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;15
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;16
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;17
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;18
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;19
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;deepseek
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;deepseek &lt;span class=&#34;s2&#34;&gt;&amp;#34;explain this function&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;deepseek --model deepseek-v4-flash &lt;span class=&#34;s2&#34;&gt;&amp;#34;summarize&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;deepseek --model auto &lt;span class=&#34;s2&#34;&gt;&amp;#34;fix this bug&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;deepseek --yolo
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;deepseek auth &lt;span class=&#34;nb&#34;&gt;set&lt;/span&gt; --provider deepseek
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;deepseek doctor
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;deepseek doctor --json
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;deepseek models
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;deepseek sessions
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;deepseek resume --last
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;deepseek resume &amp;lt;SESSION_ID&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;deepseek fork &amp;lt;SESSION_ID&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;deepseek serve --http
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;deepseek serve --acp
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;deepseek pr &amp;lt;N&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;deepseek mcp list
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;deepseek mcp validate
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;deepseek update
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;h2 id=&#34;zed-and-acp&#34;&gt;Zed and ACP
&lt;/h2&gt;&lt;p&gt;DeepSeek-TUI can run as an Agent Client Protocol server:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt; 1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 2
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 3
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 4
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 5
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 6
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 7
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 8
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 9
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;10
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-json&#34; data-lang=&#34;json&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nt&#34;&gt;&amp;#34;agent_servers&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nt&#34;&gt;&amp;#34;DeepSeek&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;nt&#34;&gt;&amp;#34;type&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;custom&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;nt&#34;&gt;&amp;#34;command&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;deepseek&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;nt&#34;&gt;&amp;#34;args&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;serve&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;--acp&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;],&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;nt&#34;&gt;&amp;#34;env&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;The README notes that the first ACP slice supports new sessions and prompt responses, while tool-backed editing and checkpoint replay are not exposed through ACP yet.&lt;/p&gt;
&lt;h2 id=&#34;configuration-and-providers&#34;&gt;Configuration and Providers
&lt;/h2&gt;&lt;p&gt;User config:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;~/.deepseek/config.toml
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Workspace overlay:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&amp;lt;workspace&amp;gt;/.deepseek/config.toml
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Some sensitive fields, such as &lt;code&gt;api_key&lt;/code&gt;, &lt;code&gt;base_url&lt;/code&gt;, &lt;code&gt;provider&lt;/code&gt;, and &lt;code&gt;mcp_config_path&lt;/code&gt;, are denied in workspace overlays.&lt;/p&gt;
&lt;p&gt;DeepSeek-TUI supports the default &lt;code&gt;deepseek&lt;/code&gt; provider plus NVIDIA NIM, Fireworks, OpenAI-compatible endpoints, SGLang, vLLM, Ollama, and others.&lt;/p&gt;
&lt;p&gt;OpenAI-compatible example:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;2
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;deepseek auth &lt;span class=&#34;nb&#34;&gt;set&lt;/span&gt; --provider openai --api-key &lt;span class=&#34;s2&#34;&gt;&amp;#34;YOUR_OPENAI_COMPATIBLE_API_KEY&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nv&#34;&gt;OPENAI_BASE_URL&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;https://openai-compatible.example/v4&amp;#34;&lt;/span&gt; deepseek --provider openai --model glm-5
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Ollama example:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;2
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;ollama pull deepseek-coder:1.3b
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;deepseek --provider ollama --model deepseek-coder:1.3b
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;h2 id=&#34;cost-and-context&#34;&gt;Cost and Context
&lt;/h2&gt;&lt;p&gt;DeepSeek-TUI is designed around DeepSeek V4. The README mentions &lt;code&gt;deepseek-v4-pro&lt;/code&gt; and &lt;code&gt;deepseek-v4-flash&lt;/code&gt;, 1M-token context windows, token usage, cost estimates, and prefix-cache telemetry.&lt;/p&gt;
&lt;p&gt;For light tasks, &lt;code&gt;deepseek-v4-flash&lt;/code&gt; or auto mode may be enough. For complex refactors, long-context debugging, and architecture work, use higher thinking or Pro.&lt;/p&gt;
&lt;p&gt;Pricing and discounts change, so check DeepSeek’s official pricing page and the current TUI cost estimates before relying on numbers.&lt;/p&gt;
&lt;h2 id=&#34;suggested-workflow&#34;&gt;Suggested Workflow
&lt;/h2&gt;&lt;p&gt;Start safely:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Try it in a small test repository.&lt;/li&gt;
&lt;li&gt;Run &lt;code&gt;deepseek doctor&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Use Plan mode for read-only exploration.&lt;/li&gt;
&lt;li&gt;Use Agent mode for small edits.&lt;/li&gt;
&lt;li&gt;Review changes with git diff and tests.&lt;/li&gt;
&lt;li&gt;Learn &lt;code&gt;/restore&lt;/code&gt; and session recovery.&lt;/li&gt;
&lt;li&gt;Use YOLO only in trusted temporary branches.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Do not store API keys in project files. For company code, confirm provider, logging, web search, and compliance rules first.&lt;/p&gt;
&lt;h2 id=&#34;summary&#34;&gt;Summary
&lt;/h2&gt;&lt;p&gt;DeepSeek-TUI is a full terminal AI coding agent. It brings DeepSeek V4, TUI interaction, tool calls, LSP diagnostics, session recovery, rollback, MCP, and skills into one Rust-based workflow.&lt;/p&gt;
&lt;p&gt;It is not the lightest DeepSeek client, but its strength is moving from chat to executable local development.&lt;/p&gt;
&lt;h2 id=&#34;references&#34;&gt;References
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;&lt;a class=&#34;link&#34; href=&#34;https://github.com/Hmbown/DeepSeek-TUI&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;DeepSeek-TUI GitHub repository&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class=&#34;link&#34; href=&#34;https://deepseek-tui.com/&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;DeepSeek-TUI website&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class=&#34;link&#34; href=&#34;https://www.npmjs.com/package/deepseek-tui&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;DeepSeek-TUI npm package&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class=&#34;link&#34; href=&#34;https://platform.deepseek.com/api_keys&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;DeepSeek API Keys&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
        </item>
        <item>
        <title>sudo vs sudo-rs: What the Rust Version of sudo Changes</title>
        <link>https://knightli.com/en/2026/05/01/sudo-vs-sudo-rs-rust-linux-command/</link>
        <pubDate>Fri, 01 May 2026 19:27:08 +0800</pubDate>
        
        <guid>https://knightli.com/en/2026/05/01/sudo-vs-sudo-rs-rust-linux-command/</guid>
        <description>&lt;p&gt;&lt;code&gt;sudo&lt;/code&gt; is one of the most familiar commands for Linux users.
It allows a normal user to temporarily run commands with higher privileges within an authorized scope, such as installing software, changing system configuration, or restarting services.&lt;/p&gt;
&lt;p&gt;Recently, &lt;code&gt;sudo-rs&lt;/code&gt; has attracted more attention because Ubuntu 25.10 starts using the Rust implementation &lt;code&gt;sudo-rs&lt;/code&gt; by default to replace classic sudo.
For ordinary users, the command on the surface is still &lt;code&gt;sudo&lt;/code&gt;.
The real change is underneath: the implementation being executed may already be the Rust version of sudo.&lt;/p&gt;
&lt;p&gt;This raises two natural questions:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Is something wrong with classic sudo?&lt;/li&gt;
&lt;li&gt;Will sudo-rs affect daily use and server configuration?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The short answer is: ordinary desktop users basically do not need to worry; if you maintain servers, have written complex sudoers rules, or rely on special sudo behavior, you should test carefully.&lt;/p&gt;
&lt;h2 id=&#34;what-is-sudo-rs&#34;&gt;What Is sudo-rs?
&lt;/h2&gt;&lt;p&gt;&lt;code&gt;sudo-rs&lt;/code&gt; is an implementation of sudo / su written in Rust.
Its goal is not to create a completely different new command, but to reimplement the main features of classic sudo while using Rust&amp;rsquo;s memory-safety properties to reduce common security risks.&lt;/p&gt;
&lt;p&gt;Classic sudo is mainly written in C. It has a long history and a very complete feature set.
That maturity brings stability, but it also brings maintenance burden.
Much of the code comes from very early Unix/Linux use cases, with many compatibility paths, extensions, and edge-case handlers added over time.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;sudo-rs&lt;/code&gt; chooses to reimplement it for several reasons:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;reduce memory-safety issues with Rust;&lt;/li&gt;
&lt;li&gt;use a more modern code structure to lower maintenance difficulty;&lt;/li&gt;
&lt;li&gt;remove some historical features and risky default behaviors;&lt;/li&gt;
&lt;li&gt;attract new contributors familiar with Rust;&lt;/li&gt;
&lt;li&gt;provide a more auditable foundation for future privilege-elevation tools.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;However, &lt;code&gt;sudo-rs&lt;/code&gt; is not a 100% compatible replacement for classic sudo.
It is still under development. Some traditional features have not been implemented yet, and others may never be implemented.&lt;/p&gt;
&lt;h2 id=&#34;what-ordinary-users-will-notice&#34;&gt;What Ordinary Users Will Notice
&lt;/h2&gt;&lt;p&gt;For ordinary users, very little changes.&lt;/p&gt;
&lt;p&gt;You still use it like this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;sudo apt update
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Or:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;sudo systemctl restart nginx
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;In Ubuntu 25.10, &lt;code&gt;sudo&lt;/code&gt; points to &lt;code&gt;sudo-rs&lt;/code&gt;.
Users do not need to change commands to &lt;code&gt;sudo-rs&lt;/code&gt;, and common &lt;code&gt;sudo&lt;/code&gt; calls in scripts will not immediately fail because of a command-name change.&lt;/p&gt;
&lt;p&gt;The most visible change is password input feedback.
&lt;code&gt;sudo-rs&lt;/code&gt; shows asterisks by default when you type the password.
Classic sudo can also be configured to behave this way, but many distributions default to showing no characters.&lt;/p&gt;
&lt;p&gt;Some error and warning messages may also use different wording.
For example, password failures, permission problems, and incompatible configuration may show prompts that are not exactly the same as before.
This has little impact on human users, but scripts that parse sudo&amp;rsquo;s error output should be checked.&lt;/p&gt;
&lt;h2 id=&#34;what-administrators-should-watch&#34;&gt;What Administrators Should Watch
&lt;/h2&gt;&lt;p&gt;System administrators and advanced users are the ones who need to pay attention.&lt;/p&gt;
&lt;p&gt;The classic sudo ecosystem is large, and many servers have complex sudoers configurations.
These configurations may include command-argument matching, environment-variable control, logging, email notifications, PAM behavior, and host-group policies.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;sudo-rs&lt;/code&gt; currently has some differences from classic sudo.
For example, the original article notes that &lt;code&gt;sudo-rs&lt;/code&gt; does not include classic sudo&amp;rsquo;s sendmail support.
Some environments used sendmail to send notifications about sudo usage, and those setups will need another approach when migrating.&lt;/p&gt;
&lt;p&gt;For authentication, &lt;code&gt;sudo-rs&lt;/code&gt; uses PAM.
This means behaviors such as resource limits and umask should be configured more through PAM, rather than relying entirely on the sudoers file.
If you previously handled many details in sudoers, verify that those rules still work before switching.&lt;/p&gt;
&lt;p&gt;Another important change is wildcard support in command argument positions.
&lt;code&gt;sudo-rs&lt;/code&gt; does not support wildcards in command argument positions, in order to avoid common sudoers configuration mistakes.
This is good for security, but it may affect existing rules.&lt;/p&gt;
&lt;h2 id=&#34;how-ubuntu-handles-sudo-and-sudo-rs&#34;&gt;How Ubuntu Handles sudo and sudo-rs
&lt;/h2&gt;&lt;p&gt;Starting with Ubuntu 25.10, the system uses &lt;code&gt;sudo-rs&lt;/code&gt; by default.
Users continue typing &lt;code&gt;sudo&lt;/code&gt;, while the Rust implementation runs underneath.&lt;/p&gt;
&lt;p&gt;Classic sudo has not disappeared immediately.
During Ubuntu&amp;rsquo;s transition, classic sudo is still kept as &lt;code&gt;sudo-ws&lt;/code&gt;.
If you truly need the traditional implementation, you can use &lt;code&gt;sudo-ws&lt;/code&gt;, or switch the default sudo through the alternatives system.&lt;/p&gt;
&lt;p&gt;The switching command looks like this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;sudo update-alternatives --config sudo
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;That said, ordinary users should not actively switch back to classic sudo.
If you have not customized sudoers and do not rely on special behavior, following the distribution default is simpler.&lt;/p&gt;
&lt;p&gt;If you want to test on older Ubuntu versions, &lt;code&gt;sudo-rs&lt;/code&gt; has been available from the universe repository since Ubuntu 24.04.
Other distributions may also provide packages, but command names and integration methods may differ.&lt;/p&gt;
&lt;h2 id=&#34;why-sudo-rs-uses-rust&#34;&gt;Why sudo-rs Uses Rust
&lt;/h2&gt;&lt;p&gt;sudo is a high-privilege tool.
If this kind of tool has a vulnerability, the consequences can be much more serious than with ordinary commands.
Historically, sudo has had several privilege-escalation vulnerabilities.&lt;/p&gt;
&lt;p&gt;Rust&amp;rsquo;s advantage is memory safety.
Through ownership, borrow checking, and the type system, it reduces common problems such as dangling pointers, out-of-bounds access, and use-after-free.
This does not guarantee that the program is absolutely safe, but it can reduce a class of vulnerabilities common in C/C++ projects.&lt;/p&gt;
&lt;p&gt;For a tool like sudo, which sits in a security-sensitive position for a long time, rewriting it in a safer language has practical meaning.
It is not just &amp;ldquo;Rust for Rust&amp;rsquo;s sake&amp;rdquo;; it is an attempt to reduce maintenance and audit cost.&lt;/p&gt;
&lt;p&gt;Of course, language cannot solve every security problem.
Permission-check logic, configuration parsing, PAM interaction, environment-variable handling, logging, and user experience still require careful design and long-term testing.&lt;/p&gt;
&lt;h2 id=&#34;sudo-rs-is-not-the-only-alternative&#34;&gt;sudo-rs Is Not the Only Alternative
&lt;/h2&gt;&lt;p&gt;There have always been other alternatives in the sudo ecosystem.&lt;/p&gt;
&lt;p&gt;One common example is &lt;code&gt;doas&lt;/code&gt;.
It comes from OpenBSD and is designed to be simpler, with a smaller configuration surface.
Some users prefer it because it is not as complex as sudo.&lt;/p&gt;
&lt;p&gt;There are also some Rust or systemd-related alternatives, such as RootAsRole and systemd&amp;rsquo;s &lt;code&gt;run0&lt;/code&gt;.
However, these tools do not have exactly the same goals or target scenarios.&lt;/p&gt;
&lt;p&gt;For most Linux distributions, sudo is still the default choice.
The significance of &lt;code&gt;sudo-rs&lt;/code&gt; is that it tries to keep user habits unchanged while replacing the underlying implementation with a more modern codebase.&lt;/p&gt;
&lt;h2 id=&#34;what-to-check-before-migrating&#34;&gt;What to Check Before Migrating
&lt;/h2&gt;&lt;p&gt;If you are just a personal desktop user, follow the distribution default.&lt;/p&gt;
&lt;p&gt;If you maintain servers or workstations, check the following:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Whether there are complex &lt;code&gt;/etc/sudoers&lt;/code&gt; or &lt;code&gt;/etc/sudoers.d/&lt;/code&gt; rules.&lt;/li&gt;
&lt;li&gt;Whether command-argument wildcards are used.&lt;/li&gt;
&lt;li&gt;Whether sudo email notifications are relied on.&lt;/li&gt;
&lt;li&gt;Whether scripts parse sudo&amp;rsquo;s error output.&lt;/li&gt;
&lt;li&gt;Whether sudoers controls umask, resource limits, or environment variables.&lt;/li&gt;
&lt;li&gt;Whether LDAP, PAM, SSSD, or other authentication integrations are used.&lt;/li&gt;
&lt;li&gt;Whether automation/deployment scripts assume classic sudo behavior.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;You can first verify on a test machine:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;sudo -l
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Then run key maintenance commands and confirm that permissions, environment variables, and logging behavior match expectations.&lt;/p&gt;
&lt;h2 id=&#34;should-you-switch-to-sudo-rs-manually&#34;&gt;Should You Switch to sudo-rs Manually?
&lt;/h2&gt;&lt;p&gt;If your distribution has already switched by default, ordinary users can accept it directly.
If you are using a server or production environment, do not manually replace sudo just for experimentation.&lt;/p&gt;
&lt;p&gt;A safer process is:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;install &lt;code&gt;sudo-rs&lt;/code&gt; in a test environment;&lt;/li&gt;
&lt;li&gt;verify existing sudoers configuration item by item;&lt;/li&gt;
&lt;li&gt;check PAM, logging, auditing, and automation scripts;&lt;/li&gt;
&lt;li&gt;confirm the rollback path;&lt;/li&gt;
&lt;li&gt;migrate after the distribution provides stable integration.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This kind of tool sits on the privilege chain, so it is not enough to judge it by whether a few commands can run.
The real test is boundary conditions and failure cases.&lt;/p&gt;
&lt;h2 id=&#34;summary&#34;&gt;Summary
&lt;/h2&gt;&lt;p&gt;&lt;code&gt;sudo-rs&lt;/code&gt; is a Rust implementation of classic sudo, aiming to support sudo&amp;rsquo;s core features with a more modern and safer codebase.
Ubuntu 25.10 enabling it by default shows that major distributions are starting to push this direction seriously.&lt;/p&gt;
&lt;p&gt;For ordinary users, the change is small.
You still type &lt;code&gt;sudo&lt;/code&gt;; only the underlying implementation may have become &lt;code&gt;sudo-rs&lt;/code&gt;.
At most, you may notice password asterisks or slightly different error messages.&lt;/p&gt;
&lt;p&gt;For system administrators, compatibility is the key issue.
If the system has complex sudoers rules, sendmail notifications, PAM integration, argument wildcards, or scripts that depend on sudo output, test before upgrading.&lt;/p&gt;
&lt;p&gt;Rewriting in Rust is not a magic cure, but for a security-sensitive tool like sudo, reducing memory-safety risk and maintenance complexity is a direction worth taking seriously.&lt;/p&gt;
&lt;p&gt;References:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a class=&#34;link&#34; href=&#34;https://itsfoss.com/sudo-vs-sudo-rs/&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;It&amp;rsquo;s FOSS: sudo vs sudo-rs: What You Need to Know&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class=&#34;link&#34; href=&#34;https://github.com/trifectatechfoundation/sudo-rs&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;sudo-rs GitHub project&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
        </item>
        
    </channel>
</rss>
