360 Secure SkillHub
360 安全技能中心

Nostr Nak

提供使用 Nostr Army Knife (nak) CLI 的通用指引:非交互环境下 stdout 缓冲会导致挂起,需用 script 强制伪终端;默认使用发现中继,用户指定中继时覆盖默认值;查询用 -a 传公钥,发布用 --sec 传私钥,并给出获取最近笔记的调用示例。

samthomson
samthomson
热度 70.38
最近更新 2026-05-11 15:57:11
分类:自动化依赖:代码执行 / 第三方 API应用场景:自动化脚本 / 社交媒体

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add nostr-nak
Metadata
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.io
  • wss://relay.primal.net
  • wss://relay.nostr.band

If the user specifies a relay, override these defaults.

Identity Handling

  • Querying: Use npub... or hex pubkey with the -a flag.
  • Posting: Use nsec... or hex private key with the --sec flag.

Usage Examples

Fetch last 5 notes: script -q -c "nak req -k 1 -a <npub> <relays> -l 5" /dev/null | cat