@bitefoundry/onenote 0.2.2 → 0.4.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 -21
- package/README.md +181 -163
- package/docs/API.md +114 -114
- package/docs/MCP.md +130 -124
- package/docs/NPM.md +172 -172
- package/docs/openapi.yaml +322 -323
- package/package.json +50 -50
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 BiteFoundry
|
|
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.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 BiteFoundry
|
|
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,163 +1,181 @@
|
|
|
1
|
-
<div align="center">
|
|
2
|
-
|
|
3
|
-
# `@bitefoundry/onenote`
|
|
4
|
-
|
|
5
|
-
**
|
|
6
|
-
|
|
7
|
-
[](https://www.npmjs.com/package/@bitefoundry/onenote)
|
|
8
|
-
[](docs/NPM.md)
|
|
9
|
-
[](https://github.com/BiteFoundry/onenote/blob/master/Cargo.toml)
|
|
10
|
-
[](
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
|
25
|
-
|
|
|
26
|
-
| **
|
|
27
|
-
| **
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
|
82
|
-
|
|
|
83
|
-
|
|
|
84
|
-
| `
|
|
85
|
-
|
|
|
86
|
-
| `
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
onenote
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
onenote
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
# `@bitefoundry/onenote`
|
|
4
|
+
|
|
5
|
+
**Read and edit OneNote pages, search cached notebooks, and update checklists from the terminal.**
|
|
6
|
+
|
|
7
|
+
[](https://www.npmjs.com/package/@bitefoundry/onenote)
|
|
8
|
+
[](docs/NPM.md)
|
|
9
|
+
[](https://github.com/BiteFoundry/onenote/blob/master/Cargo.toml)
|
|
10
|
+
[](LICENSE)
|
|
11
|
+
|
|
12
|
+
[BiteFoundry](https://bitefoundry.dev/#app-onenote) · [Latest release notes](https://github.com/BiteFoundry/onenote/releases/latest)
|
|
13
|
+
|
|
14
|
+
<br />
|
|
15
|
+
|
|
16
|
+

|
|
17
|
+
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Highlights
|
|
23
|
+
|
|
24
|
+
| Capability | Details |
|
|
25
|
+
| --- | --- |
|
|
26
|
+
| **Minimal-Chrome 3-Pane TUI** | Personal, Teams/Group & SharePoint notebooks, colored section ribbon, nested subpages (`level 0/1/2`), bidirectional XHTML ↔ Markdown canvas, surgical `data-id` `PATCH` edits, optimistic to-do toggles, Link Extractor (`u`), File Picker with `zoxide` (`Ctrl+F`), and 6 themes. |
|
|
27
|
+
| **High-Res Terminal Images** | Inline thumbnails & fullscreen HD previews (`v` / `Alt+v`) with 80ms protocol probing for **Kitty**, **iTerm2**, **Sixel** (Floyd-Steinberg dithering), and **24-bit Unicode Half-Blocks** + `Ctrl+V` clipboard PNG upload. |
|
|
28
|
+
| **Local SQLite FTS5 + IPC Daemon** | WAL-mode SQLite cache with 4-reader pool, trigram full-text search (`/`), persistent `DraftStore`, and a shared background sync daemon (`onenote daemon start`). |
|
|
29
|
+
| **4-in-1 Agent Interface** | Interactive **TUI** (`onenote`), scriptable `--json` **CLI**, local **HTTP JSON API** (`onenote serve`, port `8793`), and stdio **MCP Server** (`onenote mcp`). |
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Quick Start
|
|
34
|
+
|
|
35
|
+
```sh
|
|
36
|
+
# 1. Install globally via npm (precompiled native binary for win32 / darwin / linux)
|
|
37
|
+
npm i -g @bitefoundry/onenote
|
|
38
|
+
|
|
39
|
+
# 2. Authenticate with Microsoft 365 (PKCE loopback, --device-code, or --token-file)
|
|
40
|
+
onenote login
|
|
41
|
+
|
|
42
|
+
# 3. Launch the interactive TUI
|
|
43
|
+
onenote
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
```sh
|
|
47
|
+
onenote read "Meeting notes" --json
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Read a page with its key and notebook scope. Local search uses the identified account’s cache. If you use an opaque access token, run `onenote whoami` once online first. For full detail, add `--full` in the CLI or pass `compact: false` to `get_page` in MCP.
|
|
51
|
+
|
|
52
|
+
Build from source with `cargo build --release`. See [installation and migration](docs/NPM.md) for updating scripts, MCP configurations, and local HTTP clients.
|
|
53
|
+
|
|
54
|
+
### Company-managed Microsoft Entra sign-in
|
|
55
|
+
|
|
56
|
+
`onenote login` uses the public Microsoft Graph Command Line Tools client by default. To use a company-owned app, register it as a public client and configure the `http://localhost` redirect URI. Enable public client flows for headless `--device-code` sign-in. [Company app registration guide](https://github.com/BiteFoundry/teams/blob/master/docs/ENTERPRISE.md)
|
|
57
|
+
|
|
58
|
+
Add the Microsoft Graph delegated permissions your users need and have your Entra administrator grant consent where required.
|
|
59
|
+
|
|
60
|
+
| Feature | Delegated scopes |
|
|
61
|
+
| --- | --- |
|
|
62
|
+
| Profile and session refresh | `User.Read`, `offline_access` |
|
|
63
|
+
| Read, create, and edit the user's OneNote content | `Notes.Read`, `Notes.Create`, `Notes.ReadWrite` |
|
|
64
|
+
| Discover joined Teams and read or edit organizational notebooks the user can access | `Team.ReadBasic.All`, `Notes.Read.All`, `Notes.ReadWrite.All` |
|
|
65
|
+
|
|
66
|
+
The default sign-in adds the organizational scopes when you specify your company's tenant ID. Set `scopes` in `config.toml` to request a narrower set that matches your workflow.
|
|
67
|
+
|
|
68
|
+
```sh
|
|
69
|
+
onenote login --client-id YOUR_APP_ID --tenant-id YOUR_TENANT_ID
|
|
70
|
+
onenote whoami --json
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
For persistent environment configuration, set `ONENOTE_CLIENT_ID` and `ONENOTE_TENANT_ID`.
|
|
74
|
+
|
|
75
|
+
When supplying a token without an embedded user ID (for example an opaque `ONENOTE_ACCESS_TOKEN` or `ONENOTE_TOKEN_FILE`), run `onenote whoami` once while online to record only the token fingerprint and user ID under `identity-map/`. Running local `search` (without `--refresh`) or `--offline` with an unrecorded token returns an `Unknown identity` error instead of falling back to an empty `default` cache. Running `onenote search <query> --refresh` also records the identity binding. Whenever the token rotates or changes, run `onenote whoami` once again for the new token.
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## Keybindings Cheat Sheet
|
|
80
|
+
|
|
81
|
+
| Key | Action |
|
|
82
|
+
| --- | --- |
|
|
83
|
+
| `Tab` / `Shift+Tab` | Cycle focus (Notebooks → Pages → Note Canvas) |
|
|
84
|
+
| `j` / `k` · `↑` / `↓` | Navigate notebooks, pages, subpages, or blocks |
|
|
85
|
+
| `[` / `]` | Switch to previous / next section tab |
|
|
86
|
+
| `n` | Create a page (Markdown + `Ctrl+V` PNG) |
|
|
87
|
+
| `a` / `e` | Append Markdown block / surgically edit selected block |
|
|
88
|
+
| `Space` / `x` | Toggle selected To-Do checkbox (`data-tag="to-do:completed"`) |
|
|
89
|
+
| `B` / `S` / `D` | Create notebook / create section / delete page |
|
|
90
|
+
| `u` / `h` | Open Link Extractor modal / toggle inline `href` URLs |
|
|
91
|
+
| `v` / `o` / `y` | HD image preview / open in browser / copy page Markdown |
|
|
92
|
+
| `Ctrl+F` | Interactive File Picker (`z` for `zoxide` directory jump) |
|
|
93
|
+
| `/` | Instant full-text search across cached pages (SQLite FTS5) |
|
|
94
|
+
| `Ctrl+P` / `Ctrl+K` | Unified Command Palette & Omni-Switcher |
|
|
95
|
+
| `.` / Right-click | Context Menu |
|
|
96
|
+
| `Ctrl+,` / `Ctrl+B` / `?` | Settings / Toggle sidebar / Keyboard shortcuts help |
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## CLI, HTTP API & MCP
|
|
101
|
+
|
|
102
|
+
### CLI
|
|
103
|
+
|
|
104
|
+
```sh
|
|
105
|
+
onenote notebooks --json
|
|
106
|
+
onenote pages "Acme Engineering/Architecture" --json
|
|
107
|
+
onenote rename-section 'me|SECTION_ID' --name 'Architecture Notes' --json
|
|
108
|
+
onenote rename-notebook --drive-id DRIVE_ID --item-id ITEM_ID --name 'Engineering Notes' --json
|
|
109
|
+
onenote read "Q4 Architecture RFC" --json
|
|
110
|
+
onenote read "Q4 Architecture RFC" --json --full
|
|
111
|
+
onenote copy-page 'me|PAGE_ID' --section 'me|SECTION_ID' --json
|
|
112
|
+
onenote create "Architecture" --title "Release Notes" '## Shipped
|
|
113
|
+
- [x] WAL pool' --json
|
|
114
|
+
onenote check "Migration Cutover" --block-id 'p:m3' --done --json
|
|
115
|
+
onenote search "canary" --json
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
`onenote read PAGE --json` returns compact Markdown and identifiers by default; pass `--full` for parsed blocks, raw XHTML, and resources. Passing an explicit `--format <fmt> --json` returns the full JSON page, and adding `--compact` selects the compact shape. Write commands (`append`, `update`, `check`) with `--json` return a compact summary (`ok`, `page_key`, `title`, `last_modified_at`, plus `block_id` / `completed` where applicable) by default; pass `--full` to include the full `page` object.
|
|
119
|
+
|
|
120
|
+
Page commands (`read`, `append`, `update`, `check`, `delete`) accept an optional `--section` (name, `Notebook/Section`, ID, or scoped key) to narrow title lookup to one section.
|
|
121
|
+
|
|
122
|
+
When a `--json` command fails at runtime, it exits 1 and writes a single JSON object (`{"ok":false,"error":{"code","message"}}`, plus top-level operation fields for non-completed `copy-page`) to stdout alongside the stderr error line. Successful read/list `--json` responses omit `ok` and signal success with exit 0; CLI argument/usage errors exit 2 on stderr without JSON.
|
|
123
|
+
|
|
124
|
+
`onenote notebooks --json` and `onenote sections --json` return 50 items by default (text output stays unbounded unless `--limit` is passed); `pages` defaults to 50 and `search` defaults to 30. All four JSON list responses include `returned`, `has_more`, and `next_cursor`, which can be passed back with `--limit` and `--cursor` to page through results. Full-text body search in `onenote search` covers pages that have been read or synced (`cache.pages_with_body`).
|
|
125
|
+
|
|
126
|
+
Use `onenote read PAGE --format blocks` to find a checkbox or text block's current element ID. Use `--done` or `--undone` to set a checkbox state. Omit both flags to toggle it.
|
|
127
|
+
|
|
128
|
+
`copy-page` uses Microsoft Graph to create a new page in the destination section and preserves the original page and its links. If the copy is still pending, pass its `operation_url` with `--operation` to check the same copy. [Copy a page](docs/API.md#copy-a-page)
|
|
129
|
+
|
|
130
|
+
On Windows, `desktop-set-page-level` and `desktop-rename-section` work on existing objects in an open notebook. Use the OneNote app's **Move** command to move a page between sections. [Hierarchy operations and permissions](docs/API.md#hierarchy-operations)
|
|
131
|
+
|
|
132
|
+
### Local HTTP API (`onenote serve`)
|
|
133
|
+
|
|
134
|
+
```sh
|
|
135
|
+
# Start local Axum JSON server (default 127.0.0.1:8793)
|
|
136
|
+
onenote serve --token dev-secret
|
|
137
|
+
|
|
138
|
+
# Query pages & FTS5 search from scripts or agents
|
|
139
|
+
curl -H "Authorization: Bearer dev-secret" \
|
|
140
|
+
"http://127.0.0.1:8793/v1/onenote/search?q=canary&limit=10"
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Full route reference & OpenAPI 3.1 spec: [docs/API.md](docs/API.md) · [docs/openapi.yaml](docs/openapi.yaml).
|
|
144
|
+
|
|
145
|
+
### Model Context Protocol (`onenote mcp`)
|
|
146
|
+
|
|
147
|
+
Add to Claude Desktop, Claude Code, Cursor, or Codex over stdio JSON-RPC 2.0.
|
|
148
|
+
|
|
149
|
+
```json
|
|
150
|
+
{
|
|
151
|
+
"mcpServers": {
|
|
152
|
+
"onenote": {
|
|
153
|
+
"command": "onenote",
|
|
154
|
+
"args": ["mcp"]
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Full tool catalog & schemas: [docs/MCP.md](docs/MCP.md).
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
## `@bitefoundry` Enterprise Terminal Suite
|
|
165
|
+
|
|
166
|
+
| Package | Commands | Workspace Coverage |
|
|
167
|
+
| --- | --- | --- |
|
|
168
|
+
| [`@bitefoundry/teams`](https://www.npmjs.com/package/@bitefoundry/teams) | `teams` | Microsoft Teams chats, channels, threads & meetings |
|
|
169
|
+
| [`@bitefoundry/outlook`](https://www.npmjs.com/package/@bitefoundry/outlook) | `outlook` | Microsoft Outlook mail, calendar & contacts |
|
|
170
|
+
| **`@bitefoundry/onenote`** | `onenote` | Microsoft OneNote notebooks, sections, pages & XHTML/Markdown |
|
|
171
|
+
| [`@bitefoundry/sharepoint`](https://www.npmjs.com/package/@bitefoundry/sharepoint) | `sharepoint`, `bitefoundry-onedrive` | Microsoft SharePoint sites, document libraries & OneDrive files |
|
|
172
|
+
| [`@bitefoundry/atlassian`](https://www.npmjs.com/package/@bitefoundry/atlassian) | `atlassian`, `confluence`, `conf` | Atlassian Jira issues, boards, sprints & Confluence pages |
|
|
173
|
+
| [`@bitefoundry/notion`](https://www.npmjs.com/package/@bitefoundry/notion) | `notion` | Notion pages, databases, blocks & Markdown sync |
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
## License & Disclaimer
|
|
178
|
+
|
|
179
|
+
Licensed under the **MIT License**.
|
|
180
|
+
|
|
181
|
+
> Unofficial terminal client for Microsoft OneNote. Not affiliated with, endorsed by, or sponsored by Microsoft Corporation.
|