npm package: @gaberoo/kalshitools
Description: CLI for interacting with Kalshi prediction markets API
Author: gaberoo322
Latest version: 1.1.1

# kalshitools

A powerful CLI tool for interacting with the Kalshi prediction markets API. Built for traders, automated systems, and AI agents.

[![oclif](https://img.shields.io/badge/cli-oclif-brightgreen.svg)](https://oclif.io)
[![Version](https://img.shields.io/npm/v/kalshitools.svg)](https://npmjs.org/package/kalshitools)
[![License](https://img.shields.io/npm/l/kalshitools.svg)](https://github.com/kalshitools/kalshitools/blob/main/package.json)

## Features

- 🔐 **Secure Authentication**: RSA-PSS based authentication with secure credential storage
- 📊 **Market Data**: Browse markets, view order books, filter by event/series, batch queries
- 💼 **Portfolio Management**: View balances, positions with P&L, settlement status filtering
- 📈 **Trading**: Place and manage orders with safety features, dry-run mode
- 🤖 **AI-Friendly**: Structured JSON output for automated systems (OpenClaw integration ready)
- 🛡️ **Safety First**: Demo environment default, confirmations, and order limits
- 📈 **Order Book Analysis**: Real-time order depth and liquidity assessment
- 🔍 **Market Discovery**: Event/series filtering, nested markets, multi-ticker batch queries
- 📊 **Portfolio Analytics**: Comprehensive performance metrics, win rate, P&L analysis, fee tracking
- ⚠️ **Risk Management**: Real-time risk assessment, concentration analysis, correlation detection
- 📈 **Historical Analysis**: Time-series performance data, maker/taker statistics, trend analysis
- 🔎 **Market Scanner**: Automated opportunity discovery based on liquidity, spreads, and volume

## Quick Start

### 1. Install

```bash
npm install -g @gaberoo/kalshitools
```

### 2. Get Demo API Credentials

Visit the [Kalshi Demo Portal](https://demo-api.kalshi.co) to generate API credentials:
- **API Key ID**: Your registered email address
- **Private Key**: Download the `.pem` file

### 3. Configure Credentials

**Option A: Interactive Setup (Recommended)**

```bash
# Run the configuration wizard
kalshitools config init

# Follow the prompts:
# - Environment: demo (default)
# - API Key ID: your-email@example.com
# - Private Key Path: ~/.kalshitools/demo-private-key.pem (default)

# Place your private key file
mkdir -p ~/.kalshitools
cp ~/Downloads/private-key.pem ~/.kalshitools/demo-private-key.pem
chmod 600 ~/.kalshitools/demo-private-key.pem  # Secure permissions
```

**Option B: Environment Variables (Quick Testing)**

```bash
# Copy the example file
cp .env.example .env

# Edit .env with your credentials
nano .env

# Source the environment
source .env
```

### 4. Verify Setup

```bash
# Check configuration
kalshitools config show

# Test API connection
kalshitools portfolio balance

# List active markets
kalshitools markets list --status active --limit 5
```

### 5. Start Trading

```bash
# View available markets
kalshitools markets list --status active

# Get market details
kalshitools markets show TICKER-SYMBOL

# View order book for liquidity analysis
kalshitools markets orderbook TICKER-SYMBOL --depth 5

# Discover markets within an event
kalshitools markets list --event-ticker EVENT-ID

# Batch query multiple tickers
kalshitools markets list --tickers "TICKER1,TICKER2,TICKER3"

# View your portfolio
kalshitools portfolio balance
kalshitools portfolio positions

# Filter positions by settlement status
kalshitools portfolio positions --settlement-status open

# Place an order (with confirmation)
kalshitools orders create \
  --ticker MARKET-TICKER \
  --action buy \
  --side yes \
  --quantity 10 \
  --type market

# Use --dry-run to simulate without placing order
kalshitools orders create \
  --ticker MARKET-TICKER \
  --action buy \
  --side yes \
  --quantity 10 \
  --type market \
  --dry-run

# View order history
kalshitools orders list

# Analyze portfolio performance
kalshitools portfolio analytics --period 30 --json

# Check portfolio risk
kalshitools portfolio risk --threshold 20

# View historical performance
kalshitools portfolio history --group-by week

# Scan markets for opportunities
kalshitools markets scan --min-liquidity 200 --min-spread 0.05
```

## Advanced Features for AI Trading Agents

kalshitools provides powerful analytics and scanning capabilities designed for automated trading systems:

### Portfolio Analytics

Get comprehensive performance metrics for strategy evaluation:

```bash
# Full analytics for last 30 days
kalshitools portfolio analytics --period 30 --json

# Custom date range
kalshitools portfolio analytics \
  --min-ts 2026-01-01T00:00:00Z \
  --max-ts 2026-02-01T00:00:00Z \
  --json

# Returns: win rate, avg P&L, total return, exposure ratio, concentration, fees
```

### Risk Management

Real-time risk assessment to prevent over-concentration:

```bash
# Check portfolio risk with 20% position limit
kalshitools portfolio risk --threshold 20 --json

# Analyze concentration by event
kalshitools portfolio risk --group-by event --json

# Returns: risk score, concentrations, correlations, alerts, recommendations
```

### Historical Performance

Deep dive into trading history with time-series analytics:

```bash
# Daily performance breakdown
kalshitools portfolio history --group-by day --json

# Filter by specific market
kalshitools portfolio history --ticker MARKET-A --json

# Returns: time-series data, maker/taker stats, performance by ticker
```

### Market Opportunity Scanner

Discover high-quality trading opportunities:

```bash
# Scan for markets with good liquidity and spreads
kalshitools markets scan \
  --min-liquidity 200 \
  --min-spread 0.05 \
  --max-spread 0.20 \
  --min-volume 1000 \
  --json

# Filter to specific event
kalshitools markets scan --event-ticker EVENT-2024 --json

# Returns: scored opportunities with liquidity, spread, and volume data
```

## Configuration

Configuration is stored at `~/.config/kalshitools/config.json` and can be overridden with environment variables:

```bash
export KALSHI_ENV=demo
export KALSHI_API_KEY_ID=your-email@example.com
export KALSHI_PRIVATE_KEY_PATH=~/.kalshitools/demo-private-key.pem
export LOG_LEVEL=info
```

### Security Notes

- Private keys are **never** committed to the repository
- All `.pem`, `.key`, and `.env` files are in `.gitignore`
- Demo environment is the default (safe for testing)
- Always use `--dry-run` first to verify order parameters
- Store private keys with restricted permissions: `chmod 600`

### Configuration Precedence

1. Environment variables (highest priority)
2. `~/.config/kalshitools/config.json`
3. Default values (demo environment)

<!-- toc -->
* [kalshitools](#kalshitools)
* [Run the configuration wizard](#run-the-configuration-wizard)
* [Follow the prompts:](#follow-the-prompts)
* [- Environment: demo (default)](#--environment-demo-default)
* [- API Key ID: your-email@example.com](#--api-key-id-your-emailexamplecom)
* [- Private Key Path: ~/.kalshitools/demo-private-key.pem (default)](#--private-key-path-kalshitoolsdemo-private-keypem-default)
* [Place your private key file](#place-your-private-key-file)
* [Copy the example file](#copy-the-example-file)
* [Edit .env with your credentials](#edit-env-with-your-credentials)
* [Source the environment](#source-the-environment)
* [Check configuration](#check-configuration)
* [Test API connection](#test-api-connection)
* [List active markets](#list-active-markets)
* [View available markets](#view-available-markets)
* [Get market details](#get-market-details)
* [View order book for liquidity analysis](#view-order-book-for-liquidity-analysis)
* [Discover markets within an event](#discover-markets-within-an-event)
* [Batch query multiple tickers](#batch-query-multiple-tickers)
* [View your portfolio](#view-your-portfolio)
* [Filter positions by settlement status](#filter-positions-by-settlement-status)
* [Place an order (with confirmation)](#place-an-order-with-confirmation)
* [Use --dry-run to simulate without placing order](#use---dry-run-to-simulate-without-placing-order)
* [View order history](#view-order-history)
* [Analyze portfolio performance](#analyze-portfolio-performance)
* [Check portfolio risk](#check-portfolio-risk)
* [View historical performance](#view-historical-performance)
* [Scan markets for opportunities](#scan-markets-for-opportunities)
* [Full analytics for last 30 days](#full-analytics-for-last-30-days)
* [Custom date range](#custom-date-range)
* [Returns: win rate, avg P&L, total return, exposure ratio, concentration, fees](#returns-win-rate-avg-pl-total-return-exposure-ratio-concentration-fees)
* [Check portfolio risk with 20% position limit](#check-portfolio-risk-with-20-position-limit)
* [Analyze concentration by event](#analyze-concentration-by-event)
* [Returns: risk score, concentrations, correlations, alerts, recommendations](#returns-risk-score-concentrations-correlations-alerts-recommendations)
* [Daily performance breakdown](#daily-performance-breakdown)
* [Filter by specific market](#filter-by-specific-market)
* [Returns: time-series data, maker/taker stats, performance by ticker](#returns-time-series-data-makertaker-stats-performance-by-ticker)
* [Scan for markets with good liquidity and spreads](#scan-for-markets-with-good-liquidity-and-spreads)
* [Filter to specific event](#filter-to-specific-event)
* [Returns: scored opportunities with liquidity, spread, and volume data](#returns-scored-opportunities-with-liquidity-spread-and-volume-data)
* [Usage](#usage)
* [Commands](#commands)
<!-- tocstop -->
# Usage
<!-- usage -->
```sh-session
$ npm install -g @gaberoo/kalshitools
$ kalshitools COMMAND
running command...
$ kalshitools (--version)
@gaberoo/kalshitools/1.1.1 darwin-arm64 node-v22.20.0
$ kalshitools --help [COMMAND]
USAGE
  $ kalshitools COMMAND
...
```
<!-- usagestop -->
# Commands
<!-- commands -->
* [`kalshitools config init`](#kalshitools-config-init)
* [`kalshitools config show`](#kalshitools-config-show)
* [`kalshitools help [COMMAND]`](#kalshitools-help-command)
* [`kalshitools markets list`](#kalshitools-markets-list)
* [`kalshitools markets orderbook TICKER`](#kalshitools-markets-orderbook-ticker)
* [`kalshitools markets scan`](#kalshitools-markets-scan)
* [`kalshitools markets show TICKER`](#kalshitools-markets-show-ticker)
* [`kalshitools orders cancel ORDERID`](#kalshitools-orders-cancel-orderid)
* [`kalshitools orders create`](#kalshitools-orders-create)
* [`kalshitools orders list`](#kalshitools-orders-list)
* [`kalshitools plugins`](#kalshitools-plugins)
* [`kalshitools plugins add PLUGIN`](#kalshitools-plugins-add-plugin)
* [`kalshitools plugins:inspect PLUGIN...`](#kalshitools-pluginsinspect-plugin)
* [`kalshitools plugins install PLUGIN`](#kalshitools-plugins-install-plugin)
* [`kalshitools plugins link PATH`](#kalshitools-plugins-link-path)
* [`kalshitools plugins remove [PLUGIN]`](#kalshitools-plugins-remove-plugin)
* [`kalshitools plugins reset`](#kalshitools-plugins-reset)
* [`kalshitools plugins uninstall [PLUGIN]`](#kalshitools-plugins-uninstall-plugin)
* [`kalshitools plugins unlink [PLUGIN]`](#kalshitools-plugins-unlink-plugin)
* [`kalshitools plugins update`](#kalshitools-plugins-update)
* [`kalshitools portfolio analytics`](#kalshitools-portfolio-analytics)
* [`kalshitools portfolio balance`](#kalshitools-portfolio-balance)
* [`kalshitools portfolio fills`](#kalshitools-portfolio-fills)
* [`kalshitools portfolio history`](#kalshitools-portfolio-history)
* [`kalshitools portfolio positions`](#kalshitools-portfolio-positions)
* [`kalshitools portfolio risk`](#kalshitools-portfolio-risk)

## `kalshitools config init`

Initialize kalshitools configuration interactively

```
USAGE
  $ kalshitools config init [--json] [--env demo|production] [--keyId <value>] [--privateKeyPath <value>]

FLAGS
  --env=<option>            [default: demo] Environment to configure (demo or production)
                            <options: demo|production>
  --json                    Output in JSON format
  --keyId=<value>           API key ID (email)
  --privateKeyPath=<value>  Path to private key file

DESCRIPTION
  Initialize kalshitools configuration interactively

EXAMPLES
  $ kalshitools config init

  $ kalshitools config init --env production
```

_See code: [src/commands/config/init.ts](https://github.com/kalshitools/kalshitools/blob/v1.1.1/src/commands/config/init.ts)_

## `kalshitools config show`

Show current configuration (credentials redacted)

```
USAGE
  $ kalshitools config show [--json]

FLAGS
  --json  Output in JSON format

DESCRIPTION
  Show current configuration (credentials redacted)

EXAMPLES
  $ kalshitools config show

  $ kalshitools config show --json
```

_See code: [src/commands/config/show.ts](https://github.com/kalshitools/kalshitools/blob/v1.1.1/src/commands/config/show.ts)_

## `kalshitools help [COMMAND]`

Display help for kalshitools.

```
USAGE
  $ kalshitools help [COMMAND...] [-n]

ARGUMENTS
  [COMMAND...]  Command to show help for.

FLAGS
  -n, --nested-commands  Include all nested commands in the output.

DESCRIPTION
  Display help for kalshitools.
```

_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.2.37/src/commands/help.ts)_

## `kalshitools markets list`

List prediction markets

```
USAGE
  $ kalshitools markets list [--json] [--event-ticker <value>] [--limit <value>] [--series-ticker <value>]
    [--status active|closed|settled|finalized] [--tickers <value>] [--with-nested]

FLAGS
  --event-ticker=<value>   Filter by event ticker
  --json                   Output in JSON format
  --limit=<value>          [default: 20] Maximum number of markets to return
  --series-ticker=<value>  Filter by series ticker
  --status=<option>        Filter by market status
                           <options: active|closed|settled|finalized>
  --tickers=<value>        Comma-separated list of tickers to fetch
  --with-nested            Include nested markets

DESCRIPTION
  List prediction markets

EXAMPLES
  $ kalshitools markets list

  $ kalshitools markets list --status active --limit 10

  $ kalshitools markets list --event-ticker ELECTION-2024

  $ kalshitools markets list --tickers "TICKER1,TICKER2,TICKER3"

  $ kalshitools markets list --with-nested

  $ kalshitools markets list --json
```

_See code: [src/commands/markets/list.ts](https://github.com/kalshitools/kalshitools/blob/v1.1.1/src/commands/markets/list.ts)_

## `kalshitools markets orderbook TICKER`

Show order book for a market

```
USAGE
  $ kalshitools markets orderbook TICKER [--json] [--depth <value>]

ARGUMENTS
  TICKER  Market ticker symbol

FLAGS
  --depth=<value>  [default: 10] Number of price levels to show
  --json           Output in JSON format

DESCRIPTION
  Show order book for a market

EXAMPLES
  $ kalshitools markets orderbook TICKER

  $ kalshitools markets orderbook TICKER --depth 5

  $ kalshitools markets orderbook TICKER --json
```

_See code: [src/commands/markets/orderbook.ts](https://github.com/kalshitools/kalshitools/blob/v1.1.1/src/commands/markets/orderbook.ts)_

## `kalshitools markets scan`

Scan markets for trading opportunities based on liquidity and spreads

```
USAGE
  $ kalshitools markets scan [--json] [--depth <value>] [--event-ticker <value>] [--limit <value>] [--max-spread
    <value>] [--min-liquidity <value>] [--min-spread <value>] [--min-volume <value>] [--series-ticker <value>]
    [--sort-by liquidity|score|spread|volume]

FLAGS
  --depth=<value>          [default: 5] Orderbook depth to fetch for analysis
  --event-ticker=<value>   Filter to specific event
  --json                   Output in JSON format
  --limit=<value>          [default: 50] Maximum markets to scan
  --max-spread=<value>     [default: 0.30] Maximum spread in cents (e.g., 0.30 = 30 cents)
  --min-liquidity=<value>  [default: 100] Minimum orderbook depth in dollars
  --min-spread=<value>     [default: 0.03] Minimum spread in cents (e.g., 0.03 = 3 cents)
  --min-volume=<value>     [default: 500] Minimum 24h volume in dollars
  --series-ticker=<value>  Filter to specific series
  --sort-by=<option>       [default: score] Ranking criteria
                           <options: liquidity|score|spread|volume>

DESCRIPTION
  Scan markets for trading opportunities based on liquidity and spreads

EXAMPLES
  $ kalshitools markets scan

  $ kalshitools markets scan --min-liquidity 200 --min-spread 0.05

  $ kalshitools markets scan --event-ticker EVENT-2024

  $ kalshitools markets scan --sort-by liquidity --limit 20

  $ kalshitools markets scan --json
```

_See code: [src/commands/markets/scan.ts](https://github.com/kalshitools/kalshitools/blob/v1.1.1/src/commands/markets/scan.ts)_

## `kalshitools markets show TICKER`

Show market details

```
USAGE
  $ kalshitools markets show TICKER [--json]

ARGUMENTS
  TICKER  Market ticker symbol

FLAGS
  --json  Output in JSON format

DESCRIPTION
  Show market details

EXAMPLES
  $ kalshitools markets show TICKER

  $ kalshitools markets show TICKER --json
```

_See code: [src/commands/markets/show.ts](https://github.com/kalshitools/kalshitools/blob/v1.1.1/src/commands/markets/show.ts)_

## `kalshitools orders cancel ORDERID`

Cancel an order

```
USAGE
  $ kalshitools orders cancel ORDERID [--json] [-y]

ARGUMENTS
  ORDERID  Order ID to cancel

FLAGS
  -y, --yes   Skip confirmation prompt
      --json  Output in JSON format

DESCRIPTION
  Cancel an order

EXAMPLES
  $ kalshitools orders cancel ORDER_ID

  $ kalshitools orders cancel ORDER_ID --yes

  $ kalshitools orders cancel ORDER_ID --json
```

_See code: [src/commands/orders/cancel.ts](https://github.com/kalshitools/kalshitools/blob/v1.1.1/src/commands/orders/cancel.ts)_

## `kalshitools orders create`

Create a new order (buy or sell contracts)

```
USAGE
  $ kalshitools orders create -a buy|sell -q <value> -s yes|no -t <value> [--json] [--dry-run] [-p <value>] [--type
    market|limit] [-y]

FLAGS
  -a, --action=<option>   (required) Order action (buy or sell)
                          <options: buy|sell>
  -p, --price=<value>     Limit price (required for limit orders, 0.01-0.99)
  -q, --quantity=<value>  (required) Number of contracts
  -s, --side=<option>     (required) Contract side (yes or no)
                          <options: yes|no>
  -t, --ticker=<value>    (required) Market ticker symbol
  -y, --yes               Skip confirmation prompt
      --dry-run           Simulate the order without actually placing it
      --json              Output in JSON format
      --type=<option>     [default: market] Order type (market or limit)
                          <options: market|limit>

DESCRIPTION
  Create a new order (buy or sell contracts)

EXAMPLES
  $ kalshitools orders create --ticker TICKER --action buy --side yes --quantity 10 --type market

  $ kalshitools orders create --ticker TICKER --action buy --side yes --quantity 10 --type limit --price 0.65

  $ kalshitools orders create --ticker TICKER --action sell --side no --quantity 5 --type market --yes

  $ kalshitools orders create --ticker TICKER --action buy --side yes --quantity 100 --dry-run
```

_See code: [src/commands/orders/create.ts](https://github.com/kalshitools/kalshitools/blob/v1.1.1/src/commands/orders/create.ts)_

## `kalshitools orders list`

List orders

```
USAGE
  $ kalshitools orders list [--json] [--limit <value>] [--status pending|resting|canceled|executed|expired]
    [--ticker <value>]

FLAGS
  --json             Output in JSON format
  --limit=<value>    [default: 50] Maximum number of orders to return
  --status=<option>  Filter by order status
                     <options: pending|resting|canceled|executed|expired>
  --ticker=<value>   Filter by ticker

DESCRIPTION
  List orders

EXAMPLES
  $ kalshitools orders list

  $ kalshitools orders list --status resting

  $ kalshitools orders list --ticker TICKER

  $ kalshitools orders list --json
```

_See code: [src/commands/orders/list.ts](https://github.com/kalshitools/kalshitools/blob/v1.1.1/src/commands/orders/list.ts)_

## `kalshitools plugins`

List installed plugins.

```
USAGE
  $ kalshitools plugins [--json] [--core]

FLAGS
  --core  Show core plugins.

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  List installed plugins.

EXAMPLES
  $ kalshitools plugins
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.56/src/commands/plugins/index.ts)_

## `kalshitools plugins add PLUGIN`

Installs a plugin into kalshitools.

```
USAGE
  $ kalshitools plugins add PLUGIN... [--json] [-f] [-h] [-s | -v]

ARGUMENTS
  PLUGIN...  Plugin to install.

FLAGS
  -f, --force    Force npm to fetch remote resources even if a local copy exists on disk.
  -h, --help     Show CLI help.
  -s, --silent   Silences npm output.
  -v, --verbose  Show verbose npm output.

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Installs a plugin into kalshitools.

  Uses npm to install plugins.

  Installation of a user-installed plugin will override a core plugin.

  Use the KALSHITOOLS_NPM_LOG_LEVEL environment variable to set the npm loglevel.
  Use the KALSHITOOLS_NPM_REGISTRY environment variable to set the npm registry.

ALIASES
  $ kalshitools plugins add

EXAMPLES
  Install a plugin from npm registry.

    $ kalshitools plugins add myplugin

  Install a plugin from a github url.

    $ kalshitools plugins add https://github.com/someuser/someplugin

  Install a plugin from a github slug.

    $ kalshitools plugins add someuser/someplugin
```

## `kalshitools plugins:inspect PLUGIN...`

Displays installation properties of a plugin.

```
USAGE
  $ kalshitools plugins inspect PLUGIN...

ARGUMENTS
  PLUGIN...  [default: .] Plugin to inspect.

FLAGS
  -h, --help     Show CLI help.
  -v, --verbose

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Displays installation properties of a plugin.

EXAMPLES
  $ kalshitools plugins inspect myplugin
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.56/src/commands/plugins/inspect.ts)_

## `kalshitools plugins install PLUGIN`

Installs a plugin into kalshitools.

```
USAGE
  $ kalshitools plugins install PLUGIN... [--json] [-f] [-h] [-s | -v]

ARGUMENTS
  PLUGIN...  Plugin to install.

FLAGS
  -f, --force    Force npm to fetch remote resources even if a local copy exists on disk.
  -h, --help     Show CLI help.
  -s, --silent   Silences npm output.
  -v, --verbose  Show verbose npm output.

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Installs a plugin into kalshitools.

  Uses npm to install plugins.

  Installation of a user-installed plugin will override a core plugin.

  Use the KALSHITOOLS_NPM_LOG_LEVEL environment variable to set the npm loglevel.
  Use the KALSHITOOLS_NPM_REGISTRY environment variable to set the npm registry.

ALIASES
  $ kalshitools plugins add

EXAMPLES
  Install a plugin from npm registry.

    $ kalshitools plugins install myplugin

  Install a plugin from a github url.

    $ kalshitools plugins install https://github.com/someuser/someplugin

  Install a plugin from a github slug.

    $ kalshitools plugins install someuser/someplugin
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.56/src/commands/plugins/install.ts)_

## `kalshitools plugins link PATH`

Links a plugin into the CLI for development.

```
USAGE
  $ kalshitools plugins link PATH [-h] [--install] [-v]

ARGUMENTS
  PATH  [default: .] path to plugin

FLAGS
  -h, --help          Show CLI help.
  -v, --verbose
      --[no-]install  Install dependencies after linking the plugin.

DESCRIPTION
  Links a plugin into the CLI for development.

  Installation of a linked plugin will override a user-installed or core plugin.

  e.g. If you have a user-installed or core plugin that has a 'hello' command, installing a linked plugin with a 'hello'
  command will override the user-installed or core plugin implementation. This is useful for development work.


EXAMPLES
  $ kalshitools plugins link myplugin
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.56/src/commands/plugins/link.ts)_

## `kalshitools plugins remove [PLUGIN]`

Removes a plugin from the CLI.

```
USAGE
  $ kalshitools plugins remove [PLUGIN...] [-h] [-v]

ARGUMENTS
  [PLUGIN...]  plugin to uninstall

FLAGS
  -h, --help     Show CLI help.
  -v, --verbose

DESCRIPTION
  Removes a plugin from the CLI.

ALIASES
  $ kalshitools plugins unlink
  $ kalshitools plugins remove

EXAMPLES
  $ kalshitools plugins remove myplugin
```

## `kalshitools plugins reset`

Remove all user-installed and linked plugins.

```
USAGE
  $ kalshitools plugins reset [--hard] [--reinstall]

FLAGS
  --hard       Delete node_modules and package manager related files in addition to uninstalling plugins.
  --reinstall  Reinstall all plugins after uninstalling.
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.56/src/commands/plugins/reset.ts)_

## `kalshitools plugins uninstall [PLUGIN]`

Removes a plugin from the CLI.

```
USAGE
  $ kalshitools plugins uninstall [PLUGIN...] [-h] [-v]

ARGUMENTS
  [PLUGIN...]  plugin to uninstall

FLAGS
  -h, --help     Show CLI help.
  -v, --verbose

DESCRIPTION
  Removes a plugin from the CLI.

ALIASES
  $ kalshitools plugins unlink
  $ kalshitools plugins remove

EXAMPLES
  $ kalshitools plugins uninstall myplugin
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.56/src/commands/plugins/uninstall.ts)_

## `kalshitools plugins unlink [PLUGIN]`

Removes a plugin from the CLI.

```
USAGE
  $ kalshitools plugins unlink [PLUGIN...] [-h] [-v]

ARGUMENTS
  [PLUGIN...]  plugin to uninstall

FLAGS
  -h, --help     Show CLI help.
  -v, --verbose

DESCRIPTION
  Removes a plugin from the CLI.

ALIASES
  $ kalshitools plugins unlink
  $ kalshitools plugins remove

EXAMPLES
  $ kalshitools plugins unlink myplugin
```

## `kalshitools plugins update`

Update installed plugins.

```
USAGE
  $ kalshitools plugins update [-h] [-v]

FLAGS
  -h, --help     Show CLI help.
  -v, --verbose

DESCRIPTION
  Update installed plugins.
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.56/src/commands/plugins/update.ts)_

## `kalshitools portfolio analytics`

Comprehensive portfolio performance analytics

```
USAGE
  $ kalshitools portfolio analytics [--json] [--max-ts <value>] [--min-ts <value>] [--period <value>]

FLAGS
  --json            Output in JSON format
  --max-ts=<value>  End date for analysis (ISO-8601 format)
  --min-ts=<value>  Start date for analysis (ISO-8601 format)
  --period=<value>  Analysis period in days (overridden by min-ts/max-ts)

DESCRIPTION
  Comprehensive portfolio performance analytics

EXAMPLES
  $ kalshitools portfolio analytics

  $ kalshitools portfolio analytics --period 7

  $ kalshitools portfolio analytics --min-ts 2026-01-01T00:00:00Z

  $ kalshitools portfolio analytics --json
```

_See code: [src/commands/portfolio/analytics.ts](https://github.com/kalshitools/kalshitools/blob/v1.1.1/src/commands/portfolio/analytics.ts)_

## `kalshitools portfolio balance`

View account balance

```
USAGE
  $ kalshitools portfolio balance [--json]

FLAGS
  --json  Output in JSON format

DESCRIPTION
  View account balance

EXAMPLES
  $ kalshitools portfolio balance

  $ kalshitools portfolio balance --json
```

_See code: [src/commands/portfolio/balance.ts](https://github.com/kalshitools/kalshitools/blob/v1.1.1/src/commands/portfolio/balance.ts)_

## `kalshitools portfolio fills`

View trade history (fills)

```
USAGE
  $ kalshitools portfolio fills [--json] [--limit <value>] [--ticker <value>]

FLAGS
  --json            Output in JSON format
  --limit=<value>   [default: 50] Maximum number of fills to return
  --ticker=<value>  Filter by ticker

DESCRIPTION
  View trade history (fills)

EXAMPLES
  $ kalshitools portfolio fills

  $ kalshitools portfolio fills --ticker TICKER

  $ kalshitools portfolio fills --limit 20

  $ kalshitools portfolio fills --json
```

_See code: [src/commands/portfolio/fills.ts](https://github.com/kalshitools/kalshitools/blob/v1.1.1/src/commands/portfolio/fills.ts)_

## `kalshitools portfolio history`

Historical performance analysis with time-series data

```
USAGE
  $ kalshitools portfolio history [--json] [--group-by day|week|month] [--limit <value>] [--max-ts <value>] [--min-ts
    <value>] [--ticker <value>]

FLAGS
  --group-by=<option>  [default: day] Time aggregation level
                       <options: day|week|month>
  --json               Output in JSON format
  --limit=<value>      [default: 500] Maximum fills to fetch (handles pagination)
  --max-ts=<value>     End date (ISO-8601 format)
  --min-ts=<value>     Start date (ISO-8601 format)
  --ticker=<value>     Filter by specific market ticker

DESCRIPTION
  Historical performance analysis with time-series data

EXAMPLES
  $ kalshitools portfolio history

  $ kalshitools portfolio history --ticker MARKET-A

  $ kalshitools portfolio history --group-by week

  $ kalshitools portfolio history --min-ts 2026-01-01T00:00:00Z --max-ts 2026-02-01T00:00:00Z

  $ kalshitools portfolio history --json
```

_See code: [src/commands/portfolio/history.ts](https://github.com/kalshitools/kalshitools/blob/v1.1.1/src/commands/portfolio/history.ts)_

## `kalshitools portfolio positions`

View current positions with P&L

```
USAGE
  $ kalshitools portfolio positions [--json] [--settlement-status open|pending|settled]

FLAGS
  --json                        Output in JSON format
  --settlement-status=<option>  Filter by settlement status
                                <options: open|pending|settled>

DESCRIPTION
  View current positions with P&L

EXAMPLES
  $ kalshitools portfolio positions

  $ kalshitools portfolio positions --settlement-status open

  $ kalshitools portfolio positions --settlement-status settled

  $ kalshitools portfolio positions --json
```

_See code: [src/commands/portfolio/positions.ts](https://github.com/kalshitools/kalshitools/blob/v1.1.1/src/commands/portfolio/positions.ts)_

## `kalshitools portfolio risk`

Real-time portfolio risk analysis and warnings

```
USAGE
  $ kalshitools portfolio risk [--json] [--group-by event|series|ticker] [--threshold <value>]

FLAGS
  --group-by=<option>  [default: ticker] Grouping for concentration analysis
                       <options: event|series|ticker>
  --json               Output in JSON format
  --threshold=<value>  [default: 20] Alert threshold for position concentration (%)

DESCRIPTION
  Real-time portfolio risk analysis and warnings

EXAMPLES
  $ kalshitools portfolio risk

  $ kalshitools portfolio risk --threshold 15

  $ kalshitools portfolio risk --group-by event

  $ kalshitools portfolio risk --json
```

_See code: [src/commands/portfolio/risk.ts](https://github.com/kalshitools/kalshitools/blob/v1.1.1/src/commands/portfolio/risk.ts)_
<!-- commandsstop -->