cd /news/developer-tools/show-hn-gml-a-gmail-cli-designed-for… · home topics developer-tools article
[ARTICLE · art-68304] src=github.com ↗ pub= topic=developer-tools verified=true sentiment=· neutral

Show HN: Gml – A Gmail CLI designed for agents

A new open-source command-line tool called Gml gives coding agents and shell workflows direct access to Gmail without a daemon, browser automation, or an SDK integration. Created by developer LongyiJdos, Gml returns compact text by default and structured JSON when needed, supporting search, read, send, reply, forward, draft, label, archive, star, spam, and trash operations with safe automation features like dry-run and explicit limits.

read2 min views1 publishedJul 22, 2026
Show HN: Gml – A Gmail CLI designed for agents
Image: source

Gmail, shaped for agents.

gml

gives coding agents and shell workflows direct access to Gmail without a daemon, browser automation, or an SDK integration. It returns compact, command-specific text by default and structured JSON when exact fields matter.

Agent-first output. Stable table headers, bounded message bodies, useful summaries, and machine-readable errors.One CLI for the full workflow. Search, read, download, send, reply, forward, draft, label, archive, star, spam, and trash.Safe automation. Query-based writes require an explicit limit or--all

and support--dry-run

before anything changes.Local OAuth. Credentials stay on the machine, refresh automatically, and are never sent through an intermediary service.Gmail-native. Queries use Gmail search syntax, andrequest

exposes the underlying Gmail API when a dedicated command is not enough.

gml

requires Node.js 22.12 or later.

npm install --global @longyijdos/gmail
gml --version

Create a Google OAuth Desktop app client, download its JSON file, then log in with read-only access:

gml auth login \
  --client-secret-file ~/Downloads/client_secret_....json \
  --scope readonly

Find the messages that matter and read only the one you select:

gml messages list \
  --q 'is:unread newer_than:7d' \
  --max-results 20 \
  --summary

gml read MESSAGE_ID

Use JSON when another tool needs stable field access:

gml messages list --q 'from:alerts@example.com' --max-results 10 --json

Need to organize or send mail? Reauthorize with --scope modify

, then preview query-based changes before applying them:

gml archive \
  --query 'older_than:30d label:newsletters' \
  --max-results 100 \
  --dry-run

Successful results go to stdout. Errors go to stderr with a nonzero exit code. Gmail commands support --json

; help and authentication stay readable text. Large message bodies are truncated by default, list enrichment uses bounded concurrency, and retryable API failures are identified explicitly.

gml help send
gml auth status
gml profile
gml threads 'is:inbox newer_than:7d' --max-results 10 --summary
gml send --to user@example.com --subject 'Status' --body-file report.txt
Guide Use it for

gml

and creating Google OAuth client credentialsAgent skillgml

safely from an agent

── more in #developer-tools 4 stories · sorted by recency
── more on @gml 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/show-hn-gml-a-gmail-…] indexed:0 read:2min 2026-07-22 ·