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

@predictengine/cli

v1.0.1

Published

PredictEngine institutional trading CLI

Readme

@predictengine/cli

Command-line interface for PredictEngine's institutional trading API. Trade prediction markets, monitor positions, track whales, and more — all from your terminal.

Installation

# Install globally from npm
npm install -g @predictengine/cli

# Or install from source
git clone https://github.com/imblocksavvy-spec/predictengine-frontend.git
cd predictengine-frontend/cli
npm install
npm run build
npm link

Quick Start

# 1. Configure your API credentials
pe config

# 2. Check API health
pe health

# 3. Browse markets
pe markets --limit 10

# 4. Place a trade
pe order buy --token <TOKEN_ID> --price 0.55 --size 100

Configuration

Credentials are stored in ~/.predictengine/config.json (permissions: 600).

Interactive Setup

pe config

With Flags

pe config --key YOUR_API_KEY --secret YOUR_API_SECRET

Environment Variables

You can also set credentials via environment variables (these take precedence over the config file):

export PE_API_KEY=your_api_key
export PE_API_SECRET=your_api_secret

View Current Config

pe config --show

Commands

Market Data

# List markets
pe markets
pe markets --limit 50 --category crypto
pe markets --search "bitcoin" --active

# Market details
pe market <MARKET_ID>

# L2 orderbook
pe orderbook <TOKEN_ID>

# Price movers
pe movers

# Volume leaders
pe volume

Trading

# Place buy order
pe order buy --token <TOKEN_ID> --price 0.55 --size 100
pe order buy --token <TOKEN_ID> --price 0.55 --size 100 --type market

# Place sell order
pe order sell --token <TOKEN_ID> --price 0.75 --size 50

# Cancel order
pe order cancel <ORDER_ID>

# List open orders
pe orders
pe orders --status pending --market <MARKET_ID>

Portfolio

# Portfolio summary (balance, exposure, P&L)
pe portfolio

# Open positions
pe positions
pe positions --status open

# P&L breakdown
pe pnl
pe pnl --group-by day
pe pnl --group-by month

# Trade history
pe trades --limit 100
pe trades --export csv

Intelligence

# Whale alerts
pe whales --limit 20

# Market news
pe news --limit 10 --category crypto

# Fee schedule
pe fees

System

# API health check
pe health

# Show help
pe --help
pe order --help

JSON Output

Every command supports the --json flag for raw JSON output, useful for scripting:

pe markets --json | jq '.markets[0]'
pe positions --json > positions.json
pe portfolio --json | jq '.total_pnl'

Authentication

The CLI uses HMAC-SHA256 signed requests. Each request includes:

  • X-PE-API-KEY — Your API key
  • X-PE-TIMESTAMP — Unix timestamp
  • X-PE-SIGNATURE — HMAC-SHA256 of {timestamp}{method}{path}{body}

Public endpoints (markets, orderbook, movers, volume, news, whales, health) work without authentication. Trading endpoints (orders, positions, portfolio, pnl, trades, fees) require valid credentials.

Examples

Monitor a Market

# Watch orderbook for a token
watch -n 5 'pe orderbook <TOKEN_ID> --json | jq "{best_bid: .bids[0], best_ask: .asks[0]}"'

Export Daily Trades

pe trades --limit 1000 --export csv

Quick Portfolio Check

pe portfolio && pe positions

Scripting with JSON Output

# Get total P&L
TOTAL_PNL=$(pe portfolio --json | jq -r '.total_pnl')
echo "Total P&L: $TOTAL_PNL"

# Count open positions
OPEN=$(pe positions --json | jq '.positions | length')
echo "Open positions: $OPEN"

Development

# Install dependencies
npm install

# Run in development mode
npm run dev -- markets --limit 5

# Build
npm run build

# Run built version
npm start -- health

Requirements

  • Node.js >= 18.0.0
  • PredictEngine API credentials (get them at https://predictengine.ai/dashboard/settings)

API Base URL

Default: https://api.predictengine.ai/api/v2

Override via config or environment variable:

pe config --url https://custom-api-url.com/api/v2
# or
export PE_BASE_URL=https://custom-api-url.com/api/v2

License

MIT