# Nostr Nak

> General purpose skill for using the Nostr Army Knife (nak) CLI tool with PTY support.

- Skill: `dvcrn/nostr-nak` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add dvcrn/nostr-nak`
- Raw SKILL.md: https://api.skillmd.com/api/skills/dvcrn/nostr-nak/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: dvcrn (https://skillmd.com/u/dvcrn)
- Updated: 2026-09-08
- Page: https://skillmd.com/skills/dvcrn/nostr-nak

---


# 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`

