apps-script-clasp-workflowlisted
Install: claude install-skill bootgs/skills
# Apps Script clasp Workflow
## Auth
```bash
clasp login # interactive, opens a browser
clasp login --no-localhost # headless/CI — prints a URL to visit, then paste the resulting code back
```
Produces `~/.clasprc.json`. In CI, inject this file from a secret — never commit it; it's a live OAuth credential.
## Project setup
```bash
clasp create --type standalone --title "My Project" # new project
clasp clone <scriptId> # existing project
```
`.clasp.json` fields that matter:
| Field | Purpose |
|---|---|
| `scriptId` | Target Apps Script project — the single most important field to get right per environment (see Multi-environment below) |
| `rootDir` | Directory clasp pushes from, e.g. `"./dist/appsscript"` — point it at your **build output**, not source, if you bundle |
| `filePushOrder` | Files pushed first, before the rest — `appsscript.json` is commonly listed here since manifest changes should land before code that depends on new scopes/services |
## Push vs. deploy — the distinction that causes silent "my fix isn't live" bugs
- `clasp push` updates the project's **HEAD** (the editor/dev version). Anyone opening the script editor sees it immediately. It does **not** affect any existing versioned deployment.
- `clasp deploy` creates or updates a **versioned deployment** with a stable URL/ID. A web app or add-on installed by end users runs whatever version its deployment points at — pushing new code does nothing for