@yhotamos/extension-release-cli
v0.2.1
Published
CLI tool to build, package, and publish Chrome extensions to the Chrome Web Store.
Maintainers
Readme
Extension Release CLI
A CLI tool to pack, upload, and publish Chrome extensions to the Chrome Web Store — all from your terminal.
exr release dist/Features
pack— Zip your extension source directory into a versioned archiveupload— Upload the zip to the Chrome Web Store via APIpublish— Publish the uploaded extension (supports staged rollout)release— Run pack → upload → publish in a single commandstatus— Inspect the live status of your extension on the store- Built-in env file support — powered by dotenvx (bundled, no separate install needed)
Requirements
- Node.js >= 18
Installation
npm install -g @yhotamos/extension-release-cliSetup
1. Google API Credentials
You need OAuth2 credentials to authenticate with the Chrome Web Store API.
- Go to Google Cloud Console and create a project.
- Enable the Chrome Web Store API.
- Create OAuth 2.0 credentials (Desktop app type) and note your
CLIENT_IDandCLIENT_SECRET. - Obtain a
REFRESH_TOKENusing the OAuth2 playground or the Google auth flow.- Scopes required:
https://www.googleapis.com/auth/chromewebstore
- Scopes required:
2. Chrome Web Store IDs
PUBLISHER_ID— Your publisher ID, found in the Chrome Web Store Developer Dashboard URL.EXTENSION_ID— The ID of your extension, found on the extension's dashboard page.
3. Environment File
Create a .env file in your project root:
CLIENT_ID=your_client_id
CLIENT_SECRET=your_client_secret
REFRESH_TOKEN=your_refresh_token
PUBLISHER_ID=your_publisher_id
EXTENSION_ID=your_extension_idYou can also use .env.local (takes precedence over .env), or environment-specific files like .env.production passed via --env:
exr release dist/ --env .env.production[!TIP] Since dotenvx is built in, you can encrypt your env files. This keeps plain-text secrets out of your repository and reduces the risk of AI coding agents (e.g., Claude Code or OpenAI Codex) accidentally reading your plain
.envfiles.npx dotenvx encrypt -f .env.productionThis rewrites the file with encrypted values and generates a
.env.keysfile with the decryption key. The CLI reads.env.keysautomatically. Add.env.keysto.gitignoreand store the key in your CI secrets.
Typical Workflow
# 1. Create your .env file (first time only)
# See the Setup section above for required variables
# 2. Build your extension
npm run build
# 3. Release in one command (.env is loaded automatically)
exr release dist/
# 4. Check the store status afterwards
exr statusOr step by step:
exr pack dist/
exr upload releases/my-extension-1.0.0.zip
exr publishAuthor
yhotta240 https://github.com/yhotta240
