<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>
<a href="https://www.npmjs.com/package/@google/clasp"><img src="https://img.shields.io/npm/v/@google/clasp.svg" alt="npm Version"></a>
<a href="https://npmcharts.com/compare/@google/clasp?minimal=true"><img src="https://img.shields.io/npm/dw/@google/clasp.svg" alt="npm Downloads"></a>
<a href="https://david-dm.org/google/clasp" title="dependencies status"><img src="https://david-dm.org/google/clasp/status.svg"/></a>
<a href="https://github.com/google/gts" title="Code Style: Google"><img src="https://img.shields.io/badge/code%20style-google-blueviolet.svg"/></a>
<!-- GIF bash prompt: PS1='\[\033[38;5;9m\]❤ \[$(tput sgr0)\]' --> <!-- Width: 888px --> <!-- Commands: clasp create "Hello" ls echo 'function hello() { Logger.log("Hello, Apps Script!"); }' >> hello.js clasp push clasp deploy rm .clasp.json appsscript.json hello.js clear -->Develop Apps Script projects locally using clasp (Command Line Apps Script Projects).

To get started, try out the codelab!
You can also try clasp in Gitpod, a one-click online IDE for GitHub:
🗺️ 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.
🔢 Manage Deployment Versions: Create, update, and view your multiple deployments of your project.
📁 Structure Code: clasp automatically converts your flat project on script.google.com into folders. For example:
tests/slides.gstests/sheets.gstests/
slides.jssheets.js🔷 Write Apps Script in TypeScript: Write your Apps Script projects using TypeScript features:
➡️ Run Apps Script: Execute your Apps Script from the command line. Features:
- V8 support take advantage of the performance boost of Chrome JavaScript engine:
appsscript.json manifest to choose between the Rhino and V8 enginestsconfig.json with the "target": "ES2019" compiler optionFirst download clasp:
npm install -g @google/clasp
Then enable the Google Apps Script API: https://script.google.com/home/usersettings

