Stinkpot:基于 SQLite 的 Shell 历史记录工具
Stinkpot: SQLite-backed shell history

原始链接: https://tangled.org/oppi.li/stinkpot

**stinkpot** 是一个轻量级的 Bash shell 历史记录搜索工具,由 SQLite 提供支持。它旨在成为 Atuin 的极简替代方案。与 Atuin 提供的云同步和人工智能集成等丰富功能不同,stinkpot 专注于提供独立于会话的历史记录管理和高效的搜索终端界面(TUI)。 该工具由约 400 行 Go 代码编写而成,非常适合追求精简体验、拒绝臃肿功能的用户。 **主要功能与使用方法:** * **安装:** 用户可以通过 NixOS 的 Home Manager 模块进行集成,或将 `eval "$(stinkpot init)"` 添加到 `.bashrc` 中。 * **入门:** 安装完成后,运行 `stinkpot import` 导入现有的历史记录。 * **搜索:** 使用 `Ctrl+r` 触发界面,浏览命令历史。选中命令后,按 `Tab` 或 `Enter` 键即可确认并重新执行。 * **维护:** 历史记录数据库存储在本地的 `~/.local/share/stinkpot`。如果数据库出现问题,只需删除该文件并重新导入历史记录即可。 Stinkpot 非常适合那些需要简单、高性能且不干扰日常工作的历史记录搜索工具的用户。

Hacker News | 最新 | 往期 | 评论 | 提问 | 展示 | 招聘 | 提交 | 登录 Stinkpot:基于 SQLite 的 shell 历史记录 (tangled.org) 23 点,由 nerdypepper 于 2 小时前发布 | 隐藏 | 往期 | 收藏 | 1 条评论 | 帮助 craftkiller 于 1 小时前发布 | 下一条 [–] 对于使用 zsh 的用户,我一直很喜欢 https://github.com/larkery/zsh-histdb,它完全由 shell 脚本编写,唯一的依赖项就是 sqlite 本身。回复 考虑申请 YC 2026 年秋季批次!申请截止日期为 7 月 27 日。 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系 搜索:
相关文章

原文
stinkpot
--------
                             _
                         _  / \  _
                        (_\/\_/\/_)
                          /\/ \/\
                          \/\_/\/
                           \/_\/
                           "   "

stinkpot is an sqlite backed shell-history searcher for
bash.

stinkpot is a much tinier atuin (https://atuin.sh). i have
been using atuin for a while, but i don't use most of its
features: the sync server, atuin AI, dotfiles manager,
script manager or the KV store. while sync is interesting,
my machines have very different setups and i tend to run
very different commands on them.

my only usecase for atuin was the session agnostic history
management, and the searcher TUI. stinkpot provides these
while being about 400 lines of go.

stinkpot is a tiny turtle species apparently, hence the
name.

develop
-------

to build:

    go build -o stinkpot .

usage
-----

if you use home-manager for nixos, stinkpot has a
home-manager module:

    home-manager.users.<name> = {
      imports = [
        ./home.nix
        inputs.stinkpot.homeManagerModules.default
      ];
    };


if not, just call eval the init script in your .bashrc:

    eval "$(stinkpot init)"


start by importing your existing bash history into stinkpot:

    stinkpot import


and then hit ctrl+r at your shell to trigger reverse search:

    > search history...
     1s vim flake.nix
     3m redis-server
     3m jj l
    35m jj show m
    36m jj git fetch
    39m cd
    40m vim readme.txt
      788 matches · ↑/↓ move · enter accept · esc cancel


hit tab/enter to accept the selection, hit enter again to
execute. the history database is stored in
~/.local/share/stinkpot. if upgrades break the DB, just
delete it and run the import command.
联系我们 contact @ memedata.com