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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for zog_cli-0.3.0.tar.gz
Algorithm Hash digest
SHA256 91bfed0735e98c55193a27c6f018f27fe7681ec981ee79046765ab0220d2fed5
MD5 db27c1387df60588fb1fd2972e9120ad
BLAKE2b-256 8ca828b2d0362d69ab8ec8c90aa7f88169911977b0fc357b7af5a70f1d6ffddc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zog_cli-0.3.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 898db0817081c8fe450c91e0389c8227bb616301d1ca41ca238863ccc69ea269
MD5 0f207ea92fc74a5c4212353c1cb647c5
BLAKE2b-256 ed64d568bcdec2c91f175e0901edd72474c1886aaba109ad97e830f12656a2fe

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