Usage
Commands
| Command | Alias | Description |
|---|---|---|
login |
Log in to Google account | |
logout |
Log out from Google account | |
create-script |
create |
Create a new Apps Script project |
clone |
Clone an existing Apps Script project | |
pull |
Download project files from Apps Script | |
push |
Upload project files to Apps Script | |
open-script |
open |
Open the Apps Script project in browser |
create-deployment |
Create a deployment | |
update-deployment |
deploy |
Update an existing deployment |
list-deployments |
List deployments | |
run-function |
Run an Apps Script function remotely | |
convert |
Convert project files (TS ↔ GAS) | |
history |
Show command execution history | |
config init |
Create .clasp.json and .glasp/config.json (fails if .clasp.json exists) |
|
version |
Show version |
Push
glasp push # Push local files
glasp push --force # Ignore .claspignore (.glasp/ is always excluded)
glasp push --archive # Archive pushed files
glasp push --dryrun # Dry run without API calls
TypeScript Support
glasp automatically detects and transpiles .ts files on push, regardless of fileExtension setting in .clasp.json.
.ts→ transpiled to JavaScript via esbuild before push.js,.gs→ passed through unchanged.d.ts→ excluded (not deployable)
History Replay
glasp push --history-id <id> # Re-push from archive
glasp push --history-id <id> --dryrun # Dry run replay
Pull
glasp pull # Pull remote files
glasp pull --archive # Archive pulled files
When fileExtension is "ts", pulled files are automatically converted from GAS JavaScript to TypeScript.
Authentication
Auth tokens are stored at .glasp/access.json (permission 0600).
# A browser opens automatically to start the login flow
glasp login
PKCE
Enable OAuth2 PKCE (RFC 7636) to protect against authorization code interception attacks:
glasp login --pkce
# Or via environment variable
GLASP_USE_PKCE=1 glasp login
PKCE applies only to the interactive glasp login flow.
Reuse clasp credentials
# Reuse clasp credentials. They are imported via `glasp login` and saved to `.glasp/access.json`.
glasp login --auth ~/.clasprc.json
# Or use --auth directly on each command
glasp push --auth ~/.clasprc.json
glasp pull --auth ~/.clasprc.json
glasp clone SCRIPT_ID --auth ~/.clasprc.json
Start using glasp immediately when migrating from clasp — no re-authentication needed.
Auth source priority
--authflag (path to.clasprc.json)- Project cache (
.glasp/access.json) - Interactive login flow
Timeout
You can configure the HTTP request timeout for Script API calls. The default is 180 seconds.
Priority
--no-timeoutflag /GLASP_NO_TIMEOUTenvironment variable (unlimited)--timeoutflag /GLASP_TIMEOUTenvironment variabletimeoutSecondsin.glasp/config.json- Default (180 seconds)
A value of 0 means unset and falls back to the next source. Negative values are invalid: they are ignored and a warning is printed (use --no-timeout to disable the timeout).
Configuration
# Set via CLI flag (seconds)
glasp push --timeout 60
# Set via environment variable
GLASP_TIMEOUT=60 glasp push
# Disable timeout (unlimited)
glasp push --no-timeout
# Disable timeout via environment variable
GLASP_NO_TIMEOUT=1 glasp push
You can also set a project-wide value in .glasp/config.json:
{
"archive": { "pull": false, "push": false },
"timeoutSeconds": 60
}
Retry
glasp retries transient Script API failures (HTTP 5xx, 429, network errors) automatically. Retries apply only to idempotent commands: push, pull, list-deployments, and clone. Non-idempotent commands (create-script, create-deployment, update-deployment, run-function) are never retried to prevent duplicate resource creation.
The default retry count is 3 retries (4 total attempts including the initial attempt).
Priority
--max-retriesflag /GLASP_MAX_RETRIESenvironment variablemaxRetriesin.glasp/config.json- Default (3)
A value of 0 means unset and falls back to the next source. Negative values are invalid: they are ignored and a warning is printed. To disable retries entirely, use --no-retries.
Note:
--no-timeoutand--no-retriesare independent.--no-timeoutdoes not disable retries.http.Client.Timeout(set by--timeout) is a budget for the entire request chain including retries — a short timeout may prevent retries from running.
Configuration
# Increase retry count
glasp push --max-retries 5
# Set via environment variable
GLASP_MAX_RETRIES=5 glasp push
# Disable retries
glasp push --no-retries
# Disable retries via environment variable
GLASP_NO_RETRIES=1 glasp push
You can also set a project-wide value in .glasp/config.json:
{
"archive": { "pull": false, "push": false },
"timeoutSeconds": 60,
"maxRetries": 5
}
Symlinks
By default, push and convert skip symlinked files when collecting local files, instead of reading through the link. This protects against accidentally uploading a file reachable via a symlink that points outside the project (for example, in a project directory shared with other users or tools).
Use --allow-symlinks (or GLASP_ALLOW_SYMLINKS=1) to follow symlinked files. Even with this flag, a symlink whose target resolves outside rootDir — or inside .glasp/ (which holds your auth token and other internal data) — is rejected with an error; it is never silently followed. Symlinked directories are never traversed, with or without the flag.
# Follow symlinked files during push
glasp push --allow-symlinks
# Or via environment variable
GLASP_ALLOW_SYMLINKS=1 glasp push
When a file is skipped (via .claspignore, as a .d.ts declaration file, or as a symlink), push/convert prints a one-line summary, e.g. Skipped 2 file(s): 1 ignored, 1 symlink. Per-file details are available with --log-level debug.
Logging
glasp writes diagnostic logs (warnings, fallback notices, debug traces) to stderr in a structured format. Command results (e.g. Pulled project ...) are regular output and are not affected by these settings.
Options
--log-levelflag /GLASP_LOG_LEVELenvironment variable — minimum level:debug,info(default),warn, orerror--log-formatflag /GLASP_LOG_FORMATenvironment variable — output format:text(default) orjson
# Show OAuth flow progress and other debug traces
glasp login --log-level debug
# Emit machine-readable JSON logs (useful in CI)
GLASP_LOG_FORMAT=json glasp push
# Suppress warnings, show errors only
glasp pull --log-level error
Example output:
# text (default)
time=2026-07-09T10:00:00.000+09:00 level=WARN msg="failed to load .glasp/config.json; using default timeout" default=3m0s
# json
{"time":"2026-07-09T10:00:00+09:00","level":"WARN","msg":"failed to load .glasp/config.json; using default timeout","default":"3m0s"}
Note: OAuth login progress messages (state validation, authorization code receipt) are logged at
debuglevel and hidden by default. Essential instructions — such as the URL to open when the browser cannot be launched — are always printed regardless of the log level.
Configuration
.clasp.json
Standard clasp configuration file. glasp reads the same format:
{
"scriptId": "your-script-id",
"rootDir": "src",
"fileExtension": "ts"
}
glasp config init makes the current directory a project root: it creates .clasp.json and, when missing, .glasp/config.json. If .clasp.json already exists, the command fails without changing any file (an existing .clasp.json is never overwritten). The .clasp.json fields can be set at creation time:
glasp config init --script-id SCRIPT_ID --rootDir src --file-extension ts
--rootDirmust be a relative path inside the project.- An existing
.glasp/config.jsonis kept as is. - Creating
.clasp.jsonhere prevents commands such asglasp loginfrom resolving the project root to a.clasp.jsonin a parent directory (e.g. a stray~/.clasp.json).
.claspignore
Gitignore syntax for excluding files. glasp default excludes:
.glasp/— glasp internal directory (always excluded)node_modules/— npm dependencies
Convert
glasp convert --gas-to-ts # GAS JS → TypeScript
glasp convert --ts-to-gas # TypeScript → GAS JS
glasp convert --ts-to-gas src/main.ts # Convert specific files
History
glasp history # Show all history
glasp history --limit 10 # Last 10 entries
glasp history --status success # Filter by status
glasp history --command push # Filter by command
glasp history --order asc # Oldest first (default: desc)