A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developers.google.com/apps-script/guides/clasp below:

Use the command line interface with clasp | Apps Script

Use the command line interface with clasp

Stay organized with collections Save and categorize content based on your preferences.

To develop and manage Apps Script projects from your terminal rather than the Apps Script editor, you can use an open-source tool called clasp.

The clasp codelab provides an overview of all clasp features.

Features Develop locally

clasp lets you to develop your Apps Script projects locally. You can write code on your own computer and upload it to Apps Script when you're done. You can also download existing Apps Script projects so that you can edit them when you're offline. Since the code is local, you can use your favorite development tools like git when building Apps Script projects.

Manage deployment versions

Create, update, and view your multiple deployments of your project.

Structure code

clasp allows you to organize your code into directories, which are preserved when you upload them to script.google.com. For example:

# On script.google.com:
├── tests/slides.gs
└── tests/sheets.gs

# Locally:
├── tests/
│   ├─ slides.gs
│   └─ sheets.gs
Requirements

clasp is written in Node.js and distributed via the npm tool. Prior to using clasp, you must have Node.js version 4.7.4 or later installed. Installing Node.js requires administrative privileges.

Installation

Once you've installed Node.js, you can use the following npm command to install clasp:

npm install @google/clasp -g

After installation, you can use the clasp command from any directory on your computer.

Using clasp

You can use clasp to handle a variety of tasks from the command line. This section describes common operations you can use when developing with clasp.

Login

This command logs in and authorizes management of your Google account's Apps Script projects. Once it is run, you are asked to sign into a Google account where your Apps Script projects are stored.

clasp login
Logout

This command logs out of the command line tool. You must re-login using clasp login to re-authenticate with Google before continuing to use clasp.

clasp logout
Create a new Apps Script project

This command creates a new script in the current directory with an optional script title.

clasp create [scriptTitle]

This command also creates two files in the current directory:

Clone an existing project

This command clones an existing project in the current directory. The script must be created or shared with your Google account. You specify the script project to clone by providing its script ID.

To find the Script ID of the project, follow the below steps:

  1. Open Apps Script project.
  2. At the left, click Project Settings settings.
  3. Under IDs, copy the Script ID.

     clasp clone <scriptId>
    
Download a script project

This command downloads the Apps Script project from Google Drive to your computer's file system.

clasp pull
Upload a script project

This command uploads all of a script project's files from your computer to Google Drive.

clasp push
List project versions

This command lists the number and description of each of a script project's versions.

clasp versions
Deploy a published project

You can deploy script projects as web apps, add-ons, or executables. You can create deployments in the script editor, in the project manifest, or using clasp.

To deploy a project with clasp, first create an immutable version of the Apps Script project. A version is a "snapshot" of a script project and is similar to a read-only branched release.

clasp version [description]

This command displays the newly created version number. Using that number, you can deploy and undeploy instances of your project:

clasp deploy [version] [description]
clasp undeploy <deploymentId>

This command updates an existing deployment with a new version and description:

clasp redeploy <deploymentId> <version> <description>
List deployments

This command lists the script project's deployment IDs, versions, and their descriptions.

clasp deployments
Open the project in the Apps Script editor

This command opens a script project in the Apps Script editor. The editor is launched as a new tab in your default web browser.

clasp open
Contribute to the clasp open-source project

Contribute to clasp on GitHub.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-08-04 UTC.

[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-04 UTC."],[[["Develop Apps Script projects locally using `clasp`, enabling the use of tools like `git` and offline editing."],["Manage deployments, create versions, and update your Apps Script projects directly from the command line."],["Structure your Apps Script code into directories for better organization, mirroring the structure on script.google.com."],["Requires Node.js and installation via npm with the command `npm install @google/clasp -g`."],["Use various `clasp` commands for tasks like login, creating projects, cloning, pushing/pulling code, deploying, and more."]]],[]]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4