chrome-webstore-upload-cli
raw JSON → 3.5.0 verified Sat Apr 25 auth: no javascript
CLI tool for uploading, updating, and publishing Chrome Extensions to the Chrome Web Store. The current stable version is 3.5.0, requiring Node >=18. The v4 pre-release (v4.0.0-0) requires Node 20+ and removes CLI flags for secrets, using only environment variables. Key differentiators: it's a simple, single-purpose CLI that automates packaging and deployment, supporting both .zip and .crx files. The project has frequent minor releases (3.0.0 went stable in late 2022) and is actively maintained by Fregante. Alternatives like chrome-webstore-upload (programmatic) or web-ext have different focus areas.
Common errors
error Error: The --source flag can only be used with the 'upload' command ↓
cause Using --source with 'publish' command (v4+)
fix
Use
chrome-webstore-upload upload --source=file to upload, then chrome-webstore-upload publish to publish. error Error: Missing required environment variable: CHROME_WEBSTORE_CLIENT_ID ↓
cause Secrets not set (v4+ only ENV) or wrong variable name
fix
Set the required environment variables: CHROME_WEBSTORE_CLIENT_ID, CHROME_WEBSTORE_CLIENT_SECRET, CHROME_WEBSTORE_REFRESH_TOKEN, and CHROME_WEBSTORE_EXTENSION_ID.
error Error: source file not found: extension.zip ↓
cause The --source path is incorrect or the file doesn't exist
fix
Check the path passed to --source; it can be relative or absolute. Ensure the file exists.
Warnings
breaking v4.0.0-0 requires Node 20+ ↓
fix Upgrade Node.js to version 20 or later.
breaking v4.0.0-0 removes CLI flags for secrets; use environment variables only ↓
fix Set CHROME_WEBSTORE_CLIENT_ID, CHROME_WEBSTORE_CLIENT_SECRET, CHROME_WEBSTORE_REFRESH_TOKEN, and CHROME_WEBSTORE_EXTENSION_ID as env variables.
breaking v3.0.0 requires Node 18+ ↓
fix Upgrade Node.js to version 18 or later.
deprecated --auto-publish flag removed in v4 ↓
fix Use just `chrome-webstore-upload` (no command) to upload and publish in one step.
gotcha --source flag is forbidden when using the publish command; use upload or no command ↓
fix Use `chrome-webstore-upload upload --source=file` or `chrome-webstore-upload publish` (no --source).
Install
npm install chrome-webstore-upload-cli yarn add chrome-webstore-upload-cli pnpm add chrome-webstore-upload-cli Imports
- bin (CLI) wrong
require('chrome-webstore-upload-cli')correctnpx chrome-webstore-upload-cli --help - CLI commands wrong
chrome-webstore-upload --source=...correctchrome-webstore-upload upload --source=extension.zip --extension-id=xxx --client-id=...
Quickstart
export CHROME_WEBSTORE_EXTENSION_ID=abc123def456
CHROME_WEBSTORE_CLIENT_ID=your-client-id
CHROME_WEBSTORE_CLIENT_SECRET=your-client-secret
CHROME_WEBSTORE_REFRESH_TOKEN=your-refresh-token
npx chrome-webstore-upload-cli upload --source extension.zip