Ask extension.dev for a shareable URL to a project you already have there.
publish is a thin client. It does not compile, package, or upload anything. It sends one authenticated request to the platform and prints the URL the platform answers with.
When to use publish
- Sending a reviewer a link to a build instead of a zip file.
- Wiring a share link into CI after
build produced the artifacts.
- Pinning a share link to one specific build rather than the project’s latest.
publish resolves a project that already exists on extension.dev, so it needs a build the platform recorded. To send someone the build sitting in your own dist/ right now, upload that build instead: Share an unpublished build for review.
publish talks to the extension.dev platform, which is a separate product
from Extension.js. The Extension.js commands that run on your machine
(create, dev, build, preview, start) never need an account.
publish does.
The path argument is accepted for symmetry with the other commands and does not select what gets published. The project is whatever your access token is scoped to.
Token requirement
publish refuses to run without an access token. Provide it in one of two ways:
EXTENSION_DEV_TOKEN in the environment (preferred for CI).
--token <token> on the command line.
Without either, the command prints No token. and exits with code 1 before any network call happens. Create a token from the extension.dev dashboard or the project access-tokens API, documented in Access tokens.
The token carries the workspace and project it belongs to, which is why publish needs no project flags.
Arguments and flags
What it prints
Pretty output is a single line, the share URL, so it pipes cleanly:
--output json prints the raw response, which carries more than the URL:
With --build-sha, the URL points at that build instead of the project overview: https://<workspace>.extension.dev/<project>/builds/<sha>.
Public and private projects
The platform decides what kind of link you get:
Pinning to a build
--build-sha links to one build instead of the project’s latest. The platform verifies the sha against the project’s build index and answers with a 404 and an UNKNOWN_BUILD code when no completed build matches, so a typo fails loudly instead of producing a link to the wrong artifact.
Examples
Publishing from CI
A short-lived link for one reviewer
Behavior notes
publish never compiles. Run build first when you want the link to point at fresh output.
- Every failure path exits with code
1: a missing token, an unreachable platform, or any non-2xx response, which is printed as publish failed (<status>): <message>.
--api accepts a base URL with or without a trailing slash. The command appends /api/cli/publish itself.
--ttl is clamped by the platform to the 1 to 168 hour range.
Next steps