{"skill":{"slug":"nak","displayName":"Nostr Army Knife (nak)","summary":"The Nostr Army Knife (nak) CLI. Use this skill to interact with the Nostr network, publish events, query relays, manage keys, and perform advanced Nostr oper...","description":"---\nname: nak\ndescription: The Nostr Army Knife (nak) CLI. Use this skill to interact with the Nostr network, publish events, query relays, manage keys, and perform advanced Nostr operations like NIP-46 signing, NIP-60 wallet management, and Blossom file uploads.\ncompatibility: Requires `nak` CLI (v0.15.3+ recommended).\n---\n\n# `nak` - Nostr Army Knife\n\n`nak` is a powerful CLI for interacting with the Nostr protocol. It handles event creation, signing, publishing, querying, key management, and more.\n\n## Usage\n\n### 1. Events (`nak event`)\n\nGenerate, sign, and publish events.\n\n```bash\n# Publish a simple text note (Kind 1) to specific relays\nnak event -c \"Hello Nostr\" wss://relay.damus.io wss://nos.lol\n\n# Publish using a specific secret key (hex or nsec)\nnak event -c \"Authenticated message\" --sec <nsec/hex> wss://relay.damus.io\n\n# Reply to an event (Kind 1)\nnak event -c \"I agree!\" -e <event_id> --sec <nsec/hex> wss://relay.damus.io\n\n# Create a profile metadata event (Kind 0)\necho '{\"name\":\"bob\",\"about\":\"builder\"}' | nak event -k 0 --sec <nsec/hex> wss://relay.damus.io\n\n# Generate an event JSON without publishing (dry run)\nnak event -c \"Just checking\" -k 1 --sec <nsec/hex>\n```\n\n### 2. Querying (`nak req`)\n\nSubscribe to relays and filter events.\n\n```bash\n# Listen for all Kind 1 notes on a relay\nnak req -k 1 wss://relay.damus.io\n\n# Listen for a specific author\nnak req -a <pubkey_hex> wss://relay.damus.io\n\n# Listen for replies to a specific event (E-tag)\nnak req -e <event_id> wss://relay.damus.io\n\n# Fetch with a limit\nnak req -k 1 --limit 10 wss://relay.damus.io\n\n# Output is stream of [\"EVENT\", ...] JSON arrays.\n# Pipe to jq for readability:\nnak req -k 1 wss://relay.damus.io | jq\n```\n\n### 3. Fetching (`nak fetch`)\n\nFetch specific events by reference (NIP-19/NIP-05).\n\n```bash\n# Fetch an event by nevent\nnak fetch nevent1...\n\n# Fetch a profile\nnak fetch npub1...\n\n# Fetch from specific relays\nnak fetch npub1... --relay wss://relay.nostr.band\n```\n\n### 4. Keys & Encoding (`nak key`, `nak encode`, `nak decode`)\n\nManage keys and NIP-19 entities.\n\n```bash\n# Generate a new keypair\nnak key generate\n\n# Convert nsec to hex (or vice versa - automated detection)\nnak decode nsec1...\n\n# Encode a hex pubkey to npub\nnak encode npub <hex_pubkey>\n\n# Encode an event ID to nevent with relay hints\nnak encode nevent <event_id> --relay wss://relay.damus.io\n```\n\n### 5. Encryption (NIP-44)\n\nEncrypt and decrypt messages.\n\n```bash\n# Encrypt a message for a recipient\nnak encrypt --sec <sender_nsec> --target <recipient_pubkey> \"Secret message\"\n\n# Decrypt a message\nnak decrypt --sec <recipient_nsec> --source <sender_pubkey> <base64_ciphertext>\n```\n\n### 6. Wallet (NIP-60)\n\nManage a Cashu wallet backed by Nostr relays.\n\n```bash\n# Show balance (reloads from relays)\nnak wallet --sec <nsec>\n\n# Pay a Lightning invoice\nnak wallet pay --sec <nsec> lnbc1...\n```\n\n### 7. Blossom (File Storage)\n\nInteract with Blossom media servers.\n\n```bash\n# Upload a file\nnak blossom upload --server https://cdn.example.com --sec <nsec> ./image.png\n```\n\n## Agentic/MCP Mode\n\n`nak` has an `mcp` command that starts a Model Context Protocol server.\n```bash\nnak mcp\n```\nThis is useful if you want to integrate `nak` directly as an MCP tool source, but usually, you will invoke the CLI commands directly via `exec`.\n\n## Tips\n\n*   **Piping:** `nak` is designed for piping. You can pipe JSON into `nak event` to sign it, or pipe `nak req` output into other tools.\n*   **Environment Variables:**\n    *   `NOSTR_SECRET_KEY`: Set this to avoid passing `--sec` every time.\n","tags":{"latest":"0.1.0"},"stats":{"comments":0,"downloads":386,"installsAllTime":0,"installsCurrent":0,"stars":0,"versions":1},"createdAt":1771623011211,"updatedAt":1778991957449},"latestVersion":{"version":"0.1.0","createdAt":1771623011211,"changelog":"Initial release","license":null},"metadata":null,"owner":{"handle":"a1denvalu3","userId":"s17227w1qa2j9gb64qjvgq1bwx884rwh","displayName":"a1denvalu3","image":"https://avatars.githubusercontent.com/u/43107113?v=4"},"moderation":null}