简介
基于 Nostr Army Knife 的 CLI 交互指南,支持中继发现与密钥管理,助力安全高效地操作去中心化社交协议。
原始描述
General purpose skill for using the Nostr Army Knife (nak) CLI tool with PTY support.
通过你的 Agent 添加
点「快速安装」复制一段指令,粘给你正在用的 Agent(Claude Code、Codex、OpenClaw 等),它会自己完成安装。
或者手动安装
包里是 SKILL.md 加作者附带的文件,解压后目录名就是技能名。
技能申请的权限由作者决定,装之前请确认它能读什么、能执行什么。
中文使用说明 来自收录源
核心用法
nostr-nak 是一个纯文档型 Skill,专注于指导用户正确使用 Nostr Army Knife (nak) CLI 工具。该 Skill 不提供可执行代码,而是作为使用手册存在。
关键使用模式:
- PTY 强制包裹:由于
nak在非交互环境下会因 stdout 缓冲而挂起,必须使用script -q -c "nak ..." /dev/null | cat包裹所有命令 - 默认中继:未指定中继时自动使用
wss://relay.damus.io、wss://relay.primal.net、wss://relay.nostr.band - 身份管理:查询用
-a <npub>,发信用--sec <nsec>
典型示例:获取最近 5 条笔记
script -q -c "nak req -k 1 -a <npub> <relays> -l 5" /dev/null | cat
显著优点
- 技术细节完整:准确指出 nak 的 PTY 依赖问题并提供可靠解决方案
- 安全引导:明确区分公钥查询(npub)与私钥签名(nsec)的使用场景
- 零代码风险:纯 Markdown 文档,无自动执行逻辑,用户完全掌控实际命令执行
- 生态集成:对接 Nostr 主流中继网络,降低新手配置门槛
潜在局限
- 工具依赖前置:用户需自行安装 nak CLI,Skill 不提供安装脚本或版本管理
- T3 来源级别:个人开发者维护,长期更新承诺不确定
- 无许可证声明:SKILL.md 未明确开源协议
- 反馈渠道缺失:未提供作者联系方式或问题上报途径
适合人群
- 熟悉命令行操作的 Nostr 协议用户
- 需要批量查询或自动化 Nostr 数据的技术开发者
- 注重密钥本地管理、不愿依赖第三方客户端的隐私敏感用户
常规风险
- 私钥泄露:
--sec参数在命令历史中可能留下痕迹,建议配合专用密钥管理工具 - 中继可靠性:文档引用中继为第三方公共服务,可用性与数据隐私由对应运营方负责
- 工具供应链:nak 本体需从官方渠道(fiatjaf/nak)获取,避免使用来路不明的二进制分发
技能正文
name: nostr-nak description: General purpose skill for using the Nostr Army Knife (nak) CLI tool with PTY support.
nostr-nak
General purpose skill for using the Nostr Army Knife (nak) CLI tool.
Critical Technical Note (PTY Requirement)
nak hangs in non-interactive environments due to stdout buffering.
Always wrap nak commands in script to force a pseudo-TTY:
script -q -c "nak req ..." /dev/null | cat
Relay Logic
By default, use discovery relays if no relay is specified:
wss://relay.damus.iowss://relay.primal.netwss://relay.nostr.band
If the user specifies a relay, override these defaults.
Identity Handling
- Querying: Use
npub...or hex pubkey with the-aflag. - Posting: Use
nsec...or hex private key with the--secflag.
Usage Examples
Fetch last 5 notes:
script -q -c "nak req -k 1 -a <npub> <relays> -l 5" /dev/null | cat
正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。