@bitefoundry/outlook 0.1.9 → 0.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.
- package/LICENSE +21 -21
- package/README.md +177 -164
- package/docs/API.md +365 -365
- package/docs/MCP.md +147 -146
- package/docs/NPM.md +236 -236
- package/docs/openapi.yaml +705 -705
- package/package.json +49 -49
package/docs/NPM.md
CHANGED
|
@@ -1,236 +1,236 @@
|
|
|
1
|
-
# npm distribution
|
|
2
|
-
|
|
3
|
-
`@bitefoundry/outlook` is distributed on npm as a small JavaScript launcher plus one
|
|
4
|
-
optional dependency per platform. The launcher resolves the prebuilt Rust binary
|
|
5
|
-
and execs it directly (with `scripts/postinstall.mjs` linking the native binary
|
|
6
|
-
into `bin/` and Windows shims for zero-Node-startup execution), so there is no
|
|
7
|
-
compiler, Node native addon, or network download during install.
|
|
8
|
-
|
|
9
|
-
The Rust crate is named `outlook-cli` and produces the pure **Microsoft Outlook**
|
|
10
|
-
binary (`outlook` / `outlook.exe`). The npm package is scoped as `@bitefoundry/outlook`
|
|
11
|
-
and installs the **`outlook`** command.
|
|
12
|
-
|
|
13
|
-
## Install and run
|
|
14
|
-
|
|
15
|
-
```sh
|
|
16
|
-
# one-off
|
|
17
|
-
npx @bitefoundry/outlook --version
|
|
18
|
-
|
|
19
|
-
# global install (installs `outlook`)
|
|
20
|
-
npm install -g @bitefoundry/outlook
|
|
21
|
-
outlook --version
|
|
22
|
-
|
|
23
|
-
# project-local
|
|
24
|
-
npm install @bitefoundry/outlook
|
|
25
|
-
npx outlook mail --folder inbox
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
All workflows share the same Microsoft Entra ID login (or automatic M365 shared-session
|
|
29
|
-
bootstrap with `teams-cli`), SQLite WAL + FTS5 cache (`cache.db`), background sync
|
|
30
|
-
daemon (`outlook daemon start | status | stop | restart`), HTTP API (`outlook serve`,
|
|
31
|
-
default `127.0.0.1:3939`), MCP server (`outlook mcp`), and multi-protocol terminal image
|
|
32
|
-
preview (`Kitty` / `iTerm2` / `Sixel` / `Halfblock` via `outlook preview` and the TUI).
|
|
33
|
-
Read commands also support `--cached` / `--fast` for instant local cache reads, or run
|
|
34
|
-
with zero Graph round-trips while the daemon is warm:
|
|
35
|
-
|
|
36
|
-
- `outlook login`, `outlook whoami`, `outlook doctor --online`
|
|
37
|
-
- `outlook folders`, `outlook mail --folder inbox --limit 30`, `outlook read <message_id>`
|
|
38
|
-
- `outlook send`, `outlook reply`, `outlook forward`, `outlook mark`, `outlook move`, `outlook archive`, `outlook delete`
|
|
39
|
-
- `outlook calendar --days 7`, `outlook event <id>`, `outlook create-event`, `outlook rsvp`, `outlook delete-event`
|
|
40
|
-
- `outlook contacts --query <q>`, `outlook task-lists`, `outlook tasks`, `outlook add-task`, `outlook done`, `outlook delete-task`
|
|
41
|
-
- `outlook search`, `outlook download`, `outlook preview`, `outlook sync`, `outlook daemon <start|status|stop|restart>`, `outlook tui`, `outlook serve`, `outlook mcp`, `outlook update`
|
|
42
|
-
|
|
43
|
-
## Supported platforms
|
|
44
|
-
|
|
45
|
-
| npm package | OS | CPU | Rust target |
|
|
46
|
-
| ------------------------------- | ------- | ----- | ----------------------------------- |
|
|
47
|
-
| `@bitefoundry/outlook-win32-x64` | Windows | x64 | `x86_64-pc-windows-msvc` |
|
|
48
|
-
| `@bitefoundry/outlook-win32-arm64` | Windows | arm64 | `aarch64-pc-windows-msvc` |
|
|
49
|
-
| `@bitefoundry/outlook-darwin-x64` | macOS | x64 | `x86_64-apple-darwin` |
|
|
50
|
-
| `@bitefoundry/outlook-darwin-arm64` | macOS | arm64 | `aarch64-apple-darwin` |
|
|
51
|
-
| `@bitefoundry/outlook-linux-x64` | Linux | x64 | `x86_64-unknown-linux-gnu` (2.28) |
|
|
52
|
-
| `@bitefoundry/outlook-linux-arm64` | Linux | arm64 | `aarch64-unknown-linux-gnu` (2.28) |
|
|
53
|
-
|
|
54
|
-
Linux packages are cross-compiled in CI with `cargo-zigbuild` against **GLIBC 2.28** (`*.2.28`) and verified with `scripts/verify-glibc.mjs` plus an `almalinux:8` container smoke test, so prebuilt binaries run out of the box on **AlmaLinux 8 / RHEL 8+ / Rocky Linux 8+ / Ubuntu 20.04+ / Debian 10+**. Older glibc distributions (e.g., CentOS 7 with `GLIBC < 2.28`) and Alpine/musl Linux should build from source with Cargo (`cargo build --release`).
|
|
55
|
-
|
|
56
|
-
## How resolution works
|
|
57
|
-
|
|
58
|
-
`bin/outlook.js` looks up `@bitefoundry/outlook-<platform>-<arch>` through
|
|
59
|
-
`require.resolve`, then executes
|
|
60
|
-
`node_modules/@bitefoundry/outlook-<platform>-<arch>/bin/outlook` (or `outlook.exe` on
|
|
61
|
-
Windows) with `stdio: 'inherit'`. On `npm install`, `scripts/postinstall.mjs`
|
|
62
|
-
additionally replaces `bin/outlook.js` (Unix) or rewrites `.bin/outlook[.cmd|.ps1]`
|
|
63
|
-
(Windows) to invoke the native Rust executable directly without spawning Node.
|
|
64
|
-
Signals (`SIGINT`, `SIGTERM`, `SIGHUP`) are forwarded and the launcher exits
|
|
65
|
-
with the child's exit code. If the platform package is missing (for example
|
|
66
|
-
because optional dependencies were skipped), the launcher prints the supported
|
|
67
|
-
platforms and the `--include=optional` hint instead of a stack trace.
|
|
68
|
-
|
|
69
|
-
## Layout
|
|
70
|
-
|
|
71
|
-
```
|
|
72
|
-
package.json # @bitefoundry/outlook launcher package (bin: outlook)
|
|
73
|
-
bin/outlook.js # outlook launcher
|
|
74
|
-
scripts/postinstall.mjs # zero-Node native binary linker on npm install
|
|
75
|
-
outlook / outlook.cmd # repo-local Outlook launchers
|
|
76
|
-
npm/outlook-<platform>/ # one package per platform
|
|
77
|
-
package.json # os/cpu/files, same version as root
|
|
78
|
-
bin/outlook[.exe] # added by scripts/build-npm.mjs, never committed
|
|
79
|
-
scripts/build-npm.mjs # copy target/<triple>/release/outlook[.exe]
|
|
80
|
-
scripts/sync-version.mjs # Cargo.toml version -> all package.json files
|
|
81
|
-
scripts/verify-glibc.mjs # verify Linux ELF GLIBC <= 2.28 symbol ceiling
|
|
82
|
-
.github/workflows/release.yml # tag-triggered build, publish, GitHub Release
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
Binaries are gitignored (`npm/*/bin/outlook*`). A clean checkout has empty
|
|
86
|
-
platform `bin/` directories until a build or `npm run build:npm` runs.
|
|
87
|
-
|
|
88
|
-
## Versioning
|
|
89
|
-
|
|
90
|
-
`Cargo.toml` (`[package].version`) is the single source of truth. To bump:
|
|
91
|
-
|
|
92
|
-
```sh
|
|
93
|
-
# edit Cargo.toml [package].version
|
|
94
|
-
node scripts/sync-version.mjs
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
The script updates the root `package.json`, every `npm/outlook-*/package.json`,
|
|
98
|
-
and the root `optionalDependencies` pins. It is idempotent; `--check` exits
|
|
99
|
-
non-zero if anything is stale. All packages must be published at the same
|
|
100
|
-
version because the root package pins its platform packages exactly.
|
|
101
|
-
|
|
102
|
-
Tag the release with a matching `v` prefix:
|
|
103
|
-
|
|
104
|
-
```sh
|
|
105
|
-
git tag v0.1.0
|
|
106
|
-
git push origin v0.1.0
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
## Publishing
|
|
110
|
-
|
|
111
|
-
Publishing is automated by `.github/workflows/release.yml`, which is triggered
|
|
112
|
-
by pushing a `v*` tag (or manually via `workflow_dispatch`).
|
|
113
|
-
|
|
114
|
-
1. Add a repository secret `NPM_TOKEN` (an npm automation token with publish
|
|
115
|
-
rights for the `@bitefoundry/outlook` packages).
|
|
116
|
-
2. Bump the version in `Cargo.toml`, run `node scripts/sync-version.mjs`,
|
|
117
|
-
commit, and push `v<version>`.
|
|
118
|
-
3. The workflow builds six targets, stages binaries into the platform
|
|
119
|
-
packages, uploads artifacts, publishes each platform package, publishes the
|
|
120
|
-
root package, and creates a GitHub Release with the archives, `outlook.exe`,
|
|
121
|
-
and `SHA256SUMS.txt`.
|
|
122
|
-
|
|
123
|
-
The publish job verifies that the tag matches the package version and that all
|
|
124
|
-
six platform packages contain a binary before publishing anything. Platform
|
|
125
|
-
packages are published first so the root package's `optionalDependencies` can
|
|
126
|
-
resolve immediately.
|
|
127
|
-
|
|
128
|
-
Manual publish (matching order):
|
|
129
|
-
|
|
130
|
-
```sh
|
|
131
|
-
node scripts/sync-version.mjs --check
|
|
132
|
-
for dir in npm/outlook-*; do npm publish "$dir" --access public; done
|
|
133
|
-
npm publish --access public
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
## Local validation
|
|
137
|
-
|
|
138
|
-
```sh
|
|
139
|
-
# stage the current host binary (Windows example)
|
|
140
|
-
node scripts/build-npm.mjs --target x86_64-pc-windows-msvc
|
|
141
|
-
node bin/outlook.js --version
|
|
142
|
-
|
|
143
|
-
npm pack --dry-run
|
|
144
|
-
npm pack --dry-run ./npm/outlook-win32-x64
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
`node scripts/build-npm.mjs` with no arguments uses the host target and falls
|
|
148
|
-
back to `target/release/` when a plain `cargo build --release` was used.
|
|
149
|
-
`--all` attempts every supported target and warns about the ones not built on
|
|
150
|
-
the current host.
|
|
151
|
-
|
|
152
|
-
## External token brokers, M365 bootstrap & token scopes
|
|
153
|
-
|
|
154
|
-
When using an external Microsoft Graph token broker (`tc-auth`, `az account get-access-token`, Vault CLI, etc.), configure `token_file` / `token_refresh_cmd` instead of shell wrappers (avoids `cmd.exe` 1023-char `set /p` truncation and `.ps1`/`.cmd` shim issues). Setting `OUTLOOK_TOKEN_FILE` (`token_file`) or `OUTLOOK_ACCESS_TOKEN` automatically skips OS keyring reads.
|
|
155
|
-
|
|
156
|
-
When `share_m365_auth = true` (default; `OUTLOOK_SHARE_M365_AUTH=true`), `outlook` can also bootstrap from an existing `TEAMS_TOKEN_FILE` or `teams-cli` stored session if no `outlook-cli` token is configured yet.
|
|
157
|
-
|
|
158
|
-
### Required Microsoft Graph delegated scopes
|
|
159
|
-
|
|
160
|
-
Pure Outlook requests only Microsoft Outlook & Graph core scopes:
|
|
161
|
-
|
|
162
|
-
`offline_access`, `User.Read`, `User.ReadBasic.All`, `Mail.ReadWrite`, `Mail.Send`, `Calendars.ReadWrite`, `Contacts.ReadWrite`, `Tasks.ReadWrite`
|
|
163
|
-
|
|
164
|
-
Run `outlook whoami` or `outlook doctor` to inspect JWT `scp`/`roles` claims automatically.
|
|
165
|
-
|
|
166
|
-
### 1. `config.toml` (recommended persistent setup)
|
|
167
|
-
|
|
168
|
-
```toml
|
|
169
|
-
# Windows: %APPDATA%\outlook-cli\config.toml
|
|
170
|
-
# Linux/macOS: ~/.config/outlook-cli/config.toml
|
|
171
|
-
token_file = "~/.cursor/tc-auth/access_token"
|
|
172
|
-
token_refresh_cmd = "python ~/.cursor/tc-auth/graph-auth.py refresh"
|
|
173
|
-
token_refresh_mins = 5
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
### 2. Environment variables
|
|
177
|
-
|
|
178
|
-
```sh
|
|
179
|
-
export OUTLOOK_TOKEN_FILE="$HOME/.cursor/tc-auth/access_token"
|
|
180
|
-
export OUTLOOK_TOKEN_REFRESH_CMD="python $HOME/.cursor/tc-auth/graph-auth.py refresh"
|
|
181
|
-
export OUTLOOK_TOKEN_REFRESH_MINS=5
|
|
182
|
-
```
|
|
183
|
-
|
|
184
|
-
### 3. Azure CLI (`az account get-access-token`) JSON/stdout integration
|
|
185
|
-
|
|
186
|
-
If `token_file` is omitted, `token_refresh_cmd` stdout (raw JWT or Azure CLI camelCase JSON `accessToken` / `expiresOn`) is parsed and cached in memory:
|
|
187
|
-
|
|
188
|
-
```toml
|
|
189
|
-
token_refresh_cmd = "az account get-access-token --resource https://graph.microsoft.com --output json"
|
|
190
|
-
token_refresh_mins = 5
|
|
191
|
-
```
|
|
192
|
-
|
|
193
|
-
### Key environment variables
|
|
194
|
-
|
|
195
|
-
| Variable | Summary |
|
|
196
|
-
| --- | --- |
|
|
197
|
-
| `OUTLOOK_ACCESS_TOKEN` | Static Bearer token override (automatically skips OS keyring) |
|
|
198
|
-
| `OUTLOOK_TOKEN_FILE` | External token file path (raw JWT or JSON; skips OS keyring) |
|
|
199
|
-
| `OUTLOOK_TOKEN_REFRESH_CMD` | Shell command run to refresh expiring/`401` tokens |
|
|
200
|
-
| `OUTLOOK_TOKEN_REFRESH_MINS` | Refresh lead window in minutes before expiry (default `5`) |
|
|
201
|
-
| `OUTLOOK_SHARE_M365_AUTH` | Share/bootstrap M365 token session from `TEAMS_TOKEN_FILE` or `teams-cli` (default `true`) |
|
|
202
|
-
| `OUTLOOK_DISABLE_KEYRING=1` | Disable OS keyring and use `credentials.json` only |
|
|
203
|
-
| `OUTLOOK_CLIENT_ID` | Override Entra ID application client ID (falls back to `TEAMS_CLIENT_ID`, `AZURE_CLIENT_ID`) |
|
|
204
|
-
| `OUTLOOK_TENANT_ID` | Override Entra ID tenant ID (default `common`; falls back to `TEAMS_TENANT_ID`, `AZURE_TENANT_ID`) |
|
|
205
|
-
| `OUTLOOK_CONFIG_DIR` | Override config/credentials directory |
|
|
206
|
-
| `OUTLOOK_DATA_DIR` | Override SQLite cache (`cache.db`) directory |
|
|
207
|
-
| `OUTLOOK_NO_BROWSER` | Disable automatic browser launch during login (`1` / `true`) |
|
|
208
|
-
| `OUTLOOK_CLI_CACHE_SECS` | CLI read cache TTL in seconds (default `0`; `--cached` / `--fast` forces cache-first reads) |
|
|
209
|
-
| `OUTLOOK_AUTO_DAEMON` | Auto-start/attach to the background sync daemon (`1` / `true`, or `config.toml`: `auto_daemon = true`, default `false`) |
|
|
210
|
-
| `OUTLOOK_IMAGE_PROTOCOL` | Terminal image protocol override (`auto`, `kitty`, `iterm2`, `sixel`, `halfblock`) |
|
|
211
|
-
| `OUTLOOK_GITHUB_REPO` | Override GitHub `owner/repo` used by `outlook update` (default `BiteFoundry/outlook`) |
|
|
212
|
-
| `OUTLOOK_GITHUB_TOKEN` | GitHub token for private release checks in `outlook update` |
|
|
213
|
-
|
|
214
|
-
## Troubleshooting
|
|
215
|
-
|
|
216
|
-
- **`no prebuilt binary found for <platform>-<arch>`** — the optional
|
|
217
|
-
dependency was skipped. Reinstall with
|
|
218
|
-
`npm install -g @bitefoundry/outlook --include=optional` or
|
|
219
|
-
`npm install @bitefoundry/outlook --include=optional`. Check that your npm config
|
|
220
|
-
does not set `omit=optional`.
|
|
221
|
-
- **`EBADPLATFORM` / package skipped** — npm installs only the matching
|
|
222
|
-
`os`/`cpu` package. Cross-installing (for example x64 Node on ARM Windows via
|
|
223
|
-
emulation) still reports the Node architecture, so install under the native
|
|
224
|
-
Node build.
|
|
225
|
-
- **Older Linux (`GLIBC < 2.28`, e.g. CentOS 7) or Alpine/musl Linux** — prebuilt Linux binaries require **GLIBC >= 2.28** (AlmaLinux 8 / RHEL 8+ / Rocky Linux 8+ / Ubuntu 20.04+ / Debian 10+). On older glibc or musl systems, build from source with Cargo (`cargo build --release`).
|
|
226
|
-
- **macOS Gatekeeper** — npm-installed binaries are not notarized. If macOS
|
|
227
|
-
blocks execution, allow the binary in System Settings → Privacy & Security, or
|
|
228
|
-
build from source.
|
|
229
|
-
- **Corporate proxy/firewall** — `npx @bitefoundry/outlook` performs a registry
|
|
230
|
-
download each time unless cached; use a global install for offline-friendly
|
|
231
|
-
use.
|
|
232
|
-
- **Verify the binary** —
|
|
233
|
-
`node -p "require.resolve('@bitefoundry/outlook-win32-x64/package.json')"`
|
|
234
|
-
(adjust for your platform) shows which platform package npm selected.
|
|
235
|
-
- **Tag push did not publish** — check the publish job log; a tag/version
|
|
236
|
-
mismatch or a missing `NPM_TOKEN` fails the job before any publish.
|
|
1
|
+
# npm distribution
|
|
2
|
+
|
|
3
|
+
`@bitefoundry/outlook` is distributed on npm as a small JavaScript launcher plus one
|
|
4
|
+
optional dependency per platform. The launcher resolves the prebuilt Rust binary
|
|
5
|
+
and execs it directly (with `scripts/postinstall.mjs` linking the native binary
|
|
6
|
+
into `bin/` and Windows shims for zero-Node-startup execution), so there is no
|
|
7
|
+
compiler, Node native addon, or network download during install.
|
|
8
|
+
|
|
9
|
+
The Rust crate is named `outlook-cli` and produces the pure **Microsoft Outlook**
|
|
10
|
+
binary (`outlook` / `outlook.exe`). The npm package is scoped as `@bitefoundry/outlook`
|
|
11
|
+
and installs the **`outlook`** command.
|
|
12
|
+
|
|
13
|
+
## Install and run
|
|
14
|
+
|
|
15
|
+
```sh
|
|
16
|
+
# one-off
|
|
17
|
+
npx @bitefoundry/outlook --version
|
|
18
|
+
|
|
19
|
+
# global install (installs `outlook`)
|
|
20
|
+
npm install -g @bitefoundry/outlook
|
|
21
|
+
outlook --version
|
|
22
|
+
|
|
23
|
+
# project-local
|
|
24
|
+
npm install @bitefoundry/outlook
|
|
25
|
+
npx outlook mail --folder inbox
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
All workflows share the same Microsoft Entra ID login (or automatic M365 shared-session
|
|
29
|
+
bootstrap with `teams-cli`), SQLite WAL + FTS5 cache (`cache.db`), background sync
|
|
30
|
+
daemon (`outlook daemon start | status | stop | restart`), HTTP API (`outlook serve`,
|
|
31
|
+
default `127.0.0.1:3939`), MCP server (`outlook mcp`), and multi-protocol terminal image
|
|
32
|
+
preview (`Kitty` / `iTerm2` / `Sixel` / `Halfblock` via `outlook preview` and the TUI).
|
|
33
|
+
Read commands also support `--cached` / `--fast` for instant local cache reads, or run
|
|
34
|
+
with zero Graph round-trips while the daemon is warm:
|
|
35
|
+
|
|
36
|
+
- `outlook login`, `outlook whoami`, `outlook doctor --online`
|
|
37
|
+
- `outlook folders`, `outlook mail --folder inbox --limit 30`, `outlook read <message_id>`
|
|
38
|
+
- `outlook send`, `outlook reply`, `outlook forward`, `outlook mark`, `outlook move`, `outlook archive`, `outlook delete`
|
|
39
|
+
- `outlook calendar --days 7`, `outlook event <id>`, `outlook create-event`, `outlook rsvp`, `outlook delete-event`
|
|
40
|
+
- `outlook contacts --query <q>`, `outlook task-lists`, `outlook tasks`, `outlook add-task`, `outlook done`, `outlook delete-task`
|
|
41
|
+
- `outlook search`, `outlook download`, `outlook preview`, `outlook sync`, `outlook daemon <start|status|stop|restart>`, `outlook tui`, `outlook serve`, `outlook mcp`, `outlook update`
|
|
42
|
+
|
|
43
|
+
## Supported platforms
|
|
44
|
+
|
|
45
|
+
| npm package | OS | CPU | Rust target |
|
|
46
|
+
| ------------------------------- | ------- | ----- | ----------------------------------- |
|
|
47
|
+
| `@bitefoundry/outlook-win32-x64` | Windows | x64 | `x86_64-pc-windows-msvc` |
|
|
48
|
+
| `@bitefoundry/outlook-win32-arm64` | Windows | arm64 | `aarch64-pc-windows-msvc` |
|
|
49
|
+
| `@bitefoundry/outlook-darwin-x64` | macOS | x64 | `x86_64-apple-darwin` |
|
|
50
|
+
| `@bitefoundry/outlook-darwin-arm64` | macOS | arm64 | `aarch64-apple-darwin` |
|
|
51
|
+
| `@bitefoundry/outlook-linux-x64` | Linux | x64 | `x86_64-unknown-linux-gnu` (2.28) |
|
|
52
|
+
| `@bitefoundry/outlook-linux-arm64` | Linux | arm64 | `aarch64-unknown-linux-gnu` (2.28) |
|
|
53
|
+
|
|
54
|
+
Linux packages are cross-compiled in CI with `cargo-zigbuild` against **GLIBC 2.28** (`*.2.28`) and verified with `scripts/verify-glibc.mjs` plus an `almalinux:8` container smoke test, so prebuilt binaries run out of the box on **AlmaLinux 8 / RHEL 8+ / Rocky Linux 8+ / Ubuntu 20.04+ / Debian 10+**. Older glibc distributions (e.g., CentOS 7 with `GLIBC < 2.28`) and Alpine/musl Linux should build from source with Cargo (`cargo build --release`).
|
|
55
|
+
|
|
56
|
+
## How resolution works
|
|
57
|
+
|
|
58
|
+
`bin/outlook.js` looks up `@bitefoundry/outlook-<platform>-<arch>` through
|
|
59
|
+
`require.resolve`, then executes
|
|
60
|
+
`node_modules/@bitefoundry/outlook-<platform>-<arch>/bin/outlook` (or `outlook.exe` on
|
|
61
|
+
Windows) with `stdio: 'inherit'`. On `npm install`, `scripts/postinstall.mjs`
|
|
62
|
+
additionally replaces `bin/outlook.js` (Unix) or rewrites `.bin/outlook[.cmd|.ps1]`
|
|
63
|
+
(Windows) to invoke the native Rust executable directly without spawning Node.
|
|
64
|
+
Signals (`SIGINT`, `SIGTERM`, `SIGHUP`) are forwarded and the launcher exits
|
|
65
|
+
with the child's exit code. If the platform package is missing (for example
|
|
66
|
+
because optional dependencies were skipped), the launcher prints the supported
|
|
67
|
+
platforms and the `--include=optional` hint instead of a stack trace.
|
|
68
|
+
|
|
69
|
+
## Layout
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
package.json # @bitefoundry/outlook launcher package (bin: outlook)
|
|
73
|
+
bin/outlook.js # outlook launcher
|
|
74
|
+
scripts/postinstall.mjs # zero-Node native binary linker on npm install
|
|
75
|
+
outlook / outlook.cmd # repo-local Outlook launchers
|
|
76
|
+
npm/outlook-<platform>/ # one package per platform
|
|
77
|
+
package.json # os/cpu/files, same version as root
|
|
78
|
+
bin/outlook[.exe] # added by scripts/build-npm.mjs, never committed
|
|
79
|
+
scripts/build-npm.mjs # copy target/<triple>/release/outlook[.exe]
|
|
80
|
+
scripts/sync-version.mjs # Cargo.toml version -> all package.json files
|
|
81
|
+
scripts/verify-glibc.mjs # verify Linux ELF GLIBC <= 2.28 symbol ceiling
|
|
82
|
+
.github/workflows/release.yml # tag-triggered build, publish, GitHub Release
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Binaries are gitignored (`npm/*/bin/outlook*`). A clean checkout has empty
|
|
86
|
+
platform `bin/` directories until a build or `npm run build:npm` runs.
|
|
87
|
+
|
|
88
|
+
## Versioning
|
|
89
|
+
|
|
90
|
+
`Cargo.toml` (`[package].version`) is the single source of truth. To bump:
|
|
91
|
+
|
|
92
|
+
```sh
|
|
93
|
+
# edit Cargo.toml [package].version
|
|
94
|
+
node scripts/sync-version.mjs
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
The script updates the root `package.json`, every `npm/outlook-*/package.json`,
|
|
98
|
+
and the root `optionalDependencies` pins. It is idempotent; `--check` exits
|
|
99
|
+
non-zero if anything is stale. All packages must be published at the same
|
|
100
|
+
version because the root package pins its platform packages exactly.
|
|
101
|
+
|
|
102
|
+
Tag the release with a matching `v` prefix:
|
|
103
|
+
|
|
104
|
+
```sh
|
|
105
|
+
git tag v0.1.0
|
|
106
|
+
git push origin v0.1.0
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Publishing
|
|
110
|
+
|
|
111
|
+
Publishing is automated by `.github/workflows/release.yml`, which is triggered
|
|
112
|
+
by pushing a `v*` tag (or manually via `workflow_dispatch`).
|
|
113
|
+
|
|
114
|
+
1. Add a repository secret `NPM_TOKEN` (an npm automation token with publish
|
|
115
|
+
rights for the `@bitefoundry/outlook` packages).
|
|
116
|
+
2. Bump the version in `Cargo.toml`, run `node scripts/sync-version.mjs`,
|
|
117
|
+
commit, and push `v<version>`.
|
|
118
|
+
3. The workflow builds six targets, stages binaries into the platform
|
|
119
|
+
packages, uploads artifacts, publishes each platform package, publishes the
|
|
120
|
+
root package, and creates a GitHub Release with the archives, `outlook.exe`,
|
|
121
|
+
and `SHA256SUMS.txt`.
|
|
122
|
+
|
|
123
|
+
The publish job verifies that the tag matches the package version and that all
|
|
124
|
+
six platform packages contain a binary before publishing anything. Platform
|
|
125
|
+
packages are published first so the root package's `optionalDependencies` can
|
|
126
|
+
resolve immediately.
|
|
127
|
+
|
|
128
|
+
Manual publish (matching order):
|
|
129
|
+
|
|
130
|
+
```sh
|
|
131
|
+
node scripts/sync-version.mjs --check
|
|
132
|
+
for dir in npm/outlook-*; do npm publish "$dir" --access public; done
|
|
133
|
+
npm publish --access public
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## Local validation
|
|
137
|
+
|
|
138
|
+
```sh
|
|
139
|
+
# stage the current host binary (Windows example)
|
|
140
|
+
node scripts/build-npm.mjs --target x86_64-pc-windows-msvc
|
|
141
|
+
node bin/outlook.js --version
|
|
142
|
+
|
|
143
|
+
npm pack --dry-run
|
|
144
|
+
npm pack --dry-run ./npm/outlook-win32-x64
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
`node scripts/build-npm.mjs` with no arguments uses the host target and falls
|
|
148
|
+
back to `target/release/` when a plain `cargo build --release` was used.
|
|
149
|
+
`--all` attempts every supported target and warns about the ones not built on
|
|
150
|
+
the current host.
|
|
151
|
+
|
|
152
|
+
## External token brokers, M365 bootstrap & token scopes
|
|
153
|
+
|
|
154
|
+
When using an external Microsoft Graph token broker (`tc-auth`, `az account get-access-token`, Vault CLI, etc.), configure `token_file` / `token_refresh_cmd` instead of shell wrappers (avoids `cmd.exe` 1023-char `set /p` truncation and `.ps1`/`.cmd` shim issues). Setting `OUTLOOK_TOKEN_FILE` (`token_file`) or `OUTLOOK_ACCESS_TOKEN` automatically skips OS keyring reads.
|
|
155
|
+
|
|
156
|
+
When `share_m365_auth = true` (default; `OUTLOOK_SHARE_M365_AUTH=true`), `outlook` can also bootstrap from an existing `TEAMS_TOKEN_FILE` or `teams-cli` stored session if no `outlook-cli` token is configured yet.
|
|
157
|
+
|
|
158
|
+
### Required Microsoft Graph delegated scopes
|
|
159
|
+
|
|
160
|
+
Pure Outlook requests only Microsoft Outlook & Graph core scopes:
|
|
161
|
+
|
|
162
|
+
`offline_access`, `User.Read`, `User.ReadBasic.All`, `Mail.ReadWrite`, `Mail.Send`, `Calendars.ReadWrite`, `Contacts.ReadWrite`, `Tasks.ReadWrite`
|
|
163
|
+
|
|
164
|
+
Run `outlook whoami` or `outlook doctor` to inspect JWT `scp`/`roles` claims automatically.
|
|
165
|
+
|
|
166
|
+
### 1. `config.toml` (recommended persistent setup)
|
|
167
|
+
|
|
168
|
+
```toml
|
|
169
|
+
# Windows: %APPDATA%\outlook-cli\config.toml
|
|
170
|
+
# Linux/macOS: ~/.config/outlook-cli/config.toml
|
|
171
|
+
token_file = "~/.cursor/tc-auth/access_token"
|
|
172
|
+
token_refresh_cmd = "python ~/.cursor/tc-auth/graph-auth.py refresh"
|
|
173
|
+
token_refresh_mins = 5
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### 2. Environment variables
|
|
177
|
+
|
|
178
|
+
```sh
|
|
179
|
+
export OUTLOOK_TOKEN_FILE="$HOME/.cursor/tc-auth/access_token"
|
|
180
|
+
export OUTLOOK_TOKEN_REFRESH_CMD="python $HOME/.cursor/tc-auth/graph-auth.py refresh"
|
|
181
|
+
export OUTLOOK_TOKEN_REFRESH_MINS=5
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### 3. Azure CLI (`az account get-access-token`) JSON/stdout integration
|
|
185
|
+
|
|
186
|
+
If `token_file` is omitted, `token_refresh_cmd` stdout (raw JWT or Azure CLI camelCase JSON `accessToken` / `expiresOn`) is parsed and cached in memory:
|
|
187
|
+
|
|
188
|
+
```toml
|
|
189
|
+
token_refresh_cmd = "az account get-access-token --resource https://graph.microsoft.com --output json"
|
|
190
|
+
token_refresh_mins = 5
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
### Key environment variables
|
|
194
|
+
|
|
195
|
+
| Variable | Summary |
|
|
196
|
+
| --- | --- |
|
|
197
|
+
| `OUTLOOK_ACCESS_TOKEN` | Static Bearer token override (automatically skips OS keyring) |
|
|
198
|
+
| `OUTLOOK_TOKEN_FILE` | External token file path (raw JWT or JSON; skips OS keyring) |
|
|
199
|
+
| `OUTLOOK_TOKEN_REFRESH_CMD` | Shell command run to refresh expiring/`401` tokens |
|
|
200
|
+
| `OUTLOOK_TOKEN_REFRESH_MINS` | Refresh lead window in minutes before expiry (default `5`) |
|
|
201
|
+
| `OUTLOOK_SHARE_M365_AUTH` | Share/bootstrap M365 token session from `TEAMS_TOKEN_FILE` or `teams-cli` (default `true`) |
|
|
202
|
+
| `OUTLOOK_DISABLE_KEYRING=1` | Disable OS keyring and use `credentials.json` only |
|
|
203
|
+
| `OUTLOOK_CLIENT_ID` | Override Entra ID application client ID (falls back to `TEAMS_CLIENT_ID`, `AZURE_CLIENT_ID`) |
|
|
204
|
+
| `OUTLOOK_TENANT_ID` | Override Entra ID tenant ID (default `common`; falls back to `TEAMS_TENANT_ID`, `AZURE_TENANT_ID`) |
|
|
205
|
+
| `OUTLOOK_CONFIG_DIR` | Override config/credentials directory |
|
|
206
|
+
| `OUTLOOK_DATA_DIR` | Override SQLite cache (`cache.db`) directory |
|
|
207
|
+
| `OUTLOOK_NO_BROWSER` | Disable automatic browser launch during login (`1` / `true`) |
|
|
208
|
+
| `OUTLOOK_CLI_CACHE_SECS` | CLI read cache TTL in seconds (default `0`; `--cached` / `--fast` forces cache-first reads) |
|
|
209
|
+
| `OUTLOOK_AUTO_DAEMON` | Auto-start/attach to the background sync daemon (`1` / `true`, or `config.toml`: `auto_daemon = true`, default `false`) |
|
|
210
|
+
| `OUTLOOK_IMAGE_PROTOCOL` | Terminal image protocol override (`auto`, `kitty`, `iterm2`, `sixel`, `halfblock`) |
|
|
211
|
+
| `OUTLOOK_GITHUB_REPO` | Override GitHub `owner/repo` used by `outlook update` (default `BiteFoundry/outlook`) |
|
|
212
|
+
| `OUTLOOK_GITHUB_TOKEN` | GitHub token for private release checks in `outlook update` |
|
|
213
|
+
|
|
214
|
+
## Troubleshooting
|
|
215
|
+
|
|
216
|
+
- **`no prebuilt binary found for <platform>-<arch>`** — the optional
|
|
217
|
+
dependency was skipped. Reinstall with
|
|
218
|
+
`npm install -g @bitefoundry/outlook --include=optional` or
|
|
219
|
+
`npm install @bitefoundry/outlook --include=optional`. Check that your npm config
|
|
220
|
+
does not set `omit=optional`.
|
|
221
|
+
- **`EBADPLATFORM` / package skipped** — npm installs only the matching
|
|
222
|
+
`os`/`cpu` package. Cross-installing (for example x64 Node on ARM Windows via
|
|
223
|
+
emulation) still reports the Node architecture, so install under the native
|
|
224
|
+
Node build.
|
|
225
|
+
- **Older Linux (`GLIBC < 2.28`, e.g. CentOS 7) or Alpine/musl Linux** — prebuilt Linux binaries require **GLIBC >= 2.28** (AlmaLinux 8 / RHEL 8+ / Rocky Linux 8+ / Ubuntu 20.04+ / Debian 10+). On older glibc or musl systems, build from source with Cargo (`cargo build --release`).
|
|
226
|
+
- **macOS Gatekeeper** — npm-installed binaries are not notarized. If macOS
|
|
227
|
+
blocks execution, allow the binary in System Settings → Privacy & Security, or
|
|
228
|
+
build from source.
|
|
229
|
+
- **Corporate proxy/firewall** — `npx @bitefoundry/outlook` performs a registry
|
|
230
|
+
download each time unless cached; use a global install for offline-friendly
|
|
231
|
+
use.
|
|
232
|
+
- **Verify the binary** —
|
|
233
|
+
`node -p "require.resolve('@bitefoundry/outlook-win32-x64/package.json')"`
|
|
234
|
+
(adjust for your platform) shows which platform package npm selected.
|
|
235
|
+
- **Tag push did not publish** — check the publish job log; a tag/version
|
|
236
|
+
mismatch or a missing `NPM_TOKEN` fails the job before any publish.
|