@notatemd/cli 4.3.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.
Files changed (3) hide show
  1. package/README.md +264 -0
  2. package/dist/cli.js +2956 -0
  3. package/package.json +46 -0
package/README.md ADDED
@@ -0,0 +1,264 @@
1
+ # @notatemd/cli
2
+
3
+ Command-line interface for [Notate](https://notate.md). A pure REST client for
4
+ the Notate API: quick capture, scripting, automation, and AI queries from the
5
+ terminal, no web or desktop app required. Installs the `notate` command.
6
+
7
+ - [Install](#install)
8
+ - [Getting started](#getting-started)
9
+ - [Concepts](#concepts)
10
+ - [Command reference](#command-reference)
11
+ - [Account](#account)
12
+ - [Notes](#notes)
13
+ - [Folders](#folders)
14
+ - [Workspaces](#workspaces)
15
+ - [Tags](#tags)
16
+ - [AI](#ai)
17
+ - [Transcribe](#transcribe)
18
+ - [Stats](#stats)
19
+ - [Config](#config)
20
+ - [Completion](#completion)
21
+ - [End-to-end encryption](#end-to-end-encryption)
22
+ - [Scripting](#scripting)
23
+ - [Configuration and stored data](#configuration-and-stored-data)
24
+
25
+ ## Install
26
+
27
+ Requires Node.js 20 or newer.
28
+
29
+ ```bash
30
+ npm install -g @notatemd/cli
31
+ notate --help
32
+ ```
33
+
34
+ Or run it without installing:
35
+
36
+ ```bash
37
+ npx @notatemd/cli --help
38
+ ```
39
+
40
+ ## Getting started
41
+
42
+ The CLI talks to the Notate API (`https://api.notate.md`) by default. Log
43
+ in with your Notate account, then start capturing:
44
+
45
+ ```bash
46
+ notate login # authenticate (prompts for password)
47
+ notate whoami # confirm the logged-in account
48
+ notate workspaces use "My Workspace" # pick a default workspace
49
+ notate notes create "My Note" --content "# Hello"
50
+ notate notes list
51
+ notate ask "What notes have I favorited?" # AI over your notes
52
+ ```
53
+
54
+ Run `notate <command> --help` for the full, authoritative option list on any
55
+ command.
56
+
57
+ ## Concepts
58
+
59
+ - **Workspaces** group your folders and notes. `notate workspaces use <name|id>`
60
+ pins an active workspace so you can omit `--workspace` on every command. Any
61
+ command that operates on notes/folders accepts `--workspace <name|id>` to
62
+ override the active one for a single call.
63
+ - **Folders** hold notes and can nest. A top-level folder is a "root." New notes
64
+ land in the workspace's default folder (set with
65
+ `notate workspaces set-default-folder`), or the first root if no default is set.
66
+ - **Addressing by name vs id.** Note and folder commands take a title/name as
67
+ their argument. Names are not guaranteed unique, so most commands also accept
68
+ `--id <id>` to target a specific item unambiguously. When a name matches more
69
+ than one item in an interactive terminal, the CLI shows a picker.
70
+ - **`--json`** is available on most read/write commands for scripting. Without
71
+ it, output is human-readable tables and text.
72
+ - **Confirmation.** Destructive commands prompt before acting; pass `--confirm`
73
+ (or `--quiet`) to run non-interactively.
74
+
75
+ ## Command reference
76
+
77
+ ### Account
78
+
79
+ ```bash
80
+ notate login [--email <email>] [--server <url>] [--json] [--quiet]
81
+ notate logout
82
+ notate whoami [--json]
83
+ ```
84
+
85
+ `login` prompts for your password (and email if `--email` is omitted). `--server`
86
+ overrides the API URL for that login; otherwise the configured server is used.
87
+
88
+ ### Notes
89
+
90
+ ```bash
91
+ # create — defaults into the workspace's default folder
92
+ notate notes create <title> [--content <text> | --stdin | --file <path>]
93
+ [--folder <name>] [--tags <csv>] [--workspace <name|id>] [--json]
94
+
95
+ # read
96
+ notate notes list [--folder <name>] [--tag <name>] [--favorite]
97
+ [--sort title|createdAt|updatedAt] [--limit <n>] [--workspace <name|id>] [--json]
98
+ notate notes get [title] [--id <id>] [--workspace <name|id>] [--json]
99
+ notate notes search <query> [--mode keyword|semantic|hybrid] [--folder <name>] [--tag <name>]
100
+ [--limit <n>] [--workspace <name|id>] [--json]
101
+
102
+ # update
103
+ notate notes edit [title] [--content <text> | --stdin | --file <path> | --append <text>]
104
+ [--id <id>] [--workspace <name|id>] [--json]
105
+ notate notes move [title] [--to <folder> | --to-default] [--id <id>] [--workspace <name|id>] [--json]
106
+ notate notes tag [title] [--add <csv>] [--remove <csv>] [--set <csv>] [--id <id>] [--workspace <name|id>] [--json]
107
+ notate notes favorite [title] [--off] [--id <id>] [--workspace <name|id>] [--json]
108
+
109
+ # versions
110
+ notate notes versions [title] [--restore <version-id>] [--id <id>] [--workspace <name|id>] [--json]
111
+
112
+ # trash lifecycle
113
+ notate notes delete [title] [--id <id>] [--confirm] [--workspace <name|id>] [--quiet]
114
+ notate notes trash [--workspace <name|id>] [--json] # list trashed notes
115
+ notate notes trash delete [title] [--id <id>] [--workspace <name|id>]
116
+ notate notes trash empty [--workspace <name|id>] [--confirm]
117
+ notate notes restore [title] [--id <id>] [--workspace <name|id>] [--json]
118
+
119
+ # import / export
120
+ notate notes import <path> [--folder <name>] [--tags <csv>] [--recursive] [--dry-run] [--workspace <name|id>]
121
+ notate notes export [title] [-o <path>] [--format md|json] [--id <id>]
122
+ [--folder <name> | --all] [--workspace <name|id>] [--quiet]
123
+ ```
124
+
125
+ Notes:
126
+
127
+ - `notes versions [title]` lists a note's history; add `--restore <version-id>`
128
+ (an id from the list) to revert the note to that version.
129
+ - `notes search` supports keyword, semantic (embeddings), and hybrid modes.
130
+ Search is unavailable on encrypted accounts (see below).
131
+ - `notes import` reads a single `.md` file or a directory of them; `--recursive`
132
+ walks subdirectories, `--dry-run` previews without writing.
133
+ - `notes export` writes one note to `-o <file>`, or a whole `--folder`/`--all` to
134
+ `-o <directory>`.
135
+
136
+ ### Folders
137
+
138
+ ```bash
139
+ notate folders list [--workspace <name|id>] [--json] # tree with note counts
140
+ notate folders create <name> [--parent <name>] [--workspace <name|id>] [--json]
141
+ notate folders rename <name> <newName> [--workspace <name|id>]
142
+ notate folders move <name> [--to <parent> | --to-root] [--id <id>] [--workspace <name|id>] [--json]
143
+ notate folders favorite <name> [--off] [--workspace <name|id>]
144
+ notate folders delete <name> [--recursive] [--confirm] [--workspace <name|id>]
145
+ notate folders restore <name> [--workspace <name|id>]
146
+ notate folders trash [--workspace <name|id>] # list trashed folders
147
+ notate folders trash delete <name> [--workspace <name|id>] [--confirm]
148
+ ```
149
+
150
+ ### Workspaces
151
+
152
+ ```bash
153
+ notate workspaces list # active one is marked with a star
154
+ notate workspaces use <name|id> [--quiet] # pin the active workspace
155
+ notate workspaces create <name> [--color <color>] [--icon <icon>] [--json]
156
+ notate workspaces rename <name> <newName>
157
+ notate workspaces delete <name> [--confirm] # folders/notes are kept, just unscoped
158
+ notate workspaces set-default-folder <folder> [--workspace <name|id>]
159
+ notate workspaces add-folder <folder> [--workspace <name|id>] # link a root into another workspace
160
+ notate workspaces remove-folder <folder> [--workspace <name|id>] # unlink (does not delete)
161
+ ```
162
+
163
+ A folder (root) can belong to more than one workspace; `add-folder` /
164
+ `remove-folder` manage that membership without moving or deleting the folder.
165
+
166
+ ### Tags
167
+
168
+ ```bash
169
+ notate tags list [--workspace <name|id>] # tags with usage counts
170
+ notate tags rename <oldName> <newName> [--workspace <name|id>]
171
+ notate tags delete <name> [--confirm] [--workspace <name|id>]
172
+ ```
173
+
174
+ ### AI
175
+
176
+ ```bash
177
+ notate ask <question> [--quiet-tools] # streams the answer over your notes
178
+ notate summarize [title] [--id <id>] [--workspace <name|id>] [--json] # generate + save a summary
179
+ notate gentags [title] [--apply] [--id <id>] [--workspace <name|id>] [--json]
180
+ notate rewrite [text] [--action <action>] [--stdin] # transform text, print to stdout
181
+ ```
182
+
183
+ `rewrite` actions: `rewrite` (default), `concise`, `fix-grammar`, `to-list`,
184
+ `expand`, `summarize`. All AI commands are unavailable while end-to-end
185
+ encryption is on.
186
+
187
+ ### Transcribe
188
+
189
+ ```bash
190
+ notate transcribe <file> [--mode meeting|lecture|memo|verbatim] [--folder <name>]
191
+ [--tags <csv>] [--title <title>] [--workspace <name|id>] [--json] [--quiet]
192
+ ```
193
+
194
+ Uploads an audio file and saves a structured note from the transcript. Mode
195
+ defaults to `memo`.
196
+
197
+ ### Stats
198
+
199
+ ```bash
200
+ notate stats [--workspace <name|id>] [--json]
201
+ ```
202
+
203
+ ### Config
204
+
205
+ ```bash
206
+ notate config set <key> <value>
207
+ notate config get <key>
208
+ notate config list
209
+ notate config reset
210
+ ```
211
+
212
+ Keys: `server`, `workspace`, `defaultMode`, `defaultSort`, `pageSize`. For
213
+ example, point the CLI at a local dev server:
214
+
215
+ ```bash
216
+ notate config set server http://localhost:3004
217
+ ```
218
+
219
+ ### Completion
220
+
221
+ ```bash
222
+ notate completion bash # or zsh, fish
223
+ ```
224
+
225
+ Print a shell completion script. Add it to your shell config, for example:
226
+
227
+ ```bash
228
+ notate completion zsh >> ~/.zshrc # then reload your shell
229
+ ```
230
+
231
+ ## End-to-end encryption
232
+
233
+ If your account has end-to-end encryption enabled, the CLI encrypts note fields
234
+ (title, content, summary, transcript, tags) client-side before they leave your
235
+ machine, and decrypts them on read. The encryption key is unlocked at login and
236
+ cached in your OS keychain.
237
+
238
+ Because the server can't read encrypted content, these features are unavailable
239
+ on encrypted accounts: `notes search`, `ask`, `summarize`, `gentags`, `rewrite`,
240
+ and server-side tag aggregation in `stats`. The CLI checks your live encryption
241
+ state per command, so it will never write plaintext to an encrypted account.
242
+
243
+ ## Scripting
244
+
245
+ - Add `--json` to most commands for machine-readable output.
246
+ - `notes create`/`edit` read content from `--stdin` or `--file`, so you can pipe:
247
+
248
+ ```bash
249
+ echo "# Log\n$(date)" | notate notes create "Daily log" --stdin
250
+ git log --oneline -10 | notate notes create "Recent commits" --stdin --folder Dev
251
+ ```
252
+ - `notes get` prints raw markdown to stdout, so it composes with other tools:
253
+
254
+ ```bash
255
+ notate notes get "Spec" | wc -w
256
+ ```
257
+
258
+ ## Configuration and stored data
259
+
260
+ - **Config** (server URL, active workspace, display preferences) is stored in a
261
+ JSON file in your OS config directory. View it with `notate config list`.
262
+ - **Credentials** (access/refresh tokens and, for encrypted accounts, the
263
+ content key) are stored in your OS keychain, not on disk in plaintext.
264
+ - `notate logout` clears the stored credentials for the current server.