This is a CLI tool to execute Google Apps Script (GAS) on a terminal.
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.
- Develops GAS using your terminal and text editor which got accustomed to using.
- Executes GAS by giving values to your script.
- Executes GAS made of CoffeeScript.
- Downloads spreadsheet, document and presentation, while executes GAS, simultaneously.
- Creates, updates and backs up project with GAS.
- Downloads files from Google Drive and Uploads files to Google Drive.
- Downloads standalone script and bound script.
- Rearranges scripts in project. NEW! (v1.3.2)
- Modifies Manifests in project. NEW! (v1.3.3)
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
When you click each link of title, you can see the detail information.
- 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.
- Install Execution API
- For the created project, deploy API executable.
- Enable Execution API and Drive API at API console.
- Get Client ID, Client Secret
- Create a credential as Other and download
client_secret.json
.
- Create a credential as Other and download
- Create configure file for ggsrun
- Run
$ ggsrun auth
at the directory withclient_secret.json
.
- Run
- Test Run
- Create a sample script
function main(){return Beacon()}
assample.gs
. - Run
$ ggsrun e2 -s sample.gs -i [Script ID] -j
. Script ID is ID of the project installed the server.
- Create a sample script
Congratulation! You got ggsrun!
- Executes GAS and Retrieves Result Values
- Executes GAS with Values and Retrieves Feedbacked Values
- For Debug
- Executes GAS with Values and Downloads File
- Executes Existing Functions on Project
- Download Files
- Upload Files
- Show File List
- Search Files
- Update Project
- Retrieve Revision Files
- Rearrange Script in Project NEW! (v1.3.2)
- Modify Manifests NEW! (v1.3.3)
- Authorization for Google Services for your script
- In the case that result is "Script Error on GAS side: Insufficient Permission"
- In the case that result is "message": "Requested entity was not found."
- 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."
- In the case that result is "Missing ';' before statement."
- About library
If you have any questions and commissions for me, feel free to tell me using e-mail [email protected]
You can see the Update History at here.
If you want to read the detail manual, please check here.