CLI · Section CLI-01

PEGD CLI

Terminal-first metrology for stablecoin issuers.

INSTALL

Build from source

git clone https://github.com/pegd-money/pegd
cd pegd
pnpm install
pnpm -r build

Requires Node.js 18 or newer and pnpm. pnpm -r build compiles the workspace in dependency order and bundles the CLI to packages/cli/dist/cli.js. Run it directly with node packages/cli/dist/cli.js --help.

DOWNLOAD

Prebuilt bundle

A self-contained npm tarball. The @pegd/* workspace logic is bundled in, so it installs and runs with no monorepo checkout:

npm i -g @pegd/cli

Published on npm as @pegd/cli. The pegd command works globally after install. Or install the downloaded tarball with npm i -g ./pegd-0.1.0.tgz.

Instrument commands

8 verbs
ISSUANCE · 01

pegd issue

Command
$ pegd issue "My USD" --peg USD --collateral crypto

Prepare a new stablecoin issuance plan under a crypto over-collateralization policy.

MINT · 02

pegd mint

Command
$ pegd mint --mint <pubkey> --amount 10000

Mint stable tokens against deposited collateral once the ratio floor clears.

REDEMPTION · 03

pegd burn

Command
$ pegd burn --mint <pubkey> --amount 5000

Burn stable tokens to reclaim collateral from the vault.

RESERVES · 04

pegd reserves

Command
$ pegd reserves <mint>

Query the live collateral ratio, supply, and reserve breakdown for a mint.

ATTESTATION · 05

pegd por

Command
$ pegd por <mint>

Fetch the latest signed proof-of-reserve attestation for a mint.

RISK · 06

pegd stress

Command
$ pegd stress --mode crypto --collateral 1300000 --issued 1000000 --shock 30

Model a downside shock against a collateral position and inspect breaker behavior.

CONFIG · 07

pegd config

Command
$ pegd config

Print the current CLI configuration: RPC, wallet, program id, and cluster.

CONFIG · 08

pegd config:set

Command
$ pegd config:set --rpc <url> --cluster mainnet-beta

Update the stored CLI configuration values.

PEGD.SDK

TypeScript SDK

The same issuance primitives the CLI uses are exposed as typed methods on @pegd/sdk. Compose an issuer into your own service.

import { PegdIssuer } from '@pegd/sdk';

const issuer = new PegdIssuer(connection, wallet, config);
const snapshot = await issuer.fetchReserveSnapshot(mint);

@pegd/sdk is the TypeScript surface in the monorepo (packages/sdk-ts); the CLI is a thin wrapper over it.

CI EXAMPLE

Reserves guard

Wire proof-of-reserve into CI. This example workflow builds the CLI and prints reserves; parse the output to fail the build when the ratio drops below a floor.

# .github/workflows/reserves.yml (example)
- uses: actions/checkout@v4
- run: pnpm install --frozen-lockfile
- run: pnpm -r build
- run: node packages/cli/dist/cli.js reserves ${{ secrets.PEGD_MINT }}

Adapt the steps in .github/workflows/reserves.yml and schedule them on a cron.