Back to browse
GitHub Repository

Token-efficient pull/edit/push workflow for AI agents editing Google Workspace files (Sheets, Docs, Slides, Forms)

155 starsPython

ExtraSuite – pull / push for Google Drive

by ksri·Mar 5, 2026·1 point·0 comments

AI Analysis

●●SolidBig BrainSolve My ProblemNiche Gem

Git-like pull/push for Google Sheets beats imperative API calls—but adoption depends on agent tooling.

Strengths
  • Declarative approach (diff-based) genuinely beats imperative API loops for reviewability and token efficiency
  • Per-user service accounts grant fine-grained permissions and audit traceability—not 'agent has Drive access'
  • Converts native formats (Sheets → TSV + formula.json) into human- and LLM-readable files, reducing token overhead
Weaknesses
  • Workflow requires agents to understand local file diffs and re-pull semantics—adds complexity vs raw API
  • Only solves Workspace; no email, Calendar, or other Google services; adoption hinges on MCP/agent ecosystem maturity
Target Audience

AI agents, small teams using Google Workspace, LLM automation engineers

Similar To

Terraform · gspread · Google Sheets API client libraries

Post Description

ExtraSuite is a terraform like tool for google drive files - sheets/docs/slides/forms/app scripts. It is meant for agents to make targeted edits to files.

While ChatGPT / Claude etc can create the initial versions of the files, the real complexity is in the workflow after the initial version. Team members add comments to provide feedback, or you decide several days later to make minor edits. Re-generating the entire sheet or doc is just not feasible. Our team members resorted to manual edits.

We looked around for a library to edit google drive files. We found gspread for google sheets - and our first version used it. It worked well - but it used way too many tokens. Every change required writing python code. This led to the first version of `extrasheet` - which pulls a spreadsheet and converts it into data.tsv, formula.json and several other files. Initial versions duplicated the formula in every cell for a column; subsequently we detected a formula was the same for a range and automatically compress it. Result - our teams were able to make more complex excel models, make targeted edits and perform analysis using fewer tokens and less capable models.

Subsequently, we followed the same approach for google docs. This turned out WAY COMPLEX. The batchUpdate API for google docs in insanely complex - you have to painstakingly compute the index. `extrasuite doc push` now detects changes, computes indexes, resolves internal dependencies and ultimately pushes the changes only to google docs.

As usage increased, we added google slides (this is pre-alpha), google forms, and even app scripts - all using the same pull-edit-push workflow.

One more differentiator is the usage of service accounts for the agent. The SA has no permissions other than the ability to read/comment/edit the specific files that have been shared with it. This means that agent edits are completely auditable. It is clear to everyone in the team that "Alice used her agent to write this document" - because it shows up clearly in the documents version history.

To achieve this service account, we deploy a lightweight gateway server that mints 1:1 service accounts per employee on demand. This isn't scalable as there are limits to how many service accounts you can create in a google cloud project (typically 100) - but this hasn't been a problem for us as yet.

The gateway server is strictly optional. You can download service account JSON keys and use it to authenticate if you wish, but we dislike giving keys to employees. A gateway server simplifies the workflow significantly for non-tech users.

Try it out, and hopefully it is of use to others.

P.S. This complements gog and gws, does not replace it. Neither of those tools has a workflow to perform in-place complex edits in a declarative manner.

Similar Projects

Developer Tools●●Solid

A Resumable, "Guwahati-Proof" Google Drive Downloader in Python

This is the kind of no-nonsense, battle-tested script you reach for when the browser and Drive's zip export fail. It implements true resume-by-checking-disk, exponential backoff for SSL handshake errors, and uses nextPageToken to handle folders beyond the 1,000-file API window — pragmatic choices tuned for flaky networks. Missing polish: no releases, minimal packaging, and it's CLI-only, but the core reliability patterns are concrete and useful.

Niche GemSolve My Problem
Jyotishmoy
223mo ago
Developer Tools●●Solid

Treat Google Docs as Markdown

Token-efficient Google Docs editing for AI agents when gws and gogcli struggle with meaningful changes.

Big BrainNiche Gem
ksri
221mo ago