william

Keep Calm and Markdown.

Deepseek cli 工具 Reasonix

这篇博文本身就是 reasonix 自动完成的。

前两天在逛 GitHub 的时候,又看到 DeepSeek 生态里冒出来一个叫 Reasonix 的项目。第一眼感觉就是又一个 AI coding agent 套壳,没什么稀奇的。但当我看完它的 README 和工程文档后,发现这事儿没那么简单——尤其有意思的是它的核心理念:专为 DeepSeek 的前缀缓存(automatic prefix cache)设计,所有行为都围绕这个来优化,把长会话的 token 成本压到最低。

要知道 DeepSeek 有一个很厉害的特性——自动前缀缓存。如果你的请求前缀跟上一次完全一样(byte-stable),这部分 tokens 就不重新算,只算新内容的计算成本。这意味着 cache hit 的价格可以低到 ¥0.02/M tokens,而正常输入是 ¥1/M,差了 50 倍。Reasonix 整个架构就是奔着这个去的——系统提示词、工具描述、记忆文档,全链路保持字节稳定,永远不会在会话中途偷偷修改前缀。

1
2
3
4
npm install -g reasonix
reasonix setup
export DEEPSEEK_API_KEY=sk-xxxxxxxxxxxxxxxx
reasonix chat

这是我自己的环境,当时从源码编译的

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#需要设置 go 代理
export GOPROXY=https://goproxy.cn,direct
git pull
git pull origin main-v
make build
make cross

cd ./dist/
./reasonix-linux-amd64

alias rs='~/git/DeepSeek-Reasonix/dist/reasonix-linux-amd64'

reasonix — a config- and plugin-driven coding agent (multi-model)

Usage:
  reasonix chat [--model NAME] [-c|--continue] [--resume]   interactive session (multi-turn; -c resumes the latest, --resume picks one)
  reasonix run  [--model NAME] [--max-steps N] [-c|--continue] [--resume PATH] <task>   run one task and exit
  reasonix serve [--model NAME] [--addr HOST:PORT]      serve the session over HTTP+SSE (browser client at /)
  reasonix acp [--model NAME]                           serve Agent Client Protocol over stdio (also: reasonix --acp)
  reasonix setup [path]                                 interactive config wizard; writes reasonix.toml (+ .env)
  reasonix config auto-plan [off|on]                    configure automatic plan mode
  reasonix mcp <add|remove|list>                        manage MCP servers in reasonix.toml
  reasonix doctor [--json]                              print redacted local diagnostics
  reasonix version
  reasonix help

Examples:
  reasonix chat
  reasonix chat --continue
  reasonix run "implement the TODOs in main.go"
  reasonix run --model mimo-pro "add unit tests for this function"
  echo "explain this code" | reasonix run

Configuration:
  Resolution: flag > ./reasonix.toml > ~/.config/reasonix/config.toml > built-in defaults
  Secrets come from the environment via api_key_env (e.g. DEEPSEEK_API_KEY).
  Run 'reasonix setup' to scaffold a config; see docs/SPEC.md.

## 启动 server
reasonix serve

CentOS7 vault.centos.org 报错

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
[root@localhost ~]# yum update
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
http://vault.centos.org/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "C
Trying other mirror.


 One of the configured repositories failed (CentOS-7 - Base),
 and yum doesn't have enough cached data to continue. At this point the only
 safe thing yum can do is fail. There are a few ways to work "fix" this:

     1. Contact the upstream for the repository and get them to fix the problem.

     2. Reconfigure the baseurl/etc. for the repository, to point to a working
        upstream. This is most often useful if you are using a newer
        distribution release than is supported by the repository (and the
        packages for the previous distribution release still work).

     3. Run the command with the repository temporarily disabled
            yum --disablerepo=base ...

     4. Disable the repository permanently, so yum won't use it by default. Yum
        will then just ignore the repository until you permanently enable it
        again or use --enablerepo for temporary usage:

            yum-config-manager --disable base
        or
            subscription-manager repos --disable=base

     5. Configure the failing repository to be skipped, if it is unavailable.
        Note that yum will try to contact the repo. when it runs most commands,
        so will have to try and fail each time (and thus. yum will be be much
        slower). If it is a very temporary problem though, this is often a nice
        compromise:

            yum-config-manager --save --setopt=base.skip_if_unavailable=true

failure: repodata/repomd.xml from base: [Errno 256] No more mirrors to try.

编译安装 nvim

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 git clone https://github.com/neovim/neovim git checkout stable # 创建构建目录 mkdir build && cd build # 配置 CMake 指定安装路径 cmake .. \ -DCMAKE_INSTALL_PREFIX=$HOME/.local/neovim \ -DCMAKE_PREFIX_PATH=$HOME/.local \ -DCMAKE_BUILD_TYPE=Release \ -DENABLE_JEMALLOC=ON \ # 自定义所有

maple font

最近发现一款不错的字体. 1 2 3 4 5 6 7 8 ## https://github.com/subframe7536/maple-font/releases/tag/v7.9 wget https://github.com/subframe7536/maple-font/releases/download/v7.9/MapleMono-NF-CN-unhinted.zip unzip MapleMono-NF-CN-unhinted.zip -d maple-font cd maple-font cp *ttf /usr/share/fonts/truetype/ fc-cache -fv 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 ## -----------------------------------------------------------------------------font [font] size = 14.0 [font.normal] # family = "SauceCodePro Nerd Font" # family = "JetBrainsMono

docker 更改存储目录

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 docker info |grep -i dir ## 默认存储在 /var/lib/docker ## Docker Root Dir: /var/lib/docker ## 创建磁盘 mkdir -p /data/docker cp -r /var/lib/docker /data/docker ## 修改路径 vim /etc/docker/daemon.json ## 设置到目标路径 { "data-root": "/data/docker" } sudo systemctl daemon-reload sudo systemctl
0%