@grapecool/cli 0.0.0-stage → 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.
Files changed (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +160 -2
  3. package/dist/cli.js +1909 -0
  4. package/package.json +56 -3
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Shiny Grape, LLC
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 CHANGED
@@ -1,3 +1,161 @@
1
- # Temporary Holding Version
1
+ # Grape CLI
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ The official command line tool for [Grape](https://grape.cool), the AI note
4
+ app for Mac, Windows, Linux, iPhone and Android. Read, search and write the
5
+ notes and folders in your Grape account from a terminal, a script or an AI
6
+ agent, and search the Grape help center without signing in.
7
+
8
+ ```sh
9
+ npm install -g @grapecool/cli
10
+ grape login
11
+ grape notes list
12
+ ```
13
+
14
+ Or run it once without installing: `npx @grapecool/cli notes list`.
15
+ Node.js 20 or later.
16
+
17
+ **What you need**
18
+
19
+ - **Notes and folders** need a Grape account on the **Pro** plan, the same
20
+ plan as the ChatGPT and Claude connection. Plus and Lifetime do not
21
+ include it. [See the plans](https://grape.cool/pricing).
22
+ - **Plans, changelog, downloads and guides** need no account at all.
23
+
24
+ ## Signing in
25
+
26
+ ```sh
27
+ grape login
28
+ ```
29
+
30
+ This opens grape.cool in your browser. Sign in with the Google account you
31
+ use in the Grape apps and choose Allow. The terminal finishes by itself.
32
+
33
+ - If the account is not on Pro, the browser shows an upgrade page instead
34
+ of Allow.
35
+ - On a machine without a browser, run `grape login --no-browser`, open the
36
+ printed address on any device, and paste the address the browser ends up
37
+ on back into the terminal.
38
+ - `grape whoami` shows the account, `grape logout` removes the sign in from
39
+ this computer.
40
+
41
+ The sign in is kept in `~/.config/grape/credentials.json` (on Windows
42
+ `%APPDATA%\grape\credentials.json`), readable by your user only. It renews
43
+ itself and lasts until it goes 90 days unused.
44
+
45
+ ## Commands
46
+
47
+ | Command | What it does |
48
+ | --- | --- |
49
+ | `grape notes list [--folder <id>] [--pinned] [--deleted] [--limit <n>] [--all]` | Notes, newest first |
50
+ | `grape notes search <query>` | Notes that contain a word or phrase |
51
+ | `grape notes get <id>` | One note as markdown (also `read`) |
52
+ | `grape notes create [text] [--file <path>] [--folder <id>] [--pin]` | A new note from markdown |
53
+ | `grape notes append <id> [text] [--file <path>]` | Add to the end of a note |
54
+ | `grape notes replace <id> [text] [--file <path>] [--force]` | Replace the whole note |
55
+ | `grape notes move <id> <folder-id>` | Move a note, or restore one from Recently Deleted |
56
+ | `grape notes delete <id>` | Move a note to Recently Deleted (restorable for 30 days) |
57
+ | `grape folders list` | Every folder with its id and note count |
58
+ | `grape folders create <name> [--parent <id>]` | A new folder |
59
+ | `grape folders rename <id> <name>` | Rename a folder |
60
+ | `grape folders move <id> <parent-id\|root>` | Move a folder |
61
+ | `grape folders delete <id>` | Delete a folder; its notes go to Recently Deleted |
62
+ | `grape tools list` / `grape tools call <name> '<json>'` | The MCP tools, called directly |
63
+ | `grape guides search <question>` | Answers from the help center |
64
+ | `grape guides list` / `grape guides read <slug>` | Help articles, as markdown |
65
+ | `grape plans` | Plans, prices and what each includes |
66
+ | `grape changelog [--platform desktop\|mobile]` | What changed in the latest releases |
67
+ | `grape downloads [--kind desktop\|mobile]` | Download links for every platform |
68
+
69
+ `grape <command> --help` shows every option.
70
+
71
+ ## Writing notes
72
+
73
+ Notes are markdown: headings, lists, check lists, tables, links, bold and
74
+ italic. The first line is the title, so start with a heading. A word that
75
+ starts with `#` becomes a tag, and `[[Note title]]` links to another note.
76
+ The text can come from the arguments, a file, or a pipe:
77
+
78
+ ```sh
79
+ grape notes create "# Standup" --folder 1000000000002
80
+ grape notes create --file meeting.md
81
+ pbpaste | grape notes create
82
+ grape notes append 4821930571234 "- Call the printer"
83
+ ```
84
+
85
+ Images, drawings, slide decks and other blocks show up in `grape notes get`
86
+ as lines like `{{grape-block:drawing:4821930571234:0}}`. Keep those lines when
87
+ you `replace` a note, or the block behind them is deleted. `replace` checks
88
+ first and stops if your text would remove one; `--force` removes them.
89
+
90
+ Changes reach the Grape apps on every device through sync within minutes.
91
+ Locked notes are encrypted on your devices and are never listed or read.
92
+
93
+ ## For scripts and AI agents
94
+
95
+ Every command takes `--json` and then prints only JSON on stdout. Progress
96
+ and errors go to stderr, so stdout stays clean for a pipe.
97
+
98
+ ```sh
99
+ grape notes search "invoice" --json | jq -r '.notes[].localId'
100
+ grape folders list --json | jq '.folders[] | select(.name == "Work")'
101
+ ```
102
+
103
+ A failure exits with a code you can branch on, and with `--json` it prints
104
+ one line of JSON on stderr:
105
+
106
+ ```json
107
+ {"error":{"code":"signed_out","message":"You are not signed in to Grape.","hint":"Run grape login to sign in."}}
108
+ ```
109
+
110
+ | Exit code | Meaning |
111
+ | --- | --- |
112
+ | 0 | Done |
113
+ | 1 | It failed; the message says why (`pro_required`, `rate_limited`, `tool_error`, `network_error`...) |
114
+ | 2 | The command line was wrong |
115
+ | 3 | No usable sign in: ask the user to run `grape login` |
116
+
117
+ The account allows 600 note and folder calls an hour. `grape notes list
118
+ --all` pages through 50 notes per call.
119
+
120
+ ## Environment
121
+
122
+ | Variable | Default | |
123
+ | --- | --- | --- |
124
+ | `GRAPE_ACCESS_TOKEN` | | Use this bearer token instead of the stored sign in |
125
+ | `GRAPE_CONFIG_DIR` | `~/.config/grape` | Where the sign in is kept |
126
+ | `GRAPE_URL` | `https://grape.cool` | The OAuth server and the public API |
127
+ | `GRAPE_MCP_URL` | `https://mcp.grape.cool` | The MCP server |
128
+ | `GRAPE_DEBUG` | | Print stack traces for unexpected errors |
129
+
130
+ ## How it works
131
+
132
+ - Notes and folders go through Grape's MCP server at
133
+ `https://mcp.grape.cool`, the one ChatGPT and Claude connect to, over the
134
+ stateless 2026-07-28 revision of MCP Streamable HTTP. If you would rather
135
+ connect an MCP client directly, see
136
+ [Connect ChatGPT and Claude](https://grape.cool/help/connect-chatgpt-and-claude).
137
+ - Signing in is OAuth 2.1 for native apps (RFC 8252): dynamic client
138
+ registration, a loopback redirect on `127.0.0.1`, PKCE with S256, and the
139
+ `state` and `iss` checks. Tokens are scoped to the MCP server.
140
+ - Plans, changelog, downloads and guides read the public API at
141
+ `https://grape.cool/api/v1`, documented at
142
+ [grape.cool/docs](https://grape.cool/docs).
143
+
144
+ ## Support
145
+
146
+ Write to [support@grape.cool](mailto:support@grape.cool) or use
147
+ [grape.cool/contact](https://grape.cool/contact).
148
+
149
+ ## Development
150
+
151
+ ```sh
152
+ pnpm install
153
+ pnpm test # vitest, against a stand in MCP server built on the MCP SDK
154
+ pnpm typecheck
155
+ pnpm build # dist/cli.js
156
+ pnpm grape -- notes list
157
+ ```
158
+
159
+ Point it at local servers with `GRAPE_URL=http://localhost:4700` and
160
+ `GRAPE_MCP_URL=http://localhost:4702`. Releasing is in
161
+ [docs/RELEASING.md](docs/RELEASING.md).