Reference
CLI
Create releases and upload source maps with the openperf command.
The openperf CLI ships with @openperf/sdk and runs on Node.js 24.11.1 or later. Use it in CI to register releases and upload browser source maps.
npx openperf releases create [--ref <commit>]
npx openperf sourcemaps upload <directory> [--url-prefix <prefix>]Configuration
Every command needs four values. Pass them as environment variables (recommended in CI) or override any of them with a flag:
| Flag | Environment variable | Description |
|---|---|---|
--url <url> | OPENPERF_URL | Base URL of your OpenPerf API (e.g. https://api.example.com). |
--token <token> | OPENPERF_AUTH_TOKEN | Write-scoped API token starting with opt_. |
--project <id> | OPENPERF_PROJECT | Project ID (the last segment of the project settings URL). |
--release <version> | OPENPERF_RELEASE | Release version. Up to 200 characters, no spaces or slashes. |
Commands
openperf releases create
Creates the release if it doesn't exist yet and links the project to it.
npx openperf releases create --ref "$(git rev-parse HEAD)"Prop
Type
- Idempotent: re-running keeps the release and updates its commit when
--refis provided. - Run once per project with the same
--releaseto group multiple projects under one release. - Emits the
release.createdwebhook event the first time a project is attached.
openperf sourcemaps upload
Scans a directory recursively and uploads every .map file for the release.
npx openperf sourcemaps upload dist --url-prefix "~/static"Prop
Type
- Relative paths (without
.map) are appended to the prefix:assets/app.js.mapmatches~/assets/app.js. - Re-uploading replaces the previous map for the same release.
- Uploads are batched up to 500 files / 500 MB per request. Files over 50 MB are skipped and cause exit code
1.
Global flags & exit codes
-h,--help— prints usage and exits0.-v,--version— prints the installed@openperf/sdkversion and exits0.- Exits
0on success; exits1on missing/invalid settings, empty directory, skipped oversized map, or API error (Error: <message>on stderr).
Common API errors
API_TOKEN_INVALID— token is wrong, revoked or expired.API_TOKEN_NOT_ALLOWED— token is read-only and cannot write.PROJECT_OUTSIDE_ORGANIZATION— project ID does not belong to the token's organization.RELEASE_VERSION_CONFLICT— version already belongs to another release.SOURCE_MAP_INVALID— uploaded.mapfile is not a valid source map.