@chainlaunch/pro-cli
v0.1.1
Published
CLI for ChainLaunch Pro blockchain infrastructure platform
Downloads
84
Readme
ChainLaunch CLI
Bun-based CLI for the ChainLaunch blockchain infrastructure platform. Talks directly to the ChainLaunch REST API (/api/v1) — no Go binary required.
bunx @chainlaunch/pro-cli --help
# or install globally
bun add -g @chainlaunch/pro-cli
chainlaunch --helpQuick start
# Authenticate (interactive: prompts for API key or username/password)
chainlaunch login http://localhost:8100
# Or non-interactive, for automation
chainlaunch login http://localhost:8100 --api-key clpro_xxxx
chainlaunch login http://localhost:8100 -u admin -p secret --no-interactive
# Self-signed HTTPS (dev clusters): -k/--insecure is persisted on the context
chainlaunch login https://10.30.0.121:8100 --api-key clpro_xxxx --insecure
chainlaunch whoami
chainlaunch nodes list
chainlaunch networks listCommands
| Command | Description |
|---------|-------------|
| login / logout / whoami | Authentication |
| context (ctx) | Manage multiple server contexts (list, use/switch, current, rename, remove) |
| nodes (n) | List/show/start/stop/restart/delete nodes, tail logs |
| networks (net) | List/show/delete networks; config dumps channel config, map shows joined nodes |
| organizations (orgs) | Manage Fabric organizations (MSPs) |
| chaincodes (cc) | Inspect chaincodes: definitions, container logs, lifecycle timeline |
| keys | List/show/delete cryptographic keys |
| key-providers | List/show key providers (database, AWS KMS, Vault) |
| backups | List backups, targets, and schedules |
| users | List/show users |
| api-keys | List/create/revoke API keys |
| plugins | List plugins and deployment status |
| settings | View server settings |
Every read command supports --json for machine-readable output (spinners and chrome are suppressed, so output pipes cleanly into jq).
Contexts
Log in to multiple ChainLaunch servers and switch between them:
chainlaunch login https://prod.example.com --api-key clpro_xxx -c prod
chainlaunch login http://localhost:8100 -u admin -p secret -c local
chainlaunch context list
chainlaunch context use prod # or: context switch prod
chainlaunch context current # prints just the name (script-friendly)
chainlaunch context rename local dev
chainlaunch context remove prod # local only — does NOT revoke the server-side keyContexts are stored in ~/.chainlaunch-pro-cli/.contexts.json (mode 0600). The active-context marker in context list honors CHAINLAUNCH_CONTEXT, so it always shows what the next command will actually use.
Environment variables
| Variable | Purpose |
|----------|---------|
| CHAINLAUNCH_API_URL | Override server URL (highest priority) |
| CHAINLAUNCH_API_KEY / CHAINLAUNCH_TOKEN | API key for CI / automation (sent as Bearer) |
| CHAINLAUNCH_USERNAME / CHAINLAUNCH_PASSWORD | Basic-auth credentials |
| CHAINLAUNCH_CONTEXT | Pin a context for this shell without mutating the active flag |
| CHAINLAUNCH_INSECURE | Set to 1 to skip TLS certificate verification (self-signed certs) |
Resolution order everywhere: env vars → active context → legacy secrets file.
Development
bun install
bun run dev -- --help # run from source
bun run typecheck
bun run build # bundle to dist/ (node target, for npm)
bun run build:bin # compile a standalone binary to bin/chainlaunch
bun run generate:api # regenerate src/api from openapi.jsonTo refresh the API SDK after backend changes, copy chainlaunch-pro/docs/swagger.json over openapi.json, convert it (the spec is Swagger 2.0, the generator wants OpenAPI 3):
bunx swagger2openapi --patch openapi.json -o openapi.json
bun run generate:api