Skip to content

Instantly share code, notes, and snippets.

@rajivmehtaflex
Last active November 2, 2024 16:39
Show Gist options
  • Save rajivmehtaflex/63557e8ebf9ef9276fc1ac2f97dec776 to your computer and use it in GitHub Desktop.
Save rajivmehtaflex/63557e8ebf9ef9276fc1ac2f97dec776 to your computer and use it in GitHub Desktop.
Google App Script References
create cred.json
clasp login --creds ./cred.json <Take from Desktop/keys file and copy to remote machine>
clasp login
clasp pull
clasp push

Google Apps Script with Clasp CLI - Quick Reference

This Gist documents the steps and commands used to set up and manage a Google Apps Script project using the clasp CLI.

Installation and Setup

1. Verify Node.js Installation

node -v

2. Install Clasp Globally

npm i @google/clasp -g

3. Verify Clasp Installation

npm list -g --depth=0

Authentication

4. Log in to Clasp

clasp login

for Remote

create cred.json
clasp login --creds ./cred.json <Take from Desktop/keys file and copy to remote machine>
clasp login
clasp pull
clasp push

Project Creation

5. Create a New Project

mkdir clasp_codelab
cd clasp_codelab
clasp create --title "Clasp Codelab" --type standalone

Project Management

6. Open the Project in the Google Apps Script Editor

clasp open

7. Pull the Latest Code from the Remote Repository

clasp pull

8. Push Local Changes to the Remote Repository

clasp push

9. Set a Version for the Project

clasp version "First version"

Help and Status

10. View Clasp Help

clasp --help

11. Check the Current Project Status

clasp status

Logout

12. Log Out of Clasp

clasp logout

13. Verify Logout by Checking Status

clasp status
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment