Atuin
$ atuin 社区开源 中风险Atuin 用带索引的 SQLite 数据库替代传统纯文本 Shell 历史,记录时间戳、工作目录、退出码与耗时,并支持可选的端到端加密同步。虽然 atuin search -i 会打开 TUI,但无交互的 atuin search --format 与 atuin history list --cmd-only 可稳定运行于 Agent 脚本中。
brew install atuin 通过 atuin search --format 在本地毫秒级检索 SQLite 命令历史,避免把敏感历史记录暴露给 MCP 服务。
Agent 友好度体检单
当前为静态评估(本机尚未安装或尚未运行探针)。可在本地运行 npm run data:probe 并提交 data/probes/ 升级为实测证据。
FCRS-1.0 六维评分拆解
支持无交互 atuin search --format、--cwd、--exit、--limit 与 atuin history list --cmd-only,但尚无原生 --json 输出。
- Non-interactive
atuin search(without-i) and--formattemplating - Rich SQLite filters (
--cwd,--exit,--after,--before)
本地只读查询安全且同步经过端到端加密,但历史命令本身可能包含过往输入的敏感参数或口令。
- Client-side E2E encryption before remote sync
- History entries may contain secrets typed in past shell commands
高速 Rust 二进制,支持 macOS、Linux 与 Windows,可通过 Homebrew、cargo install atuin --locked 与官方包安装。
- Cross-platform Rust binary
按目录、主机和退出码建索引的 SQLite 历史,检索效率远胜直接 grep 扁平 .zsh_history 文件。
- Indexed SQLite history with duration and exit code metadata
活跃维护的 MIT 开源 Rust 项目(atuinsh/atuin),拥有稳健的社区与商业支持。
- Frequent releases and well-maintained codebase
docs.atuin.sh 文档详尽覆盖检索参数、加密同步与自托管部署。
- Structured CLI reference at docs.atuin.sh
安全边界、鉴权与放权指南
本地 SQLite 历史库、同步会话令牌与端到端加密密钥存放在 ~/.local/share/atuin/ 与 ~/.config/atuin/config.toml。
CLI 与自建同步服务端以 MIT 开源免费使用;官方托管 Atuin Cloud 为可选服务。
# Atuin Agent Rules - NEVER pass `-i` (`--interactive`) to `atuin search` inside agent shells; always use `--format` or `atuin history list --cmd-only` with `--limit`. - Treat command history as sensitive—never dump unrestricted `atuin history list` output that may contain inline tokens.
Agent 高频安全命令配方
只读查询(安全推荐)
atuin search --cwd . --exit 0 --limit 20 --format "{time}\t{command}" 使用 --format 查询在 . 下成功执行的历史命令,不传入 -i 以免进入交互式 TUI。
atuin history list --cmd-only --cwd . | tail -n 20
从本地 SQLite 历史中提取纯命令字符串,便于快速回溯常用指令。
受控写入与预演
atuin sync
在开启同步的前提下执行端到端加密的增量历史同步。
核心优势
- + 支持无交互
atuin search,可按--cwd、--exit、--limit过滤并自定义--format。 - + 本地 SQLite 高速检索叠加端到端加密同步。
注意事项与踩坑点
- ! 暂未提供原生
--json参数,需借助--format模板拼接格式化输出。 - ! 宽泛拉取历史记录可能意外暴露曾输入过的 Token 或敏感参数。