{"id":13392557,"url":"https://github.com/google/clasp","last_synced_at":"2025-05-14T07:07:57.503Z","repository":{"id":39700240,"uuid":"113111403","full_name":"google/clasp","owner":"google","description":"🔗 Command Line Apps Script Projects","archived":false,"fork":false,"pushed_at":"2025-03-26T19:19:24.000Z","size":3824,"stargazers_count":4922,"open_issues_count":40,"forks_count":446,"subscribers_count":59,"default_branch":"master","last_synced_at":"2025-05-07T06:59:25.584Z","etag":null,"topics":["apps-script","cli","javascript","typescript"],"latest_commit_sha":null,"homepage":"https://developers.google.com/apps-script/guides/clasp","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/google.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-12-05T00:34:56.000Z","updated_at":"2025-05-06T21:57:09.000Z","dependencies_parsed_at":"2024-01-10T20:10:48.428Z","dependency_job_id":"21919c46-3f91-440a-b189-98a606b18978","html_url":"https://github.com/google/clasp","commit_stats":{"total_commits":693,"total_committers":87,"mean_commits":"7.9655172413793105","dds":0.7575757575757576,"last_synced_commit":"551000b55565d20fccc29673c5460022d42ee5cf"},"previous_names":[],"tags_count":49,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fclasp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fclasp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fclasp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fclasp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/google","download_url":"https://codeload.github.com/google/clasp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254092650,"owners_count":22013290,"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":["apps-script","cli","javascript","typescript"],"created_at":"2024-07-30T17:00:27.638Z","updated_at":"2025-05-14T07:07:57.489Z","avatar_url":"https://github.com/google.png","language":"TypeScript","readme":"# Clasp\n\n![build status](https://github.com/google/clasp/actions/workflows/ci.yaml/badge.svg)\n\u003ca href=\"https://coveralls.io/github/google/clasp?branch=master\"\u003e\u003cimg src=\"https://coveralls.io/repos/github/google/clasp/badge.svg?branch=master\" alt=\"Coverage Status\"\u003e\u003c/a\u003e\n\u003ca href=\"https://www.npmjs.com/package/@google/clasp\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/@google/clasp.svg\" alt=\"npm Version\"\u003e\u003c/a\u003e\n\u003ca href=\"https://npmcharts.com/compare/@google/clasp?minimal=true\"\u003e\u003cimg src=\"https://img.shields.io/npm/dw/@google/clasp.svg\" alt=\"npm Downloads\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/google/gts\" title=\"Code Style: Google\"\u003e\u003cimg src=\"https://img.shields.io/badge/code%20style-google-blueviolet.svg\"/\u003e\u003c/a\u003e\n\n\u003e Develop [Apps Script](https://developers.google.com/apps-script/) projects locally using clasp (**C**ommand **L**ine **A**pps **S**cript **P**rojects).\n\n\u003c!-- GIF bash prompt: PS1='\\[\\033[38;5;9m\\]❤  \\[$(tput sgr0)\\]' --\u003e\n\u003c!-- Width: 888px --\u003e\n\u003c!-- Commands:\nclasp create \"Hello\"\nls\necho 'function hello() {\n  Logger.log(\"Hello, Apps Script!\");\n}' \u003e\u003e hello.js\nclasp push\nclasp deploy\nrm .clasp.json appsscript.json hello.js\nclear\n--\u003e\n![clasp](https://user-images.githubusercontent.com/744973/42856573-a5d96d7c-89fa-11e8-9d69-8d2c66f00d8d.gif)\n\n**To get started, try out the [codelab](https://g.co/codelabs/clasp)!**\n\nYou can also try clasp in Gitpod, a one-click online IDE for GitHub:\n\n[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/google/clasp/blob/master/docs/Gitpod/)\n\n## Features\n\n**🗺️ Develop Locally:** `clasp` allows you to develop your Apps Script projects locally. That means you can check-in your code into source control, collaborate with other developers, and use your favorite tools to develop Apps Script.\n\n**🔢 Manage Deployment Versions:** Create, update, and view your multiple deployments of your project.\n\n**📁 Structure Code:** `clasp` automatically converts your flat project on [script.google.com](https://script.google.com) into **folders**. For example:\n\n- _On script.google.com_:\n  - `tests/slides.gs`\n  - `tests/sheets.gs`\n- _locally_:\n  - `tests/`\n    - `slides.js`\n    - `sheets.js`\n\n**➡️ Run Apps Script:** Execute your Apps Script from the command line. Features:\n\n- _Instant_ deployment.\n- Suggested functions Autocomplete (Fuzzy)\n- Easily add custom Google OAuth scopes\n- [And more…](docs/run.md)\n\n## Install\n\nFirst download `clasp`:\n\n```sh\nnpm install -g @google/clasp\n```\n\nThen enable the Google Apps Script API: https://script.google.com/home/usersettings\n\n![Enable Apps Script API](https://user-images.githubusercontent.com/744973/54870967-a9135780-4d6a-11e9-991c-9f57a508bdf0.gif)\n\n## Commands\n\nThe following command provide basic Apps Script project management.\n\n\u003e Note: Most of them require you to `clasp login` and `clasp create/clone` before using the rest of the commands.\n\n```sh\nclasp\n```\n\n- [`clasp login [--no-localhost] [--creds \u003cfile\u003e] [--redirect-port]`](#login)\n- [`clasp logout`](#logout)\n- [`clasp create-script [--title \u003ctitle\u003e] [--type \u003ctype\u003e] [--rootDir \u003cdir\u003e] [--parentId \u003cid\u003e]`](#create)\n- [`clasp clone-script \u003cscriptId | scriptURL\u003e [versionNumber] [--rootDir \u003cdir\u003e]`](#clone)\n- [`clasp pull [--versionNumber]`](#pull)\n- [`clasp push [--watch] [--force]`](#push)\n- [`clasp show-file-status [--json]`](#status)\n- [`clasp open-script`](#open)\n- [`clasp list-deployments`](#deployments)\n- [`clasp create-deployment [--versionNumber \u003cversion\u003e] [--description \u003cdescription\u003e] [--deploymentId \u003cid\u003e]`](#deploy)\n- [`clasp delete-deployment [deploymentId] [--all]`](#undeploy)\n- [`clasp create-version [description]`](#version)\n- [`clasp list-versions`](#versions)\n- [`clasp list-scripts`](#list)\n\n### Advanced Commands\n\n\u003e **NOTE**: These commands require you to add your [Project ID](#projectid-optional).\n\n- [`clasp tail-logs [--json] [--open] [--setup] [--watch] [--simplified]`](#logs)\n- [`clasp list-apis`](#apis)\n- [`clasp enable-api\u003capi\u003e`](#apis)\n- [`clasp disable-api \u003capi\u003e`](#apis)\n- [`clasp run-function [function]`](#clasp-run)\n\n## Guides\n\n### Migrating from 2.x to 3.x\n\n#### Drop typescript support\n\nClasp no longer transpiles typescript code. For typescript projects, use typescript with a bundler like [Rollup](https://rollupjs.org/) to transform code prior to pushing with clasp. This has the advantage of offering more\nrobust support for Typescript features along with ESM module and NPM package support.\n\nThere are several template projects on GitHub that show how to transform Typescript code into Apps Script that are all excellent choices.\n\n* https://github.com/WildH0g/apps-script-engine-template\n* https://github.com/tomoyanakano/clasp-typescript-template\n* https://github.com/google/aside\n* https://github.com/sqrrrl/apps-script-typescript-rollup-starter\n\n\n#### Command renames\n\nClasp 3.x introduces some breaking changes from 2.x. For common use cases these changes should not impact usage, but some lesser used commands have been restructured and renamed to improve consistency.\n\n| 2.x                        | 3.x                                    |\n|----------------------------|----------------------------------------|\n|`open`                        | `open-script`                        |\n|`open --web`                  | `open-web-app`                       |\n|`open --addon`                | `open-container`                     |\n|`open --creds`                | `open-credentials-setup`             |\n|`login --creds \u003cfile\u003e`        | `login -u \u003cname\u003e --creds \u003cfile\u003e`     |\n|`logs --open`                 | `open-logs`                          |\n|`logs --setup`                | N/A                                  |\n|`apis --open`                 | `open-api-console`                   |\n|`apis enable \u003capi\u003e`           | `enable-api \u003capi\u003e`                   |\n|`apis disable \u003capi\u003e`          | `disable-api \u003capi\u003e`                  |\n|`deploy -i \u003cid\u003e`              | `update-deployment \u003cid\u003e`             |\n|`settings`                    | N/A                                  |\n\nOther commands have also been renamed but retain aliases for compatibility.\n\n### Authorization\n\nMost command require user authorization. Run `clasp login` to authorize access to manage your scripts.\n\n#### Multiple user support\n\nUse the global `--user` option to switch between accounts. This supports both running clasp as different users as well as when invoking the `clasp run-function` command.\n\nExamples:\n\n```sh\nclasp login # Saves as default credentials\nclasp clone # User not specified, runs using default credentials\nclasp login --user testaccount # Authorized new named credentials\nclasp run-function --user testaccount myFunction # Runs function as test account\n```\n\n### Bring your own project/credentials\n\nWhile clasp includes a default OAuth client, using your own project is recommend and can improve security and compliance in environments that limit which third party applications users may authorize. To set up your own project:\n\n1. [Create a new project](https://cloud.google.com/resource-manager/docs/creating-managing-projects) in the Google Cloud Developer Console.\n1. [Create an OAuth client](https://support.google.com/cloud/answer/15549257?hl=en#:~:text=To%20create%20an%20OAuth%202.0,are%20yet%20to%20do%20so.). The client type must be `Desktop Application`. Download and save the generated client secrets file. This is required when authorizing using the`clasp login --creds \u003cfilename\u003e` command.\n1. [Enable services](https://cloud.google.com/endpoints/docs/openapi/enable-api). For full functionality, clasp requires the following:\n  * Apps Script API - `script.googleapis.com` (required)\n  * Service Usage API - `serviceusage.googleapis.com` (required to list/enable/disable APIs)\n  * Google Drive API - `drive.googleapis.com` (required to list scripts, create container-bound scripts)\n  - Cloud Logging API - `logging.googleapis.com` (required to read logs)\n\n\nNote: If configuring the project for external use where OAuth scopes must be registered, include the following:\n\n```\nhttps://www.googleapis.com/auth/script.deployments\nhttps://www.googleapis.com/auth/script.projects\nhttps://www.googleapis.com/auth/script.webapp.deploy\nhttps://www.googleapis.com/auth/drive.metadata.readonly\nhttps://www.googleapis.com/auth/drive.file\nhttps://www.googleapis.com/auth/service.management\nhttps://www.googleapis.com/auth/logging.read\nhttps://www.googleapis.com/auth/userinfo.email\nhttps://www.googleapis.com/auth/userinfo.profile\nhttps://www.googleapis.com/auth/cloud-platform\n```\n\n### Allow-list clasp\n\nIf your organization restricts authorization for third-party apps, you may either:\n\n* Request your admin allow-list clasp's client id `1072944905499-vm2v2i5dvn0a0d2o4ca36i1vge8cvbn0.apps.googleusercontent.com`\n* Set up an internal-only GCP project for clasp as described in the previous section.\n\n### Service accounts\n\nUse the `--adc` option on any command to read credentials from the environment using Google Cloud's [application default credentials](https://cloud.google.com/docs/authentication/application-default-credentials) mechanism.\n\nNote that if using a service account, service accounts can not own scripts. To use a service account to push or pull files from Apps Script, the scripts must be shared with the service account with the appropriate role (e.g. `Editor` in able to push.)\n\n\n### Ignore File (`.claspignore`)\n\nLike `.gitignore`, `.claspignore` allows you to ignore files that you do not wish to upload on `clasp push`. Steps:\n\n1. Create a file called `.claspignore` in your project's root directory.\n1. Add patterns to be excluded from `clasp push`. _Note_: The `.claspignore` patterns are applied by [multimatch](https://github.com/sindresorhus/multimatch), which is different from `.gitignore`, especially for directories. To ignore a directory, use syntax like `**/node_modules/**`.\n\nA sample `.claspignore` ignoring everything except the manifest and `build/main.js`:\n\n```text\n**/**\n!build/main.js\n!appsscript.json\n```\n\n_Note_: The `.claspignore` patterns are applied relative from the `rootDir`.\n\nIf no `.claspignore` is specified, a default set of patterns is applied. This default set will only consider the `appsscript.json` manifest and any JavaScript, TypeScript and `.html` source files within the `rootDir` folder. Child folders other than `.git` and `node_modules` are processed.\n\n```text\n# ignore all files…\n**/**\n\n# except the extensions…\n!appsscript.json\n!**/*.gs\n!**/*.js\n!**/*.ts\n!**/*.html\n\n# ignore even valid files if in…\n.git/**\nnode_modules/**\n```\n\n## Project Settings File (`.clasp.json`)\n\nWhen running `clone` or `create`, a file named `.clasp.json` is created in the current directory to describe `clasp`'s configuration for the current project. Example `.clasp.json`:\n\n```json\n{\n  \"scriptId\": \"\",\n  \"rootDir\": \"build/\",\n  \"projectId\": \"project-id-xxxxxxxxxxxxxxxxxxx\",\n  \"fileExtension\": \"ts\",\n  \"filePushOrder\": [\"file1.ts\", \"file2.ts\"]\n}\n```\n\nThe following configuration values can be used:\n\n### `scriptId` (required)\n\nSpecifies the id of the Google Script project that clasp will target. \n\n1. Open script url.\n1. File \u003e Project properties \u003e Script ID\n\n\n### `rootDir` (optional)\n\nSpecifies the **local** directory in which clasp will store your project files. If not specified, clasp will default to the current directory.\n\n### `projectId` (optional)\n\nSpecifies the id of the Google Cloud Platform project that clasp will target.\nYou must [associate Google Script project with Google Cloud Platform](https://github.com/google/clasp/blob/master/docs/run.md#setup-instructions) beforehand.\n\n1. Run `clasp open`.\n1. Click `Resources \u003e Cloud Platform project...`.\n1. Specify the project ID `project-id-xxxxxxxxxxxxxxxxxxx`.\n\nEven if you do not set this manually, clasp will ask this via a prompt to you at the required time.\n\n### `fileExtension` (deprecated, optional)\n\nSpecifies the file extension for **local** script files in your Apps Script project.\n\n### `scriptExtensions` (optional)\n\nSpecifies the file extensions for **local** script files in your Apps Script project. May be a string or array of strings. Files matching the extension will be considered scripts files.\n\nWhen pulling files, the first extension listed is used to write files.\n\nDefaults to `[\".js\", \".gs\"]`\n\n### `htmlExtensions` (optional)\n\nSpecifies the file extensions for **local** HTML files in your Apps Script project. May be a string or array of strings. Files matching the extension will be considered HTML files.\n\nWhen pulling files, the first extension listed is used to write files.\n\nDefaults to `[\".html\"]`\n\n### `filePushOrder` (optional)\n\nSpecifies the files that should be pushed first, useful for scripts that rely on order of execution. All other files are pushed after this list of files, sorted by name.\n\nNote that file paths are relative to directory containing .clasp.json. If `rootDir` is also set, any files listed should include that path as well.\n\n### `skipSubdirectories` (optional)\n\nFor backwards compatibility with previous behavior where subdirectories\nare ignored if a `.claspignore` file is not present. Clasp provides default\nignore rules, making the previous warning and behavior confusing. If you\nneed to force clasp to ignore subdirectories and do not want to construct\na `.claspignore` file, set this option to true.\n\n## Reference\n\n### Global options\n\n- `--user \u003cname\u003e`: Uses credentials stored under the named key. When omitted, the `default` user is used.\n- `--adc`: Uses application default credentials from the environment. Intended to support service accounts in CI workflows.\n- `--project \u003cfile\u003e`: Reads project settings from a file other than `.clasp.json`. Intended to support multiple deployment targets.\n- `--auth \u003cfile\u003e`: (**DEPRECATED**) Reads credentials from a file other than `.clasprc.json`. Use the `--user` option to maintain multiple authorized accounts.\n- `--ignore \u003cfile\u003e`: Reads ignore patterns from a file other than `.claspignore`.\n\n### Login\n\nLogs the user in. Saves the client credentials to a `.clasprc.json` file in the user's home directory\n\n#### Options\n\n- `--no-localhost`: Do not run a local server, manually enter code instead.\n- `--creds \u003cfile\u003e`: Use custom credentials used for `clasp run`. Saves a `.clasprc.json` file to current working directory. This file should be private!\n- `--redirect-port \u003cport\u003e`: Specify a custom port for the local redirect server during the login process. Useful for environments where a specific port is required.\n\n#### Examples\n\n- `clasp login`\n- `clasp login --no-localhost`\n- `clasp login --user test-user --creds client_secret.json`\n- `clasp login --redirect-port 37473`\n\n### Logout\n\nLogs out the user by deleting client credentials.\n\n#### Examples\n\n- `clasp logout`\n\n### Create\n\nCreates a new script project. Prompts the user for the script type if not specified.\n\n#### Options\n\n- `--type [docs/sheets/slides/forms]`: If specified, creates a new add-on attached to a Document, Spreadsheet, Presentation, or Form. If `--parentId` is specified, this value is ignored.\n- `--title \u003ctitle\u003e`: A project title.\n- `--rootDir \u003cdir\u003e`: Local directory in which clasp will store your project files. If not specified, clasp will default to the current directory.\n- `--parentId \u003cid\u003e`: A project parent Id.\n  - The Drive ID of a parent file that the created script project is bound to. This is usually the ID of a Google Doc, Google Sheet, Google Form, or Google Slides file. If not set, a standalone script project is created.\n  - i.e. `https://docs.google.com/presentation/d/{id}/edit`\n\n#### Examples\n\n- `clasp create-script`\n- `clasp create-script --type standalone` (default)\n- `clasp create-script --type docs`\n- `clasp create-script --type sheets`\n- `clasp create-script --type slides`\n- `clasp create-script --type forms`\n- `clasp create-script --type webapp`\n- `clasp create-script --type api`\n- `clasp create-script --title \"My Script\"`\n- `clasp create-script --rootDir ./dist`\n- `clasp create-script --parentId \"1D_Gxyv*****************************NXO7o\"`\n\nThese options can be combined like so:\n\n- `clasp create-script --title \"My Script\" --parentId \"1D_Gxyv*****************************NXO7o\" --rootDir ./dist`\n\n### Clone\n\nClones the script project from script.google.com.\n\n#### Options\n\n- `scriptId | scriptURL`: The script ID _or_ script URL to clone.\n- `--versionNumber \u003cnumber\u003e`: The version of the script to clone.\n- `--rootDir \u003cdir\u003e`: Local directory in which clasp will store your project files. If not specified, clasp will default to the current directory.\n\n#### Examples\n\n- `clasp clone-script \"15ImUCpyi1Jsd8yF8Z6wey_7cw793CymWTLxOqwMka3P1CzE5hQun6qiC\"`\n- `clasp clone-script \"https://script.google.com/d/15ImUCpyi1Jsd8yF8Z6wey_7cw793CymWTLxOqwMka3P1CzE5hQun6qiC/edit\"`\n- `clasp clone-script \"15ImUCpyi1Jsd8yF8Z6wey_7cw793CymWTLxOqwMka3P1CzE5hQun6qiC\" --rootDir ./src`\n\n### Pull\n\nFetches a project from either a provided or saved script ID.\nUpdates local files with Apps Script project.\n\n#### Options\n\n- `--versionNumber \u003cnumber\u003e`: The version number of the project to retrieve.\n\n#### Examples\n\n- `clasp pull`\n- `clasp pull --versionNumber 23`\n\n### Push\n\nForce writes all local files to script.google.com.\n\n\u003e Warning: Google `scripts` APIs do not currently support atomic nor per file operations. Thus the `push` command always **replaces** the whole content of the online project with the files being pushed.\n\nIgnores files:\n\n- That start with a `.`\n- That don't have an accepted file extension\n- That are ignored (filename matches a glob pattern in the `.claspignore` file)\n\n#### Options\n\n- `-f` `--force`: Forcibly overwrites the remote manifest.\n- `-w` `--watch`: Watches local file changes. Pushes files every few seconds.\n\n#### Examples\n\n- `clasp push`\n- `clasp push -f`\n- `clasp push --watch`\n\n### Status\n\nLists files that will be written to the server on `push`.\n\nIgnores files:\n\n- That start with a `.`\n- That don't have an accepted file extension\n- That are ignored (filename matches a glob pattern in the ignore file)\n\n#### Options\n\n- `--json`: Show status in JSON form.\n\n#### Examples\n\n- `clasp show-file-status`\n- `clasp show-file-status --json`\n\n### Open\n\nClasp offers several commands to opens the current directory's `clasp` project and related resources.\n\n\n#### Examples\n\n- `clasp open-script`\n- `clasp open-web-app`\n- `clasp open-container`\n- `clasp open-credentials-setup`\n\n### Deployments\n\nList deployments of a script.\n\n#### Examples\n\n- `clasp list-deployments`\n\n### Deploy\n\nCreates a version and deploys a script.\nThe response gives the deployment ID and the version of the deployment.\n\nFor web apps, each deployment has a unique URL.\nTo update/redeploy an existing deployment, provide the deployment ID.\n\n#### Options\n\n- `-V \u003cversion\u003e` `--versionNumber \u003cversion\u003e`: The project version to deploy at.\n- `-d \u003cdescription\u003e` `--description \u003cdescription\u003e`: The deployment description.\n- `-i \u003cid\u003e` `--deploymentId \u003cid\u003e`: The deployment ID to redeploy.\n\n#### Examples\n\n- `clasp create-deployment` (create new deployment and new version)\n- `clasp create-deployment --versionNumber 4` (create new deployment)\n- `clasp create-deployment --description \"Updates sidebar logo.\"` (deploy with description)\n- `clasp create-deployment --deploymentId abcd1234` (redeploy and create new version)\n- `clasp create-deployment -V 7 -d \"Updates sidebar logo.\" -i abdc1234`\n\n### Redeploy\n\nUpdates an existing deployment. Same as `create-deployment -i id`.\n\n#### Options\n\n- `-V \u003cversion\u003e` `--versionNumber \u003cversion\u003e`: The project version to deploy at.\n- `-d \u003cdescription\u003e` `--description \u003cdescription\u003e`: The deployment description.\n\n#### Examples\n\n- `clasp update-deployment abcd1234` (redeploy and create new version)\n\n### Undeploy\n\nUndeploys a deployment of a script.\n\n#### Options\n\n- `[deploymentId]`: An optional deployment ID.\n- `-a` `--all`: Undeploy all deployments.\n\n#### Examples\n\n- `clasp delete-deployment` (prompts for deployment or deletes if only one)\n- `clasp delete-deployment \"123\"`\n- `clasp delete-deployment --all`\n\n### Version\n\nCreates an immutable version of the script.\n\n#### Options\n\n- `description`: description The description of the script version.\n\n#### Examples\n\n- `clasp create-version`\n- `clasp create-version \"Bump the version.\"`\n\n### Versions\n\nList versions of a script.\n\n#### Examples\n\n- `clasp list-versions`\n\n### List\n\nLists your most recent Apps Script projects.\n\n#### Examples\n\n- `clasp list-scripts`: Prints `helloworld1 – xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ...`\n\n## Advanced Commands\n\n\u003e **NOTE**: These commands require Project ID/credentials setup ([see below](#projectid-optional)).\n\n### Logs\n\nPrints out most recent the _StackDriver logs_. These are logs from `console.log`, not `Logger.log`.\n\n#### Options\n\n- `--json`: Output logs in json format.\n- `--watch`: Retrieves the newest logs every 5 seconds.\n- `--simplified`: Removes timestamps from the logs.\n\n#### Examples\n\n```text\nclasp logs\nERROR Sat Apr 07 2019 10:58:31 GMT-0700 (PDT) myFunction      my log error\nINFO  Sat Apr 07 2019 10:58:31 GMT-0700 (PDT) myFunction      info message\n```\n\n- `clasp logs --json`\n- `clasp logs --watch`\n- `clasp logs --simplified`\n\n### Run\n\nRemotely executes an Apps Script function.\n\nThe complete step-by-step information on how to use `clasp run` is available here: [Run](/docs/run.md)  \nBelow is a short summary:\n\n1. Log in with your credentials (`clasp login --creds creds.json`), see: [Run - Prerequisites](/docs/run.md#prerequisites)\n1. Deploy the Script as an API executable (Easiest done via GUI at the moment).\n1. Enable any APIs that are used by the script, see: [Run - Function with Scopes](/docs/run.md#run-a-function-that-requires-scopes)\n1. Have the following in your `appsscript.json`. Be sure it's pushed:\n\n```json\n\"executionApi\": {\n  \"access\": \"ANYONE\"\n}\n```\n\n#### Options\n\n- `\u003cfunctionName\u003e`: The name of the function in the script that you want to run.\n- `--nondev`: If true, runs the function in non-devMode.\n- `-p \u003cparamString\u003e` `--params \u003cparamString\u003e`: A JSON string array of parameters to pass to the function\n\n#### Examples\n\n- `clasp run-function 'sendEmail'`\n- `clasp run-function 'addOptions' -p '[\"string\", 123, {\"test\": \"for\"}, true]'`\n\n### List/Enable/Disable Google APIs\n\nList available APIs. Enables and disables Google APIs.\n\n#### List APIs\n\nLists Google APIs that can be enabled as [Advanced Services](https://developers.google.com/apps-script/guides/services/advanced).\n\n- `clasp list-apis`\n- `clasp list-apis`\n\n#### Enable/Disable APIs\n\nEnables or disables APIs with the Google Cloud project. These APIs are used via services like GmailApp and Advanced Services like BigQuery.\n\nThe API name can be found using `clasp apis list`.\n\n- `clasp enable-api drive`\n- `clasp disable-api drive`\n\n#### Open APIs Console\n\nOpen the Google Cloud Console where you can view and manage API access.\n\n- `clasp open-api-console`\n\n### Help\n\nDisplays the help function.\n\n#### Examples\n\n- `clasp`\n- `clasp help`\n\n#### Clasp Run\n\n\u003e **NOTE**: This command requires you to [bring your own Google API credentials](/docs/run.md).\n\n- [`clasp run-function [functionName] [--nondev] [--params \u003cStringArray\u003e]`](#run)\n\n## Troubleshooting\n\n### NodeJS Version\n\nThe library requires **NodeJS version \u003e= 22.0.0**.\n\nYou can check your version of NodeJS with this command.\n\n```sh\nnode -v\n```\n\nYou can use these commands to upgrade NodeJS if necessary (**not on Windows**):\n\n```sh\nnpm install -g npm # Update npm and npx\nnpx n latest # use the n package to update node\n```\n\n### Debugging \u0026 filing issues\n\nClasp uses the [debug](https://www.npmjs.com/package/debug) library for internal logging. If you encounter an issue and want to file a bug report, please include a log with debugging enabled. Enable debugging by setting the envionment variable `DEBUG=clasp:*`\n\nExample:\n\n```sh\nDEBUG=clasp:* clasp pull # Runs clasp with verbose debug output\n```\n\n### Using a Proxy\n\nClasp supports proxies via the Google APIs Node Module.\nSee [\"Using a Proxy\"](https://github.com/googleapis/google-api-nodejs-client#using-a-proxy) and [this discussion](https://github.com/google/clasp/issues/8#issuecomment-427560737) for details on how to use the proxy.\nThis requires using the environment variables `HTTP_PROXY` / `HTTPS_PROXY`.\n\n## README Badge\n\nUsing clasp for your project? Add a README badge to show it off: [![clasp](https://img.shields.io/badge/built%20with-clasp-4285f4.svg)](https://github.com/google/clasp)\n\n```md\n[![clasp](https://img.shields.io/badge/built%20with-clasp-4285f4.svg)](https://github.com/google/clasp)\n```\n\n## Develop clasp\n\nSee [the develop guide](docs/develop.md) for instructions on how to build `clasp`. It's not that hard!\n\n## Contributing\n\nThe main purpose of this tool is to enable local Apps Script development.\nIf you have a core feature or use-case you'd like to see, find a GitHub issue or\ncreate a detailed proposal of the use-case.\nPRs are very welcome! See the [issues](https://github.com/google/clasp/issues) (especially **good first issue** and **help wanted**).\n\n⚡ Powered by the [Apps Script API](https://developers.google.com/apps-script/api/).\n","funding_links":[],"categories":["Libraries","cli","TypeScript","TypeScript (19)","Setup (local usage only)","Development","Table of Contents"],"sub_categories":["Lists \u0026 collections","Google Apps Script"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle%2Fclasp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoogle%2Fclasp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle%2Fclasp/lists"}