Skip to content

Latest commit

 

History

History
141 lines (95 loc) · 5.27 KB

README.md

File metadata and controls

141 lines (95 loc) · 5.27 KB

Chrome Web Store CLI

deno version GitHub Release Release codecov Open in Visual Studio Code

cwc is an easy-to-use command-line program for uploading & publishing your extensions and themes to the Chrome Web Store.

If you're looking for programmatic access to the APIs behind this, you might want to check out cwa.

Installation

You can download the latest version of the CLI for your platform from the Releases page.

If you use Deno, you can also directly compile from source and install cwc using the command —

deno install --quiet --allow-read --allow-write --allow-net=www.googleapis.com --allow-env --name cwc https://deno.land/x/[email protected]/mod.ts

Usage

  Usage:   cwc
  Version: 1.1.0

  Description:

    Upload & publish extensions and themes to the Chrome Web Store

  Options:

    -h, --help                            - Show this help.
    -V, --version                         - Show the version number for this program.
    -i, --id             <id>             - ID of the extension or theme on the Chrome Web Store  (required)
    -c, --client-id      <client-id>      - Google API OAuth2 client ID                           (required)
    -s, --client-secret  <client-secret>  - Google API OAuth2 client secret                       (required)
    -r, --refresh-token  <refresh-token>  - Google API OAuth2 refresh token                       (required)

  Commands:

    upload   - Upload directory or ZIP file to Chrome Web Store
    publish  - Publish last upload to Chrome Web Store

🗜 Auto-Zip support

Note that cwc supports both files and directories for upload. If a directory is provided as a source, it is automatically compressed into a ZIP file for upload.

🕵🏼 Debugging

To debug the program or to get detailed logs, set the environment variable DEBUG to *. For example, if you're a *Nix user, use the command —

DEBUG=* cwc <your options>

Permissions

The app needs a few permissions –

Permission Reason
--allow-read Read files to upload
--allow-write To write temporary files when creating ZIP archive before upload
--allow-env To detect the system's temporary files directory and to optionally get DEBUG options
--allow-net=www.googleapis.com To upload/publish the item on the Chrome Web Store

Recipes

  1. Upload and auto-publish your extension
    cwc upload --file "<path-to-extension>" --id "<extension-id>" --client-id "<client-id>" --client-secret "<client-secret>" --refresh-token "<refresh-token>" --auto-publish
    
  1. Publish the last uploaded version of your extension
    cwc publish --id "<extension-id>" --client-id "<client-id>" --client-secret "<client-secret>" --refresh-token "<refresh-token>"
    
  1. Publish the last uploaded version of your extension but only to trusted testers
    cwc publish --id "<extension-id>" --client-id "<client-id>" --client-secret "<client-secret>" --refresh-token "<refresh-token>" --trusted-testers
    

Developer Notes

1.Useful deno shorthand scripts and Git hooks are set up with velociraptor. You can view a list of the commands using –

vr

Make a release

  1. Create a tag.
git tag v0.0.0 -s -a -m "Release v0.0.0"
  1. Push the tag to Github.
git push --tags
  1. Find the newly created tag on the Tags page and Edit the release to include the changelog.
  2. Publish the release. This triggers the workflow that attaches pre-built binaries to the release as attachments 🥳

License

The code in this project is released under the MIT License.

FOSSA Status