A powerful CLI for Zoho Mail with full inbox management, folder/label organization, and email operations.
- Package:
@versatly/zoho-mail-cli - Auth: OAuth 2.0 via Pipedream (pdauth)
- Tech Stack: TypeScript, Commander.js, Axios, cli-table3, ESM
- Regions: US (zoho.com), EU (zoho.eu), IN (zoho.in), AU (zoho.com.au), JP (zoho.jp)
| Region | Base URL |
|---|---|
| US | https://mail.zoho.com/api/ |
| EU | https://mail.zoho.eu/api/ |
| IN | https://mail.zoho.in/api/ |
| AU | https://mail.zoho.com.au/api/ |
| JP | https://mail.zoho.jp/api/ |
- User runs
zoho-mail auth login - CLI checks for existing Pipedream connection via
pdauth status - If not connected, generates OAuth link via
pdauth connect zoho_mail - After OAuth, CLI stores accountId and region in
~/.config/zoho-mail-cli/config.json
ZohoMail.accounts- Account accessZohoMail.folders- Folder managementZohoMail.tags- Label managementZohoMail.messages- Email operations
zoho-mail auth login # OAuth flow via Pipedream
zoho-mail auth status # Show current auth status
zoho-mail auth logout # Disconnect (pdauth disconnect)
zoho-mail auth accounts # List all mail accountszoho-mail mail list [folder] # List emails (default: Inbox)
--limit <n> # Max emails to fetch (default: 50)
--unread # Only unread
--flagged # Only flagged
--from <email> # Filter by sender
--subject <text> # Filter by subject
zoho-mail mail read <messageId> # Read email content
--headers # Include headers
--raw # Original message
zoho-mail mail search <query> # Search emails
--limit <n> # Max results
--folder <folderId> # Search in specific folder
zoho-mail mail send # Send email (interactive or flags)
--to <email>
--cc <email>
--bcc <email>
--subject <text>
--body <text>
--html # Body is HTML
--attach <file> # Attachment path
zoho-mail mail reply <messageId> # Reply to email
--body <text>
--all # Reply all
zoho-mail mail forward <messageId> # Forward email
--to <email>
--body <text>
zoho-mail mail move <messageId> <folderId> # Move to folder
zoho-mail mail delete <messageId> # Delete email
zoho-mail mail spam <messageId> # Mark as spam
zoho-mail mail unspam <messageId> # Mark not spam
zoho-mail mail archive <messageId> # Archive
zoho-mail mail flag <messageId> # Flag/star
zoho-mail mail unflag <messageId> # Remove flag
zoho-mail mail read-status <messageId> # Mark as read
zoho-mail mail unread-status <messageId> # Mark as unread
zoho-mail mail label <messageId> <labelId> # Apply label
zoho-mail mail unlabel <messageId> <labelId> # Remove labelzoho-mail folders list # List all folders
zoho-mail folders create <name> # Create folder
--parent <folderId> # Create as subfolder
zoho-mail folders rename <folderId> <name> # Rename folder
zoho-mail folders move <folderId> <parentId> # Move folder
zoho-mail folders delete <folderId> # Delete folder
zoho-mail folders empty <folderId> # Empty folder contents
zoho-mail folders mark-read <folderId> # Mark all as readzoho-mail labels list # List all labels
zoho-mail labels create <name> # Create label
--color <hex> # Label color
zoho-mail labels update <labelId> # Update label
--name <name>
--color <hex>
zoho-mail labels delete <labelId> # Delete labelzoho-mail threads move <threadId> <folderId> # Move thread
zoho-mail threads flag <threadId> # Flag thread
zoho-mail threads unflag <threadId> # Unflag
zoho-mail threads label <threadId> <labelId> # Apply label
zoho-mail threads unlabel <threadId> <labelId> # Remove label
zoho-mail threads read <threadId> # Mark as read
zoho-mail threads unread <threadId> # Mark as unread
zoho-mail threads spam <threadId> # Mark as spam
zoho-mail threads unspam <threadId> # Mark not spamzoho-mail signatures list # List signatures
zoho-mail signatures create <name> # Create signature
--content <html>
zoho-mail signatures update <sigId> # Update
--name <name>
--content <html>
zoho-mail signatures delete <sigId> # DeleteGET /api/accounts- Get all accountsGET /api/accounts/{accountId}- Get specific account
POST /api/accounts/{accountId}/folders- Create folderGET /api/accounts/{accountId}/folders- List foldersGET /api/accounts/{accountId}/folders/{folderId}- Get folderPUT /api/accounts/{accountId}/folders/{folderId}- Update folderDELETE /api/accounts/{accountId}/folders/{folderId}- Delete folder
POST /api/accounts/{accountId}/labels- Create labelGET /api/accounts/{accountId}/labels- List labelsGET /api/accounts/{accountId}/labels/{labelId}- Get labelPUT /api/accounts/{accountId}/labels/{labelId}- Update labelDELETE /api/accounts/{accountId}/labels/{labelId}- Delete label
POST /api/accounts/{accountId}/messages- Send emailGET /api/accounts/{accountId}/messages/view- List emails in folderGET /api/accounts/{accountId}/messages/search- Search emailsGET /api/accounts/{accountId}/folders/{folderId}/messages/{messageId}/content- Get email contentGET /api/accounts/{accountId}/folders/{folderId}/messages/{messageId}/header- Get headersGET /api/accounts/{accountId}/messages/{messageId}/originalmessage- Get originalPUT /api/accounts/{accountId}/updatemessage- Update message (move, flag, label, etc.)DELETE /api/accounts/{accountId}/folders/{folderId}/messages/{messageId}- Delete
PUT /api/accounts/{accountId}/updatethread- Update thread (move, flag, label, etc.)
POST /api/accounts/signature- CreateGET /api/accounts/signature- ListPUT /api/accounts/signature- UpdateDELETE /api/accounts/signature- Delete
~/.config/zoho-mail-cli/config.json:
{
"region": "zoho.com",
"accountId": "2560636000000008002",
"userId": "telegram:5439689035",
"defaultFolder": "Inbox"
}--json- JSON output for scripting--table- Table format (default)--compact- Compact single-line per item
- Retry with exponential backoff on 429 (rate limit)
- Clear error messages with suggested fixes
--debugflag for verbose logging
zoho-mail-cli/
├── src/
│ ├── index.ts # CLI entry point
│ ├── commands/
│ │ ├── auth.ts
│ │ ├── mail.ts
│ │ ├── folders.ts
│ │ ├── labels.ts
│ │ ├── threads.ts
│ │ └── signatures.ts
│ ├── lib/
│ │ ├── client.ts # Zoho API client
│ │ ├── config.ts # Config management
│ │ ├── auth.ts # Pipedream integration
│ │ └── output.ts # Output formatting
│ └── types/
│ └── zoho.ts # TypeScript types
├── package.json
├── tsconfig.json
├── README.md
└── SPEC.md
{
"dependencies": {
"commander": "^12.0.0",
"axios": "^1.6.0",
"cli-table3": "^0.6.3",
"chalk": "^5.3.0",
"conf": "^12.0.0",
"ora": "^8.0.0"
},
"devDependencies": {
"@types/node": "^20.0.0",
"typescript": "^5.3.0"
}
}- Auth commands (login, status, logout, accounts)
- Folders (list, create, delete)
- Labels (list, create, delete)
- Mail list and read
- Mail send (basic)
- Mail search
- Mail move, delete, flag, archive
- Mail labeling
- Folder rename, move, empty
- Threads operations
- Signatures
- Reply/forward
- Attachments
Create workspace/skills/zoho-mail-cli/SKILL.md alongside the CLI.