Google Docs in the Terminal — Editorial TUI, Zero-Login URL Reader & 11-Tool MCP
Read any public Google Doc or Drive .txt/.md link immediately with zero login (gdocs <url>), browse in a Google Docs Native Blue editorial TUI with z pane zoom, which-key, and -p ANSI print mode, or wire 11 UTF-16 safe MCP tools (stdio & HTTP POST /mcp) into AI agents.
$npm i -g @bitefoundry/gdocs
Key Capabilities
Zero-Login Public Google Docs & Drive Link Reader
Pass any public Google Doc (`docs.google.com/document/d/...`) or public Drive `.txt`/`.md` URL directly to `gdocs <url>` for instant TUI reading, `-p` ANSI printing, or `-j` JSON—with automatic macOS Hangul NFD→NFC normalization and named multi-account CLI (`accounts list/use/logout`).
Google Docs Native Blue Editorial TUI & 16 Themes
Borderless editorial reader infused with Google Docs Native Blue DNA (`#1A73E8` Light / `#669DF6` Dark), `z` single-key pane zoom, `which-key` leader popups (`g`/`y`), destructive `Shift+Y` confirmation modal, Korean 2-beolsik IME normalization, and a 16-theme `Ctrl+T` live picker.
Full replace_doc_markdown & 11 UTF-16 Safe MCP Tools
Performs full-document `replace_doc_markdown` (`gdocs edit --replace-all` / HTTP `PUT /api/v1/docs/{id}`), surgical `--section` replacement, and unique `--find`/`--replace` using exact UTF-16 code-unit offsets and native Docs `writeControl.requiredRevisionId` locks across stdio & Streamable HTTP `POST /mcp`.
0% Idle CPU, 5.4 MiB Native Binary & cargo-auditable SBOM
Built with a zero-wakeup `EventReader` and `FramePacer` for 0% idle CPU, bundled SQLite WAL + FTS5 (with 1–2 char Korean/CJK `LIKE` fallback), and embedded `cargo-auditable` dependency SBOM metadata in every release binary.
Quickstart & MCP Agent Setup
gdocs "https://docs.google.com/document/d/<ID>/edit" # Zero-login public Docs/Drive TUI reader
gdocs "https://docs.google.com/document/d/<ID>/edit" -p # Non-interactive ANSI print mode for pipes
gdocs accounts list # Manage named OAuth / ADC profiles (--no-activate)
gdocs serve --port 8794 # Hardened HTTP API + Streamable POST /mcp
gdocs mcp # Start 11-tool stdio MCP server (--read-only supported)
{
"mcpServers": {
"gdocs": {
"command": "gdocs",
"args": [
"mcp"
]
}
}
}
Representative MCP tools (io.github.BiteFoundry/gdocs): get_doc, list_doc_sections, list_docs, search_docs, list_doc_comments, gdocs_status, create_doc, append_doc_markdown, replace_doc_markdown, replace_doc_section, replace_doc_text.
BiteFoundry Google Docs vs. Traditional Desktop / Web Client
| Dimension | BiteFoundry Google Docs (Rust) | Electron / Browser Client |
|---|---|---|
| Public shared docs | Zero-login `gdocs <url>` TUI, `-p` ANSI, or `-j` JSON | Heavy browser tab (~300–800 MB RAM) |
| Runtime & idle footprint | 5.4 MiB native Rust binary, 0% idle CPU, `cargo-auditable` SBOM | Multi-process Chromium tab with continuous JS timers |
| Editing safety for agents | Exact UTF-16 offsets, native `requiredRevisionId` locks, `--dry-run` diffs | Fragile browser automation or unguarded overwrites |
| Interfaces included | Editorial TUI + `-p` ANSI + `--json` CLI + HTTP (`:8794`) + 11 stdio/HTTP MCP tools | Web GUI only |
| Offline search | Local SQLite WAL + FTS5 + Korean/CJK `LIKE` fallback | Cloud-dependent web search |
Frequently Asked Questions
Can I read a shared Google Doc or Drive text file from the terminal without logging in?
Yes. Any public Google Doc (`docs.google.com/document/d/...`) or public Drive `.txt`/`.md` link (`drive.google.com/file/d/...`) opens immediately with `gdocs "<URL>"` in the editorial TUI, prints ANSI-styled output with `-p`, or returns structured JSON with `-j`—zero OAuth setup required.
Where does `@bitefoundry/gdocs` live on GitHub?
The `gdocs` binary is built and released from the `BiteFoundry/google` monorepo (`https://github.com/BiteFoundry/google`), which shares `google-core` across BiteFoundry's Google Workspace terminal tools. Both `bitefoundry.dev/i` and `bitefoundry.dev/w` map `gdocs` cleanly to `BiteFoundry/google` releases.
What MCP tools does `gdocs mcp` provide?
`gdocs mcp` (and `gdocs serve` at `POST /mcp`) exposes 11 typed MCP tools (`get_doc`, `list_doc_sections`, `list_docs`, `search_docs`, `list_doc_comments`, `gdocs_status`, `create_doc`, `append_doc_markdown`, `replace_doc_markdown`, `replace_doc_section`, `replace_doc_text`) and respects both `--read-only` and read-only account profiles.
How does `gdocs` handle Korean, emoji, and safe document edits?
The editing engine calculates exact UTF-16 code-unit offsets (Hangul = 1, emoji surrogate pairs = 2), enforces `match_count == 1` on replacements, verifies `revisionId` optimistic locks, supports `--dry-run` unified diffs, and requires explicit `Shift+Y` confirmation in the TUI before pushing edits.