Quick Start with the CLI
Deploy a Polkadot Product from your terminal with playground-cli. The pg command pairs with your Polkadot App, builds your Product, uploads the bundle, and publishes it to a dotNS name. No local host setup is required to reach a live deployment.
The CLI is the command-line counterpart to Polkadot Desktop: Desktop runs published Products by their dotNS names; pg takes a project on disk and turns it into one. By the end of this guide, you will have a Product live at its own name, reachable in any browser through the dotNS web gateway.
Before You Start
Section titled “Before You Start”Get these in order before your first deploy. The last two are easy to skip and fail silently later, so do not leave them out:
- Install the Polkadot App on your phone and create an account. It pairs with
pgand signs your deploy. - Have a terminal with
curlavailable and permission to install CLI tools in your user shell. - Have a Product project on disk with a package-manager build command.
- Fund your account with PAS from the faucet. PAS pays transaction fees and the name deposit.
- Get a Bulletin Chain storage authorization for the account that will sign. Without it, uploads are rejected at deploy time even when your balance is fine — a prerequisite that surfaces only as a failed publish. See Get TestNet Tokens.
Install the CLI
Section titled “Install the CLI”The installer supports Linux and macOS. On Windows, work inside WSL and follow the Debian/Ubuntu steps there.
-
Install the base prerequisites. macOS needs no preparation:
curlships with the OS, and the Xcode Command Line Tools cover the rest. On a fresh Debian or Ubuntu system:Terminal window sudo apt update && sudo apt install -y build-essential curl -
Run the installer:
Terminal window curl -fsSL https://raw.githubusercontent.com/paritytech/playground-cli/main/install.sh | bashThe binary lands in
~/.polkadot/bin/, with both commands symlinked into~/.local/bin/and that path appended to your shell RC file. -
Open a new shell, or
sourceyour RC file, and verify the install:Terminal window pg --version
Log In
Section titled “Log In”pg login is the first-run setup: it pairs the CLI with your signer, installs the toolchain, and requests your service allowances. It is safe to re-run; existing installs and sessions are detected and skipped. Do not reach for pg init here — that scaffolds a project from the starter template and pairs nothing.
pg loginThree things happen, and the first two run concurrently:
- Login: A QR code is printed to the terminal. Scan it with the Polkadot App to pair. Skipped if you already have a session under
~/.polkadot-apps/. - Toolchain install:
git,curl, a C linker,rustupwith nightly andrust-src,cargo-pvm-contract,wget, and theipfsCLI (Kubo). Existing installs are detected and skipped. - Account setup: Once a session exists, your phone shows a single approval dialog requesting the
BulletInAllowance(Bulletin uploads at deploy time) andSmartContractAllowance(which mints PGAS to yourplayground.dot/0product account and account-maps it on chain).
pg build auto-detects and runs your project build.
pg buildDeploy
Section titled “Deploy”pg deploy runs the full pipeline: build the frontend, upload artifacts to the Polkadot Bulletin Chain, and register a dotNS domain under the environment's TLD (.paseo on Paseo Next v2). Before building, it always runs your package manager's install step to keep dependencies in sync.
# Interactive - pg prompts for signer, domain, and build directorypg deploy
# Dev signer - no phone needed (the deployed Product is owned by the shared dev account)pg deploy --signer dev --suri //Alice --domain my-productPass the bare label to --domain. The CLI appends the environment's TLD, so my-product becomes my-product.paseo on Paseo Next v2. Name availability depends on the label's length, counted as written; see Choose a Name for the rules the prompt enforces.
For the full interactive deploy walkthrough, including the domain-name rules, contract redeploys, and the confirmation summary, see Deploy Your App.
More CLI commands
Account and session
-
pg status: Prints your signed-in product account in both encodings (SS58 and H160), its PAS and PGAS balances, and the state of your Bulletin and smart-contract allowances. Read-only: it signs nothing and submits nothing, so it is safe to run at any time. With no session paired it prints a "log in first" notice and exits cleanly.Terminal window pg status -
pg drip: Tops up your product account with a little TestNet PAS: 1 PAS per run, up to a 10 PAS cap, from a shared dev funder rather than the public faucet. It only ever funds the caller's own account, resolved from the active session, so there is no address flag. Login never calls it for you.Terminal window pg drip -
pg logout: Signs out of the paired account, tells the paired phone to drop its side of the connection, and clears session files under~/.polkadot-apps/. A no-op if you are not signed in.Terminal window pg logout
Projects and deploys
-
pg init: Scaffolds a new project from the playground starter template. A shorthand forpg mod playground-template.Terminal window pg init -
pg mod: Clones a moddable app from the Playground registry so you can customize and redeploy it as your own Product. Only apps that opted into--moddableat deploy time are listed. Pass a domain label, such asmy-productormy-product.paseo, to clone directly, or omit it to open an interactive picker showing every moddable app. Source is fetched as a tarball over HTTPS, so neithergitnorghis required.Terminal window pg mod [domain] -
pg decentralize: Takes a static site you already have — a live URL to mirror, or a local build directory — uploads it to the Bulletin Chain, and registers a dotNS name pointing at it. The counterpart topg deploy, which builds your project first.Terminal window pg decentralize --site https://example.compg decentralize --path ./dist -
pg deploy-all: Deploys several apps listed in a JSON manifest in one invocation. Builds run in parallel, while all on-chain work is serialized per signing account so concurrent deploys never collide on a nonce. Non-interactive by design.Terminal window pg deploy-all --manifest apps.json --signer dev --playground -
pg contract: The playground-native path to contracts, backed bycdm.pg contract deploybuilds, deploys, and registers your contracts signed by your logged-in account;pg contract installwritescdm.jsonand the generated type outputs. See Add a Smart Contract to Your Product for the workflow, including when to callcdmdirectly instead.Terminal window pg contract deploypg contract install [libraries...] -
pg update: Updatespgto the latest version from the GitHub releases page.Terminal window pg update
You have deployed a Polkadot Product. To keep building it with your own editor and toolchain, head to the Build guides; they open with project setup so Polkadot Desktop can load your Product from localhost while you iterate with live reload.
Where to Go Next
Section titled “Where to Go Next”-
Product SDK
Understand the SDK that powers your Product: what each package does and how the pieces fit together.
-
Build Guides
Set up the local dev loop, then add capabilities to your Product: signing, on-chain reads, decentralized storage, off-chain pub/sub, local persistence, and smart contracts.
-
Deploy Your App
The full deploy flow in depth: build the bundle, register a dotNS name, publish to the playground, and go live on the Bulletin Chain.