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

pipx install zog-cli
zog auth add me@example.com

This 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-browser

For power users who want to use their own Zoho app, use --self-client.

Usage

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] [--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

Output Modes

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

OAuth Setup

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-client

Then 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.3.1.tar.gz (30.9 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.3.1-py3-none-any.whl (32.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for zog_cli-0.3.1.tar.gz
Algorithm Hash digest
SHA256 58899bda9d0ccbcdfcf1c798bdd25900b48283dc755137fa006e13dee6cc9cbe
MD5 8cde77a11d249f71ca4c1dfd26cba527
BLAKE2b-256 326593484e68c0832ffc0162c71d537cbc6b0a9a7ec2cff25968531256c39134

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for zog_cli-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c289f51e8fa390e94d8af955f314942534e3eee415e1554afb6b66e00cf97226
MD5 45b00b6b4e7ab0e33e5cf0c7b87783bb
BLAKE2b-256 45d32484b2e33b33ee13f9913a6e23f2159de1367ba22b3f85d329e48907bd4c

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