Skip to main content

Zoho Mail CLI modeled after gog.

Project description

zog

License: MIT Python 3.10+

zog is a Python CLI for Zoho Mail, designed to feel familiar to anyone who already uses gog for Google services. It keeps the dependency set small, uses argparse, stores credentials under ~/.config/zogcli/, and supports both machine-readable and terminal-friendly output.

Install

pipx install zog-cli
uv tool install zog-cli

For local development:

uv venv
source .venv/bin/activate
uv pip install -e .[dev]

Quickstart

Authorize your mailbox:

zog auth add you@yourdomain.com

Search mail:

zog mail search -a you@yourdomain.com "from:cloudflare" --max 3

List folders:

zog mail folders -a you@yourdomain.com

Dry-run a send:

zog mail send \
  -a you@yourdomain.com \
  --to friend@example.com \
  --subject "zog test" \
  --body "hello from zog" \
  --dry-run

Importing existing Zoho credentials

If you already have a JSON file with client_id, client_secret, and refresh_token from a previous Zoho Self Client setup, you can import it directly:

zog auth import-legacy /path/to/credentials.json

Command Reference

zog auth add <email> [--services mail]
zog auth list
zog auth remove <email>
zog auth import-legacy <path>

zog mail search -a <email> "<query>" [--max N] [-j|-p]
zog mail get -a <email> <messageId> [-j|-p]
zog mail thread get -a <email> <threadId> [-j|-p]
zog mail send -a <email> --to ... --subject ... --body ...
zog mail folders -a <email> [-j|-p]

zog --version

Global flags follow gog-style conventions:

  • -a, --account
  • -j, --json
  • -p, --plain
  • -n, --dry-run
  • -v, --verbose
  • -h, --help

Output Modes

  • Default: aligned table output for list-style commands.
  • --json: {"status": "...", "data": ...} envelope.
  • --plain: stable TSV for scripting.

OAuth Setup

zog auth add uses Zoho's Self Client flow. Create or select a Self Client in the Zoho API Console:

https://api-console.zoho.com/

Use these scopes:

ZohoMail.messages.ALL,ZohoMail.accounts.READ,ZohoMail.folders.READ

Contributing

  1. Create a virtual environment with uv venv.
  2. Install the package in editable mode with uv pip install -e .[dev].
  3. Run pytest -q.
  4. Keep changes small, typed, and focused.

See LICENSE for license terms.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zog_cli-0.2.1.tar.gz (24.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zog_cli-0.2.1-py3-none-any.whl (27.0 kB view details)

Uploaded Python 3

File details

Details for the file zog_cli-0.2.1.tar.gz.

File metadata

  • Download URL: zog_cli-0.2.1.tar.gz
  • Upload date:
  • Size: 24.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.16

File hashes

Hashes for zog_cli-0.2.1.tar.gz
Algorithm Hash digest
SHA256 3a32e92b8949645f9451ce3d3097f815b3ca18b8016da2e77f41b6fa26da7f72
MD5 8f2df2bdd2f2e05fa1d24e4dc2e73ab3
BLAKE2b-256 63f3326c7d86e58d4a731c8dcec7f42c4077b2813d0d971e82d414f2dd959fcd

See more details on using hashes here.

File details

Details for the file zog_cli-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: zog_cli-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 27.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.16

File hashes

Hashes for zog_cli-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0032ecfd036ecc67bc663b52bf9639c8f6387059bb32d243f71e442c900a2a97
MD5 1bba93a221e2d69fb7be3500475e1992
BLAKE2b-256 d710fc5cdb99d1a68a57cc206da6b87215c52f30a5e39fcdd36c2c8ee419f241

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page