Crossdeck University
Watch — the build-time jobs, scripted into your pipeline Film in production
0:00 / 0:00
Lesson 2 of 3 · Server & frameworks

The CLI

Some Crossdeck work belongs in your pipeline, not your app code — uploading source maps after a build, checking your setup before you ship. The CLI is the tool for those build-time jobs.

3 min CLI · CI

When you're done: you can run Crossdeck's build-time tasks from your terminal and wire them into CI.

1 What this is & why it matters

The jobs that happen at build time, not run time

Not everything is an SDK call from inside your app. Uploading source maps after a production build, sanity-checking your integration before a release, wiring a Crossdeck step into your deploy — these are build-time jobs, and they belong in your terminal and your CI pipeline. The CLI is the single tool that runs them.

2 How to use it

Install, authenticate, run

Install it globally (or call it with npx), and authenticate by putting your secret key in the environment — which is exactly how a CI secret store hands it to a job:

npm install -g @cross-deck/cli
export CROSSDECK_SECRET_KEY=cd_sk_live_…   # from your CI secret store

crossdeck --version
crossdeck doctor          # check your setup and surface problems early
crossdeck upload-sourcemaps --release "$GIT_SHA" --url-prefix https://your.app/assets/ ./dist
3 How it works, piece by piece

Environment-authenticated, CI-shaped

The CLI reads CROSSDECK_SECRET_KEY from the environment — not a flag you'd leave in your shell history, not a value committed to the repo. That's deliberate: it's the exact shape every CI secret store expects, so the same command runs identically on your laptop and in a pipeline. crossdeck doctor validates your configuration and tells you what's off before a release does. And upload-sourcemaps is the build-time half of the Source maps lesson — the step you run after each build.

If you'd rather drive it from a build script than a shell, the same functionality is importable programmatically (import { uploadSourcemaps } from "@cross-deck/cli"), so it composes into whatever your pipeline already looks like.

4 The green result

A clean doctor, maps shipping from CI

Run crossdeck doctor and get a clean bill of health; add upload-sourcemaps to your deploy job and every release ships its maps automatically. The build-time side of Crossdeck is now part of your pipeline, not a manual step you'll forget.

ci · @cross-deck/cli
doctor ok · maps uploaded

Authenticated from the CI secret store, doctor green and source maps uploaded for release $GIT_SHA — every build, no hands.

npm install -g @cross-deck/cli, authenticate with CROSSDECK_SECRET_KEY in the environment, then crossdeck doctor to check your setup and crossdeck upload-sourcemaps in your deploy job. Environment-authenticated by design, so the same command runs on your laptop and in CI — and it's importable programmatically too.