Skip to main content
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 trade reference to match
  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: