tanaike - Google Apps Script, Gemini API, and Developer Tips

The Thinker

Streamlining Google Apps Script Development with Gemini CLI Extensions and VSCode

Gists

Abstract

This guide explores a powerful, next-level workflow for Google Apps Script (GAS) development by integrating Gemini CLI Extensions with Visual Studio Code (VSCode). This combination streamlines the entire development process, from script creation and local testing in a secure sandbox to deploying and managing projects, all within a unified and efficient environment.

Introduction

Visual Studio Code (VSCode) is widely recognized as a premier source code editor. The release of the Gemini CLI has dramatically transformed script development by bringing advanced AI capabilities directly into the terminal. In particular, combining Gemini CLI with VSCode creates a powerful development ecosystem, highly effective for languages typically executed locally, such as Python, Node.js, Go and so on. Beyond coding, this setup streamlines content creation, including articles and papers, by leveraging AI for drafting and editing. Ref For cloud-based Google Apps Script (GAS) development, the standard approach involves using VSCode alongside Clasp to manage projects locally. Ref Integrating Gemini CLI into this established workflow promises significant synergistic effects. A recent update has further expanded these possibilities by enabling Clasp to function experimentally as a Model Context Protocol (MCP) server, allowing LLMs to directly interact with GAS project structures. Ref Furthermore, to address security concerns when executing AI-generated GAS code, I have introduced a “fake sandbox” environment for safer testing. Ref and Ref With the recent release of Gemini CLI Extensions, which allow for custom AI tools and specialized workflows, combining these assets creates a vastly superior developer environment. In this article, I will introduce next-level Google Apps Script development by leveraging the combined power of Gemini CLI Extensions and VSCode.

A Developer's Guide to Building Gemini CLI Extensions

Gists

Abstract

This guide offers a comprehensive walkthrough of the essential steps and key considerations for developing Gemini CLI extensions. It covers setting up a sample project, configuring the gemini-extension.json file, local testing, and automating dependency management with GitHub Actions, providing developers with the foundational knowledge to create their own custom tools.

Introduction

After the release of Gemini CLI Extensions, a growing community of users is developing a wide range of extensions to enhance their command-line workflows. Ref and Ref This trend is expected to continue and strengthen. As the ecosystem expands, knowing how to develop these extensions becomes increasingly valuable for users who want to create their own custom tools. Many useful articles for understanding Gemini CLI Extensions have already been published. In particular, the articles by Romin Irani are very helpful. Ref In this article, I would like to introduce the core parts I paid attention to when I developed my own extensions (Ref). I hope this article proves useful. As a sample tool in this article, the current time is returned using Node.js.

Gemini CLI Extension: ToolsForMCPServer-extension

ToolsForMCPServer-extension

This Gemini CLI Extension simplifies Google Workspace automation. It installs a local Model Context Protocol (MCP) server that communicates with a powerful, securely authorized backend built on Google Apps Script Web Apps, overcoming previous complex setup and performance bottlenecks.

You can see the details at my repository.

https://github.com/tanaikech/ToolsForMCPServer-extension

Simplified Google Workspace Automation with Gemini CLI Extensions

Gists

Abstract

This project simplifies Google Workspace automation by using a Gemini CLI Extension. It installs a local Model Context Protocol (MCP) server that communicates with a powerful, securely authorized backend built on Google Apps Script Web Apps, overcoming previous complex setup and performance bottlenecks.

Introduction

In order to achieve Google Workspace Automation with seamless authorization and safety, I have published a Model Context Protocol (MCP) server built by Google Apps Script Web Apps. Ref This is very useful because Google Apps Script provides native, secure authorization for Google Workspace APIs like Gmail, Drive, and Calendar. However, there was a bottleneck in the complex installation and a long loading time of the MCP server. Recently, Gemini Extensions have been released. Ref By this, tools and MCP servers can be directly and easily installed from sources like GitHub repositories using a simple command. From this situation, I attempted to implement this simplified installation method on the MCP server built by Google Apps Script Web Apps.

