Reputation: 841
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:
clasp list
: No script files found.clasp clone
: Could not find
script. Did you provide the correct scriptId? Are you logged in to
the correct account with the script?clasp pull
: Could not find
script. Did you provide the correct scriptId? Are you logged in to
the correct account with the script?clasp push
: Push failed.
Upvotes: 2
Views: 79
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