gitmyhub

clasp

TypeScript β˜… 5.7k updated 12d ago

πŸ”— Command Line Apps Script Projects

Clasp is a command-line tool that lets you write and manage Google Apps Script projects on your own computer instead of in the browser-based script editor. Google Apps Script is the scripting platform built into Google Workspace products like Sheets, Docs, and Drive. Normally you edit those scripts in a web interface; clasp replaces that with a local workflow where you can use any code editor, store code in version control like Git, and collaborate with other developers.

The core workflow is straightforward: you log in once with your Google account, then use clasp to create or clone a script project. From there you write code locally, push changes up to Google's servers with one command, and deploy or run your scripts from the terminal. Clasp also lets you pull down changes, manage multiple deployment versions, and tail live log output from your scripts.

File organization is handled automatically. Apps Script stores all files flat in a single project, but clasp converts that into folders when pulling to your local machine, and reconstructs the flat structure when pushing back. This makes it much easier to organize larger projects.

Version 3 of the tool dropped built-in TypeScript transpilation. If your project uses TypeScript you now handle that step yourself with a bundler before pushing. The README links to several starter templates that show how to set that up. Some command names also changed between version 2 and 3, and the README includes a migration table.

Clasp can also be installed as an extension for Claude Code CLI or Gemini CLI, which makes it available as an MCP server for use in AI-assisted workflows. The tool requires enabling the Google Apps Script API in your Google account settings before first use. The full README is longer than what was shown.