Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
86bbc0f
initial scaffolding of cli package
charlesHetterich Apr 7, 2026
4c525d2
Add baseline `dot` CLI with local install and GitHub Release infrastr…
charlesHetterich Apr 8, 2026
eb4753e
ported cli defined in [playground-app](https://github.com/paritytech/…
charlesHetterich Apr 8, 2026
d99a4a4
refactor CLI to final command set: init, remix, build, test, deploy, …
charlesHetterich Apr 8, 2026
bea6384
add temporary CI job for releasing the CLI from this branch
charlesHetterich Apr 8, 2026
3792281
update cli install.sh to be permissioned
charlesHetterich Apr 8, 2026
50ee183
fall back to preview release if no latest stable is availble (current…
charlesHetterich Apr 8, 2026
715be36
update cli to use `~/.polkadot` instead of `~/.dot`
charlesHetterich Apr 9, 2026
ebf63a8
added qr code signing using (currently local) `@polkadot-apps/termina…
charlesHetterich Apr 10, 2026
ec51ff0
wire up QR mobile signing for deploy: bulletin upload, DotNS, and pla…
charlesHetterich Apr 13, 2026
f3396ad
add test coverage
charlesHetterich Apr 13, 2026
f7fe349
removed `test` command
charlesHetterich Apr 13, 2026
726cd1d
more tests & marked @integration for code that shouldn't be inclluded…
charlesHetterich Apr 13, 2026
fc8a498
format
charlesHetterich Apr 13, 2026
cfa67c9
Merge branch 'main' into ch/cli
charlesHetterich Apr 13, 2026
528707b
fix lock file
charlesHetterich Apr 13, 2026
0c3c995
updated dependencies for new bulletin-deploy release
charlesHetterich Apr 13, 2026
dc26385
Merge remote-tracking branch 'origin/main' into ch/cli
charlesHetterich Apr 13, 2026
baeef90
updated lock file
charlesHetterich Apr 13, 2026
12bdbbe
fix cli deploy ci
charlesHetterich Apr 13, 2026
3c1e450
fix ci bundler for patch on `host-papp`
charlesHetterich Apr 13, 2026
f0f6749
fix: strip provenance xattrs during install (may still not be suffici…
ReinhardHatko Apr 14, 2026
a6ab6ef
feat: adding checks for balance and using Alice as default for signing
ReinhardHatko Apr 14, 2026
9c9a96a
updated cli dependencies to include `utils` package, and updated cli'…
charlesHetterich Apr 14, 2026
59aa4c9
using alice as default signer, adding --mobile-signer as option do de…
ReinhardHatko Apr 14, 2026
ad69350
Merge branch 'main' into ch/cli
charlesHetterich Apr 14, 2026
de8aab6
fix lock file
charlesHetterich Apr 14, 2026
79d4b56
fix lock file
charlesHetterich Apr 14, 2026
6d16c72
use new bulletin deploy which has resolved the bun binary compatibili…
charlesHetterich Apr 14, 2026
4deb94c
it looks like because of recent versions of mac os, cross signing for…
charlesHetterich Apr 14, 2026
5a4aeb9
fix ci to use older version of bun which is not broken
charlesHetterich Apr 14, 2026
969a678
Merge remote-tracking branch 'origin/main' into ch/cli
UtkarshBhardwaj007 Apr 14, 2026
dca7f86
revert back to releasing all binaries from single linux process
charlesHetterich Apr 14, 2026
ecfa4d3
updated init command to add cdm
charlesHetterich Apr 14, 2026
5bfa8c3
fix(cli): address code review findings across all commands
UtkarshBhardwaj007 Apr 14, 2026
fb1f414
update install.sh to run `dot init` after installation completes
charlesHetterich Apr 14, 2026
8c26d94
feat(cli): auto-run toolchain setup before deploy/build/remix
UtkarshBhardwaj007 Apr 14, 2026
c7c7483
added automatic account funding & mapping to init command
charlesHetterich Apr 14, 2026
f5ac9a0
formatting
charlesHetterich Apr 14, 2026
623e33f
renaming: "mobile wallet" -> "Polkadot App"
ReinhardHatko Apr 14, 2026
47914b5
adding constants for metadata url and people chain endpoint
ReinhardHatko Apr 14, 2026
da7998a
fix: output of remix with no domain given
ReinhardHatko Apr 14, 2026
4290e1f
Merge remote-tracking branch 'origin/main' into ch/cli
UtkarshBhardwaj007 Apr 14, 2026
d1f4182
chore: update bulletin-deploy to 0.6.3
UtkarshBhardwaj007 Apr 14, 2026
f6538c2
chore: update bulletin-deploy to 0.6.4
UtkarshBhardwaj007 Apr 14, 2026
0daf401
fix: remove stale bulletin-deploy link from package.json
UtkarshBhardwaj007 Apr 14, 2026
193074b
fix best block query in init command, also temporarily disable for demo
charlesHetterich Apr 14, 2026
a1ff57d
fix(cli): suppress contract query warnings and fix remix exit crash
UtkarshBhardwaj007 Apr 14, 2026
f385ad8
fixed dot remix querying to use the logged in signer
charlesHetterich Apr 14, 2026
f8feb0b
remove `session?.destroy` to avoid error in terminal package
charlesHetterich Apr 14, 2026
14d4a9f
add --playground flag to command in dot remix output and flipped --sk…
charlesHetterich Apr 15, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .github/workflows/cli-dev-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: CLI Dev Release

on:
push:
branches: [ch/cli]

permissions:
contents: write

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: "1.2.x"
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: "22"

- run: pnpm install
- run: pnpm build

# Delete previous dev release so we can recreate it
- name: Delete previous dev release
run: gh release delete cli-dev --cleanup-tag -y 2>/dev/null || true
env:
GH_TOKEN: ${{ github.token }}

- name: Compile CLI binaries
run: |
bun build --compile --target=bun-linux-x64 ./apps/cli/src/index.ts --outfile dot-linux-x64
bun build --compile --target=bun-linux-arm64 ./apps/cli/src/index.ts --outfile dot-linux-arm64
bun build --compile --target=bun-darwin-x64 ./apps/cli/src/index.ts --outfile dot-darwin-x64
bun build --compile --target=bun-darwin-arm64 ./apps/cli/src/index.ts --outfile dot-darwin-arm64

- name: Create dev release
uses: softprops/action-gh-release@v2
with:
tag_name: cli-dev
name: CLI Dev Build
prerelease: true
make_latest: false
files: |
dot-linux-x64
dot-linux-arm64
dot-darwin-x64
dot-darwin-arm64
body: |
Dev build from `ch/cli` branch.

Install: `DOT_TAG=cli-dev curl -fsSL https://raw.githubusercontent.com/paritytech/polkadot-apps/ch/cli/install.sh | bash`
35 changes: 35 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ jobs:
echo "found=false" >> $GITHUB_OUTPUT
fi

- if: steps.bot.outputs.skip != 'true' && steps.changesets.outputs.found == 'true'
uses: oven-sh/setup-bun@v2
with:
bun-version: "1.2.x"
- if: steps.bot.outputs.skip != 'true' && steps.changesets.outputs.found == 'true'
uses: pnpm/action-setup@v4
- if: steps.bot.outputs.skip != 'true' && steps.changesets.outputs.found == 'true'
Expand Down Expand Up @@ -124,3 +128,34 @@ jobs:
inputs: '${{ format(''{{ "repo": "{0}", "run_id": "{1}" }}'', github.repository, github.run_id) }}'
env:
GITHUB_TOKEN: ${{ secrets.NPM_PUBLISH_AUTOMATION_TOKEN }}

# Compile CLI binaries for all platforms
- name: Compile CLI binaries
if: steps.bot.outputs.skip != 'true' && steps.changesets.outputs.found == 'true'
run: |
bun build --compile --target=bun-linux-x64 ./apps/cli/src/index.ts --outfile dot-linux-x64
bun build --compile --target=bun-linux-arm64 ./apps/cli/src/index.ts --outfile dot-linux-arm64
bun build --compile --target=bun-darwin-x64 ./apps/cli/src/index.ts --outfile dot-darwin-x64
bun build --compile --target=bun-darwin-arm64 ./apps/cli/src/index.ts --outfile dot-darwin-arm64

- name: Generate CLI release tag
if: steps.bot.outputs.skip != 'true' && steps.changesets.outputs.found == 'true'
id: cli_tag
run: |
VERSION=$(node -p "require('./apps/cli/package.json').version")
TAG="v${VERSION}"
echo "tag=$TAG" >> $GITHUB_OUTPUT
echo "version=$VERSION" >> $GITHUB_OUTPUT

- name: Create GitHub Release
if: steps.bot.outputs.skip != 'true' && steps.changesets.outputs.found == 'true'
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.cli_tag.outputs.tag }}
name: Release ${{ steps.cli_tag.outputs.tag }}
files: |
dot-linux-x64
dot-linux-arm64
dot-darwin-x64
dot-darwin-arm64
generate_release_notes: true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ coverage/
.pnpm-store/
reference-repos/
docs/
.cdm/
24 changes: 23 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,32 @@ Follow the contributor guidelines in `README.md`.
- **Format check:** `pnpm format:check`
- **Generate descriptors:** `pnpm generate-descriptors`
- **Generate docs:** `pnpm docs`
- **Install CLI locally:** `pnpm cli:install`

