CLI Reference
Complete command reference for the gpm CLI.
Installation
The GasPackᵐ CLI requires Node.js 18 or later.
Install globally
npm install -g @gaspackm/gpm Verify installation
$ gpm --version
1.0.1
Get help
# General help
gpm --help
# Command-specific help
gpm install --helpAuthentication
Log in to access private packages and publish your own.
Login
$ gpm login
Starting secure authentication flow...
Opening browser for authentication...
Browser opened successfully
Waiting for authentication in browser...
Authentication successful!
Welcome, you.gmail.com!
Check current user
gpm whoami Logout
gpm logout | Command | Description |
|---|---|
gpm login | Authenticate with Google account |
gpm login --token <token> | Login with a token directly |
gpm logout | Clear stored credentials |
gpm whoami | Show current authenticated user |
Project Commands
Commands for managing dependencies in your Apps Script project.
| Command | Description |
|---|---|
gpm init | Initialize GasPackᵐ in existing project |
gpm create project <name> | Create a new project from scratch |
gpm install | Install all dependencies from gpm.json |
gpm install <package> | Install a package |
gpm install <package> --ver <version> | Install specific version |
gpm install <package> --save-dev | Install as dev dependency |
gpm uninstall <package> | Remove a package |
gpm update | Update all packages |
gpm update <package> | Update specific package |
gpm list | List installed packages |
gpm list --verbose | Show detailed package info |
gpm list --exports | Show module exports |
gpm audit | Check for security issues |
gpm build | Bundle project with dependencies |
gpm build --check-updates | Check for available updates during build |
gpm build --strict-deps | Turn dependency warnings into errors |
Build options
| Flag | Description |
|---|---|
--minify | Minify module code with terser |
--compact | Compact metadata (single-line header/manifest) |
--no-header | Exclude documentation header from bundle |
--no-manifest | Exclude __GASPACKM__ runtime manifest |
--strip-comments | Strip comments from module code |
--check-updates | Check for available non-breaking updates |
--strict-deps | Turn dependency warnings into build errors |
Package Commands
Commands for creating and managing packages.
| Command | Description |
|---|---|
gpm create package <name> | Create a new package |
gpm create module <name> | Add a module to existing package |
gpm create module <name> --namespace <NS> | Create module with specific namespace |
gpm add | Add OAuth scopes or Advanced Services (interactive) |
gpm remove | Remove scopes or services (interactive) |
gpm scopes | List configured scopes and services |
gpm scopes --verbose | Show detailed scope information |
gpm build | Build package for publishing |
gpm verify | Verify package integrity |
gpm bump <module> <type> | Bump module version (package auto-calculated) |
gpm bump <mod> <type> <mod> <type> | Bump multiple modules at once |
gpm publish | Publish to registry |
gpm publish --access public | Publish as public package |
gpm publish --dry-run | Preview without publishing |
gpm link | Link package globally for local testing |
gpm link <package> | Link a global package into current project |
gpm unlink <package> | Remove package link |
Dependency commands
| Command | Description |
|---|---|
gpm dep add <mod> --dep <ref> | Add dependency by canonical ref (@scope/pkg/mod) |
gpm dep add <mod> --dep-ns <ns> | Add dependency by namespace (registry lookup) |
gpm dep remove <mod> --dep <ref> | Remove a dependency |
gpm dep list <mod> | List dependencies for a module |
gpm dep detect <mod> | Scan code and suggest missing dependencies |
Create options
| Flag | Description |
|---|---|
--description <desc> | Package description |
--author <name> | Author name |
--license <license> | License (default: MIT) |
--module <name> | Initial module name (default: base) |
--namespace <NS> | Module namespace in ALL_CAPS |
--no-interactive | Skip prompts, use defaults |
Registry Commands
Commands for searching and viewing packages in the registry.
| Command | Description |
|---|---|
gpm search <query> | Search for packages |
gpm search <query> --limit <n> | Limit results (default: 20) |
gpm search <query> --json | Output as JSON |
gpm info <package> | View package details |
gpm info <package> --ver <version> | View specific version |
gpm info <package> --json | Output as JSON |
Configuration
| Command | Description |
|---|---|
gpm config list | Show all configuration |
gpm config get <key> | Get configuration value |
gpm config set <key> <value> | Set configuration value |
gpm config delete <key> | Delete configuration value |
Environment variables
Set GPM_REGISTRY_URL to use a custom registry.