Skip to main content

gdrivectl - Project by Kushagra Sharma

2 Minutes305 words25 views
gdrivectl
README.md305 lines

gdrivectl

This one exists because i had a problem – too many Google Docs shared with too many people from college group projects, freelance work, random collaborations. Needed to audit and clean up permissions in bulk without clicking through the Google Drive UI like a caveman.

So i built a CLI for it.

What it does

gdrivectl auth login     # one-time Google OAuth
gdrivectl auth logout    # remove stored credentials
gdrivectl auth status    # check if logged in
gdrivectl list           # show all your docs
gdrivectl inspect        # check permissions on a specific doc
gdrivectl grant          # grant access (dry-run by default)
gdrivectl revoke         # revoke access (dry-run by default)
gdrivectl audit          # export all permissions to CSV

Safety first

The whole thing is designed around the principle of “don’t nuke your Google Drive by accident”:

  • Dry-run by default – grant and revoke show what would happen unless you pass --execute
  • Owner protection – your email is never shown as revocable
  • Confirmation prompts – always asks before executing changes
  • Audit logging – every operation logs results to logs/

Install

# PyPI
pip install gdrivectl

# Arch Linux (AUR)
yay -S gdrivectl

# From source
pipx install git+https://github.com/TheDarkArtist/gdrivectl.git

OAuth credentials are bundled – no GCP project setup needed. Running gdrivectl auth login opens your browser for Google’s consent screen, token stays local at ~/.config/gdrivectl/token.json.

Why Python

Because it’s a CLI tool that talks to a REST API. Python is perfect for this – quick to write, easy to maintain, google-api-python-client exists. No need to over-engineer it.

I use this regularly now. Probably the most “useful in daily life” thing i’ve built.

comments0 comments

Loading comments...

© 2026 Kushagra Sharma (TheDarkArtist)

https://www.thedarkartist.in/projects/gdrivectl