## CLI

- The CLI lives at `apps/cli/` and installs as `dot`. Compiles to a standalone binary via `bun build --compile`.
- **Dev:** `bun run apps/cli/src/index.ts` (runs TypeScript directly)
- **Local install:** `pnpm cli:install` (builds all packages, compiles binary to `~/.polkadot/bin/dot`)
- **End-user install:** `bash install.sh` (downloads binary from GitHub Releases, uses `gh` for private repo auth)
- The CLI is `private: true` — not published to npm. Distributed as compiled binaries via GitHub Releases.
- Commands are separate files in `apps/cli/src/commands/`, each exporting a `Command` instance registered via `program.addCommand()`.
- Contract ABI (`cdm.json`) is managed by CDM — `postinstall` runs `cdm i` automatically if cdm is available.

**Commands:** `init`, `remix`, `build`, `deploy`, `info`, `update`

| Command | Purpose |
|---------|---------|
| `dot init` | Set up dev environment (Rust toolchain, gh CLI) and authenticate |
| `dot remix [domain]` | Fork an app — interactive picker if no domain, `--quest` flag (stubbed) |
| `dot build` | Detect and build contracts (Rust) and frontend |
| `dot deploy` | Deploy contracts + frontend to Bulletin. `--playground` to also publish to registry |
| `dot info <domain>` | Show detailed app information from the registry |
| `dot update` | Self-update from GitHub Releases |

