Socket
Socket
Sign inDemoInstall

@google/clasp

Package Overview
Dependencies
175
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @google/clasp

Develop Apps Script Projects locally


Version published
Maintainers
1
Install size
39.0 MB
Created

Readme

Source

clasp

Develop Apps Script projects locally using clasp (Command Line Apps Script Projects).

clasp

To get started, try out the codelab!

Install

First download clasp:

npm i @google/clasp -g

Then enable Apps Script API: https://script.google.com/home/usersettings

Features

🗺️ Develop Locally: clasp allows you to develop your Apps Script projects locally. That means you can check-in your code into source control, collaborate with other developers, and use your favorite tools to develop Apps Script.

🔢 Manage Deployment Versions: Create, update, and view your multiple deployments of your project.

📁 Structure Code: clasp automatically converts your flat project on script.google.com into folders. For example:

  • On script.google.com:
    • tests/slides.gs
    • tests/sheets.gs
  • locally:
    • tests/
      • slides.js
      • sheets.js

Commands

clasp -h
  • clasp login
  • clasp logout
  • clasp create [scriptTitle]
  • clasp clone <scriptId>
  • clasp pull
  • clasp push
  • clasp open
  • clasp deployments
  • clasp deploy [version] [description]
  • clasp redeploy <deploymentId> <description>
  • clasp version [description]
  • clasp versions

How To...

Login/Logout

clasp login
clasp logout

Create a New Apps Script Project

Files in the current directory are added to the project.

clasp create [scriptTitle]

Clone an existing project in the current directory

clasp clone <scriptId>

Push/Pull

clasp push # Updates Apps Script project with local files
clasp pull # Updates local files with Apps Script project

Update a Published Project / Deploy

To deploy a project:

  1. Create an immutable version of the Apps Script project using clasp version
  2. Deploy the version using clasp deploy [version]
clasp versions # List versions
clasp version [description] # Create a new version with a description

then deploy...

clasp deploy [version] [description]
clasp undeploy <deploymentId>
clasp deployments # List all deployment IDs

Open the project on script.google.com

clasp open

Troubleshooting

The library requires Node version >= 4.7.4.

node -v # Check Node version
sudo npm install n -g
sudo n latest

Develop

To develop the Apps Script SDK locally, install the CLI locally:

sudo npm i -g
clasp <command>

Bump versions and publish with:

npm publish --access public

⚡ Powered by the Apps Script API.

Keywords

FAQs

Last updated on 19 Jan 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc