What is clasp for Google Sheets Apps Script?

clasp is Google's command line tool for developing Apps Script outside the browser. You clone a script project to local .gs and .html files, edit in VS Code or Cursor, and push changes back with clasp push. Teams use it for git version control, code review, and faster refactors on large sheet automations.

When to use it

Use clasp when a script outgrows the online editor: multiple files, TypeScript via bundlers, git history, CI checks, or copying the same library into many workbook projects.

When to skip it

Skip clasp for one-file beginner scripts you only tweak in Extensions > Apps Script. The setup cost is not worth a ten-line onOpen menu.

How it works

  1. 1

    Install Node.js and run npm install -g @google/clasp.

  2. 2

    clasp login authorizes your Google account for the CLI.

  3. 3

    clasp clone SCRIPT_ID pulls the bound or standalone project into a local folder with appsscript.json manifest.

  4. 4

    Edit .gs files locally, then clasp push uploads to the cloud project.

  5. 5

    clasp pull brings remote changes down before you push to avoid overwriting teammates.

  6. 6

    Use clasp deploy for web app versions when you automate releases from CI.

Examples in Google Sheets

Git-backed sheet tool

A team clones the container-bound script, branches in git, and opens PRs before clasp push to production spreadsheet.

Shared snippet sync

One repo holds utility functions clasp pushed to several customer workbooks on a schedule.

TypeScript workflow

Developers write .ts, bundle to Code.gs, and clasp push as part of npm run deploy.

Build this without starting from a blank cell

Use a Better Sheets tool for clasp, then watch a walkthrough when you want the full pattern.

Better Sheets resources

Common mistakes

  • Pushing without pull and wiping changes someone made in the browser editor.
  • Committing .clasp.json with wrong scriptId and pushing to the wrong customer file.
  • Forgetting clasp does not copy triggers; reinstall triggers after cloning to a new file.
  • Pushing secrets in plain text instead of Script Properties setup scripts.
  • Not enabling the Apps Script API in Google account settings before login fails.

Frequently asked questions

Does clasp work with container-bound sheet scripts?
Yes. clasp clone works on the script project tied to a spreadsheet. You still deploy triggers in the cloud project.
What is scriptId?
The unique Apps Script project ID from Project Settings in the editor. clasp stores it in .clasp.json.
Can I use clasp without Node?
clasp requires Node.js. It is a Node CLI tool distributed on npm.
Does clasp push run the script?
No. It only uploads source. Run functions in the editor, triggers, or web app URLs as usual.
How do I pull someone else's online edit?
clasp pull in your local repo merges remote files. Resolve conflicts like any git project.
Can clasp manage multiple projects?
Yes. Each folder has its own .clasp.json scriptId. Use separate directories per workbook.
Is clasp official?
Yes. Google maintains clasp as the standard CLI for Apps Script development.
Do I still need the browser editor?
You can do most work locally, but triggers, executions, and some deploy dialogs are still easiest in the web UI.

Related Tutorials

Watch how clasp works

Browse more tutorials
MAKE Your Google Sheets Add-on USABLE

MAKE Your Google Sheets Add-on USABLE

In this section we're going to turn our apps script into an add-on. comp...
10 Google Sheets I Wish Someone Would Make

10 Google Sheets I Wish Someone Would Make

if you're looking for ideas on what sheets to make I think this video is...
Two Things to Know When Starting to Learn Google Sheets

Two Things to Know When Starting to Learn Google Sheets

Two things I would teach every beginner to immediately improve your skil...
Curate Google Sheets Easily - Automatic Bookmarklet Maker

Curate Google Sheets Easily - Automatic Bookmarklet Maker

Curated sites, articles, and more web resources super easily into a Goog...
Convert Google Sheets into a REST API

Convert Google Sheets into a REST API

How to use Google Sheets as a database by turning it into a REST API wit...
Scrape Google Maps

Scrape Google Maps

Scrape any query in Google Maps into your Google Sheets. Enter your API ...

Related blog posts

Guides that explain clasp in more depth.

Browse the blog

Related glossary terms

Done reading about clasp?

Membership unlocks 636+ tutorials, unlimited generators, and every template. Practical lessons. Zero fluff.

Need this once

Jump to a free tool or a single tutorial for this topic.

Learning Sheets for real

Unlock the full library, generators, and templates with membership.