Skip to main content
Not yet released. The packages on this page are not published to npm yet, so the install commands below will not resolve. The documented interface is stable and the code exists; only publication is outstanding. To use KeyStone from a frontend today, call the REST API or the TypeScript SDK, which is published. Contact us if you need early access.
The KeyStone CLI helps platform developers during development and debugging. The standout feature is keystone listen which forwards webhooks to your local server without ngrok or tunneling tools.

Installation

Or use without installing:

Login

Authenticate with your M2M credentials. Stored locally in ~/.keystone/config.json.
You’ll be prompted for your client ID and secret. Or pass them as flags:
Set the environment (default: production):

Webhook Forwarding

Forward webhook events to your local development server. No ngrok needed.
This:
  1. Creates a temporary webhook endpoint on KeyStone
  2. Polls for new events
  3. Forwards each event to your local server via HTTP POST
  4. Shows events in your terminal with colored output
  5. Cleans up the temporary endpoint on exit (Ctrl+C)
Example output:

Settlements

List settlements

Example output:

Get settlement detail

Shows state, parties, legs, event timeline, and timeout.

Instructions

List instructions

Submit an instruction interactively

Walks you through an interactive prompt:
  1. Select your role (seller/buyer)
  2. Enter party details (name, reference, wallet)
  3. Enter leg details (instrument, quantity)
  4. Select template
  5. Optionally enter a counterparty trade reference to confirm against
  6. Confirm and submit

Activity Logs

Tail your platform’s activity log:
Example output:

Scaffold a Project

Generate a working starter project:
Creates a Next.js project with:
  • /api/keystone/session - Session token endpoint
  • /api/webhooks/keystone - Webhook handler with signature verification
  • /settlements - Settlement list page using @keystoneos/react
  • /settlements/[id] - Settlement detail page
  • .env.local.example with required environment variables

Configuration

Credentials are stored in ~/.keystone/config.json:
Staging is the environment to integrate against today. https://api-staging.keystoneos.xyz is live and serves testnet settlements. The production host is reserved and not yet serving; requests to it will fail. api-dev is for KeyStone-internal use and does not resolve publicly.