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