跳到正文
原文
Hacker News · agent 关键词· frodikarlsson·· 2026-09-28精选AI 评分52

开发者开源 onesie:面向 Jev 等 System One 模型的 Unix 管道 CLI

Show HN: onesie – An expressive Unix-pipeable CLI for System One models like Jev

AI 导读

作者开源了命令行工具 onesie,用于在 shell 管道、脚本和智能体工作流中调用 Jev 等 System One 模型,支持缓存、批处理、去重与流式输出。

推荐理由

作者解释为何选用 CLI 而非 MCP 服务端承载本地智能体工作流,并给出可复用的阈值校准流程。

正文 · AI 翻译

onesie 是一个 Unix 风格的 CLI,用于在 shell 管道、脚本和 agentic 工作流中使用 System One 模型:https://github.com/frodi-karlsson/onesie

  echo 'EVERYTHING IS DOWN, CALL ME NOW' | onesie 'does this convey urgency' -r
  # 0.99

它提供了缓存、批处理、去重、Unix 可组合性、流式处理,甚至还能基于标注数据校准阈值和问题:

  onesie calibrate -f shell-safety -i jsonl --map .command --id .id \
    --label destroys=.destroys --label secrets=.secrets --label network=.network \
    --cuts 0.25,0.5 < examples/data/shell-safety.jsonl

  destroys, yes/no: labelled 40, 16 yes, 24 no, 0 failed. AUC 1.00
    cut flagged catches false alarms right when flagged
    0.25 18 16/16 100% 81-100% 2/24 8% 2-26% 16/18 89% 67-97%
    0.50 15 15/16 94% 72-99% 0/24 0% 0-14% 15/15 100% 80-100%
  worst misses
    echo-overwrite labelled yes answered 0.37

它可与 TypeSafe 的 Jev、通过 OpenRouter 使用的 Jev、Berget 的 System One 模型,以及任何兼容 Jev 的 API 配合使用。

如果你还不了解,System One 是 Typesafe 对一类模型的称呼。我个人觉得它们非常令人兴奋。你可以在这里了解更多:https://typesafe.ai/blog/introducing-system-one-models-and-j...。

当 Jev 发布时,我最早的小项目之一就是用它对文件进行“lint”。这很难,我发现别人做得更好,但我学到了校准问题以尽量减少假阴性/假阳性的重要性。

后来我开始用脚本与 Jev 交互,发现自己想要一些在其他 CLI 中找不到的功能,于是我构建了 onesie。以下是 onesie 能做的更多示例:

在单个请求中提出三个问题

  echo 'Third time asking. I was charged twice and nobody answers. Fix it or I am cancelling.' |
  onesie --ask urgent='is this urgent' \
         --ask team='who should handle this' --pick billing,shipping,technical \
         --ask mood='how frustrated is the customer' --rate calm,annoyed,furious \
         -o values

  {"urgent":0.91,"team":"billing","mood":"furious"}

筛选流式日志条目以供人工审核

  tail -f app.log |
  onesie 'does this line report a failure a person must act on' -i lines --merge -o json \
    --assert 'answer.value < 0.8' |
  jq -c --unbuffered 'select(.answers.assert == false)'

在脚本中对命令进行门控。门控失败退出码为 1,不确定则退出码为 7。注意:在生产环境中大概不要对用户输入运行这个确切的门控。

  echo "$cmd" | onesie -f shell-safety -q
  case $? in
      0) eval "$cmd" ;;
      1) echo blocked ;;
      7) ask_the_user ;;
      *) echo 'no answer, blocked' ;;
  esac

……还有更多。请查看仓库以获取更多示例和详细参考!

显然,如果没有 Jev 类提供商的 API 密钥,很难试用 onesie,不过也有使用模拟数据或空运行的选项。仓库中有关于如何使用密钥进行身份验证的说明。

如果你想要 MCP 服务器或每次运行前的成本估算,shaharia-lab/jev-cli 两者都有。这是个不错的项目。

我选择不做 MCP 服务器,因为我的目标受众是人类和本地 agentic 工作流。对于这些场景,我认为一个好的 CLI 是最好的,尤其是与插件 + 技能结合使用时。我也觉得 onesie 大多数突出的功能并不能通过该协议得到很好的发挥。市面上还有其他专门的 Jev MCP,它们做得也不错。

我选择不做成本估算,因为我对估算 token 或维护一张成本表没有兴趣,毕竟这些模型如此便宜。

你可以通过以下方式安装它

  brew install frodi-karlsson/tap/onesie

或

  go install github.com/frodi-karlsson/onesie/cmd/onesie@latest

是的,开发过程非常 agentic :)

它采用 MIT 许可证。

来源:Hacker News · agent 关键词 · news.ycombinator.com