Matthew
Matthew

Reputation: 841

How to clasp list, clasp clone, clasp pull and/or clasp push a Google Apps Script project bound to a Google Doc container (eg. Google Sheet)

How can clasp access Google Apps Script projects bound to their Google Doc container using clasp list, clasp clone, clasp push, clasp pull? Without proper use they fail with errors like:

Upvotes: 2

Views: 79

Answers (1)

Matthew
Matthew

Reputation: 841

As of 11/21/24 clasp can list bound projects along with standalone projects, and it can clone and pull bound projects as it can standalone projects. However, the proper permissions scopes must be selected during clasp login in the authentication flow in the browser on the page introducing the list with "Select what clasp – The Apps Script CLI can access":

  • clasp list requires "See information about your Google Drive files. [✓]".
  • clasp clone <script ID> (where you copy <script ID> from the GAS project's Project Settings page) as well as clasp pull and clasp push require "Create and update Google Apps Script projects. [✓]" (also ensure that the local dir does not contain a .clasp.json file already, as the clone operation needs to overwrite it but will be blocked by an existing one).
  • clasp push additionally requires activating Google Apps Script API at https://script.google.com/u/5/home/usersettings , which can take a few minutes to take effect for clasp to use it.

Upvotes: 3

Related Questions