Skip to main content Chuyển đến nội dung chính
3tsmart
v1.0.0 MIT License

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
Parallel quota check via 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.

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.

01 · CLI

Loopback + PKCE

gdc add starts a temporary 127.0.0.1 listener and generates an S256 code verifier.

02 · GOOGLE

Official Consent

You sign in on Google and approve only the non-sensitive drive.file scope.

03 · BROKER

Stateless Relay

gdc.3tsmart.com exchanges or refreshes tokens in memory with zero database or token logs.

04 · LOCAL

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.

1 · Build & link from source
git clone https://github.com/thanhdotien278/Google-Drive-Storage-checking.git
cd Google-Drive-Storage-checking
npm install && npm run build && npm link
2 · Add accounts & check storage
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.