@google/clasp 3.1.0 → 3.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -0
- package/build/src/auth/serverless_auth_code_flow.js +4 -2
- package/docs/run.md +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# Clasp
|
|
2
2
|
|
|
3
|
+
Note: This is not an officially support Google product.
|
|
4
|
+
|
|
3
5
|

|
|
4
6
|
<a href="https://coveralls.io/github/google/clasp?branch=master"><img src="https://coveralls.io/repos/github/google/clasp/badge.svg?branch=master" alt="Coverage Status"></a>
|
|
5
7
|
<a href="https://www.npmjs.com/package/@google/clasp"><img src="https://img.shields.io/npm/v/@google/clasp.svg" alt="npm Version"></a>
|
|
@@ -64,6 +66,18 @@ Then enable the Google Apps Script API: https://script.google.com/home/usersetti
|
|
|
64
66
|
|
|
65
67
|

|
|
66
68
|
|
|
69
|
+
### Installing as a Gemini CLI Extension
|
|
70
|
+
|
|
71
|
+
You can install clasp as an Gemini CLI extensions using the following command:
|
|
72
|
+
|
|
73
|
+
```sh
|
|
74
|
+
gemini extensions install https://github.com/google/clasp
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
This makes clasp available as an MCP server in Gemini CLI.
|
|
78
|
+
|
|
79
|
+
Make sure to enable the Google Apps Script API (as explained above) and perform a `clasp login` (with your specific login parameters) before you use the extension.
|
|
80
|
+
|
|
67
81
|
## Commands
|
|
68
82
|
|
|
69
83
|
The following command provide basic Apps Script project management.
|
|
@@ -44,12 +44,14 @@ export class ServerlessAuthorizationCodeFlow extends AuthorizationCodeFlow {
|
|
|
44
44
|
* @throws {Error} If the pasted URL contains an error or no code.
|
|
45
45
|
*/
|
|
46
46
|
async promptAndReturnCode(authorizationUrl) {
|
|
47
|
-
const
|
|
47
|
+
const urlMessage = intl.formatMessage({ id: "7EHKbR", defaultMessage: [{ type: 0, value: "\uD83D\uDD11 Authorize clasp by visiting this url: " }, { type: 1, value: "url" }] }, {
|
|
48
48
|
url: authorizationUrl,
|
|
49
49
|
});
|
|
50
|
+
console.log(urlMessage);
|
|
51
|
+
const promptMessage = intl.formatMessage({ id: "xADuBP", defaultMessage: [{ type: 0, value: "After authorizing, copy the URL from your browser and paste it here:" }] });
|
|
50
52
|
const answer = await inquirer.prompt([
|
|
51
53
|
{
|
|
52
|
-
message:
|
|
54
|
+
message: promptMessage,
|
|
53
55
|
name: 'url',
|
|
54
56
|
type: 'input',
|
|
55
57
|
},
|
package/docs/run.md
CHANGED
|
@@ -67,7 +67,7 @@ After setup, you can remotely execute Apps Script functions from `clasp`:
|
|
|
67
67
|
|
|
68
68
|
If you get an "Script API executable not published/deployed." error, deploy your script as an API Executable:
|
|
69
69
|
|
|
70
|
-
- Run `clasp open`
|
|
70
|
+
- Run `clasp open-script`
|
|
71
71
|
- Click `Deploy > New deployment`
|
|
72
72
|
- Select type ⚙ > API Executable
|
|
73
73
|
- Type a `Description`
|
|
@@ -79,7 +79,7 @@ Many Apps Script functions require special OAuth Scopes (Gmail, Drive, etc.).
|
|
|
79
79
|
|
|
80
80
|
To run functions that use these scopes, you must add the scopes to your Apps Script manifest and `clasp login` again.
|
|
81
81
|
|
|
82
|
-
- `clasp open`
|
|
82
|
+
- `clasp open-script`
|
|
83
83
|
- `File > Project Properties > Scopes`
|
|
84
84
|
- Add these [scopes to your `appsscript.json`](https://developers.google.com/apps-script/concepts/scopes#set-explicit).
|
|
85
85
|
- Log in again: `clasp login --user <name> --use-project-scopes --creds creds.json`. This will add these scopes to your credentials.
|