apple-notes-tui 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Tyler Xiao
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,124 @@
1
+ # notes — a terminal UI for Apple Notes
2
+
3
+ A fast, clean TUI for browsing your Apple Notes from the terminal. Zero dependencies — plain Node.js talking to Notes.app over Apple Events (JXA).
4
+
5
+ ```
6
+ ✳ Apple Notes 83 notes · by modified · page 1/5
7
+ ╭────────────────────────────────────────────────────────────────────────────╮
8
+ │ 1 ❯ Draft up notion doc Notes · Aug 28 │
9
+ │ 2 Bank account Notes · Aug 18 │
10
+ │ 3 Parallelization Notes · Jul 27 │
11
+ ╰────────────────────────────────────────────────────────────────────────────╯
12
+ ↵ open · 1-9 jump · / search · r refresh · s settings · ? help · q quit
13
+ ```
14
+
15
+ ## Install
16
+
17
+ ```sh
18
+ npm install -g apple-notes-tui
19
+ notes
20
+ ```
21
+
22
+ Or from source:
23
+
24
+ ```sh
25
+ git clone https://github.com/lordboba/apple-notes-cli.git
26
+ cd apple-notes-cli
27
+ npm install -g . # or: npm link
28
+ notes
29
+ ```
30
+
31
+ Requires macOS and Node 18+. On first run, macOS may ask you to allow your
32
+ terminal to control Notes (System Settings → Privacy & Security → Automation).
33
+
34
+ ## Usage
35
+
36
+ ```sh
37
+ notes # interactive UI
38
+ notes list # plain-text dump of all notes (pipe-friendly)
39
+ notes --help
40
+ ```
41
+
42
+ ## Keys
43
+
44
+ Arrow keys, PgUp/PgDn, Home/End, and Enter always work. On top of that,
45
+ both vim and emacs bindings are active by default (the `hybrid` keymap):
46
+
47
+ | Action | Common | vim | emacs |
48
+ | ---------------- | ------------ | ------------------ | -------------- |
49
+ | Move down / up | ↓ / ↑ | `j` / `k` | `C-n` / `C-p` |
50
+ | Page down / up | PgDn / space | `C-d` / `C-u` | `C-v` / `M-v` |
51
+ | Top / bottom | Home / End | `gg` / `G` | `M-<` / `M->` |
52
+ | Open note | ↵ | | |
53
+ | Jump to note | `1`–`9` (multi-digit works too) | | |
54
+ | Prev / next note | ← / → | `h` / `l` | |
55
+ | Back | esc | | `C-g` |
56
+ | Search titles | `/` | | |
57
+ | Open in Notes.app| `o` | | |
58
+ | Open attachment | `a` (or `1`–`9`) | | |
59
+ | Edit note | `e` | | |
60
+ | New note | `n` | | |
61
+ | Refresh / reload | `r` | | |
62
+ | Settings | `s` | | |
63
+ | Help | `?` | | |
64
+ | Quit | `q`, `C-c` | | |
65
+
66
+ In the note view, ←/→ (or `h`/`l`) move between notes without going back to
67
+ the list. In the list, ←/→ flip whole pages.
68
+
69
+ The mouse works too: click a note to open it, click a settings row to change
70
+ it, scroll with the wheel, and click the `×` in the top-right corner to quit.
71
+ (Terminals reserve text selection while mouse mode is on — hold Shift or Fn
72
+ to select text as usual.)
73
+
74
+ Inline attachments show as `[📎 filename]` — click one (or press `a` for the
75
+ first, `1`–`9` for the nth) to open it with its default macOS app. Under the
76
+ hood, Notes.app exports the file to a temp directory first, since attachment
77
+ files aren't directly readable without Full Disk Access.
78
+
79
+ Locked notes are marked with 🔒;
80
+ macOS only lets Notes.app itself take the password or Touch ID prompt, so
81
+ press `o` to unlock a note there, then `r` back in the TUI to reload its
82
+ text.
83
+
84
+ ## Configuration
85
+
86
+ Settings live at `~/.config/notes-cli/config.json` and can be changed in-app
87
+ by pressing `s`:
88
+
89
+ ```json
90
+ {
91
+ "keymap": "hybrid",
92
+ "sort": "modified",
93
+ "keys": {
94
+ "quit": ["x"],
95
+ "pageDown": ["ctrl+j"]
96
+ }
97
+ }
98
+ ```
99
+
100
+ - `keymap` — `hybrid` (default), `vim`, or `emacs`
101
+ - `sort` — `modified` (default), `created`, or `title`
102
+ - `keys` — extra bindings per action, added on top of the keymap. Key names:
103
+ single characters (`x`, `G`), `ctrl+<letter>`, `meta+<char>`, `up`, `down`,
104
+ `left`, `right`, `pageup`, `pagedown`, `home`, `end`, `enter`, `escape`,
105
+ `space`, or two-key chords like `"g g"`.
106
+
107
+ ## How it works
108
+
109
+ - `src/store.js` fetches notes via `osascript -l JavaScript` (Apple Events),
110
+ the only official API for Notes. Titles/dates load in bulk; note bodies are
111
+ fetched lazily on open and cached for the session.
112
+ - `src/app.js` is the TUI: state, key handling, and rendering.
113
+ - `src/keys.js` parses raw stdin and resolves keymaps/chords.
114
+ - `src/term.js` handles ANSI styling and emoji/CJK-aware text layout.
115
+
116
+ Browsing never modifies your notes. Writes happen only through `e` (edit) and
117
+ `n` (new): the note's plain text opens in `$VISUAL`/`$EDITOR`, and saving
118
+ writes it back to Apple Notes — `n` starts from an empty buffer and creates
119
+ the note in your default folder (first line becomes the title; quit without
120
+ writing anything and no note is created). **Edits replace the whole note
121
+ body** — rich formatting
122
+ (bold, checklists, tables) is flattened to plain text and inline attachments
123
+ are dropped from the edited note. "Recently Deleted" and password-locked note
124
+ contents are not shown.
package/bin/notes.js ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import { run } from '../src/app.js';
3
+
4
+ run(process.argv.slice(2));
package/package.json ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "apple-notes-tui",
3
+ "version": "1.0.0",
4
+ "description": "A clean, zero-dependency terminal UI for browsing Apple Notes",
5
+ "type": "module",
6
+ "bin": {
7
+ "notes": "bin/notes.js"
8
+ },
9
+ "files": [
10
+ "bin",
11
+ "src",
12
+ "README.md",
13
+ "LICENSE"
14
+ ],
15
+ "keywords": [
16
+ "apple-notes",
17
+ "notes",
18
+ "tui",
19
+ "cli",
20
+ "terminal",
21
+ "macos",
22
+ "jxa"
23
+ ],
24
+ "homepage": "https://github.com/lordboba/apple-notes-cli#readme",
25
+ "repository": {
26
+ "type": "git",
27
+ "url": "git+https://github.com/lordboba/apple-notes-cli.git"
28
+ },
29
+ "bugs": {
30
+ "url": "https://github.com/lordboba/apple-notes-cli/issues"
31
+ },
32
+ "engines": {
33
+ "node": ">=18"
34
+ },
35
+ "os": [
36
+ "darwin"
37
+ ],
38
+ "author": "Tyler Xiao",
39
+ "license": "MIT"
40
+ }