{"id":52670,"date":"2025-03-12T14:00:00","date_gmt":"2025-03-12T13:00:00","guid":{"rendered":"https:\/\/blog.sheetgo.com\/?p=52670"},"modified":"2025-06-03T22:06:00","modified_gmt":"2025-06-03T20:06:00","slug":"configuracao-do-clasp-para-script-de-aplicativos-do-google","status":"publish","type":"post","link":"https:\/\/www.sheetgo.com\/pt\/blog\/google-sheets-formulas\/clasp-setup-for-google-apps-script\/","title":{"rendered":"Comece a usar o CLASP: Configura\u00e7\u00e3o f\u00e1cil do Google Apps Script"},"content":{"rendered":"\n[et_pb_section fb_built=&#8221;1&#8243; theme_builder_area=&#8221;post_content&#8221; _builder_version=&#8221;4.27.2&#8243; _module_preset=&#8221;default&#8221;][et_pb_row _builder_version=&#8221;4.27.2&#8243; _module_preset=&#8221;default&#8221; theme_builder_area=&#8221;post_content&#8221;][et_pb_column _builder_version=&#8221;4.27.2&#8243; _module_preset=&#8221;default&#8221; type=&#8221;4_4&#8243; theme_builder_area=&#8221;post_content&#8221;][et_pb_text _builder_version=&#8221;4.27.2&#8243; _module_preset=&#8221;default&#8221; theme_builder_area=&#8221;post_content&#8221; hover_enabled=&#8221;0&#8243; sticky_enabled=&#8221;0&#8243;]<blockquote>\n<p><strong>Note:<\/strong> This post was originally published in our community forum.<\/p>\n<\/blockquote>\n<p><span>Looking to supercharge your Google Apps Script development? Meet CLASP\u2014Command Line Apps Script, the tool that lets you write and manage your Google Apps Script projects locally on your computer, with the power of version control and modern development practices.<\/span><\/p>\n<p><span>In this quick guide, we\u2019ll walk you through the steps to get CLASP up and running, so you can start coding like a pro in no time!<\/span><\/p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.27.2&#8243; _module_preset=&#8221;default&#8221; theme_builder_area=&#8221;post_content&#8221; hover_enabled=&#8221;0&#8243; sticky_enabled=&#8221;0&#8243;]<h2>Step 1: Install Node.js and NPM<\/h2>\nBefore you can install CLASP, you need to have Node.js and NPM (Node Package Manager) installed on your machine.\n\n<h3>1. Download and Install Node.js<\/h3>\n<ul>\n\t<li>Go to the<a href=\"https:\/\/nodejs.org\/\" rel=\"ugc noopener nofollow\" target=\"_blank\">Node.js official website<\/a>and download the latest stable version for your operating system.<\/li>\n\t<li>Follow the installation prompts, and make sure NPM is installed along with Node.js. NPM usually comes bundled with Node.js, so you should be all set once the installation is complete.<\/li>\n<\/ul>\n<h3>2. Verify the Installation<\/h3>\n<ul>\n\t<li>Open your command line interface (CLI) and type the following commands to check if Node.js and NPM are installed: bashnode -v npm -v<\/li>\n<\/ul>\n<ul>\n\t<li>If installed correctly, both commands should return version numbers.<\/li>\n<\/ul>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.27.2&#8243; _module_preset=&#8221;default&#8221; theme_builder_area=&#8221;post_content&#8221; hover_enabled=&#8221;0&#8243; sticky_enabled=&#8221;0&#8243;]<h2>Step 2: Install CLASP<\/h2>\nNow that Node.js and NPM are installed, you can install CLASP globally on your machine.\n\n<h3>1. Install CLASP<\/h3>\n<ul>\n\t<li>In your CLI, type the following command: bash npm install -g @google\/clasp<\/li>\n\t<li>This command installs CLASP globally, allowing you to use it from anywhere on your system.<\/li>\n<\/ul>\n<h3>2. Verify the Installation<\/h3>\n<ul>\n\t<li>To confirm that CLASP is installed correctly, run the following command: bash clasp -v<\/li>\n\t<li>You should see the version number of CLASP, indicating a successful installation.<\/li>\n<\/ul>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.27.2&#8243; _module_preset=&#8221;default&#8221; theme_builder_area=&#8221;post_content&#8221; hover_enabled=&#8221;0&#8243; sticky_enabled=&#8221;0&#8243;]<h2>Step 3: Set Up Google Apps Script Project<\/h2>\n\nNow that CLASP is installed, you can set up your Google Apps Script project.\n\n<h3>1. Authenticate CLASP with Your Google Account<\/h3>\n<ul>\n\t<li>Run the following command to log in with your Google account: bash clasp login<\/li>\n\t<li>This will open a browser window asking you to authenticate CLASP with your Google account. Follow the prompts to allow access.<\/li>\n<\/ul>\n<h3>2. Create a New Google Apps Script Project<\/h3>\n<ul>\n\t<li>To create a new project, navigate to your desired directory in the CLI and run: bash clasp create \u2013title \u201cMy New Project\u201d \u2013type standalone<\/li>\n\t<li>Replace `\u201cMy New Project\u201d` with your desired project name. The `\u2013type standalone` flag indicates that this is a standalone script, not bound to any particular Google Document, Spreadsheet, or Form.<\/li>\n<\/ul>\n<h3>3. Pull an Existing Google Apps Script Project (Optional)<\/h3>\n<ul>\n\t<li>If you already have a Google Apps Script project and want to work on it locally, use: bash clasp clone YOUR_SCRIPT_ID<\/li>\n\t<li>Replace `YOUR_SCRIPT_ID` with the script ID of your project. This pulls the project to your local machine.<\/li>\n<\/ul>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.27.2&#8243; _module_preset=&#8221;default&#8221; theme_builder_area=&#8221;post_content&#8221; hover_enabled=&#8221;0&#8243; sticky_enabled=&#8221;0&#8243;]<h2>Step 4: Start Coding and Pushing Changes<\/h2>\nWith your project set up, you can now start coding locally and push your changes back to Google Apps Script.\n\n<h3>1. Write Your Code Locally<\/h3>\n<ul>\n\t<li>Use your favorite code editor (like VS Code) to write your Apps Script code. The files are typically saved as `.gs` (Google Script) or `.js` (JavaScript) files.<\/li>\n<\/ul>\n<h3>2. Push Changes to Google Apps Script<\/h3>\n<ul>\n\t<li>After making changes locally, you can push them to Google Apps Script by running: bash clasp push<\/li>\n\t<li>This command uploads your local changes to the Google Apps Script editor.<\/li>\n<\/ul>\n<h3>3. Pull Changes from Google Apps Script<\/h3>\n<ul>\n\t<li>If you\u2019ve made changes directly in the Google Apps Script editor, pull those changes to your local environment with: bash clasp pull<\/li>\n\t<li>This ensures that your local files are up-to-date with the latest changes.<\/li>\n<\/ul>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.27.2&#8243; _module_preset=&#8221;default&#8221; theme_builder_area=&#8221;post_content&#8221; hover_enabled=&#8221;0&#8243; sticky_enabled=&#8221;0&#8243;]<h2>Step 5: Deploy Your Script<\/h2>\nOnce you\u2019re happy with your script, you can deploy it directly using CLASP.\n\n<h3>1. Deploy as a Web App<\/h3>\n<ul>\n\t<li>To deploy your script as a web app, use the following command: bash clasp deploy \u2013description \u201cInitial deployment\u201d<\/li>\n\t<li>This deploys the latest version of your script and gives you a deployment URL.<\/li>\n<\/ul>\n<h3>2. Manage Deployments<\/h3>\n<ul>\n\t<li>To view all deployments or update an existing deployment, use: bash clasp deployments<\/li>\n\t<li>This command shows all active deployments and their URLs.<\/li>\n<\/ul>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.27.2&#8243; _module_preset=&#8221;default&#8221; theme_builder_area=&#8221;post_content&#8221; hover_enabled=&#8221;0&#8243; sticky_enabled=&#8221;0&#8243;]<h2>Conclusion<\/h2>\n\nWith CLASP, managing your Google Apps Script projects becomes more efficient and scalable. You can now take advantage of version control, local development environments, and seamless deployment processes.\n\nWhether you\u2019re developing a complex script or just getting started, CLASP is a game-changer for Apps Script developers.\n\nReady to take your coding to the next level? Set up CLASP today and start exploring the endless possibilities!<span>\u00a0<\/span>[\/et_pb_text][\/et_pb_column][\/et_pb_row][\/et_pb_section]\n","protected":false},"excerpt":{"rendered":"<p>Note: This post was originally published in our community forum. Looking to supercharge your Google Apps Script development? Meet CLASP\u2014Command Line Apps Script, the tool that lets you write and manage your Google Apps Script projects locally on your computer, with the power of version control and modern development practices. In this quick guide, we\u2019ll [&hellip;]<\/p>\n","protected":false},"author":48,"featured_media":44470,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_et_pb_use_builder":"on","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[54],"tags":[],"class_list":["post-52670","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-google-sheets-formulas"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/posts\/52670","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/users\/48"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/comments?post=52670"}],"version-history":[{"count":0,"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/posts\/52670\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/media\/44470"}],"wp:attachment":[{"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/media?parent=52670"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/categories?post=52670"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/tags?post=52670"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}