ggsrun

Simple Method for using ggsrun

Gists This is a simple method for using ggsrun. ggsrun 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. When you use ggsrun, it is required to retrieve the client ID and client secret and/or the service account at Cloud Platform Project. But, there is the case that you want to simply test or you want to just upload and download the files for Google Drive.

Updated ggsrun to v174

v1.7.4 (March 11, 2020) Recently, I noticed that new Google Apps Script project of the standalone script type cannot be created by the create method of Drive API. From now, in order to create the standalone Google Apps Script project, only Google Apps Script API is required to be used. Ref By this, I updated ggsrun. So the command for creating new GAS project is not changed.

Uploading File to Shared Folder using ggsrun

Gists ggsrun is also a CLI application for using Google Drive. Here, I would like to introduce a sample command. This is a sample command for uploading a file to a shared folder using ggsrun. This situation supposes that the shared folder is https://drive.google.com/drive/folders/abcdefg?usp=sharing and the folder has the edit permission. Sample command: $ ggsrun u -f "sample.txt" -p "abcdefg" --serviceaccount "###JSON file of Service Account###" If you have already used OAuth2, you can upload the file by ggsrun u -f "sample.

Updated ggsrun to v171

ggsrun was updated to v.1.7.1 v1.7.1 (December 30, 2018) A bug was removed. When a project is downloaded and zipped, there was a case that “createdTime” and “modifiedTime” of the project cannot be retrieved by Apps Script API. This was modified. You can check ggsrun at https://github.com/tanaikech/ggsrun.

Updated ggsrun to v170

ggsrun was updated to v.1.7.0 v1.7.0 (December 27, 2018) Manage permissions of files. Get Drive Information. By this, you can know the storage quotas. ggsrun got to be able to be used by not only OAuth2, but also Service Account. By this, using ggsrun, Google Drive for Service Account got to be able to be managed. Some modifications. You can check ggsrun at https://github.com/tanaikech/ggsrun.

Updated ggsrun to v160

ggsrun was updated to v.1.6.0 v1.6.0 (November 30, 2018) Although at ggsrun, files can be searched by filename and file ID, searching files using search query and regex couldn’t be done. From version 1.6.0, files got to be able to be searched using the search query and regex. $ ggsrun sf -q "### search query ###" -f "### fields ###" -r "### regex ###" Some modifications.

Updated ggsrun to v152

ggsrun was updated to v.1.5.2 v1.5.2 (November 4, 2018) About downloading folders, when files are downloaded from a folder, you can download Google Docs files with the mimeType you want. For example, when you download files from the folder, if -e txt is used, Google Docs are downloaded as the text file. When -e pdf is used, they are downloaded as the PDF file. Of course, there are mimeType which cannot be converted.

Updated ggsrun to v151

ggsrun was updated to v.1.5.1 v1.5.1 (November 2, 2018) Removed a bug. When a file information was retrieved, createdTime and modifiedTime couldn’t be seen and the information was incomplete. You can check ggsrun at https://github.com/tanaikech/ggsrun.

Updated ggsrun to v150

ggsrun was updated to v.1.5.0 v1.5.0 (October 27, 2018) From this version, ggsrun got to be able to download all files and folders in the specific folder in Google Drive. When all files are downloaded from a folder, the same folder structure of Google Drive is created to the local PC. $ ggsrun d -f folderName or folderId When the project file is downloaded, it is downloaded as a zip file.

Updated ggsrun to v141

ggsrun was updated to v.1.4.1 v1.4.1 (February 9, 2018) For uploading, the resumable-upload method was added. The resumable-upload method is automatically used by the size of file. “multipart/form-data” can upload files with the size less than 5 MB. “resumable-upload” can upload files with the size more than 5 MB. The chunk for resumable-upload is 100 MB as the default. Users can also give this chunk size using an option.

Updated ggsrun to v140

ggsrun was updated to v.1.4.0 v1.4.0 (January 25, 2018) Google Apps Script API was finally released. From this version, ggsrun uses this API. So ggsrun got to be able to use not only projects of standalone script type, but also projects of container-bound script type. I hope this updated ggsrun will be useful for you. To users which are using ggsrun with v1.3.4 and/or less. For retrieving, downloading, creating and updating projects, Apps Script API is used.

Updated ggsrun to v134

ggsrun was updated to v.1.3.4 v1.3.4 (January 2, 2018) Added new option for downloading ‘bound-scripts’ of Google Sheets, Docs, or Forms file. When the bound-scripts are downloaded, the project name cannot be retrieved because Drive API cannot be used for the bound-scripts. So when the bound-scripts are downloaded, the project ID had been used previously. Such filename is not easily to be seen. By this additional option, users can give the filename when it downloads the bound-scripts.

Create New Project with Original Manifests

It was found that you can also create new project with your original Manifests using ggsrun. By using this, for example, when you created new project, the project can have libraries, Advanced Google Services and so on at the initial stage. I think that this can be used as a template for Project. $ ggsrun u -pn [Project name] -f appsscript.json https://github.com/tanaikech/ggsrun/blob/master/help/README.md#ModifyManifests You can check this and download ggsrun at https://github.

Updated ggsrun to v133

ggsrun was updated to v.1.3.3 v1.3.3 (October 30, 2017) At October 24, 2017, “Manifests” which is new function for controlling the properties of Google Apps Script was added (GAS). You can see the detail of “Manifests” here. In order to modify the manifests from local PC, I added this new function to ggsrun. By using this, you can edit the manifests and update it from your local PC.

Updated ggsrun to v132

ggsrun was updated to v.1.3.2 v1.3.2 (October 20, 2017) Updated ggsrun’s Install manual (README.md). Since I thought that the manual became too complicated, I separated it to the simple version and the detail version. And also , recently, since Google’s specification was updated, about how to deploy API executable and enable APIs for ggsrun’s Install manual were updated. From this version, scripts in a project can be rearranged.

Updated ggsrun to v131

ggsrun was updated to v.1.3.1 Recently, when scripts on local PC is uploaded to Google Drive as a new project, the time to create on Google became a bit long. (I think that this is due to Google Update.) Under this situation, when the script is uploaded, the timeout error occurs while the new project is created using the script. So the time until timeout of fetch was modified from 10 seconds to 30 seconds.

Updated ggsrun to v130

ggsrun was updated to v.1.3.0 From this version, container-bound scripts can be downloaded. The container-bound script is the script created at the script editor on Google Sheets, Docs, or Forms file. In order to download container-bound scripts, the project ID of container-bound scripts is required. The project ID can be retrieved as follows. Open the project. And please operate follows using click. -> File -> Project properties -> Get Script ID (This is the project ID.

Updated ggsrun to v122

ggsrun was updated to v.1.2.2 For Google Docs (spreadsheet, document, slide and drawing), since I noticed that the revision files would not be able to be retrieved using Drive API v3, I modified this using new workaround. The new workaround is to use Drive API v2. drive.revisions.get of Drive API v2 can retrieve not only the revision list, but also the export links. I thought of the use of the export links.

Updated ggsrun to v110

Updated ggsrun to v.1.1.0 Added a command for updating existing project on Google Drive. One of scripts in the project can be also updated. https://github.com/tanaikech/ggsrun

CLI Tool - ggsrun

Overview This is a CLI tool to execute Google Apps Script (GAS) on a terminal. Motivation Will you want to develop GAS using CoffeeScript on your local PC? Generally, when we develop GAS, we have to login to Google using own browser and develop it using Javascript on the Script Editor. Recently, I have wanted to have more convenient local-environment for developing GAS. So I created this “ggsrun”. The detail information and how to get this are https://github.