Does Clasp Run and clasp logs still work?

297 views
Skip to first unread message

Tim Dobson

unread,
Jul 3, 2023, 8:43:12 PM7/3/23
to Google Apps Script Community
Hi there,

I've been trying to get

$ clasp run

and

$ clasp logs

working.

I've followed some of the better documentation:

I don't think I've fallen for the common problems, and part of me wonders if they work for *anyone* at the moment?

clasp pull and push work well for me:

tdobson@tragicomix:~/dev/clasp-demo$ clasp login --creds creds.json
Warning: You seem to already be logged in *locally*. You have a ./.clasprc.json
Logging in locally…

Authorizing with the following scopes:
https://www.googleapis.com/auth/script.deployments
https://www.googleapis.com/auth/script.projects
https://www.googleapis.com/auth/script.webapp.deploy
https://www.googleapis.com/auth/drive.metadata.readonly
https://www.googleapis.com/auth/drive.file
https://www.googleapis.com/auth/service.management
https://www.googleapis.com/auth/logging.read
https://www.googleapis.com/auth/cloud-platform

NOTE: The full list of scopes your project may need can be found at script.google.com under:
File > Project Properties > Scopes

Using credentials located here:
https://console.developers.google.com/apis/credentials?project=test-appscript-project123

🔑 Authorize clasp by visiting this url:
https://accounts.google.com/o/oauth2/v2/auth?access_type=offline&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fscript.deployments%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fscript.projects%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fscript.webapp.deploy%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive.metadata.readonly%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive.file%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fservice.management%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Flogging.read%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcloud-platform&response_type=code&client_id=561203860803-mojg7357mt1gcdg85is5gjrnlv0205ma.apps.googleusercontent.com&redirect_uri=http%3A%2F%2Flocalhost%3A35015

Authorization successful.

Local credentials saved to: /home/tdobson/dev/clasp-demo/.clasprc.json.
*Be sure to never commit this file!* It's basically a password.
No access, refresh token, API key or refresh handler callback is set.

tdobson@tragicomix:~/dev/clasp-demo$ clasp push
└─ /home/tdobson/dev/clasp-demo/appsscript.json
└─ /home/tdobson/dev/clasp-demo/Code.js
└─ /home/tdobson/dev/clasp-demo/helper functions.js
└─ /home/tdobson/dev/clasp-demo/main.js
└─ /home/tdobson/dev/clasp-demo/test.js
Pushed 5 files.

tdobson@tragicomix:~/dev/clasp-demo$ clasp deploy
Created version 15.
Only users in the same domain as the script owner may deploy this script.

tdobson@tragicomix:~/dev/clasp-demo$ clasp run lol
Running in dev mode.
Script API executable not published/deployed.

tdobson@tragicomix:~/dev/clasp-demo$ clasp logs
The projectId "test-appscript-project123" looks incorrect.
Did you provide the correct projectID?

(I managed to find the logs in the web based GCP cloud log viewer... so yes, it is the right ID)

appscript.json contains:


Can anyone conclusively say that they work?

-Tim

Reply all
Reply to author
Forward
0 new messages