npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@anmho/kalshi-cli

v0.2.2

Published

Curated terminal-first CLI for Kalshi using the official TypeScript SDK

Readme

kalshi-cli

Terminal-first Kalshi CLI built on the official TypeScript SDK (kalshi-typescript).

npm package: @anmho/kalshi-cli

Official references:

Install

bun install
bun run build

Local binary:

./dist/index.js --help

Install globally on your machine:

bun run install:system
kalshi --help

Install from npm:

npm install -g @anmho/kalshi-cli
kalshi --help

Authentication

Kalshi API auth uses API Key ID + RSA private key signing (no OAuth in current official docs).

Local .env (recommended for development):

cp .env.example .env

Environment variables:

export KALSHI_API_KEY_ID="your-key-id"
export KALSHI_PRIVATE_KEY_PATH="$HOME/.kalshi/kalshi-key.pem"
export KALSHI_BASE_URL="https://api.elections.kalshi.com/trade-api/v2"
export KALSHI_TIMEOUT_MS="10000"

Or persist in CLI config:

kalshi config set apiKeyId your-key-id
kalshi config set privateKeyPath "$HOME/.kalshi/kalshi-key.pem"
kalshi config set baseUrl https://api.elections.kalshi.com/trade-api/v2
kalshi config show

Precedence: CLI flags > environment (.env) > config file > defaults.

Quickstart

Public endpoints (no credentials required):

kalshi ping
kalshi exchange status
kalshi events list --limit 10
kalshi markets list --limit 10

Private endpoints (credentials required):

kalshi portfolio balance
kalshi orders list --limit 20
kalshi account limits
kalshi portfolio settlements --limit 20
kalshi orders queue-positions

Output Modes

  • Default table: human-readable columns
  • Wide table: -o wide
  • JSON: --json or -o json

Examples:

kalshi markets list --limit 5
kalshi markets list --limit 5 -o wide
kalshi markets list --limit 5 --json

Typical default table:

TICKER                   EVENT                STATUS LAST   YES_BID YES_ASK VOLUME
KX...                    KX...                active 0.0000 0.0000  0.0000  0.00

Typical wide table:

TICKER ... OPEN_INTEREST CLOSE_TIME           TITLE
KX...      0.00          2026-04-16T14:00:00Z yes ...

JSON output:

kalshi markets list --limit 2 --json

Commands

  • config: local config management
  • doctor: local config + connectivity checks
  • ping: exchange reachability
  • exchange: status, schedule, announcements
  • events: list/get
  • markets: list/get/orderbook/trades
  • orders: list/get/create/cancel/amend/decrease/queue-position/queue-positions/batch-create/batch-cancel
  • portfolio: balance/positions/fills/settlements/resting-order-value/subaccounts
  • account: API limits

Each subcommand description includes the mapped endpoint (for example GET /markets).

Docs

Docusaurus docs + API reference are in website/.

bun run docs:sync-openapi
bun run docs:dev

Build docs:

bun run docs:build

Deploy docs:

Validation

bun run check
bun run build
bun run test:commands
bun run test:commands:private