## Key Conventions

- All packages live in `packages/<name>/` and are scoped under `@polkadot-apps/`.
- All packages live in `packages/<name>/` and are scoped under `@polkadot-apps/`. The CLI lives in `apps/cli/`.
- Use in-source testing (`if (import.meta.vitest)` blocks) for unit tests. Separate `tests/*.test.ts` files are for integration tests only.
- Internal deps use `"workspace:*"`, shared versions use `"catalog:"` from `pnpm-workspace.yaml`.
- Packages must be framework-agnostic pure TypeScript. No React/Vue imports in core packages.
Expand Down
248 changes: 248 additions & 0 deletions apps/cli/cdm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,248 @@
{
"targets": {
"acc2c3b5e912b762": {
"asset-hub": "wss://asset-hub-paseo-rpc.n.dwellir.com",
"bulletin": "https://paseo-ipfs.polkadot.io/ipfs"
}
},
"dependencies": {
"acc2c3b5e912b762": {
"@example/playground-registry": "latest"
}
},
"contracts": {
"acc2c3b5e912b762": {
"@example/playground-registry": {
"version": 6,
"address": "0x279585Cb8E8971e34520A3ebbda3E0C4D77C3d97",
"abi": [
{
"type": "constructor",
"inputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "publish",
"inputs": [
{
"name": "domain",
"type": "string"
},
{
"name": "metadata_uri",
"type": "string"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "unpublish",
"inputs": [
{
"name": "domain",
"type": "string"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "rateApp",
"inputs": [
{
"name": "domain",
"type": "string"
},
{
"name": "rating",
"type": "uint8"
},
{
"name": "comment_uri",
"type": "string"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "removeRating",
"inputs": [
{
"name": "domain",
"type": "string"
},
{
"name": "reviewer",
"type": "address"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "getContextId",
"inputs": [],
"outputs": [
{
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "getAppCount",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint32"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "getDomainAt",
"inputs": [
{
"name": "index",
"type": "uint32"
}
],
"outputs": [
{
"name": "",
"type": "tuple",
"components": [
{
"name": "isSome",
"type": "bool"
},
{
"name": "value",
"type": "string"
}
]
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "getOwnerAppCount",
"inputs": [
{
"name": "owner",
"type": "address"
}
],
"outputs": [
{
"name": "",
"type": "uint32"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "getOwnerDomainAt",
"inputs": [
{
"name": "owner",
"type": "address"
},
{
"name": "index",
"type": "uint32"
}
],
"outputs": [
{
"name": "",
"type": "tuple",
"components": [
{
"name": "isSome",
"type": "bool"
},
{
"name": "value",
"type": "string"
}
]
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "getSudo",
"inputs": [],
"outputs": [
{
"name": "",
"type": "address"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "getMetadataUri",
"inputs": [
{
"name": "domain",
"type": "string"
}
],
"outputs": [
{
"name": "",
"type": "tuple",
"components": [
{
"name": "isSome",
"type": "bool"
},
{
"name": "value",
"type": "string"
}
]
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "getOwner",
"inputs": [
{
"name": "domain",
"type": "string"
}
],
"outputs": [
{
"name": "",
"type": "address"
}
],
"stateMutability": "view"
}
],
"metadataCid": "bafk2bzaceck7veaix4ttzyd6bmwlssgycrrlgilpat2c272nczzlrgnqy6fze"
}
}
}
}
Loading
Loading