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.