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.
pipx install zog-cliuv tool install zog-cliFor local development:
uv venv
source .venv/bin/activate
uv pip install -e .[dev]pipx install zog-cli
zog auth add me@example.comThis opens your browser to authorize zog. After you click Allow, the CLI captures the authorization callback automatically and stores your tokens locally.
For headless servers or SSH sessions without port forwarding, use the out-of-band flow:
zog auth add me@example.com --no-browserFor power users who want to use their own Zoho app, use --self-client.
Authorize your mailbox:
zog auth add you@yourdomain.comSearch mail:
zog mail search -a you@yourdomain.com "from:cloudflare" --max 3List folders:
zog mail folders -a you@yourdomain.comDry-run a send:
zog mail send \
-a you@yourdomain.com \
--to friend@example.com \
--subject "zog test" \
--body "hello from zog" \
--dry-runIf 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.jsonzog auth add <email> [--services mail] [--no-browser] [--port N]
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
- Default: aligned table output for list-style commands.
--json:{"status": "...", "data": ...}envelope.--plain: stable TSV for scripting.
By default zog auth add uses Zoho's OAuth 2.0 Authorization Code flow with a local loopback server, so no manual Self Client setup is required. If you prefer to use your own Zoho app, use the --self-client flag:
zog auth add you@yourdomain.com --self-clientThen create or select a Self Client in the Zoho API Console:
Use these scopes:
ZohoMail.messages.ALL,ZohoMail.accounts.READ,ZohoMail.folders.READ
- Create a virtual environment with
uv venv. - Install the package in editable mode with
uv pip install -e .[dev]. - Run
pytest -q. - Keep changes small, typed, and focused.
See LICENSE for license terms.