{"id":13581962,"url":"https://github.com/tanaikech/ggsrun","last_synced_at":"2025-04-28T16:31:42.111Z","repository":{"id":79705667,"uuid":"89201523","full_name":"tanaikech/ggsrun","owner":"tanaikech","description":"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.","archived":false,"fork":false,"pushed_at":"2023-04-05T12:38:02.000Z","size":2914,"stargazers_count":148,"open_issues_count":1,"forks_count":14,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-04-05T09:51:08.561Z","etag":null,"topics":["cli","cli-app","cli-tool","developer-tools","gas","golang","google-apps-script","google-drive","terminal","terminal-app"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tanaikech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-04-24T05:35:27.000Z","updated_at":"2025-03-05T16:44:38.000Z","dependencies_parsed_at":"2024-01-16T09:05:48.674Z","dependency_job_id":"35ec2aea-d0da-4b33-8b2b-bc2496e5e263","html_url":"https://github.com/tanaikech/ggsrun","commit_stats":null,"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tanaikech%2Fggsrun","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tanaikech%2Fggsrun/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tanaikech%2Fggsrun/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tanaikech%2Fggsrun/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tanaikech","download_url":"https://codeload.github.com/tanaikech/ggsrun/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251345969,"owners_count":21574810,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","cli-app","cli-tool","developer-tools","gas","golang","google-apps-script","google-drive","terminal","terminal-app"],"created_at":"2024-08-01T15:02:21.213Z","updated_at":"2025-04-28T16:31:38.245Z","avatar_url":"https://github.com/tanaikech.png","language":"Go","funding_links":[],"categories":["Go","ai-agents","Development"],"sub_categories":["Lists \u0026 collections"],"readme":"# ggsrun\r\n\r\n\u003ca name=\"TOP\"\u003e\u003c/a\u003e\r\n[![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](LICENCE)\r\n\r\n\u003ca name=\"Overview\"\u003e\u003c/a\u003e\r\n\r\n# Overview\r\n\r\nThis is a CLI tool to execute Google Apps Script (GAS) on a terminal. Also this CLI tool can be used for managing files in Google Drive for OAuth2 and Service Account.\r\n\r\n\u003ca name=\"Demo\"\u003e\u003c/a\u003e\r\n\r\n# Demo\r\n\r\n![](help/images/spreadsheetdemo.gif)\r\n\r\n\u003ca name=\"Description\"\u003e\u003c/a\u003e\r\n\r\n# Description\r\n\r\nWill 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. Furthermore, this tool can be also used for managing files in own Google Drive (OAuth2) and Google Drive for Service Account.\r\n\r\nFeatures of \"ggsrun\" are as follows.\r\n\r\n1. **[Develops GAS using your local terminal and text editor which got accustomed to using.](help/README.md#demosublime)**\u003csup\u003e\u003cfont color=\"Red\"\u003eUpdated! (v1.4.0)\u003c/font\u003e\u003c/sup\u003e\r\n1. **[Executes GAS by giving values to your script.](help/README.md#executesgasandretrievesresultvalues)**\r\n1. **[Executes GAS made of CoffeeScript.](help/README.md#coffeescript)**\r\n1. **[Downloads spreadsheet, document and presentation, while executes GAS, simultaneously.](help/README.md#downloadfiles)**\r\n1. **[Downloads files from Google Drive and Uploads files to Google Drive.](help/README.md#uploadfiles)** \u003csup\u003e\u003cfont color=\"Red\"\u003eUpdated! (v1.4.1)\u003c/font\u003e\u003c/sup\u003e\r\n1. **[Downloads standalone script and bound script.](help/README.md#downloadfiles)** \u003csup\u003e\u003cfont color=\"Red\"\u003eUpdated! (v1.4.0)\u003c/font\u003e\u003c/sup\u003e\r\n1. **[Downloads all files and folders in a specific folder.](help/README.md#downloadfilesfromfolder)** \u003csup\u003e\u003cfont color=\"Red\"\u003eUpdated! (v1.5.2)\u003c/font\u003e\u003c/sup\u003e\r\n1. **[Upload script files and create project as standalone script and container-bound script.](help/README.md#uploadfiles)** \u003csup\u003e\u003cfont color=\"Red\"\u003eUpdated! (v1.5.2)\u003c/font\u003e\u003c/sup\u003e\r\n1. **[Update project.](help/README.md#updateproject)** \u003csup\u003e\u003cfont color=\"Red\"\u003eUpdated! (v1.4.0)\u003c/font\u003e\u003c/sup\u003e\r\n1. **[Retrieve revision files of Google Docs and retrieve versions of projects.](help/README.md#revisionfile)** \u003csup\u003e\u003cfont color=\"Red\"\u003eUpdated! (v1.4.0)\u003c/font\u003e\u003c/sup\u003e\r\n1. **[Rearranges scripts in project.](help/README.md#rearrangescripts)** \u003csup\u003e\u003cfont color=\"Red\"\u003eUpdated! (v1.4.0)\u003c/font\u003e\u003c/sup\u003e\r\n1. **[Modifies Manifests in project.](help/README.md#modifymanifests)**\r\n1. **[Seach files in Google Drive using search query and regex](help/README.md#searchfilesusingregex)** \u003csup\u003e\u003cfont color=\"Red\"\u003eUpdated! (v1.6.0)\u003c/font\u003e\u003c/sup\u003e\r\n1. **[Manage Permissions of files](help/README.md#managepermissions)** \u003csup\u003e\u003cfont color=\"Red\"\u003eUpdated! (v1.7.0)\u003c/font\u003e\u003c/sup\u003e\r\n1. **[Get Drive Information.](help/README.md#getdriveinformation)** \u003csup\u003e\u003cfont color=\"Red\"\u003eUpdated! (v1.7.0)\u003c/font\u003e\u003c/sup\u003e\r\n1. **[ggsrun got to be able to be used by not only OAuth2, but also Service Account.](help/README.md#useserviceaccount)** \u003csup\u003e\u003cfont color=\"Red\"\u003eUpdated! (v1.7.0)\u003c/font\u003e\u003c/sup\u003e\r\n\r\n\u003ca name=\"howtoinstall\"\u003e\u003c/a\u003e\r\n\r\n# How to Install\r\n\r\nDecember 28, 2021: If you want to simply test ggsrun, you can also use [this method](https://gist.github.com/tanaikech/695f7016b04e4c4156ad928e9482ead9).\r\n\r\n## 1. Get ggsrun\r\n\r\nDownload an executable file of ggsrun from [the release page](https://github.com/tanaikech/ggsrun/releases) and import to a directory with path.\r\n\r\nor\r\n\r\nUse go get.\r\n\r\n```bash\r\n$ go install github.com/tanaikech/ggsrun@latest\r\n```\r\n\r\n- `GO111MODULE=on`\r\n\r\n\u003ca name=\"BasicSettingFlow\"\u003e\u003c/a\u003e\r\n\r\n## Before Basic setting flow\r\n\r\n**IMPORTANT: Please check this.**\r\n\r\nAt April 8, 2019, the specification of Google Apps Script Project was changed. By this, when new GAS project is created after April 8, 2019, in order to use Goole API (Google Apps Script API and Drive API which can be used by ggsrun.), the GAS project is required to link to Cloud Platform Project. When you use the GAS project creted after April 8, 2019, at first, please do [this flow](https://gist.github.com/tanaikech/e945c10917fac34a9d5d58cad768832c).\r\n\r\nAfter the GAS project was linked to Cloud Platform Project by above flow, please do \"Basic setting flow\" at the next section.\r\n\r\n- [Ref1: Default Cloud Platform projects](https://developers.google.com/apps-script/guides/cloud-platform-projects#default_cloud_platform_projects)\r\n- [Ref2: Linking Cloud Platform Project to Google Apps Script Project](https://gist.github.com/tanaikech/e945c10917fac34a9d5d58cad768832c)\r\n\r\n## 2. Basic setting flow\r\n\r\nWhen you click each link of title, you can see the detail information.\r\n\r\n1. [Setup ggsrun Server (at Google side)](help/README.md#setupggsrunserver)\r\n   - Create new project and install the server as a library.\r\n   - [Deploy API executable](https://developers.google.com/apps-script/api/how-tos/execute#step_1_deploy_the_script_as_an_api_executable). Choose \"Only myself\" as \"Who has access to the script\"\r\n   - [Install the server as a library.](https://developers.google.com/apps-script/guides/libraries#managing_libraries) Script ID of the library is\r\n     - **`115-19njNHlbT-NI0hMPDnVO1sdrw2tJKCAJgOTIAPbi_jq3tOo4lVRov`**\r\n   - **\u003cu\u003eAfter installed the library, please push the save button at the script editor.\u003c/u\u003e** This is very important! By this, the library is completely reflected.\r\n1. [Get Client ID, Client Secret](help/README.md#getclientid)\r\n   - On the Script Editor\r\n     - Resources -\u003e Cloud Platform Project\r\n     - Click the lower part of \"This script is currently associated with project:\"\r\n     - In \"Getting Started\", Click \"Enable APIs and get credentials like keys\".\r\n     - On \"API APIs\u0026services\"\r\n     - Click \"Credentials\" at left side.\r\n     - At \"Create Credentials\", Click OAuth client ID.\r\n     - Choose **Other**\r\n     - Input Name (This is a name you want.)\r\n     - done\r\n     - Download a JSON file with Client ID and Client Secret as **`client_secret.json`** using download button.\r\n1. [Enable APIs](help/README.md#onstallexecutionapi)\r\n   - ggsrun uses Google Apps Script API and Drive API. Please enable them at API console. You can directly access them as follows. Project ID can be seen at downloaded `client_secret.json`.\r\n     - `https://console.cloud.google.com/apis/library/script.googleapis.com/?project=### project ID ###`\r\n       - **Also here [https://script.google.com/home/usersettings](https://script.google.com/home/usersettings) has to be enabled. Please turn ON.**\r\n     - `https://console.cloud.google.com/apis/api/drive.googleapis.com/?project=### project ID ###`\r\n1. [Create configure file for ggsrun](help/README.md#Createconfigurefile)\r\n   - Run `$ ggsrun auth` at the directory with `client_secret.json`.\r\n1. [Test Run](help/README.md#runggsrun)\r\n   - Create a sample script `function main(){return Beacon()}` as `sample.gs`.\r\n   - Run `$ ggsrun e2 -s sample.gs -i [Script ID] -j`. Script ID is ID of the project installed the server.\r\n\r\nCongratulation! You got ggsrun!\r\n\r\n\u003ca name=\"from134to140\"\u003e\u003c/a\u003e\r\n\r\n# To users which are using ggsrun with v1.3.4 and/or less \u003csup\u003e\u003cfont color=\"Red\"\u003eUpdated! (v1.4.0)\u003c/font\u003e\u003c/sup\u003e\r\n\r\nPlease reauthorize to include a new scope to the access token as follows.\r\n\r\n1. Confirm whether Google Apps Script API is enabled. You can directly access it as follows. Project ID can be seen at the downloaded `client_secret.json`.\r\n   - `https://console.cloud.google.com/apis/library/script.googleapis.com/?project=### project ID ###`\r\n   - Also here [https://script.google.com/home/usersettings](https://script.google.com/home/usersettings) has to be enabled. Please turn ON.\r\n1. Add a scope of `https://www.googleapis.com/auth/script.projects` to `ggsrun.cfg`.\r\n1. Run the following command under the directory with `client_secret.json` and `ggsrun.cfg`.\r\n   - `$ ggsrun auth`\r\n\r\nCompleted!\r\n\r\n\u003ca name=\"from170\"\u003e\u003c/a\u003e\r\n\r\n# From version 1.7.0, ggsrun can access to Google Drive using Service Account. \u003csup\u003e\u003cfont color=\"Red\"\u003eUpdated! (v1.7.0)\u003c/font\u003e\u003c/sup\u003e\r\n\r\nggsrun can access to Google Drive using [Service Account](https://developers.google.com/identity/protocols/OAuth2ServiceAccount). When OAuth2 is used, you can see the files and folders in own Google Drive. When Service Account is used, you can see them in Google Drive for Service Account. Namely, the Drive for OAuth2 is different from that for Service Account. Please be careful this. And when Service Account is used, there are what it can do and what it can't do. About them, please read [here](help/README.md#useserviceaccount).\r\n\r\n# How to use ggsrun\r\n\r\n1. [Executes GAS and Retrieves Result Values](help/README.md#executesgasandretrievesresultvalues)\r\n1. [Executes GAS with Values and Retrieves Feedbacked Values](help/README.md#executesgaswithvaluesandretrievesfeedbackedvalues)\r\n1. [For Debug](help/README.md#fordebug)\r\n1. [Executes GAS with Values and Downloads File](help/README.md#executesgaswithvaluesanddownloadsfile)\r\n1. [Executes Existing Functions on Project](help/README.md#ExecutesExistingFunctionsonProject)\r\n1. [Download Files](help/README.md#downloadfiles)\r\n1. [Downloads all files and folders in a specific folder.](help/README.md#downloadfilesfromfolder)\r\n1. [Upload Files](help/README.md#uploadfiles)\r\n1. [Show File List](help/README.md#showfilelist)\r\n1. [Search Files](help/README.md#searchfiles)\r\n1. [Update Project](help/README.md#updateproject)\r\n1. [Retrieve Revision Files and Versions of Projects](help/README.md#revisionfile)\r\n1. [Rearrange Script in Project](help/README.md#rearrangescripts)\r\n1. [Modify Manifests](help/README.md#modifymanifests)\r\n1. [Seach Files using Query and Regex](help/README.md#searchfilesusingregex)\r\n1. [Manage Permissions of files](#managepermissions)\r\n1. [Get Drive Information.](#getdriveinformation)\r\n1. [ggsrun got to be able to be used by not only OAuth2, but also Service Account.](#useserviceaccount)\r\n\r\n# Applications\r\n\r\n1. [For Sublime Text](help/README.md#demosublime)\r\n1. [For CoffeeScript](help/README.md#coffeescript)\r\n1. [Create Triggers](help/README.md#createtriggers)\r\n1. [Link to Python script](help/README.md#linktovariousresources)\r\n\r\n# [Q\u0026A](help/README.md#qa)\r\n\r\n1. [Authorization for Google Services for your script](help/README.md#qa1)\r\n1. [In the case that result is \"Script Error on GAS side: Insufficient Permission\"](help/README.md#qa2)\r\n1. [In the case that result is \"message\": \"Requested entity was not found.\"](help/README.md#qa3)\r\n1. [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.\"](help/README.md#qa4)\r\n1. [In the case that result is \"Missing ';' before statement.\"](help/README.md#qa5)\r\n1. [About library](help/README.md#qa6)\r\n1. [Order of directories for searching](help/README.md#qa7)\r\n\r\n---\r\n\r\n\u003ca name=\"Licence\"\u003e\u003c/a\u003e\r\n\r\n# Licence\r\n\r\n[MIT](LICENCE)\r\n\r\n\u003ca name=\"Author\"\u003e\u003c/a\u003e\r\n\r\n# Author\r\n\r\n[Tanaike](https://tanaikech.github.io/about/)\r\n\r\nIf you have any questions and commissions for me, feel free to tell me using e-mail tanaike@hotmail.com\r\n\r\n\u003ca name=\"Update_History\"\u003e\u003c/a\u003e\r\n\r\n# Update History\r\n\r\nYou can see the Update History at **[here](help/UpdateHistory.md)**.\r\n\r\n\u003cu\u003eIf you want to read the detail manual, please check [here](help/README.md).\u003c/u\u003e\r\n\r\n[TOP](#TOP)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftanaikech%2Fggsrun","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftanaikech%2Fggsrun","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftanaikech%2Fggsrun/lists"}