Skip to content

Publish from the CLI

extension publish answers with the URL of your project's build page on extension.dev, ready to hand to a tester, a reviewer, or a teammate. Under the hood it posts to /api/cli/publish and prints the URL the platform returns. It uploads nothing and changes nothing: the project's visibility stays whatever it was, and the builds it links are ones the platform already recorded.

What comes back depends on the project's visibility:

  • A public project answers with its canonical public page on the workspace host, https://<workspace>.extension.dev/<project>. That page is public with or without this command, and --ttl does not apply.
  • A private project answers with the same address plus a time-limited ?share= token. The token lives 1 to 168 hours (--ttl, default 24), and the page opens for whoever holds the link while the token lasts.

Two neighbors are different verbs. The revocable 30-day preview link that uploads your local dist/ is minted by sharing an unpublished build for review. Sending an extension to a store is Publishing.

How it relates to the rest of Extension.js

Everything else in Extension.js (dev, logs, inspect, act, the agent bridge) is local and needs no account. Hosted distribution is the single platform surface, and publish is its entry point.

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.

Authentication

publish authenticates with EXTENSION_DEV_TOKEN, a workspace or project access token. Create one in the extension.dev dashboard and provide it via the environment or --token:

bash
EXTENSION_DEV_TOKEN=<token> extension publish
bash
extension publish --token <token>

INFO

Prefer not to copy tokens by hand? Run npx @extension.dev/mcp login --project <workspace>/<project> (or the extension_auth MCP tool with action: "login") to use extension.dev's device flow: you approve the printed code at extension.dev/device in a browser signed in to extension.dev, and a project scoped token is stored locally, so the publish path chooses it up automatically. GitHub is federated server side, so no GitHub token reaches your machine. Precedence: --token flag, then EXTENSION_DEV_TOKEN, then the stored login.

Usage

bash
extension publish [path] [options]

Flags

FlagWhat it doesDefault
--token <token>extension.dev access token (or EXTENSION_DEV_TOKEN).n/a
--ttl <hours>Private-project share token lifetime, 1 to 168. Ignored for public projects.24
--build-sha <sha>Pin the share URL to a specific build.latest
--api <url>Platform base URL (or EXTENSION_DEV_API_URL).https://www.extension.dev
--output <pretty|json>Output format. json prints the full platform response.pretty

Examples

Print a shareable URL for the current project:

bash
EXTENSION_DEV_TOKEN=<token> extension publish

Pin a specific build and, on a private project, keep the token alive for a week, as JSON for scripts:

bash
EXTENSION_DEV_TOKEN=<token> extension publish \
  --build-sha 672c4f2 --ttl 168 --output json

pretty prints just the share URL; json returns the full response (shareUrl, visibility, and, when applicable, expiresAt).

For AI assistants

With the MCP server, this is extension_publish. It posts to the same /api/cli/publish endpoint and returns the same URL, so the agent and the terminal always agree. It reads EXTENSION_DEV_TOKEN from the environment; the MCP server never holds the token itself.

The 30-day preview link is the other MCP verb: extension_preview_web with share: true uploads the local build and mints a revocable ?preview= link. extension_publish never does.

When it fails

  • An auth error: the token is missing, wrong, or expired. Device login tokens live at most 7 days; log in again or set EXTENSION_DEV_TOKEN.
  • The project is not found: publish resolves a project the platform already knows. Connect the repository first, or share the local dist/ via the upload path.
  • You expected a store listing: this command links a build page, it does not submit. Store submission starts at Publishing.
  • You expected a 30-day revocable preview link: that is the upload path, Share an unpublished build for review, not this command.

Next