<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试衣效果最好的软件。使用先进AIGC能力为电商卖家批量提供优质的、低成本的商拍图。合作品牌有Shein、Lazada、安踏、百丽等65个国内外头部品牌,以及国内10万+淘宝、天猫、京东等主流平台的品牌商家,为卖家节省将近85%的出图成本,提升约3倍出图效率,让品牌能够快速上架。


企业专属的AI法律顾问
iTerms是法大大集团旗下法律子品牌,基于最先进的大语言模型(LLM)、专业的法律知识库和强大的智能体架构,帮助企业扫清合规障碍,筑牢风控防线,成为您企业专属的AI法律顾问。


稳定高效的流量提升解决方案,助力品牌曝光
稳定高效的流量提升解决方案,助力品牌曝光


最新版Sora2模型免费使用,一键生成无水印视频
最新版Sora2模型免费使用,一键生成无水印视频


实时语音翻译/同声传译工具
Transly是一个多场景的AI大语言模型驱动的同声传译、专业翻译助手,它拥有超精准的音频识别翻译能力,几乎零延迟的使用体验和支持多国语言可以让你带它走遍全球,无论你是留学生、商务人士、韩剧美剧爱好者,还是出国游玩、多国会议、跨国追星等等,都可以满足你所有需要同传的场景需求,线上线下通用,扫除语言障碍,让全世界的语言交流不再有国界。


选题、配图、成文,一站式创作,让内容运营更高效
讯飞绘文,一个AI集成平台,支持写作、选题、配图、排版和发布。高效生成适用于各类媒体的定制内容,加速品牌传播,提升内容营销效果。


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


最强AI数据分析助手
小浣熊家族Raccoon,您的AI智能助手,致力于通过先进的人工智能技术,为用户提供高效、便捷的智能服务。无论是日常咨询还是专业问题解答,小浣熊都能以快速、准确的响应满足您的需求,让您的生活更加智能便捷。


像人一样思考的AI智能体
imini 是一款超级AI智能体,能根据人类指令,自主思考、自主完成、并且交付结果的AI智能体。


AI数字人视频创作平台
Keevx 一款开箱即用的AI数字人视频创作平台,广泛适用于电商广告、企业培训与社媒宣传,让全球企业与个人创作者无需拍摄剪辑,就能快速生成多语言、高质量的专业视频。
最新AI工具、AI资讯
独家AI资源、AI项目落地

微信扫一扫关注公众号