Manage your google apps script from terminal!

Now when i was using my worst platform (at least till i found this lol) - google apps script cause i needed gmail access, i was going crazy from their ui website on mobile. (its a nightmare on a 2 inch screen) i came across:

Clasp

it lets you do everything locally from the terminal and technically you can even edit the files using any Ide too. Its a must use if you often use gas. (don’t even know why I’m saying so much while I only used it for like a few minutes lol)

I don’t know all options but it seems like you can do a lot. Here’s the core basics I used:

npm install -g @google/clasp
npm fund
clasp login
clasp clone "script id"

you’ll get your script, a appsscript.json for some config and .clasp.json. You can now edit your script using nano vim or even vscode. Then to upload your changes you can save and deploy the new version and use the same link so you don’t break your functions with these simple commands.

clasp push #saves
clasp version "name your new version" #you'll get your new version number
clasp deployments #you'll see the id from your last deployment
clasp deploy -i "paste id here" 6 #replace 6 by your new version number

i got no clue what else this has but it seems like something you should check out if you deploy to gas.

feel free to correct me or add info or functionality or your experience.

1 Like