`clasp` is the [[Google Apps Script]] [[command line interface|CLI]] which lets you develop Apps Script projects locally rather than within the online Apps Script editor. This allows you to use [[git]] for version control and work within your [[interactive development environment|IDE]] of choice.
The `clasp` [codelab](https://codelabs.developers.google.com/codelabs/clasp/#0) is a good place to start learning about `clasp`. Follow this [walk through](https://developers.google.com/apps-script/guides/clasp) to try it out. Using `clasp` is very similar to using [[git]] with [[GitHub]].
## Common clasp commands
| **Clasp command** | **Result** |
| ---------------------------- | ------------------------------------------------- |
| `clasp login` | login to your Google account |
| `clasp create <scriptTitle>` | create a new project |
| `clasp clone <scriptID>` | clone an existing project |
| `clasp pull` | download project files |
| `clasp push` | upload project files |
| `clasp open` | open the script project in the Apps Script editor |
| `clasp logout` | logout of your Google account |
## installation
Install `clasp` with [[npm]]. You must have [[Node.js]] installed.
```bash
npm install @google/clasp -g
```
## basic workflow
This workflow describes how to start using `clasp` from an existing project.
- In your browser, navigate to the existing Google Apps Script project.
- In the left sidebar, click the **Project Settings** (gear icon).
- Under IDs, copy the Script ID.
- In Windows Explorer, navigate to the desired directory to clone the existing project.
- Right-click to open the context menu and select **Git Bash Here**.
- Clone the project
```bash
clasp clone <scriptID>
```
- Download the Apps Script project.
```bash
clasp pull
```
- Edit files in your IDE of choice.
- Push files back to the Apps Script project.
```bash
clasp push
```
## project organization
You can use directories as you would with other projects. In the Apps Script IDE, rename the file as if it were a path like `scripts/js.html`. For more ideas on how to organize your project, see [[project organization]].
> [!tip]- Additional Resources
> - [Get __it Done! YT: Develop Google Apps Script Locally in VSCode using CLASP](https://www.youtube.com/watch?v=lwxiEB-Mnys)