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.2.tar.gz (25.5 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.2-py3-none-any.whl (28.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for zog_cli-0.2.2.tar.gz
Algorithm Hash digest
SHA256 266fde3a7701716865a0db7a66d6529f82053ee0604117282039c9de5eba0968
MD5 4c65f0f970737de59d06f494f32b78f7
BLAKE2b-256 4370cf7b4e682c58a4dbaf542cd3376e5419a4c3a420fc2cbbe4bb3ad8dea1b3

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for zog_cli-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 33bb20a57d9a19d444e039f584cf98ec878039e706c2495b1e51b31b7202863a
MD5 15cf5fec1cef25d82d0e8fc076c6027c
BLAKE2b-256 fcd8d5e81e05b5e61acb190635cf69b4ff8d5e17fc94630089037bb19e498a3d

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