Recipient of the Outstanding Google Developer Expert Award

I am thrilled and deeply honored to be recognized with the “First place in the Outstanding GDE award”. This incredible honor inspires me to redouble my efforts in advancing new projects and further energizing our amazing community.

Dynamic Tool Creation for Google Workspace Automation with Gemini CLI

Gists

Abstract

This article presents a method for optimizing Google Workspace automation by dynamically converting frequently used, AI-generated Google Apps Scripts into permanent, reusable tools. By integrating the Gemini CLI with a gas-fakes sandbox via an MCP server, we demonstrate how to securely add and manage these custom tools, reducing operational costs and improving efficiency.

Introduction

When using generative AI to create scripts, ensuring the secure execution of the generated code is critical. This is especially true for applications that manage cloud resources like Google Workspace, where it is paramount to prevent unintended data access or modification. The standard permission model for Google Apps Script often requires broad access, creating a significant security risk when running code from untrusted sources.

A Collaborative Dialogue Between Gemini CLI and Copilot CLI Through MCP

Gists

Abstract

This article introduces a method for integrating Google’s Gemini CLI and GitHub’s Copilot CLI using the Model Context Protocol (MCP). By configuring one CLI as an MCP server, the other can invoke it from a prompt, enabling a powerful, collaborative interaction between the two AI assistants for enhanced development workflows.

Introduction

Recently, GitHub released the Copilot CLI, a command-line interface that brings the power of GitHub Copilot directly to your terminal. It assists with various tasks, including answering questions, writing code, and interacting with GitHub. Concurrently, Google has already introduced the Gemini CLI, an open-source AI agent that integrates the Gemini models into the command line to help developers with coding, problem-solving, and task management.

Secure and Conversational Google Workspace Automation: Integrating Gemini CLI with a gas-fakes MCP Server

Gists

Abstract

This article introduces a method for securely executing AI-generated Google Apps Script. By implementing a “fake-sandbox” using the gas-fakes library as an MCP server, users can empower the Gemini CLI to safely automate Google Workspace tasks with granular, file-specific permissions, avoiding significant security risks.

Introduction

“Have you ever faced a task that isn’t part of your routine but is tedious to do manually, like, ‘I need to add a “[For Review]” prefix to the titles of all Google Docs in a specific folder this afternoon’? Or perhaps you’ve thought, ‘I want to use AI to work with my spreadsheets, but I’m concerned about the security implications of granting a tool full access to my Google Drive’?

Streamlining Content Creation: A Guide to Using Gemini CLI, MCP Server, and VSCode

Gists

Abstract

This guide explores a powerful workflow for generating articles and other content by integrating Gemini CLI, a Model Context Protocol (MCP) server, and Visual Studio Code (VSCode). Discover how to leverage this combination for efficient, context-aware content creation, modification, and distribution, complete with practical examples and prompts.

Introduction

The integration of Gemini CLI with Visual Studio Code (VSCode) creates a highly efficient and context-aware environment for developers and writers alike. This setup allows the AI-powered Gemini CLI to access the VSCode workspace, making it aware of open files and selected text to provide relevant and targeted suggestions. A key feature is the native in-editor diffing, which enables a side-by-side review and modification of AI-generated changes before acceptance, offering greater control over the final output.

Accelerating Gemini CLI: A Node.js Wrapper for Google Apps Script MCP Servers

Gists

Abstract

This article introduces a Node.js wrapper that dramatically reduces the startup time for the Gemini CLI when used with MCP servers built on Google Apps Script. This optimization enhances user experience by accelerating the initialization process, achieving a speed boost of approximately 15 times.

1. Introduction

The Model Context Protocol (MCP) is a vital open standard enabling AI agents to connect with external tools and data sources for complex, real-world tasks. To integrate the Gemini AI agent with Google Workspace, I developed two open-source tools: MCPApp, for managing the MCP server lifecycle, and ToolsForMCPServer, a suite of tools for interacting with services like Gmail and Drive. These are built with Google Apps Script for use with the Gemini CLI.