The following command provide basic Apps Script project management.
Note: Most of them require you to
clasp loginandclasp create/clonebefore using the rest of the commands.
clasp
clasp login [--no-localhost] [--creds <file>] [--status]clasp logoutclasp create [--title <title>] [--type <type>] [--rootDir <dir>] [--parentId <id>]clasp clone <scriptId | scriptURL> [versionNumber] [--rootDir <dir>]clasp pull [--versionNumber]clasp push [--watch] [--force]clasp status [--json]clasp open [scriptId] [--webapp] [--creds] [--addon] [--deploymentId <id>]clasp deploymentsclasp deploy [--versionNumber <version>] [--description <description>] [--deploymentId <id>]clasp undeploy [deploymentId] [--all]clasp version [description]clasp versionsclasp listNOTE: These commands require you to add your Project ID.
clasp logs [--json] [--open] [--setup] [--watch] [--simplified]clasp apis listclasp apis enable <api>clasp apis disable <api>clasp setting <key> [value]NOTE: This command requires you to bring your own Google API credentials.
Logs the user in. Saves the client credentials to a .clasprc.json file.
--no-localhost: Do not run a local server, manually enter code instead.--creds <file>: Use custom credentials used for clasp run. Saves a .clasprc.json file to current working directory. This file should be private!--status: Print who you are currently logged in as, if anyone.clasp login --no-localhostclasp login --creds creds.jsonclasp login --statusLogs out the user by deleting client credentials.
clasp logoutCreates a new script project. Prompts the user for the script type if not specified.
--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.--title <title>: A project title.--rootDir <dir>: Local directory in which clasp will store your project files. If not specified, clasp will default to the current directory.--parentId <id>: A project parent Id.
https://docs.google.com/presentation/d/{id}/editclasp createclasp create --type standalone (default)clasp create --type docsclasp create --type sheetsclasp create --type slidesclasp create --type formsclasp create --type webappclasp create --type apiclasp create --title "My Script"clasp create --rootDir ./distclasp create --parentId "1D_Gxyv*****************************NXO7o"These options can be combined like so:
clasp create --title "My Script" --parentId "1D_Gxyv*****************************NXO7o" --rootDir ./distClones the script project from script.google.com.
scriptId | scriptURL: The script ID or script URL to clone.--versionNumber <number>: The version of the script to clone.--rootDir <dir>: Local directory in which clasp will store your project files. If not specified, clasp will default to the current directory.clasp clone "15ImUCpyi1Jsd8yF8Z6wey_7cw793CymWTLxOqwMka3P1CzE5hQun6qiC"clasp clone "https://script.google.com/d/15ImUCpyi1Jsd8yF8Z6wey_7cw793CymWTLxOqwMka3P1CzE5hQun6qiC/edit"clasp clone "15ImUCpyi1Jsd8yF8Z6wey_7cw793CymWTLxOqwMka3P1CzE5hQun6qiC" --rootDir ./srcFetches a project from either a provided or saved script ID. Updates local files with Apps Script project.
--versionNumber <number>: The version number of the project to retrieve.clasp pullclasp pull --versionNumber 23Force writes all local files to script.google.com.
Warning: Google
scriptsAPIs do not currently support atomic nor per file operations. Thus thepushcommand always replaces the whole content of the online project with the files being pushed.
Ignores files:
..claspignore file)-f --force: Forcibly overwrites the remote manifest.-w --watch: Watches local file changes. Pushes files every few seconds.clasp pushclasp push -fclasp push --watchLists files that will be written to the server on push.
Ignores files:
.--json: Show status in JSON form.clasp statusclasp status --jsonOpens the current directory's clasp project on script.google.com. Provide a scriptId to open a different script. Can also open web apps.
[scriptId]: The optional script project to open.--webapp: Open web application in a browser.--creds: Open the URL to create credentials.--addon: List parent IDs and open the URL of the first one.--deploymentId <id>: Use custom deployment ID with --webapp.clasp openclasp open "15ImUCpyi1Jsd8yF8Z6wey_7cw793CymWTLxOqwMka3P1CzE5hQun6qiC"clasp open --webappclasp open --credsclasp open --addonclasp open --webapp --deploymentId abcd1234List deployments of a script.
clasp deploymentsCreates a version and deploys a script. The response gives the deployment ID and the version of the deployment.
For web apps, each deployment has a unique URL. To update/redeploy an existing deployment, provide the deployment ID.
-V <version> --versionNumber <version>: The project version to deploy at.-d <description> --description <description>: The deployment description.-i <id> --deploymentId <id>: The deployment ID to redeploy.clasp deploy (create new deployment and new version)clasp deploy --versionNumber 4 (create new deployment)clasp deploy --description "Updates sidebar logo." (deploy with description)clasp deploy --deploymentId abcd1234 (redeploy and create new version)clasp deploy -V 7 -d "Updates sidebar logo." -i abdc1234Undeploys a deployment of a script.
[deploymentId]: An optional deployment ID.-a --all: Undeploy all deployments.clasp undeploy (undeploy the last deployment.)clasp undeploy "123"clasp undeploy --allCreates an immutable version of the script.
description: description The description of the script version.clasp versionclasp version "Bump the version."List versions of a script.
clasp versionsLists your most recent Apps Script projects.
clasp list: Prints helloworld1 – xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ...NOTE: These commands require Project ID/credentials setup (see below).
Prints out most recent the StackDriver logs. These are logs from console.log, not Logger.log.
--json: Output logs in json format.--open: Open StackDriver logs in a browser.--setup: Setup StackDriver logs.--watch: Retrieves the newest logs every 5 seconds.--simplified: Removes timestamps from the logs.clasp logs ERROR Sat Apr 07 2019 10:58:31 GMT-0700 (PDT) myFunction my log error INFO Sat Apr 07 2019 10:58:31 GMT-0700 (PDT) myFunction info message
clasp logs --jsonclasp logs --openclasp logs --watchclasp logs --simplifiedRemotely executes an Apps Script function.
The complete step-by-step information on how to use clasp run is available here: Run
Below is a short summary:
clasp login --creds creds.json), see: Run - Prerequisitesappsscript.json. Be sure it's pushed:"executionApi": { "access": "ANYONE" }
<functionName>: The name of the function in the script that you want to run.--nondev: If true, runs the function in non-devMode.-p <paramString> --params <paramString>: A JSON string array of parameters to pass to the functionclasp run 'sendEmail'clasp run 'addOptions' -p '["string", 123, {"test": "for"}, true]'List available APIs. Enables and disables Google APIs.
Lists Google APIs that can be enabled as Advanced Services.
clasp apisclasp apis listEnables or disables APIs with the Google Cloud project. These APIs are used via services like GmailApp and Advanced Services like BigQuery.
The API name can be found using clasp apis list.
clasp apis enable driveclasp apis disable driveOpen the Google Cloud Console where you can view and manage API access.
clasp apis --openDisplays the help function.
claspclasp helpUpdate .clasp.json settings file.
If settingKey is omitted it prints the current settings.
If newValue is omitted it returns the current setting value.
settingKey: settingKey The key in .clasp.json you want to changenewValue: newValue The new value for the settingclasp settingclasp setting scriptIdclasp setting scriptId new-id.claspignore)Like .gitignore, .claspignore allows you to ignore files that you do not wish to not upload on clasp push. Steps:
.claspignore in your project's root directory.clasp push. Note: The .claspignore patterns are applied by multimatch, which is different from .gitignore, especially for directories. To ignore a directory, use syntax like **/node_modules/**.A sample .claspignore ignoring everything except the manifest and


