$ npm i -g google-apps-script
Authenticate the Drive API (add '-f' to force reauthentication):
$ gas auth [-f]
Create, delete or rename a project in your Google Drive:
$ gas create <name>
$ gas delete <fileName|fileId>
$ gas rename <fileName|fileId> <newName>
List your remote projects and their fileId's (optional filter on filename):
$ gas list [nameFilter]
Link a remote project to your current directory:
$ gas link <fileName|fileId>
Pull and push code from/to your remote project: (We map files in local folders to their full path name in a project and the other way around)
$ gas pull
$ gas push
Some shortcuts for creating, linking and pulling projects all in one:
$ gas init <name>
$ gas clone <fileName|fileId>
Open the linked project or a specified project in the online editor:
$ gas open [fileName|fileId]
Show some info about the linked project or a specified project:
$ gas show [fileName|fileId]
Check if there are any differences between your local files and Google Drive:
$ gas status
There is also the beta feature of including specified external files
// Content of gas-include.js
'time.js' - 'https://raw.githubusercontent.com/MaartenDesnouck/google-apps-script-include/master/Time.js'
$ gas include
$ gas push
$ gas init myScript
$ cd myScript
$ gas open
$ gas list
$ gas clone myScript
$ gas create myScript2
$ mkdir src
$ cd src
$ gas link myScript2
$ gas info
$ gas pull
Gas creates some extra files in a .gas folder of which only 'ID' should be checked into git,
so a .gitignore file gets added to your project if there isn't one present yet.
That's all (so far).
Suggestions or questions?
Tweet me @MaartenDesnouck or create an issue on github.