create-macro
v0.1.7
Published
Create GAS projects with clasp in one command
Maintainers
Readme
create-macro
A CLI tool for quickly setting up Google Apps Script (GAS) projects.
Installation
npm create macroor
npx create-macroUsage
Interactive Mode
npm create macroFollow the prompts to configure your project:
- Project name
- Language (TypeScript / JavaScript)
- Whether to auto-create a GAS project
- Project type (standalone, sheets, docs, forms, slides, webapp)
Non-Interactive Mode
npm create macro my-project -- --yesCreates a project with default values:
- Language: TypeScript
- Create GAS project: Yes
- Project type: standalone
Options
| Option | Short | Description |
|--------|-------|-------------|
| --yes | -y | Skip all prompts with default values |
| --help | -h | Show help |
| --version | -v | Show version |
Generated File Structure
my-project/
├── src/
│ ├── main.ts (or main.js)
│ └── appsscript.json
├── dist/ (generated after build)
├── .clasp.json
├── .gitignore
├── package.json
└── tsconfig.json (TypeScript only)Workflow
# Create project
npm create macro my-project
# Change directory
cd my-project
# Build
npm run build
# Push to GAS
npm run push
# (Optional) Open in browser
npm run openPrerequisites
- Node.js >= 18
- Google account
- Google Apps Script API enabled (see below)
Enabling GAS API
To auto-create GAS projects, you need to enable the Google Apps Script API:
- Visit https://script.google.com/home/usersettings
- Turn on "Google Apps Script API"
License
MIT
