outlook-cli 1.2.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/CLI.md +89 -0
- package/LICENSE +21 -0
- package/QUICKSTART.md +104 -0
- package/README.md +994 -0
- package/auth/index.js +36 -0
- package/auth/oauth-server.js +139 -0
- package/auth/token-manager.js +199 -0
- package/auth/token-storage.js +282 -0
- package/auth/tools.js +127 -0
- package/calendar/accept.js +64 -0
- package/calendar/cancel.js +64 -0
- package/calendar/create.js +69 -0
- package/calendar/decline.js +64 -0
- package/calendar/delete.js +59 -0
- package/calendar/index.js +123 -0
- package/calendar/list.js +77 -0
- package/cli.js +1349 -0
- package/config.js +84 -0
- package/docs/PROJECT-STRUCTURE.md +52 -0
- package/docs/PUBLISHING.md +86 -0
- package/docs/REFERENCE.md +679 -0
- package/email/folder-utils.js +171 -0
- package/email/index.js +157 -0
- package/email/list.js +89 -0
- package/email/mark-as-read.js +101 -0
- package/email/read.js +128 -0
- package/email/search.js +282 -0
- package/email/send.js +120 -0
- package/folder/create.js +124 -0
- package/folder/index.js +78 -0
- package/folder/list.js +264 -0
- package/folder/move.js +163 -0
- package/index.js +136 -0
- package/outlook-auth-server.js +305 -0
- package/package.json +76 -0
- package/rules/create.js +248 -0
- package/rules/index.js +177 -0
- package/rules/list.js +202 -0
- package/tool-registry.js +54 -0
- package/utils/graph-api.js +120 -0
- package/utils/mock-data.js +145 -0
- package/utils/odata-helpers.js +40 -0
package/CLI.md
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# CLI Quick Reference
|
|
2
|
+
|
|
3
|
+
Use this file as a fast command cheat sheet.
|
|
4
|
+
For complete parameter-by-parameter documentation, use [docs/REFERENCE.md](docs/REFERENCE.md).
|
|
5
|
+
|
|
6
|
+
## Install
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
npm i -g outlook-cli
|
|
10
|
+
outlook-cli --help
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Global options
|
|
14
|
+
|
|
15
|
+
- `--json`
|
|
16
|
+
- `--output text|json`
|
|
17
|
+
- `--plain`
|
|
18
|
+
- `--no-color`
|
|
19
|
+
- `--no-animate`
|
|
20
|
+
- `--help`
|
|
21
|
+
- `--version`
|
|
22
|
+
|
|
23
|
+
## Discovery
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
outlook-cli commands
|
|
27
|
+
outlook-cli tools list
|
|
28
|
+
outlook-cli tools schema send-email
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Auth
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
outlook-cli auth status
|
|
35
|
+
outlook-cli auth url
|
|
36
|
+
outlook-cli auth login --open --start-server --wait --timeout 180
|
|
37
|
+
outlook-cli auth logout
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Email
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
outlook-cli email list --folder inbox --count 20
|
|
44
|
+
outlook-cli email search --query "invoice" --unread-only true --count 10
|
|
45
|
+
outlook-cli email read --id <message-id>
|
|
46
|
+
outlook-cli email send --to jane@example.com --subject "Status" --body "Done"
|
|
47
|
+
outlook-cli email mark-read --id <message-id> --is-read true
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Calendar
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
outlook-cli calendar list --count 15
|
|
54
|
+
outlook-cli calendar create --subject "Planning" --start "2026-04-03T10:00:00" --end "2026-04-03T11:00:00" --attendees a@x.com,b@y.com
|
|
55
|
+
outlook-cli calendar decline --event-id <event-id> --comment "Conflict"
|
|
56
|
+
outlook-cli calendar cancel --event-id <event-id>
|
|
57
|
+
outlook-cli calendar delete --event-id <event-id>
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Folder
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
outlook-cli folder list --include-item-counts true --include-children true
|
|
64
|
+
outlook-cli folder create --name "Important"
|
|
65
|
+
outlook-cli folder move --email-ids <id1>,<id2> --target-folder "Important"
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Rule
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
outlook-cli rule list --include-details true
|
|
72
|
+
outlook-cli rule create --name "Move invoices" --contains-subject "invoice" --move-to-folder "Finance"
|
|
73
|
+
outlook-cli rule sequence --rule-name "Move invoices" --sequence 5
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Generic tool call
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
outlook-cli call search-emails --arg query=invoice --arg unreadOnly=true
|
|
80
|
+
outlook-cli call create-event --args-json '{"subject":"Standup","start":"2026-04-03T09:00:00","end":"2026-04-03T09:30:00"}'
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Diagnostics and update
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
outlook-cli doctor
|
|
87
|
+
outlook-cli update
|
|
88
|
+
outlook-cli update --run
|
|
89
|
+
```
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 outlook-cli contributors
|
|
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/QUICKSTART.md
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# Quick Start - outlook-cli
|
|
2
|
+
|
|
3
|
+
## 1. Install globally
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm i -g outlook-cli
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Verify install:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
outlook-cli --version
|
|
13
|
+
outlook-cli doctor
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## 2. Provide Microsoft credentials
|
|
17
|
+
|
|
18
|
+
Set one of these credential pairs:
|
|
19
|
+
|
|
20
|
+
- `OUTLOOK_CLIENT_ID` and `OUTLOOK_CLIENT_SECRET` (preferred)
|
|
21
|
+
- `MS_CLIENT_ID` and `MS_CLIENT_SECRET` (backward-compatible)
|
|
22
|
+
|
|
23
|
+
On PowerShell (current session):
|
|
24
|
+
|
|
25
|
+
```powershell
|
|
26
|
+
$env:OUTLOOK_CLIENT_ID="<your-client-id>"
|
|
27
|
+
$env:OUTLOOK_CLIENT_SECRET="<your-client-secret>"
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## 3. Authenticate once
|
|
31
|
+
|
|
32
|
+
Start the auth callback server in one terminal:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
outlook-cli auth login --start-server --wait
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Optional browser auto-open:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
outlook-cli auth login --open --start-server --wait
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Token behavior:
|
|
45
|
+
|
|
46
|
+
- Token is stored in your user profile.
|
|
47
|
+
- It is reused across runs, reinstalls, and updates.
|
|
48
|
+
- Refresh is handled automatically when possible.
|
|
49
|
+
|
|
50
|
+
## 4. Run commands
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
outlook-cli commands
|
|
54
|
+
outlook-cli tools list
|
|
55
|
+
outlook-cli email list --count 10
|
|
56
|
+
outlook-cli calendar list --count 10
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Machine-readable output:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
outlook-cli auth status --json
|
|
63
|
+
outlook-cli call list-emails --args-json '{"count":5}' --json
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## 5. Update
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
npm i -g outlook-cli@latest
|
|
70
|
+
# or
|
|
71
|
+
outlook-cli update --run
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Optional: MCP server mode
|
|
75
|
+
|
|
76
|
+
If you want to connect this project as a standard MCP server for clients such as Claude Desktop:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
npm run mcp-server
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Then point your MCP client config to `index.js` and set the same credential environment variables.
|
|
83
|
+
|
|
84
|
+
## Troubleshooting
|
|
85
|
+
|
|
86
|
+
- Run `outlook-cli doctor` first.
|
|
87
|
+
- Re-authenticate if needed:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
outlook-cli auth logout
|
|
91
|
+
outlook-cli auth login --open --start-server --wait
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
- If port 3333 is already in use:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
npx kill-port 3333
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Next docs
|
|
101
|
+
|
|
102
|
+
- Full command and parameter reference: [docs/REFERENCE.md](docs/REFERENCE.md)
|
|
103
|
+
- CLI cheat sheet: [CLI.md](CLI.md)
|
|
104
|
+
- Publish checklist: [docs/PUBLISHING.md](docs/PUBLISHING.md)
|