CLI (pnote)
Manage your PromptNote prompts from the terminal. Search, copy, pipe, and script.
This content is not available in your language yet.
pnote is the PromptNote CLI. Search notes, copy snippets to clipboard, create content from stdin, and pipe output to other tools.
Installation
Section titled “Installation”Requires Node.js 18 or later.
npm install -g pnoteAuthentication
Section titled “Authentication”Generate an API token from the web app, then:
pnote auth token pn_your_token_here
# Verifypnote auth whoamiOr set the environment variable:
export PNOTE_TOKEN=pn_your_token_hereCommands
Section titled “Commands”pnote notes # List all notespnote notes --tag "AI/art" # Filter by tagpnote notes --archived # Show archivedpnote notes --deleted # Show deletedpnote notes --pinned # Show pinned onlypnote notes --protected # Show only PIN-protected notespnote notes --search "query" # Search by titlepnote notes get <id> # Get note detailspnote notes get <id> --latest # Get note with latest snippet onlypnote notes create "Title" # Create new notepnote notes update <id> --title "New Title"pnote notes update <id> --tags a b cpnote notes archive <id> # Archive notepnote notes archive <id> --undo # Unarchive notepnote notes pin <id> # Toggle pinpnote notes delete <id> # Soft deleteNotes are listed 50 at a time. Use --limit <n> and --offset <n> for pagination, or --all to fetch every matching note. The 8-character id shown in tables is accepted anywhere a note id is expected (an ambiguous prefix is refused).
Snippets
Section titled “Snippets”pnote notes snippet <note-id> # Show latest snippet (pipe-friendly)pnote notes snippet list <note-id> # List all versionspnote notes snippet copy <note-id> # Copy to clipboardpnote notes snippet copy <note-id> --version 2 # Copy a specific versionecho "content" | pnote notes snippet add <note-id> # Add version from stdinecho "updated" | pnote notes snippet update <snippet-id> # Update existingpnote notes snippet favorite <snippet-id> # Toggle favoritepnote tags # List all tags with countspnote tags --include-archived # Include tags from archived notespnote tags rename "old" "new" # Rename tag (includes children)pnote tags merge "a" "b" --into "c" # Merge tagsSharing
Section titled “Sharing”pnote share tags # List shared tagspnote share tags <id> # View notes in shared tagpnote share tags <id> --limit 10 # Limit notes returnedpnote share notes # List public share linkspnote share notes --include-revoked # Include revoked linksSearch
Section titled “Search”pnote search "query" # Full-text search (default limit 20)pnote search "query" --notes-only # Notes onlypnote search "query" --snippets-only # Snippets onlypnote search "query" --limit 50 # Limit resultsPIN protection
Section titled “PIN protection”Notes can be PIN-protected (encrypted server-side). The PIN is set in the PromptNote web app under Settings.
pnote pin status # Check PIN configuration and cache statuspnote pin list # List protected notes (metadata only)
# Access protected notesPNOTE_PIN=1234 pnote notes --protectedPNOTE_PIN=1234 pnote notes get <protected-note-id>echo "1234" | pnote notes get <id> --pin-stdinPIN resolution order: -p flag → --pin-stdin → PNOTE_PIN env var (recommended for automation) → 5-min session cache. The interactive prompt is not part of the chain: on a terminal the CLI asks for the PIN only when a command actually reaches a protected note (hidden input, one * per keystroke, 3 attempts) and caches it for 5 minutes. With no terminal attached it never prompts — the command exits with code 5 instead of hanging or pretending the note is empty.
Agent skills sync
Section titled “Agent skills sync”Sync agent skill files between PromptNote cloud and your local agent directories. Skills are stored as notes (note_type="skill") with titles like skill-name/filename.md.
pnote skills # List skills in cloudpnote skills pull # Pull all globally (~/.agents/skills/ + symlinks)pnote skills pull <name> # Pull a specific skill globallypnote skills pull --project # Pull project-level (.agents/skills/ + symlinks)pnote skills pull --dry-run # Preview without writing filespnote skills pull --force # Overwrite conflicts (originals backed up)pnote skills push <dir> # Upload local skill directory to cloudpnote skills push <dir> --name <name> # Override the skill namepnote skills push <name> --file <path> # Push a single filepnote skills diff # Compare local files with the cloudpnote skills scan # Read-only inventory of local skillspnote skills scan --usage # Include 30-day usage statspnote skills scan --path <dir> # Deep-scan a directory (depth 8)Skills are written to .agents/skills/<name>/ (canonical) and symlinked into .claude/skills/ (always), plus .windsurf/skills/, .augment/skills/, and .agent/skills/ when those agents are installed. A pull never deletes a real directory or overwrites a locally modified file — it reports a conflict and skips. scan is read-only and covers only the global agent skill directories, project roots derived from agent session records, and the current directory; a repository cloned but never opened in an agent needs --path <dir>.
CLI maintenance
Section titled “CLI maintenance”pnote update # Check npm for a newer version and install itpnote schema # Print the full command schema as JSON (for AI agents)Workflow examples
Section titled “Workflow examples”Pipe search results through jq to extract titles:
pnote search "system prompt" --json | jq '.[].title'Create a note from a file:
cat my-prompt.txt | pnote notes snippet add <note-id>Back up all notes as JSON:
pnote notes --json > my-notes-backup.jsonGlobal options
Section titled “Global options”| Option | Description |
|---|---|
--json | Output as JSON (machine-readable) |
--no-color | Disable colors |
--plain | Plain text output (no formatting) |
-p, --pin <pin> | PIN for accessing protected notes |
--pin-stdin | Read PIN from stdin (first line) |
-h, --help | Show help |
-V, --version | Show version |
Environment variables
Section titled “Environment variables”| Variable | Description |
|---|---|
PNOTE_TOKEN | API token (overrides stored credentials) |
PNOTE_PIN | PIN for accessing protected notes (recommended for automation) |
PROMPTNOTE_PIN | Alias for PNOTE_PIN |
PNOTE_PIN_CACHE_DIR | Override the PIN session-cache directory |
NO_COLOR | Disable colors (standard convention) |
Unix conventions
Section titled “Unix conventions”pnote follows Unix philosophy:
- stdout for data, stderr for status messages
- Exit codes:
0success,1general error,2auth error,3not found,4network error,5PIN required (the note is protected and stayed locked — it exists, its content is unknown) - Supports piping:
pnote search "x" --json | jq '.[] | .title' --jsonfor programmatic consumption
Configuration
Section titled “Configuration”Credentials stored in ~/.config/pnote/credentials.json (XDG-compliant).