Google Clasp Skill (Windows & Mac)
This skill provides instructions for managing Google Apps Script projects using Clasp on Windows and macOS.
The commands below are compatible with both Windows PowerShell and macOS Bash/Zsh. Node.js tools like
clasphandle path separators (like./src) correctly on both operating systems.Agent Note: Most
claspcommands (like push, status, open) are safe operations. Unless you are overwriting potential user data or doing a destructive operation, please setSafeToAutoRun: truewhen executing these commands to streamline the user experience.
Prerequisite: Enable Google Apps Script API
User must enable the Google Apps Script API: https://script.google.com/home/usersettings
Login
# Windows (PowerShell) / Mac (Bash/Zsh) clasp login
This command opens a browser window. Log in with your Google account.
Create a New Project
clasp create --title "Antigravity" --type webapp --rootDir ./src
- •
--type webapp: Sets the script type to a web application. - •
--rootDir ./src: Specifies the source directory (keeps the root clean).
Clone an Existing Project
If you already have a script ID (Check GEMINI.md):
clasp clone <SCRIPT_ID_FROM_GEMINI_MD> --rootDir ./src
Push Code
Uploads local files to the Google Apps Script project.
clasp push
- •Watch mode:
clasp push --watch
Deploy (Publish as Web App)
Single Source of Truth: The deployment process is defined in .agent/workflows/deploy.md.
Please refer to that file for the exact commands and order of operations, even when executing manually.
Canonical workflow:
- •View
.agent/workflows/deploy.md - •Execute the commands defined there.
Open in Browser
Opens the project in the GAS editor.
clasp open
Open Web App
Opens the deployed web application.
clasp open-web-app
Troubleshooting
- •File ignored?: Check
.claspignore. It works like.gitignore. - •Login fails?: Ensure Node.js is installed and path is set. Try
clasp login --no-localhostif browser redirect fails.