Problem
The CLI requires interactive password input, uses spinners/animations in output, and doesn't provide machine-readable formats. This makes it difficult for:
- AI agents (like OpenClaw assistants)
- CI/CD pipelines
- Automation scripts
- Batch operations
Proposed Solutions
1. Non-interactive Authentication
Add environment variable and flag support:
# Environment variable
HOOT_PASSWORD=xxx hoot -p
# Password from stdin
echo $PASSWORD | hoot -p --password-stdin
# Password from file
hoot -p --password-file ~/.config/nostr-cli/password
2. JSON Output Mode
Add --json flag for machine-readable output:
hoot -l --json
hoot -p --json
hoot -dms --json
Example output:
{
"posts": [
{
"id": "note1...",
"content": "Hello world",
"created_at": "2026-03-25T18:25:19Z",
"relays": ["wss://relay.damus.io"]
}
]
}
3. Quiet Mode
Add -q / --quiet flag to disable spinners, animations, and progress output:
hoot -m "test" -q
hoot -p -q
4. Consistent Exit Codes
- 0 = success
- 1 = general error
- 2 = auth error (wrong password, no key)
- 3 = network error (relay connection failed)
- 4 = validation error (invalid input)
5. Machine-Readable Errors
JSON errors when --json is set:
{
"error": "relay connection failed",
"code": 3,
"relay": "wss://relay.nostr.band"
}
6. Config via Flags
Allow overriding config file settings via flags:
hoot -m "test" --relays wss://damus.io,wss://nos.lol
hoot -p --timeout 30s
7. Batch Operations (optional)
# Multiple posts from file
hoot --batch posts.json
# Multiple commands via stdin
hoot --batch - <<EOF
{"cmd": "update_profile", "name": "Test"}
{"cmd": "post", "content": "Hello"}
EOF
Priority
High - this would enable:
- AI assistants to interact with Nostr programmatically
- Better CI/CD integration
- Scripted automation
- Testing in headless environments
Related
- Subagents running in PTY can't easily pipe passwords
- Spinners/animations break terminal capture
Problem
The CLI requires interactive password input, uses spinners/animations in output, and doesn't provide machine-readable formats. This makes it difficult for:
Proposed Solutions
1. Non-interactive Authentication
Add environment variable and flag support:
2. JSON Output Mode
Add
--jsonflag for machine-readable output:Example output:
{ "posts": [ { "id": "note1...", "content": "Hello world", "created_at": "2026-03-25T18:25:19Z", "relays": ["wss://relay.damus.io"] } ] }3. Quiet Mode
Add
-q/--quietflag to disable spinners, animations, and progress output:hoot -m "test" -q hoot -p -q4. Consistent Exit Codes
5. Machine-Readable Errors
JSON errors when
--jsonis set:{ "error": "relay connection failed", "code": 3, "relay": "wss://relay.nostr.band" }6. Config via Flags
Allow overriding config file settings via flags:
hoot -m "test" --relays wss://damus.io,wss://nos.lol hoot -p --timeout 30s7. Batch Operations (optional)
Priority
High - this would enable:
Related