[Agent-Friendly] Make CLI usable by AI agents and automation
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
# 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 to disable spinners/animations:
hoot -m "test" -q
hoot -p --quiet
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
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
[Agent-Friendly] Make CLI usable by AI agents and automation
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
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/--quietto disable spinners/animations:hoot -m "test" -q hoot -p --quiet4. 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)
# Multiple posts from file hoot --batch posts.jsonPriority
High - this would enable:
Related