Skip to content

Commit b8dd6aa

Browse files
committed
Updated to v2.0.0
1 parent 8012865 commit b8dd6aa

11 files changed

+396
-389
lines changed

README.md

+59-35
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
1-
ggsrun
2-
=====
1+
# ggsrun
32

43
<a name="TOP"></a>
54
[![Build Status](https://travis-ci.org/tanaikech/ggsrun.svg?branch=master)](https://travis-ci.org/tanaikech/ggsrun)
65
[![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](LICENCE)
76

87
<a name="Overview"></a>
8+
99
# Overview
10+
1011
This 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.
1112

1213
<a name="Demo"></a>
14+
1315
# Demo
16+
1417
![](help/images/spreadsheetdemo.gif)
1518

1619
<a name="Description"></a>
20+
1721
# Description
22+
1823
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. Furthermore, this tool can be also used for managing files in own Google Drive (OAuth2) and Google Drive for Service Account.
1924

2025
Features of "ggsrun" are as follows.
@@ -37,23 +42,29 @@ Features of "ggsrun" are as follows.
3742
1. **[ggsrun got to be able to be used by not only OAuth2, but also Service Account.](help/README.md#useserviceaccount)** <sup><font color="Red">Updated! (v1.7.0)</font></sup>
3843

3944
<a name="howtoinstall"></a>
45+
4046
# How to Install
4147

4248
December 28, 2021: If you want to simply test ggsrun, you can also use [this method](https://gist.github.com/tanaikech/695f7016b04e4c4156ad928e9482ead9).
4349

4450
## 1. Get ggsrun
51+
4552
Download an executable file of ggsrun from [the release page](https://github.com/tanaikech/ggsrun/releases) and import to a directory with path.
4653

4754
or
4855

4956
Use go get.
5057

51-
~~~bash
52-
$ go get -u github.com/tanaikech/ggsrun
53-
~~~
58+
```bash
59+
$ go install github.com/tanaikech/ggsrun@latest
60+
```
61+
62+
- `GO111MODULE=on`
5463

5564
<a name="BasicSettingFlow"></a>
65+
5666
## Before Basic setting flow
67+
5768
**IMPORTANT: Please check this.**
5869

5970
At 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).
@@ -64,58 +75,63 @@ After the GAS project was linked to Cloud Platform Project by above flow, please
6475
- [Ref2: Linking Cloud Platform Project to Google Apps Script Project](https://gist.github.com/tanaikech/e945c10917fac34a9d5d58cad768832c)
6576

6677
## 2. Basic setting flow
78+
6779
When you click each link of title, you can see the detail information.
6880

6981
1. [Setup ggsrun Server (at Google side)](help/README.md#setupggsrunserver)
70-
- Create new project and install the server as a library.
71-
- [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"
72-
- [Install the server as a library.](https://developers.google.com/apps-script/guides/libraries#managing_libraries) Script ID of the library is
73-
- **``115-19njNHlbT-NI0hMPDnVO1sdrw2tJKCAJgOTIAPbi_jq3tOo4lVRov``**
74-
- **<u>After installed the library, please push the save button at the script editor.</u>** This is very important! By this, the library is completely reflected.
82+
- Create new project and install the server as a library.
83+
- [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"
84+
- [Install the server as a library.](https://developers.google.com/apps-script/guides/libraries#managing_libraries) Script ID of the library is
85+
- **`115-19njNHlbT-NI0hMPDnVO1sdrw2tJKCAJgOTIAPbi_jq3tOo4lVRov`**
86+
- **<u>After installed the library, please push the save button at the script editor.</u>** This is very important! By this, the library is completely reflected.
7587
1. [Get Client ID, Client Secret](help/README.md#getclientid)
76-
- On the Script Editor
77-
- Resources -> Cloud Platform Project
78-
- Click the lower part of "This script is currently associated with project:"
79-
- In "Getting Started", Click "Enable APIs and get credentials like keys".
80-
- On "API APIs&services"
81-
- Click "Credentials" at left side.
82-
- At "Create Credentials", Click OAuth client ID.
83-
- Choose **Other**
84-
- Input Name (This is a name you want.)
85-
- done
86-
- Download a JSON file with Client ID and Client Secret as **``client_secret.json``** using download button.
88+
- On the Script Editor
89+
- Resources -> Cloud Platform Project
90+
- Click the lower part of "This script is currently associated with project:"
91+
- In "Getting Started", Click "Enable APIs and get credentials like keys".
92+
- On "API APIs&services"
93+
- Click "Credentials" at left side.
94+
- At "Create Credentials", Click OAuth client ID.
95+
- Choose **Other**
96+
- Input Name (This is a name you want.)
97+
- done
98+
- Download a JSON file with Client ID and Client Secret as **`client_secret.json`** using download button.
8799
1. [Enable APIs](help/README.md#onstallexecutionapi)
88-
- 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``.
89-
- ``https://console.cloud.google.com/apis/library/script.googleapis.com/?project=### project ID ###``
90-
- **Also here [https://script.google.com/home/usersettings](https://script.google.com/home/usersettings) has to be enabled. Please turn ON.**
91-
- ``https://console.cloud.google.com/apis/api/drive.googleapis.com/?project=### project ID ###``
100+
- 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`.
101+
- `https://console.cloud.google.com/apis/library/script.googleapis.com/?project=### project ID ###`
102+
- **Also here [https://script.google.com/home/usersettings](https://script.google.com/home/usersettings) has to be enabled. Please turn ON.**
103+
- `https://console.cloud.google.com/apis/api/drive.googleapis.com/?project=### project ID ###`
92104
1. [Create configure file for ggsrun](help/README.md#Createconfigurefile)
93-
- Run ``$ ggsrun auth`` at the directory with ``client_secret.json``.
105+
- Run `$ ggsrun auth` at the directory with `client_secret.json`.
94106
1. [Test Run](help/README.md#runggsrun)
95-
- Create a sample script ``function main(){return Beacon()}`` as ``sample.gs``.
96-
- Run ``$ ggsrun e2 -s sample.gs -i [Script ID] -j``. Script ID is ID of the project installed the server.
107+
- Create a sample script `function main(){return Beacon()}` as `sample.gs`.
108+
- Run `$ ggsrun e2 -s sample.gs -i [Script ID] -j`. Script ID is ID of the project installed the server.
97109

98110
Congratulation! You got ggsrun!
99111

100112
<a name="from134to140"></a>
113+
101114
# To users which are using ggsrun with v1.3.4 and/or less <sup><font color="Red">Updated! (v1.4.0)</font></sup>
115+
102116
Please reauthorize to include a new scope to the access token as follows.
103117

104-
1. 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``.
105-
- ``https://console.cloud.google.com/apis/library/script.googleapis.com/?project=### project ID ###``
106-
- Also here [https://script.google.com/home/usersettings](https://script.google.com/home/usersettings) has to be enabled. Please turn ON.
107-
1. Add a scope of ``https://www.googleapis.com/auth/script.projects`` to ``ggsrun.cfg``.
108-
1. Run the following command under the directory with ``client_secret.json`` and ``ggsrun.cfg``.
109-
- ``$ ggsrun auth``
118+
1. 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`.
119+
- `https://console.cloud.google.com/apis/library/script.googleapis.com/?project=### project ID ###`
120+
- Also here [https://script.google.com/home/usersettings](https://script.google.com/home/usersettings) has to be enabled. Please turn ON.
121+
1. Add a scope of `https://www.googleapis.com/auth/script.projects` to `ggsrun.cfg`.
122+
1. Run the following command under the directory with `client_secret.json` and `ggsrun.cfg`.
123+
- `$ ggsrun auth`
110124

111125
Completed!
112126

113127
<a name="from170"></a>
128+
114129
# From version 1.7.0, ggsrun can access to Google Drive using Service Account. <sup><font color="Red">Updated! (v1.7.0)</font></sup>
115-
ggsrun 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).
116130

131+
ggsrun 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).
117132

118133
# How to use ggsrun
134+
119135
1. [Executes GAS and Retrieves Result Values](help/README.md#executesgasandretrievesresultvalues)
120136
1. [Executes GAS with Values and Retrieves Feedbacked Values](help/README.md#executesgaswithvaluesandretrievesfeedbackedvalues)
121137
1. [For Debug](help/README.md#fordebug)
@@ -136,12 +152,14 @@ ggsrun can access to Google Drive using [Service Account](https://developers.goo
136152
1. [ggsrun got to be able to be used by not only OAuth2, but also Service Account.](#useserviceaccount)
137153

138154
# Applications
155+
139156
1. [For Sublime Text](help/README.md#demosublime)
140157
1. [For CoffeeScript](help/README.md#coffeescript)
141158
1. [Create Triggers](help/README.md#createtriggers)
142159
1. [Link to Python script](help/README.md#linktovariousresources)
143160

144161
# [Q&A](help/README.md#qa)
162+
145163
1. [Authorization for Google Services for your script](help/README.md#qa1)
146164
1. [In the case that result is "Script Error on GAS side: Insufficient Permission"](help/README.md#qa2)
147165
1. [In the case that result is "message": "Requested entity was not found."](help/README.md#qa3)
@@ -153,17 +171,23 @@ ggsrun can access to Google Drive using [Service Account](https://developers.goo
153171
---
154172

155173
<a name="Licence"></a>
174+
156175
# Licence
176+
157177
[MIT](LICENCE)
158178

159179
<a name="Author"></a>
180+
160181
# Author
182+
161183
[Tanaike](https://tanaikech.github.io/about/)
162184

163185
If you have any questions and commissions for me, feel free to tell me using e-mail tanaike@hotmail.com
164186

165187
<a name="Update_History"></a>
188+
166189
# Update History
190+
167191
You can see the Update History at **[here](help/UpdateHistory.md)**.
168192

169193
<u>If you want to read the detail manual, please check [here](help/README.md).</u>

0 commit comments

Comments
 (0)