node-note-cli
v2.2.0
Published
A simple CLI tool for managing global notes by title, sorted newest-first.
Maintainers
Readme
node-note-cli
A lightning-fast, zero-dependency CLI tool for managing personal notes directly from your terminal.
Installation
Install globally via npm:
npm install -g node-note-cliOr run directly without installing:
npx node-note-cliUsage
| Command | Description |
| :--------------------------------- | :------------------------------------------------------ |
| note <title...> | Quickly add a note |
| note add <title...> | Explicitly add a note (avoids keyword collisions) |
| note | List all notes (newest first) |
| note list -n <count> | List the most recent <count> notes |
| note find <query> | Search notes by substring (displays global [#index]) |
| note edit <index> <new title...> | Update note title at specified index |
| note rm <index> [-y] | Delete a note (prompts confirmation unless -y passed) |
| note clear [--yes] | Delete all notes |
| note -v, --version | Display installed version |
| note -h, --help | Show command usage and options |
Examples
1. Adding Notes
note Buy groceries
# Output: Added: Buy groceries
# To add notes starting with commands like 'clear', 'find', etc., use `add`:
note add clear the desk
# Output: Added: clear the desk2. Listing Notes
noteOutput:
#1 clear the desk · just now
#2 Buy groceries · 5m ago
#3 Finish weekly report · 2d agoLimit displayed notes:
note list -n 23. Searching Notes
Search results display the note's global index in brackets ([#index]), making it safe to edit or delete directly:
note find groceriesOutput:
[#2] Buy groceries · 5m ago4. Editing a Note
note edit 2 Buy groceries and fruitsOutput:
Updated: Buy groceries and fruits5. Deleting a Note
# Interactive confirmation prompt:
note rm 1
# Output: Delete "clear the desk"? (y/N) y
# Output: Deleted: clear the desk
# Or skip prompt with -y / --yes:
note rm 1 -y
# Output: Deleted: Buy groceries and fruits6. Clearing All Notes
note clear --yes
# Output: All notes cleared.Storage & Configuration
By default, notes are stored locally in standard OS data directories:
- macOS:
~/Library/Application Support/note/notes.json - Linux:
~/.local/share/note/notes.json(respects$XDG_DATA_HOME) - Windows:
%APPDATA%\note\notes.json
Custom Storage Location
You can customize where notes are stored using environment variables:
# Use a custom directory:
export NOTE_DIR="$HOME/Dropbox/notes"
# Or point to a specific file:
export NOTES_FILE="$HOME/.my-notes.json"Programmatic API
node-note-cli can also be required as a standard Node.js module:
const { addNote, listNotes, findNotes, deleteNote } = require("node-note-cli");
// Add note
addNote("Review pull request");
// List notes sorted newest-first
const all = listNotes({ limit: 5 });
// Search notes
const matches = findNotes("review");Development & Testing
Run the automated test suite (uses Node's native test runner, zero dependencies required):
npm testLicense
ISC © Imran Pollob
