
Abstract
This article guides you through establishing a modern, cloud-based development workflow for Google Apps Script. Learn to leverage Google Cloud and Firebase Studio with powerful tools like the Gemini CLI and gas-fakes to build, test, and deploy your automations with enhanced efficiency and security.
Introduction
Google Apps Script is primarily designed to be created in a cloud-based script editor and run on the cloud. However, using Google Apps Script on various cloud platforms opens up the possibility of wider application development due to its high compatibility with each platform’s features.
In previous articles, I have highlighted the importance of safely executing Google Apps Script code generated by AI and establishing a secure, streamlined development process using tools like the Gemini CLI, clasp, and gas-fakes. Ref, Ref While these methods traditionally focus on a local terminal environment, the same principles can be extended to cloud-based platforms for a more integrated and powerful workflow.
By leveraging environments like Google Cloud Shell and the advanced Firebase Studio, developers can achieve greater compatibility and efficiency when building solutions for Google Workspace. Firebase Studio, in particular, represents a significant leap forward as an agentic, cloud-based development environment designed for building and shipping production-quality, full-stack AI applications.
This article will explore how to adapt this streamlined and secure development approach for Google Apps Script to both Google Cloud and the AI-powered environment of Firebase Studio.
Core Tools for Modern GAS Development
Before diving into the setup, it’s essential to understand the roles of the key command-line interface (CLI) tools that make this modern workflow possible:
- Gemini CLI: An AI-powered assistant that can accelerate development by generating code snippets or entire functions based on natural language prompts. When integrated with
gas-fakesthrough an extension, it can create and immediately test GAS code, drastically reducing development time. gas-fakes: This tool creates a “fake” sandbox environment that mimics Google Apps Script services. It enables you to test your scripts’ logic and interactions with services likeDriveApporSpreadsheetAppdirectly from the terminal without executing them in a live Google Workspace environment. This is crucial for rapid testing and ensuring code safety.
Setting Up Your Cloud Development Environment
The following setup steps are identical whether you are using Google Cloud Shell or a terminal within a Firebase Studio workspace.
1. Prepare Your Google Cloud Project
First, ensure you have a Google Cloud Project. You can create a new one or use an existing project.
- Open the Google Cloud Console.
- Select or create a project.
- Copy the Project ID, as you will need it for configuration.
- Launch the Cloud Shell Editor by clicking the terminal icon in the top-right corner.
2. Install and Configure gas-fakes
Next, install the gas-fakes CLI using npm.
npm -g install @mcpher/gas-fakes
3. Authorize Access to Your Google Services
To allow gas-fakes to interact with your Google services for testing, you need to authorize it. The CLI simplifies this process.
First, create a .env file to store your project configuration. The tool will prompt you for the Project ID you copied earlier.
gas-fakes init
Next, run the authorization command. This will guide you through logging into your Google account and granting the necessary permissions.
gas-fakes auth
Finally, enable the required Google APIs for your project to ensure all necessary services are accessible.
gas-fakes enableAPIs
4. Test Your Configuration
Once the setup is complete, run a simple test command to verify that gas-fakes is correctly configured. This command uses the tool’s sandbox to execute a script that retrieves the name of the root folder in your Google Drive.
gas-fakes -s "const rootFolder = DriveApp.getRootFolder(); const rootFolderName = rootFolder.getName(); console.log(rootFolderName);"
If the command executes without errors and prints your root folder’s name, your environment is ready for development.
Development on Google Cloud Shell
With your environment configured, you can now integrate the Gemini CLI to accelerate your coding process.
Collaboration with Gemini CLI
Install the gas-fakes extension for the Gemini CLI. This allows Gemini to generate and test Google Apps Script code within the secure sandbox.
gemini extensions install https://github.com/tanaikech/gas-development-kit-extension
Sample Workflow
The following demonstrates a sample workflow using gas-fakes with the Gemini CLI on Cloud Shell. You can prompt Gemini to write a script, and the extension will use gas-fakes to validate its functionality instantly.

Advanced Development on Firebase Studio
Firebase Studio offers a more advanced, AI-centric environment for building applications. The setup process for developing Google Apps Script is identical to the one for Google Cloud Shell.
1. Open Firebase Studio and Your Project
- Navigate to Firebase Studio.
- Create a new workspace or open an existing one linked to your Google Cloud Project.
- Open a terminal within the workspace.
2. Install and Authorize Tools
Follow the exact same steps outlined in the Setting Up Your Cloud Development Environment section to install and configure gas-fakes and the Gemini CLI extension.
3. Sample Workflow in Firebase Studio
The development experience in Firebase Studio is similar but benefits from a more integrated, full-stack environment. The animation below shows the script generated in the previous section being used within Firebase Studio.

Summary
This article demonstrated how to create a modern, cloud-based development workflow for Google Apps Script using gas-fakes and the Gemini CLI. By shifting development from a local machine to Google Cloud Shell or Firebase Studio, you can create a more consistent, secure, and AI-accelerated process.
- Cloud-Based Environment: Set up a complete development and testing environment for Google Apps Script within Google Cloud Shell or Firebase Studio, eliminating the need for a local setup.
- AI-Powered Development: Leverage the Gemini CLI with the
gas-fakesextension to generate and instantly test Google Apps Script code, significantly speeding up development cycles. - Secure and Rapid Testing: Utilize
gas-fakesto run scripts in a sandboxed environment, allowing for safe and immediate validation of code logic without impacting live Google Workspace data.