m365-cli 0.1.0 → 0.1.2
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/README.md +18 -21
- package/config/default.json +1 -1
- package/package.json +14 -4
- package/src/utils/trusted-senders.js +2 -5
package/README.md
CHANGED
|
@@ -2,6 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
Modern command-line interface for Microsoft 365 personal accounts (Mail, Calendar, OneDrive, SharePoint).
|
|
4
4
|
|
|
5
|
+
## Who is this for?
|
|
6
|
+
|
|
7
|
+
This CLI is primarily designed for **AI agents** (e.g., [OpenClaw](https://openclaw.ai), and similar agent frameworks) to interact with Microsoft 365 on behalf of users — reading emails, managing calendars, and handling files through natural language workflows.
|
|
8
|
+
|
|
9
|
+
That said, it works perfectly as a standalone CLI tool for power users who prefer managing M365 from the terminal.
|
|
10
|
+
|
|
11
|
+
**Agent use cases:**
|
|
12
|
+
- Let your AI assistant read, summarize, and reply to emails
|
|
13
|
+
- Automate calendar management through agent workflows
|
|
14
|
+
- Enable agents to upload/download files on OneDrive
|
|
15
|
+
- Integrate M365 data into multi-step agent pipelines
|
|
16
|
+
|
|
17
|
+
**Human use cases:**
|
|
18
|
+
- Quick email triage from the terminal
|
|
19
|
+
- Script-friendly JSON output for automation
|
|
20
|
+
- Lightweight M365 access without a heavy GUI
|
|
21
|
+
|
|
5
22
|
## Features
|
|
6
23
|
|
|
7
24
|
- 📧 **Mail**: List, read, send, search emails (with attachments)
|
|
@@ -430,18 +447,8 @@ For production use or organizational requirements, you can register your own Azu
|
|
|
430
447
|
|
|
431
448
|
> 💡 **Tip**: Admin consent allows all users in your organization to use the app without individual approval.
|
|
432
449
|
|
|
433
|
-
**
|
|
434
|
-
|
|
435
|
-
1. Go to **Overview** page
|
|
436
|
-
2. Copy the following values:
|
|
437
|
-
- **Application (client) ID** → This is your `CLIENT_ID`
|
|
438
|
-
- **Directory (tenant) ID** → This is your `TENANT_ID`
|
|
450
|
+
**Configure the CLI**
|
|
439
451
|
|
|
440
|
-
**Step 5: Configure the CLI**
|
|
441
|
-
|
|
442
|
-
Choose one of these methods:
|
|
443
|
-
|
|
444
|
-
**Option A: Environment Variables (Recommended)**
|
|
445
452
|
```bash
|
|
446
453
|
export M365_TENANT_ID="your-tenant-id"
|
|
447
454
|
export M365_CLIENT_ID="your-client-id"
|
|
@@ -449,16 +456,6 @@ export M365_CLIENT_ID="your-client-id"
|
|
|
449
456
|
|
|
450
457
|
Add these to your `~/.bashrc` or `~/.zshrc` to make them permanent.
|
|
451
458
|
|
|
452
|
-
**Option B: Configuration File**
|
|
453
|
-
|
|
454
|
-
Edit `config/default.json`:
|
|
455
|
-
```json
|
|
456
|
-
{
|
|
457
|
-
"tenantId": "your-tenant-id",
|
|
458
|
-
"clientId": "your-client-id"
|
|
459
|
-
}
|
|
460
|
-
```
|
|
461
|
-
|
|
462
459
|
##### Method 2: Azure CLI (One-Command Setup)
|
|
463
460
|
|
|
464
461
|
If you have [Azure CLI](https://learn.microsoft.com/cli/azure/install-azure-cli) installed:
|
package/config/default.json
CHANGED
package/package.json
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "m365-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Microsoft 365 CLI - Manage Mail, Calendar, and OneDrive from the command line",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"files": [
|
|
6
|
+
"files": [
|
|
7
|
+
"bin",
|
|
8
|
+
"src",
|
|
9
|
+
"config",
|
|
10
|
+
"README.md"
|
|
11
|
+
],
|
|
7
12
|
"main": "src/index.js",
|
|
8
13
|
"bin": {
|
|
9
14
|
"m365": "./bin/m365.js"
|
|
@@ -23,8 +28,13 @@
|
|
|
23
28
|
"onedrive"
|
|
24
29
|
],
|
|
25
30
|
"author": "",
|
|
26
|
-
"repository": {
|
|
27
|
-
|
|
31
|
+
"repository": {
|
|
32
|
+
"type": "git",
|
|
33
|
+
"url": ""
|
|
34
|
+
},
|
|
35
|
+
"bugs": {
|
|
36
|
+
"url": ""
|
|
37
|
+
},
|
|
28
38
|
"homepage": "",
|
|
29
39
|
"license": "MIT",
|
|
30
40
|
"engines": {
|
|
@@ -12,9 +12,6 @@ const WHITELIST_PATHS = [
|
|
|
12
12
|
join(homedir(), '.m365-cli/trusted-senders.txt'),
|
|
13
13
|
];
|
|
14
14
|
|
|
15
|
-
/**
|
|
16
|
-
* Get the active whitelist file path
|
|
17
|
-
*/
|
|
18
15
|
function getWhitelistPath() {
|
|
19
16
|
// Return first existing path
|
|
20
17
|
for (const path of WHITELIST_PATHS) {
|
|
@@ -23,8 +20,8 @@ function getWhitelistPath() {
|
|
|
23
20
|
}
|
|
24
21
|
}
|
|
25
22
|
|
|
26
|
-
// Default to
|
|
27
|
-
return WHITELIST_PATHS[
|
|
23
|
+
// Default to first path if none exist (will be created on first add)
|
|
24
|
+
return WHITELIST_PATHS[0];
|
|
28
25
|
}
|
|
29
26
|
|
|
30
27
|
/**
|