← 返回
开发者工具 Key 中文

Dagny Nostr (nak)

Manage Nostr posting and engagement via the nak CLI. Use for creating notes, replying in threads, tagging npubs, checking replies/mentions, monitoring a rela...
通过nak CLI管理Nostr发布和互动,包括创建帖子、线程回复、标记npub用户、查看回复和提及、监控关系等。
edwardbickerton
开发者工具 clawhub v0.1.4 1 版本 99830.8 Key: 需要
★ 0
Stars
📥 1,180
下载
💾 6
安装
1
版本
#latest

概述

Nostr (nak)

Overview

Use nak for all Nostr actions: publish notes, reply in threads, and query relays for replies/mentions. Default relay: wss://relay.primal.net unless the user specifies another.

Install / Update nak

  • Repo: https://github.com/fiatjaf/nak
  • Install (script): curl -sSL https://raw.githubusercontent.com/fiatjaf/nak/master/install.sh | sh
  • Update: re-run the install script above (it installs latest)
  • Tip: review the script before running if you want to audit what it does.

Onboarding (keys)

  • Generate a new key: nak key generate (prints nsec + npub)
  • Save the secret: store NOSTR_SECRET_KEY in a shell profile or a local .env with restricted permissions.
  • Example: export NOSTR_SECRET_KEY="nsec1..."
  • Optional: chmod 600 .env if you store it locally.
  • Prefer env vars over inline --sec in commands.

Quick Start (common tasks)

  • Post a note: nak event -k 1 --sec $NOSTR_SECRET_KEY -c "..."
  • Reply to a note: include root and reply tags (see below)
  • Check replies: nak req -k 1 -e -l
  • Check mentions: nak req -k 1 -p -l

Workflow: Posting & Replies

1) Create a new note

  • Build content.
  • Publish:

```bash

nak event -k 1 --sec $NOSTR_SECRET_KEY -c "" wss://relay.primal.net

```

2) Reply to a reply (correct threading)

Always include both root and reply tags so clients display it as a reply:

  • root = original top‑level note id
  • reply = the specific note you’re replying to

Use -t e=";;root" and -t e=";;reply".

Example:

nak event -k 1 --sec $NOSTR_SECRET_KEY \
  -t e="<root_id>;wss://relay.primal.net;root" \
  -t e="<reply_id>;wss://relay.primal.net;reply" \
  -p <other_pubkey_hex> \
  -c "<reply content>" \
  wss://relay.primal.net

3) Check for replies to a note

nak req -k 1 -e <root_id> -l 20 wss://relay.primal.net

4) Check mentions of your pubkey

nak req -k 1 -p <your_pubkey_hex> -l 20 wss://relay.primal.net

Conventions

  • Default relay: wss://relay.primal.net
  • Prefer NOSTR_SECRET_KEY env var instead of inline --sec.
  • When tagging users, include -p .
  • For human-facing links, encode with nak encode nevent ... and format as https://primal.net/e/.

References

  • Use nak event --help and nak req --help for flag details.

版本历史

共 1 个版本

  • v0.1.4 当前
    2026-03-29 07:30 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

developer-tools

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 672 📥 324,407
developer-tools

Gog

steipete
Google Workspace 命令行工具,支持 Gmail、日历、云端硬盘、通讯录、表格和文档。
★ 921 📥 185,835
developer-tools

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 68 📥 180,374