ArbindBuilds LogoArbindBuilds
Blog
CheatsheetsProjectsLinksAbout
Hire Me

ArbindBuilds

Build. Design. Repeat.

© 2026 ArbindBuilds.
All rights reserved.

Site Map

  • Home
  • Blog
  • Projects
  • About
  • Uses

Content

  • Cheatsheets
  • AI Tools
  • AI Prompts
  • Links

Products

  • Speakify
  • Gumroad Store
  • GitHub
  • Twitter / X

Made with care in Assam, India.

  1. Home/
  2. Blog/
  3. I Built an Agent Skill That Lets Any AI Manage Your Google Drive
AI Tools
Arbind Singh·March 28, 2026·5 min read·

I Built an Agent Skill That Lets Any AI Manage Your Google Drive

I'm deep in a Claude Code session. I need to pull a file from Drive, or upload something, or share a folder with a client. And I'm context-switching constantly.

I Built an Agent Skill That Lets Any AI Manage Your Google Drive

I kept running into the same thing over and over.

I'm deep in a Claude Code session. I need to pull a file from Drive, or upload something, or share a folder with a client. And I'm context-switching constantly. Terminal, browser, Drive, back to terminal. It's not a big deal once or twice, but when you're shipping things fast, that friction adds up.

So I built gdrive-manager.

It's an Agent Skill, which means it's a single folder you drop into your AI agent's skills directory, and from that point on your agent knows how to fully manage Google Drive. Create files, upload folders, search by content, share with people, trash things safely. All from inside your coding session.


What Problem This Actually Solves

The pattern I was stuck in looked like this: I'd be building something, need to reference a doc or upload a deliverable, and suddenly I'm not building anymore. I'm managing files manually.

The bigger issue is that "AI can access my Drive" usually means a read-only MCP connector, not actual Drive management. There's a difference between Claude being able to search your Drive and Claude being able to move files around, batch upload a folder tree, or revoke sharing permissions. gdrive-manager is about the second thing.


How It Works

The project follows the Agent Skills open standard, which basically means a SKILL.md file plus some executable Python scripts. When an agent loads the skill, it reads the instructions in SKILL.md and can call scripts/gdrive.py directly via bash tool calls.

The CLI itself covers everything I actually needed:

# List files in root or a specific folder
python scripts/gdrive.py list
python scripts/gdrive.py list --parent FOLDER_ID

# Search by name or full text
python scripts/gdrive.py search --name "budget"
python scripts/gdrive.py search --text "invoice"

# Upload a file or an entire folder tree
python scripts/gdrive.py upload --src ./project-folder --to FOLDER_ID

# Download a file or folder (with auto-export from Google Workspace formats)
python scripts/gdrive.py download --id FOLDER_ID --dest ./backups

# Share with someone
python scripts/gdrive.py share --id FILE_ID --email [email protected] --role writer

# Trash (recoverable) or permanently delete (with confirmation both times)
python scripts/gdrive.py trash --id FILE_ID
python scripts/gdrive.py delete --id FILE_ID

All commands also support --out json if you need structured output for piping into something else.


The Part I Cared Most About: Safety

The first thing I thought about when building this was: what happens when the agent makes a mistake with delete.

The answer is that it can't, silently. Every destructive operation routes through scripts/safety.py, and the guardrails are enforced in code, not just instructions. There's no prompt or flag that bypasses them.

The rules are simple:

  1. No file gets trashed without explicit typed confirmation from a human.
  2. Trash is always preferred over permanent delete. Things in trash are recoverable for 30 days.
  3. Permanent delete requires you to type the exact file name.
  4. Bulk delete requires you to type "delete N files".
  5. Every destructive attempt gets logged to gdrive_audit.log with a timestamp, file name, and outcome.

Even with the agent warning you first in chat, the Python script asks you again in the terminal. Both steps are required. Neither step can be skipped.

This is the kind of thing that matters when you're building automation and you don't want to find out it deleted a client folder at 2am.


It Works Across All the Major AI Agents

This is the part I'm actually proud of. Because it follows the Agent Skills open standard, the same folder works with no reformatting across:

  • Claude Code
  • Gemini CLI
  • Kilo Code
  • Codex CLI
  • Kiro
  • OpenCode
  • GitHub Copilot in VS Code
  • Claude.ai browser (via skill upload or custom instructions)

The fastest way to install it anywhere is with npx:

# Installs to every supported agent you have installed
npx skills add habitual69/gdrive-manager

# Or just one
npx skills add habitual69/gdrive-manager --agent claude-code

If you want to do it manually, it's just a git clone into the agent's skills directory:

# Claude Code (global, all projects)
git clone https://github.com/habitual69/gdrive-manager.git ~/.claude/skills/gdrive-manager

# Gemini CLI
git clone https://github.com/habitual69/gdrive-manager.git ~/.gemini/skills/gdrive-manager

The skill auto-discovers at startup. No config edits, no restarts needed for most agents.


Auth Setup

The setup script handles OAuth and is OS-aware. Run it once, and it prints the exact environment variable commands for your shell (bash, zsh, fish, PowerShell, CMD):

python scripts/auth_setup.py

You'll need a credentials.json from Google Cloud Console. The project README walks through exactly which APIs to enable (Drive, Docs, Sheets, Slides) and how to download the OAuth credentials.

One thing worth noting: never commit credentials.json or token.json to version control. The README covers the .gitignore entries you need.


What I'd Add Next

A few things are on my list:

  • Shared Drive support (right now it's personal Drive only)
  • Batch operations with progress output
  • A --dry-run flag for destructive commands that shows what would happen without executing
  • Native MCP support so this can also work as a proper MCP server

If you want to contribute, the setup is simple. Fork, branch, make sure all destructive ops route through safety.py, and open a PR. The CONTRIBUTING section in the README has the full checklist.


Try It

The repo is at github.com/habitual69/gdrive-manager.

If you're already using Claude Code or any of the other agents listed above, the install takes two minutes. If you find a bug or want something added, open an issue.

And if it saved you from a bad delete, a star on the repo would mean a lot.

Build. Ship. Repeat.

Arbind Singh

Arbind Singh

ArbindBuilds is my digital space where I showcase my projects, share insightful blogs, and document my work and ideas.

Comments

Leave a comment

0/500 characters

READ NEXT

Lovable Leaks Source Code: The $6.6B BOLA Vulnerability

An 8 million user platform ignored a critical BOLA vulnerability for 48 days. How a $6.6B AI app builder leaked source code, credentials, and user data.

Read →

How 84 Malicious TanStack Packages Hit npm in 6 Minutes

On May 11, 2026, an attacker published 84 malicious versions across 42 @tanstack/* packages in under 6 minutes. Not a typo. Here is the exact chain that made it possible. 42 @tanstack packages compromised via GitHub Actions cache poisoning and OIDC token extraction

Read →

Google Released Gemma 4 for Free. Here Is Why That Makes Sense.

Gemma 4 dropped April 2, 2026 under Apache 2.0 with full commercial rights. This is what the architecture actually does and what Google is really after.

Read →

Tagged

saasnextjsaibuildinpublicskillsclaudeskillsagentskillaiagent
← Back to Blog