Command-line utility to write a note from stdin. Replaces the ad-hoc inline Python requests.put pattern.
Location: ~/bin/notes-put (executable, on PATH)
Usage
# From a JSON file
notes-put my/key < doc.json
# Inline
echo '{"title":"x","content":[]}' | notes-put my/key
# Heredoc with Python dict syntax (ast.literal_eval)
notes-put my/key <<'EOF'
{
'title': 'My Note',
'content': [{'para': ['hello']}]
}
EOF
Features
- Accepts JSON or Python dict literal (ast.literal_eval — safe, supports single quotes and trailing commas)
- Reads from stdin — works with pipes and heredocs
- NOTES_URL env var respected (default: http://127.0.0.1:8021)
- Exit code 0 on success, 1 on error
When to use
- notes-put: when constructing the doc in a script and piping to stdin
- notes load -d: when you have a JSON file on disk (the standard 'Write tool + load' workflow)
- notes write: for very short inline content passed as a shell argument