职场AI,就用扣子
AI办公助手,复杂任务高效处理。办公效率低?扣子空间AI助手支持播客生成、PPT制作、网页开发及报告写作,覆盖科研、商业、舆情等领域的专家Agent 7x24小时响应,生活工作无缝切换,提升50%效率!


多风格AI绘画神器
堆友平台由阿里巴巴设计团队创建,作为一款AI驱动的设计工具,专为设计师提供一站式增长服务。功能覆盖海量3D素材、AI绘画、实时渲染以及专业抠图,显著提升设计品质和效率。平台不仅提供工具,还是一个促进创意交流和个人发展的空间,界面友好,适合所有级别的设计师和创意工作者。


零代码AI应用开发平台
零代码AI应用开发平台,用户只需一句话简单描述需求,AI能自动生成小程序、APP或H5网页应用,无需编写代码。


免费创建高清无水印Sora视频
Vora是一个免费创建高清无水印Sora视频的AI工具


最适合小白的AI自动化工作流平台
无需编码,轻松生成可复用、可变现的AI自动化工作流

大模型驱动的Excel数据处理工具
基于大模型交互的表格处理系统,允许用户通过对话方式完成数据整理和可视化分析。系统采用机器学习算法解析用户指令,自动执行排序、公式计算和数据透视等操作,支持多种文件格式导入导出。数据处理响应速度保持在0.8秒以内,支持超过100万行数据的即时分析。


AI辅助编程,代码自动修复
Trae是一种自适应的集成开发环境(IDE),通过自动化和多元协作改变开发流程。利用Trae,团队能够更快速、精确地编写和部署代码,从而提高编程效率和项目交付速度。Trae具备上下文感知和代码自动完成功能,是提升开发效率的理想工具。


AI论文写作指导平台
AIWritePaper论文写作是一站式AI论文写作辅助工具,简化了选题、文献检索至论文撰写的整个过程。通过简单设定,平台可快速生成高质量论文大纲和全文,配合图表、参考文献等一应俱全, 同时提供开题报告和答辩PPT等增值服务,保障数据安全,有效提升写作效率和论文质量。

