You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+13-2
Original file line number
Diff line number
Diff line change
@@ -7,15 +7,15 @@ ggsrun
7
7
8
8
<aname="Overview"></a>
9
9
# Overview
10
-
This is a CLI tool to execute Google Apps Script (GAS) on a terminal.
10
+
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.
11
11
12
12
<aname="Demo"></a>
13
13
# Demo
14
14

15
15
16
16
<aname="Description"></a>
17
17
# Description
18
-
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.
18
+
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.
19
19
20
20
Features of "ggsrun" are as follows.
21
21
@@ -32,6 +32,9 @@ Features of "ggsrun" are as follows.
32
32
1.**[Rearranges scripts in project.](help/README.md#rearrangescripts)** <sup><fontcolor="Red">Updated! (v1.4.0)</font></sup>
33
33
1.**[Modifies Manifests in project.](help/README.md#modifymanifests)**
34
34
1.**[Seach files in Google Drive using search query and regex](help/README.md#searchfilesusingregex)** <sup><fontcolor="Red">Updated! (v1.6.0)</font></sup>
35
+
1.**[Manage Permissions of files](help/README.md#managepermissions)** <sup><fontcolor="Red">Updated! (v1.7.0)</font></sup>
1.**[ggsrun got to be able to be used by not only OAuth2, but also Service Account.](help/README.md#useserviceaccount)** <sup><fontcolor="Red">Updated! (v1.7.0)</font></sup>
35
38
36
39
<aname="howtoinstall"></a>
37
40
# How to Install
@@ -94,6 +97,11 @@ Please reauthorize to include a new scope to the access token as follows.
94
97
95
98
Completed!
96
99
100
+
<aname="from170"></a>
101
+
# From version 1.7.0, ggsrun can access to Google Drive using Service Account. <sup><fontcolor="Red">Updated! (v1.7.0)</font></sup>
102
+
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).
103
+
104
+
97
105
# How to use ggsrun
98
106
1.[Executes GAS and Retrieves Result Values](help/README.md#executesgasandretrievesresultvalues)
99
107
1.[Executes GAS with Values and Retrieves Feedbacked Values](help/README.md#executesgaswithvaluesandretrievesfeedbackedvalues)
@@ -110,6 +118,9 @@ Completed!
110
118
1.[Rearrange Script in Project](help/README.md#rearrangescripts)
app.Usage="This is an application of Google Drive and Google Apps Script (GAS)."
18
-
app.Version="1.6.0"
17
+
app.Usage="This is a CLI application for managing Google Drive and Google Apps Script (GAS)."
18
+
app.Version="1.7.0"
19
19
app.Commands= []cli.Command{
20
20
{
21
21
Name: "exe1",
@@ -159,6 +159,10 @@ func main() {
159
159
Name: "extension, e",
160
160
Usage: "Extension (File format of downloaded file)",
161
161
},
162
+
cli.StringFlag{
163
+
Name: "mimetype, m",
164
+
Usage: "mimeType (You can retrieve only files with the specific mimeType, when files are downloaded from a folder.) ex. '-m \"mimeType1,mimeType2\"'",
165
+
},
162
166
cli.BoolFlag{
163
167
Name: "rawdata, r",
164
168
Usage: "Save a project with GAS scripts as raw data (JSON data).",
@@ -187,6 +191,10 @@ func main() {
187
191
Name: "jsonparser, j",
188
192
Usage: "Display results by JSON parser",
189
193
},
194
+
cli.StringFlag{
195
+
Name: "serviceaccount, sa",
196
+
Usage: "Value is filename and path of credentials.json which was retrieved by creating Service Account.",
197
+
},
190
198
},
191
199
},
192
200
{
@@ -242,6 +250,10 @@ func main() {
242
250
Name: "jsonparser, j",
243
251
Usage: "Display results by JSON parser",
244
252
},
253
+
cli.StringFlag{
254
+
Name: "serviceaccount, sa",
255
+
Usage: "Value is filename and path of credentials.json which was retrieved by creating Service Account.",
256
+
},
245
257
},
246
258
},
247
259
{
@@ -312,6 +324,10 @@ func main() {
312
324
Name: "jsonparser, j",
313
325
Usage: "Display results by JSON parser",
314
326
},
327
+
cli.StringFlag{
328
+
Name: "serviceaccount, sa",
329
+
Usage: "Value is filename and path of credentials.json which was retrieved by creating Service Account.",
330
+
},
315
331
},
316
332
},
317
333
{
@@ -341,6 +357,10 @@ func main() {
341
357
Name: "jsonparser, j",
342
358
Usage: "Display results by JSON parser",
343
359
},
360
+
cli.StringFlag{
361
+
Name: "serviceaccount, sa",
362
+
Usage: "Value is filename and path of credentials.json which was retrieved by creating Service Account.",
363
+
},
344
364
},
345
365
},
346
366
{
@@ -366,6 +386,81 @@ func main() {
366
386
Name: "jsonparser, j",
367
387
Usage: "Display results by JSON parser",
368
388
},
389
+
cli.StringFlag{
390
+
Name: "serviceaccount, sa",
391
+
Usage: "Value is filename and path of credentials.json which was retrieved by creating Service Account.",
392
+
},
393
+
},
394
+
},
395
+
{
396
+
Name: "permissions",
397
+
Aliases: []string{"p"},
398
+
Usage: "Manage file permissions.",
399
+
Description: "In this mode, an access token is required.",
400
+
Action: managePermissions,
401
+
Flags: []cli.Flag{
402
+
cli.StringFlag{
403
+
Name: "fileid, fi",
404
+
Usage: "Value is file ID. This value is required.",
405
+
},
406
+
cli.StringFlag{
407
+
Name: "permissionid, pi",
408
+
Usage: "Value is permission ID. This ID can be retrieved by retrieving permission list.",
409
+
},
410
+
cli.BoolFlag{
411
+
Name: "create, c",
412
+
Usage: "Create new permissions.",
413
+
},
414
+
cli.BoolFlag{
415
+
Name: "delete, d",
416
+
Usage: "Delete permissions. fileId and permissionId are required.",
417
+
},
418
+
cli.StringFlag{
419
+
Name: "role",
420
+
Usage: "The role granted by this permission. While new values may be supported in the future, the following are currently allowed: owner, organizer, fileOrganizer, writer, commenter, reader",
421
+
},
422
+
cli.StringFlag{
423
+
Name: "type",
424
+
Usage: "The type of the grantee. Valid values are: user, group, domain, anyone",
425
+
},
426
+
cli.StringFlag{
427
+
Name: "emailaddress, email",
428
+
Usage: "The email address of the user or group to which this permission refers.",
429
+
},
430
+
cli.BoolFlag{
431
+
Name: "transferownership, transfer",
432
+
Usage: "Whether to transfer ownership to the specified user and downgrade the current owner to a writer. This parameter is required as an acknowledgement of the side effect. (Default: false)",
433
+
},
434
+
cli.BoolFlag{
435
+
Name: "jsonparser, j",
436
+
Usage: "Display results by JSON parser",
437
+
},
438
+
cli.StringFlag{
439
+
Name: "serviceaccount, sa",
440
+
Usage: "Value is filename and path of credentials.json which was retrieved by creating Service Account.",
441
+
},
442
+
},
443
+
},
444
+
{
445
+
Name: "driveinformation",
446
+
Aliases: []string{"di"},
447
+
Usage: "Get drive information.",
448
+
Description: "In this mode, an access token is required.",
449
+
Action: getDriveInformation,
450
+
Flags: []cli.Flag{
451
+
cli.StringFlag{
452
+
Name: "fields, f",
453
+
Usage: "Fields for retrieving files.",
454
+
Value: "storageQuota,user",
455
+
},
456
+
cli.BoolFlag{
457
+
Name: "jsonparser, j",
458
+
Usage: "Display results by JSON parser",
459
+
},
460
+
cli.StringFlag{
461
+
Name: "serviceaccount, sa",
462
+
Usage: "Value is filename and path of credentials.json which was retrieved by creating Service Account.",
0 commit comments