Skip to content
forked from tanaikech/ggsrun

This is a CLI tool to execute Google Apps Script (GAS) at own terminal on local PC. Also this CLI tool can be used for managing files in Google Drive for OAuth2 and Service Account.

License

Notifications You must be signed in to change notification settings

wesszabo/ggsrun

Repository files navigation

ggsrun

Build Status MIT License

Overview

This is a CLI tool to execute Google Apps Script (GAS) on a terminal.

Demo

Description

Will you want to develop GAS on your local PC? Generally, when we develop GAS, we have to login to Google using own browser and develop it on the Script Editor. Recently, I have wanted to have more convenient local-environment for developing GAS. So I created this "ggsrun". The main work is to execute GAS on local terminal and retrieve the results from Google.

Features of "ggsrun" are as follows.

  1. Develops GAS using your terminal and text editor which got accustomed to using.
  2. Executes GAS by giving values to your script.
  3. Executes GAS made of CoffeeScript.
  4. Downloads spreadsheet, document and presentation, while executes GAS, simultaneously.
  5. Creates, updates and backs up project with GAS.
  6. Downloads files from Google Drive and Uploads files to Google Drive.
  7. Download standalone script and bound script.
  8. Rearranges scripts in project. NEW! (v1.3.2)

How to Install

1. Get ggsrun

Download an executable file of ggsrun from the release page and import to a directory with path.

or

Use go get.

$ go get -u github.com/tanaikech/ggsrun

2. Basic setting flow

When you click each link of title, you can see the detail information.

  1. Setup ggsrun Server (at Google side)
    • Create new project and install the server as a library.
    • Script ID of the library is "115-19njNHlbT-NI0hMPDnVO1sdrw2tJKCAJgOTIAPbi_jq3tOo4lVRov".
    • After installed the library, please push the save button at the script editor. This is important! By this, the library is completely reflected.
  2. Install Execution API
    • For the created project, deploy API executable.
    • Enable Execution API and Drive API at API console.
  3. Get Client ID, Client Secret
    • Create a credential as Other and download client_secret.json.
  4. Create configure file for ggsrun
    • Run $ ggsrun auth at the directory with client_secret.json.
  5. Test Run
    • Create a sample script function main(){return Beacon()} as sample.gs.
    • Run $ ggsrun e2 -s sample.gs -i [Script ID] -j. Script ID is ID of the project installed the server.

Congratulation! You got ggsrun!

How to use ggsrun

  1. Executes GAS and Retrieves Result Values
  2. Executes GAS with Values and Retrieves Feedbacked Values
  3. For Debug
  4. Executes GAS with Values and Downloads File
  5. Executes Existing Functions on Project
  6. Download Files
  7. Upload Files
  8. Show File List
  9. Search Files
  10. Update Project
  11. Retrieve Revision Files
  12. Rearrange Script in Project NEW! (v1.3.2)

Applications

  1. For Sublime Text
  2. For CoffeeScript
  3. Create Triggers
  4. Link to Python script
  1. Authorization for Google Services for your script
  2. In the case that result is "Script Error on GAS side: Insufficient Permission"
  3. In the case that result is "message": "Requested entity was not found."
  4. In the case that result is "Script Error on GAS side: Script has attempted to perform an action that is not allowed when invoked through the Google Apps Script Execution API."
  5. In the case that result is "Missing ';' before statement."
  6. About library

Licence

MIT

Author

Tanaike

If you have any questions and commissions for me, feel free to tell me using e-mail [email protected]

Update History

You can see the Update History at here.

If you want to read the detail manual, please check here.

TOP

About

This is a CLI tool to execute Google Apps Script (GAS) at own terminal on local PC. Also this CLI tool can be used for managing files in Google Drive for OAuth2 and Service Account.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 95.8%
  • JavaScript 4.2%