Friday, July 10, 2026

Developing Google Apps Script with serverless Antigravity harness engine in Managed Agents API

Do you also hate doing the same manual tasks in Google Workspace over and over again? Imagine just describing what you need in plain English, and boom - your spreadsheet automates itself like magic. With Antigravity, you can orchestrate automations directly, or let the agent write Google Apps Script for you. The real beauty of Apps Script is that it has built-in OAuth for Google services and runs serverless in the cloud. Your automations keep running serverless and in da cloud without your laptop even being turned on! :-)



You can define what you want directly in plain English and Antigravity writes the code. Even better, it can automatically deploy it using the clasp CLI (the command-line interface for Apps Script) so you don't have to copy-paste anything. The catch? To run this locally, you must keep your computer powered on. But who wants that? That's why we migrate the entire development flow into a serverless environment using the Managed Agents API!

BTW And have you heard the news? Google Apps Script was recently officially elevated to a Google Workspace core service! 🆕 This is huge! It means enterprise-grade data protection, administrative control, and standard technical support. 

Let's look at how this magic works under the hood! 😉

Here is how we move away from traditional line-by-line syntax to Vibe-Coding, where we set the high-level intent and the agent handles the heavy lifting

Step 1) Get ready with Antigravity

Instead of writing code, you just tell the agent in plain language: "Create a script that checks column B, and if it contains 'Cancelled', send an email to [email protected]." The agent acts as your

workspace developer, structuring the code, manifest, and configs automatically.

To get started, you need to download and install Antigravity. Personally, I run two setups: Antigravity IDE for my personal stuff (hooked up to my private Gmail account with a Google AI Pro license), and Antigravity 2.0 connected to a corporate Google Cloud Project. For this demo, we'll be using Antigravity IDE! 😉

Tip!

The black background icon is for Antigravity IDE, which was released in 11/2025
The white background icon is for Antigravity 2.0, which was introduced during in 5/2026.



Step 2) Prepare you environment

When you open Antigravity IDE for the first time, select your project folder. On the right-hand side, you'll see a panel where you can write instructions. And yes, you can execute commands directly from this chat input


Run clasp login on your computer to authorize the CLI.

Just type:

Use clasp CLI to login



To avoid starting from scratch, I prepared several Skills,  structured markdown files (SKILL.md) that describe how the agent should run and invoke tools. I have prepared three custom skills for this project:

- apps-script-developer: acts as your Google Apps Script developer, handling OAuth credentials and deploying code via clasp cli
https://github.com/codeas/managed-antigravity-gas/tree/main/skills/apps-script-developer

- cloud-migrator: takes care of packaging the local workspace and migrating dev tasks to the cloud sandbox.
https://github.com/codeas/managed-antigravity-gas/blob/main/skills/cloud-migrator/SKILL.md

- system-manager:  Configures Python virtual environments and manages package installations to keep everything isolated and clean.
https://github.com/codeas/managed-antigravity-gas/blob/main/skills/system-manager/SKILL.md


You can install skills with terminal commands (if you feel like a pro)

npx skills add https://github.com/codeas/managed-antigravity-gas

But wait, there is an even easier way! You don't even have to type that terminal command. Since you are talking to an intelligent agent, you can just ask it in plain English: “Install skill into local folder from https://github.com/codeas/managed-antigravity-gas” and watch it configure itself. How neat is that?



Once added, Antigravity automatically recognizes that there is a dedicated environment configuration skill (system-manager) in your workspace and runs it immediately to configure your local setup. In our case, it handles the Python virtual environment (.venv) setup and installs all packages for you. Zero manual terminal commands needed!

Step 3) Configure the Gemini API

We need this key to call the Managed Agents API service. (Another route is using the Gemini Enterprise Agent Platform, formerly known as Vertex AI on Google Cloud, but we'll stick to the simpler Gemini API option today!). 

Just hop over to Google AI Studio to grab your API key (or create a new one), and save it into your  .env
 file under GEMINI_API_KEY.



Tip! 

Always set a hard limit on your monthly spend in your billing settings—whether it's $10, $100, or $1000. It's a lifesaver safety net just in case something goes wrong and your agent goes on an infinite loop! ðŸĪŠ



Step 4) Local development with local Antigravity harness

Describe what you want to automate and watch the magic happen! Now we have everything ready! We can unleash Antigravity and let the agent use the installed skills, running locally on our computer via Gemini (using our API key), to create and deploy a brand new Google Apps Script.

How do we actually do this? Let's start with a quick, simple experiment. Just describe what you want in plain language. To keep things sweet and simple, let's start with:
create a new folder and write a google apps script in this folder. Script retrieves all labels from my Gmail”.

Here is a simple snippet the agent can generate and push for you:



You can visithttps://script.google.com/, where you will find the same Google Apps Script as well



Step 5) Cloud development with local Antigravity harness with Managed Agents API

Everything we've shown so far is the "classic" local developer loop, similar to what other tools like Claude Code do. But now, let's look at the real superpower of Antigravity and Google—it's like turning on the warp drive! What if you want to execute tasks completely off your local machine?

For this, we'll harness the Managed Agents API. It runs the exact same Antigravity environment in the cloud. You can use the standard remote agent, or customize it to your needs.

To keep it super simple, we'll use our pre-configured 

cloud-migrator skill. It reads your local workspace context and configuration, sends it to the cloud sandbox along with your prompt, executes the agent reasoning loop remotely, and performs the Apps Script deployment directly from there! All serverless.

Just run (instead of xxxxxxxxxxx, paste your apps script)
Migrate to cloud and execute: Improve google apps script xxxxxxxxxxxx to save all Gmail labels into a spreadsheet named 'labels-demo'.

Under the hood, this command triggers the cloud-migrator skill, which contains the exact blueprint of how to call the Managed Agents API. Once launched, the remote Antigravity agent spins up in a secure container in the cloud and executes your prompt completely on its own!



One super neat detail: when the cloud execution starts, the local agent tells you it's waiting for the remote task to finish and will notify you when it's done


Once the cloud run is complete, the local agent detects the remote changes and automatically merges them back into your local workspace files! 😉


Finally, you can check your Google Apps Script dashboard to verify that your script has updated and deployed correctly!





Summary


With this post, I wanted to inspire you on how to unleash the true power of Skills combined with the Managed Agents API to run tasks entirely in da cloud!

Beyond standard Python development, this setup is incredibly powerful for automating Google Apps Script inside your Google Workspace. You don't necessarily need complex, persistent frameworks like OpenClaw. By extending the concepts we explored, you can easily set up a cloud agent that you talk to directly via Google Chat, letting it build automations or automatically resolve bugs based on GitHub issues!

This is the beauty of serverless Ad-hoc skill execution engines and ephemeral compute patterns: you write reusable, portable Markdown execution protocols for ad-hoc agent tooling, letting the agent temporarily spin up secure environments for specific tasks without any ongoing server runtime or infrastructure headaches.

What do you think about this way of vibe-coding? Are you ready to take your Apps Script development to da cloud? Ping me on X @ivankutil or let me know on #LinkedinIn

#GoogleAppsScript #GeminiAPI #AntigravitySDK #WorkspaceAutomation #AISprint #AgenticArchitect #GoogleAntigravity 






Are you interested in this topic? Follow me on Twitter or subscribe RSS