GDC Storage Check
Check Google Drive storage usage, free space, and plan tier status across all your Google accounts in parallel — right from your terminal, signing in once per account.
Open source under the MIT License · Node.js ≥ 20 · Zero-Config Shared OAuth Broker.
Official Google Drive API v3 · Non-sensitive drive.file scope · Local-only tokens (0600)
~ % gdc Alias Email Purpose Plan / Status Used Free Total Usage ──────── ────────────────────── ──────── ───────────────────────────── ─────── ──────── ───────── ──────────────────────── personal [email protected] Personal Google One / AI Pro (2 TB) 1.42 TB 594.8 GB 2.00 TB [███████░░░] 71.0% work [email protected] Work Google AI Plus (200 GB) 168.6 GB 31.4 GB 200 GB [████████░░] 84.3% ⚠ archive [email protected] Backup Free (15 GB) ⬇ was AI Pro 14.6 GB 410 MB 15 GB [██████████] 97.3% ❗ studio [email protected] Studio Unlimited / Workspace 4.81 TB - Unlimited Unlimited Totals: 4/4 accounts | Used: 6.41 TB | Free: 626.6 GB+ | Capacity: 2.21 TB+Unlimited
Promise.allSettled with automatic tier inference & downgrade alerts.
Command named gdc to avoid zsh gds alias conflict.
See every command in action
Explore terminal snapshots from daily workflows: inspecting per-service breakdown, sorting by free capacity, exporting JSON/CSV for scripts, and managing account tokens.
~ % gdc check --details Alias Email Plan / Status Used Free Total Usage Drive Gmail+Photos Trash ──────── ──────────────── ─────────────────────────── ──────── ─────── ────── ──────────────────── ──────── ──────────── ─────── personal [email protected] Google One / AI Pro (2 TB) 1.42 TB 594.8 GB 2.00 TB [███████░░░] 71.0% 1.18 TB 229.4 GB 16.2 GB work [email protected] Google AI Plus (200 GB) 168.6 GB 31.4 GB 200 GB [████████░░] 84.3% ⚠ 94.2 GB 68.9 GB 5.5 GB archive [email protected] Free (15 GB) ⬇ was AI Pro 14.6 GB 410 MB 15 GB [██████████] 97.3% ❗11.9 GB 2.4 GB 310 MB Totals: 3/3 accounts | Used: 1.60 TB | Free: 626.6 GB | Capacity: 2.21 TB
--details (-d) splits total usage into Drive, Gmail+Photos, and recoverable Trash space.
~ % gdc check --sort free --si Alias Email Purpose Plan / Status Used Free Total Usage ──────── ────────────────────── ──────── ──────────────────────────── ──────── ──────── ─────── ────────────────────── personal [email protected] Personal Google One / AI Pro (2 TB) 1.56 TB 638.7 GB 2.20 TB [███████░░░] 71.0% work [email protected] Work Google AI Plus (200 GB) 181.0 GB 33.7 GB 215 GB [████████░░] 84.3% ⚠ archive [email protected] Backup Free (15 GB) ⬇ was AI Pro 15.7 GB 430 MB 16 GB [██████████] 97.3% ❗ ~ % gdc check --account work -d Alias Email Purpose Plan / Status Used Free Total Usage Drive Gmail+Photos Trash ───── ────────────────── ─────── ─────────────────────── ──────── ─────── ────── ──────────────────── ─────── ──────────── ────── work [email protected] Work Google AI Plus (200 GB) 168.6 GB 31.4 GB 200 GB [████████░░] 84.3% ⚠ 94.2 GB 68.9 GB 5.5 GB
Sort by free, used, percent, or alias. Filter one account with -a/--account or switch to decimal SI units (1000) via --si.
~ % gdc check --account personal --json { "checkedAt": "2026-12-05T13:45:00.000Z", "accounts": [ { "ok": true, "alias": "personal", "email": "[email protected]", "purpose": "Personal", "quota": { "limitBytes": 2199023255552, "usageBytes": 1561306713292, "freeBytes": 637716542260, "usagePercent": 71.0, "status": "ok" }, "plan": { "inferredPlan": "Google One / AI Pro (2 TB)", "change": "unchanged" } } ] } ~ % gdc check --csv alias,email,purpose,plan,status,used_bytes,free_bytes,limit_bytes,usage_percent,used_human,free_human,limit_human,drive_bytes,other_bytes,trash_bytes,error personal,[email protected],Personal,Google One / AI Pro (2 TB),ok,1561306713292,637716542260,2199023255552,71.00,1.42 TB,594.8 GB,2.00 TB,1297416683520,246316187648,17573842124,
Pipe --json into jq or cron alerts, or export --csv directly into spreadsheets and monitoring dashboards.
~ % gdc add personal --purpose "Personal" --plan "AI Pro" --expires 2027-01-15 Đang mở trình duyệt để xác thực Google (scope: drive.file)... Đã thêm tài khoản [personal] ([email protected]) — AI Pro (2.00 TB), đã dùng 1.42 TB / 2.00 TB. ~ % gdc tag work --plan "AI Pro" --purpose "Team Assets" --expires 2027-03-01 Đã cập nhật thông tin cho [work] ([email protected]). ~ % gdc list Alias Email Purpose Plan Tag Expires ──────── ────────────────────── ─────────── ──────── ────────── personal [email protected] Personal AI Pro 2027-01-15 work [email protected] Team Assets AI Pro 2027-03-01 archive [email protected] Backup (auto) - ~ % gdc remove archive Đã xóa tài khoản [archive] ([email protected]).
Authenticate once per account with gdc add, manage metadata offline via gdc tag & gdc list, and revoke tokens cleanly with gdc remove.
| Command | Key Flags | What It Does |
|---|---|---|
gdc / gdc check | -a -d --sort --si --json --csv | Checks all saved accounts in parallel, renders colored usage bars, warnings, and totals. |
gdc add [alias] | --purpose --plan --expires | Runs 1-time browser OAuth (127.0.0.1 + PKCE) and saves the refresh token locally. |
gdc tag <alias> | --plan --purpose --expires --clear-plan | Updates plan label, purpose note, or renewal date, or restores automatic tier inference. |
gdc list | — | Lists saved aliases, emails, purposes, plan tags, and expiration dates completely offline. |
gdc remove <alias> | --no-revoke | Deletes an account from local storage and revokes its refresh token at Google by default. |
gdc init | -b/--broker -f/--file --client-id --client-secret | Optional: point to a self-hosted Cloudflare Worker broker or load BYO Google Cloud credentials. |
Environment variables: GDC_CONFIG_DIR (default ~/.config/gdc), GDC_BROKER_URL (default https://gdc.3tsmart.com), and NO_COLOR.
Built for people managing multiple Google accounts
Every capability is focused on speed, clear quota visibility, and strict adherence to Google OAuth policies.
Parallel Multi-Account Checks
Queries every configured Google account concurrently with Promise.allSettled. One revoked or offline account never blocks the rest of your report.
Zero-Config OAuth (Sign In Once)
Connects out of the box to the shared stateless broker at gdc.3tsmart.com using OAuth 2.0 Loopback (127.0.0.1) + PKCE (S256). No Google Cloud Project needed.
Plan Inference & Downgrade Alerts
Automatically recognizes tiers from 15 GB to 30 TB and Unlimited, pairs with custom --plan tags, and flags ⬇ was ... or ⬆ was ... if live capacity changes.
Per-Service Breakdown & Thresholds
Color-coded progress bars alert you at 80% (warning) and 95% (critical). Pass --details to inspect Drive, Gmail+Photos, and Trash usage separately.
Sorting, Filtering & SI Units
Sort accounts by free, used, percent, or alias, target one account via -a/--account, toggle decimal 1000 units with --si, or disable ANSI colors with NO_COLOR.
Script-Ready JSON & CSV Export
Emit structured --json payloads (with raw bytes, percentages, and plan change flags) or RFC-compliant --csv rows for cron jobs, shell scripts, and spreadsheets.
Account Tagging & Offline List
Annotate each account with --purpose, --plan, and renewal date --expires. Review saved metadata offline with gdc list, or unlink cleanly via gdc remove.
Portable Config, Self-Host & BYO
Copy a single ~/.config/gdc/store.json file when moving machines without re-authenticating, or switch to a self-hosted Worker (gdc init --broker) or BYO OAuth client (--file).
Minimal Permission & Zero-Storage Architecture
Designed to be verifiable and compliant with the Google API Services User Data Policy. No web scraping, no browser cookie extraction, and no server-side token storage.
Loopback + PKCE
gdc add starts a temporary 127.0.0.1 listener and generates an S256 code verifier.
Official Consent
You sign in on Google and approve only the non-sensitive drive.file scope.
Stateless Relay
gdc.3tsmart.com exchanges or refreshes tokens in memory with zero database or token logs.
Quota Read-Only
Tokens stay in ~/.config/gdc/store.json (0600) to call drive.about.get directly.
Least-privilege scope
Requests only https://www.googleapis.com/auth/drive.file solely to call GET /drive/v3/about?fields=user,storageQuota. Cannot list, read, download, or alter existing personal Drive files.
Zero-retention broker
Hosted on Cloudflare Workers at gdc.3tsmart.com. Relays PKCE (S256) exchanges to oauth2.googleapis.com/token without storing codes, tokens, or emails.
Owner-only local file
Credentials live strictly on your machine with 0700 directory and 0600 file permissions. Run gdc remove <alias> anytime to revoke access at Google.
Read the Privacy Policy, inspect the bilingual Security FAQ (EN / VI), or check Broker Health.
Get started in 30 seconds
Requires Node.js ≥ 20. Clone the repository, link the gdc binary, and connect your first Google account.
git clone https://github.com/thanhdotien278/Google-Drive-Storage-checking.git
cd Google-Drive-Storage-checking
npm install && npm run build && npm link gdc add personal --purpose "Personal" --plan "AI Pro"
gdc check --details Audit the source code
100% TypeScript CLI and Cloudflare Worker broker, MIT-licensed with Vitest coverage.
Report a bug or idea
Open a GitHub issue for new plan tiers, table options, or OAuth edge cases.
Self-host the OAuth broker
Deploy your own Cloudflare Worker in minutes and point CLI via gdc init --broker.
Hướng dẫn & FAQ Tiếng Việt
Xem giải đáp bảo mật song ngữ và tài liệu đầy đủ tại README.vi.md.