pp-kalshi
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseKalshi — Printing Press CLI
Kalshi — Printing Press CLI
Prerequisites: Install the CLI
前提条件:安装CLI
This skill drives the binary. You must verify the CLI is installed before invoking any command from this skill. If it is missing, install it first:
kalshi-pp-cli- Install via the Printing Press installer:
bash
npx -y @mvanhorn/printing-press install kalshi --cli-only - Verify:
kalshi-pp-cli --version - Ensure (or
$GOPATH/bin) is on$HOME/go/bin.$PATH
If the install fails (no Node, offline, etc.), fall back to a direct Go install (requires Go 1.23+):
npxbash
go install github.com/mvanhorn/printing-press-library/library/payments/kalshi/cmd/kalshi-pp-cli@latestIf reports "command not found" after install, the install step did not put the binary on . Do not proceed with skill commands until verification succeeds.
--version$PATH本技能驱动二进制文件。在调用本技能的任何命令之前,您必须确认CLI已安装。 如果未安装,请先执行以下步骤:
kalshi-pp-cli- 通过Printing Press安装器安装:
bash
npx -y @mvanhorn/printing-press install kalshi --cli-only - 验证安装:
kalshi-pp-cli --version - 确保(或
$GOPATH/bin)已添加到$HOME/go/bin环境变量中。$PATH
如果安装失败(无Node环境、离线等),可以回退到直接使用Go安装(需要Go 1.23及以上版本):
npxbash
go install github.com/mvanhorn/printing-press-library/library/payments/kalshi/cmd/kalshi-pp-cli@latest如果安装后执行提示"command not found",说明安装步骤未将二进制文件添加到中。在验证成功之前,请勿继续执行技能命令。
--version$PATHWhen to Use This CLI
何时使用此CLI
Reach for kalshi-pp-cli when an agent needs price-over-time or category-level analytics on Kalshi markets — the public API only returns current prices and flat positions, so historical and aggregated questions require the local snapshot store. Use it for daily portfolio reconciliation, signal discovery via correlation across markets, and safe scripting against read-only API credentials.
当需要对Kalshi市场进行价格走势或分类层面的分析时,请使用kalshi-pp-cli——公开API仅返回当前价格和持仓情况,而历史数据和聚合分析需要本地快照存储。可用于每日投资组合对账、通过跨市场关联发现信号,以及使用只读API凭证进行安全脚本编写。
Unique Capabilities
独特功能
These capabilities aren't available in any other tool for this API.
- — See your P&L broken down by market category and series over any time period
portfolio attribution - — Track how market odds moved over time with price progression charts
markets history - — Calculate your win/loss ratio, expected value, and ROI across all settled positions
portfolio winrate - — See upcoming settlements with your positions, expected payouts, and category breakdown
portfolio calendar - — Find markets with the biggest price swings since your last sync
markets movers - — Compare price histories of two markets to discover correlated events
markets correlate - — See your total risk broken down by category, with concentration warnings
portfolio exposure - — Find positions in markets approaching expiry where you haven't acted recently
portfolio stale
这些功能是其他针对该API的工具所不具备的:
- — 查看任意时间段内按市场分类和系列划分的盈亏情况
portfolio attribution - — 通过价格走势图表跟踪市场赔率随时间的变化
markets history - — 计算所有已结算持仓的胜率/败率、期望值和投资回报率
portfolio winrate - — 查看即将到来的结算信息,包括持仓、预期收益和分类细分
portfolio calendar - — 查找自上次同步以来价格波动最大的市场
markets movers - — 比较两个市场的价格历史,发现相关事件
markets correlate - — 查看按分类划分的总风险,并提供集中度警告
portfolio exposure - — 查找即将到期且近期未操作的持仓
portfolio stale
Command Reference
命令参考
account — Manage account
- — Endpoint to retrieve the API tier limits associated with the authenticated user.
kalshi-pp-cli account get-api-limits - — Lists API v2 endpoints whose configured token cost differs from the default cost. Endpoints that use the default...
kalshi-pp-cli account get-endpoint-costs
api-keys — API key management endpoints
- — Endpoint for creating a new API key with a user-provided public key. This endpoint allows users with Premier or...
kalshi-pp-cli api-keys create - — Endpoint for deleting an existing API key. This endpoint permanently deletes an API key. Once deleted, the key can...
kalshi-pp-cli api-keys delete - — Endpoint for generating a new API key with an automatically created key pair. This endpoint generates both a public...
kalshi-pp-cli api-keys generate - — Endpoint for retrieving all API keys associated with the authenticated user. API keys allow programmatic access to...
kalshi-pp-cli api-keys get
communications — Request-for-quote (RFQ) endpoints
- — Endpoint for accepting a quote. This will require the quoter to confirm
kalshi-pp-cli communications accept-quote - — Endpoint for confirming a quote. This will start a timer for order execution
kalshi-pp-cli communications confirm-quote - — Endpoint for creating a quote in response to an RFQ
kalshi-pp-cli communications create-quote - — Endpoint for creating a new RFQ. You can have a maximum of 100 open RFQs at a time.
kalshi-pp-cli communications create-rfq - — Endpoint for deleting a quote, which means it can no longer be accepted.
kalshi-pp-cli communications delete-quote - — Endpoint for deleting an RFQ by ID
kalshi-pp-cli communications delete-rfq - — Endpoint for getting the communications ID of the logged-in user.
kalshi-pp-cli communications get-id - — Endpoint for getting a particular quote
kalshi-pp-cli communications get-quote - — Endpoint for getting quotes
kalshi-pp-cli communications get-quotes - — Endpoint for getting a single RFQ by id
kalshi-pp-cli communications get-rfq - — Endpoint for getting RFQs
kalshi-pp-cli communications get-rfqs
events — Event endpoints
- — Get all events. This endpoint excludes multivariate events. To retrieve multivariate events, use the GET...
kalshi-pp-cli events get - — Endpoint for getting data about an event by its ticker. An event represents a real-world occurrence that can be...
kalshi-pp-cli events get-eventticker - — Retrieve multivariate (combo) events. These are dynamically created events from multivariate event collections....
kalshi-pp-cli events get-multivariate
exchange — Exchange status and information endpoints
- — Endpoint for getting all exchange-wide announcements.
kalshi-pp-cli exchange get-announcements - — Endpoint for getting the exchange schedule.
kalshi-pp-cli exchange get-schedule - — Endpoint for getting the exchange status.
kalshi-pp-cli exchange get-status - — There is typically a short delay before exchange events are reflected in the API endpoints. Whenever possible,...
kalshi-pp-cli exchange get-user-data-timestamp
fcm — FCM member specific endpoints
- — Endpoint for FCM members to get orders filtered by subtrader ID. This endpoint requires FCM member access level and...
kalshi-pp-cli fcm get-fcmorders - — Endpoint for FCM members to get market positions filtered by subtrader ID. This endpoint requires FCM member access...
kalshi-pp-cli fcm get-fcmpositions
historical — Manage historical
- — Returns the cutoff timestamps that define the boundary between live and historical data. ## Cutoff fields -...
kalshi-pp-cli historical get-cutoff - — Endpoint for getting all historical fills for the member. A fill is when a trade you have is matched.
kalshi-pp-cli historical get-fills - — Endpoint for getting data about a specific market by its ticker from the historical database.
kalshi-pp-cli historical get-market - — Endpoint for fetching historical candlestick data for markets that have been archived from the live data set. Time...
kalshi-pp-cli historical get-market-candlesticks - — Endpoint for getting markets that have been archived to the historical database. Filters are mutually exclusive.
kalshi-pp-cli historical get-markets - — Endpoint for getting orders that have been archived to the historical database.
kalshi-pp-cli historical get-orders - — Endpoint for getting all historical trades for all markets. Trades that were filled before the historical cutoff are...
kalshi-pp-cli historical get-trades
incentive-programs — Incentive program endpoints
- — List incentives with optional filters. Incentives are rewards programs for trading activity on specific markets.
kalshi-pp-cli incentive-programs
kalshi-trade-manual-search — Manage kalshi trade manual search
- — Retrieve available filters organized by sport. This endpoint returns filtering options available for each sport,...
kalshi-pp-cli kalshi-trade-manual-search
kalshi-trade-manual-search-2 — Manage kalshi trade manual search 2
- — Retrieve tags organized by series categories. This endpoint returns a mapping of series categories to their...
kalshi-pp-cli kalshi-trade-manual-search-2
live-data — Live data endpoints
- — Get live data for multiple milestones
kalshi-pp-cli live-data get - — Get live data for a specific milestone.
kalshi-pp-cli live-data get-by-milestone - — Get play-by-play game statistics for a specific milestone. Supported sports: Pro Football, College Football, Pro...
kalshi-pp-cli live-data get-game-stats
markets — Market data endpoints
- — Endpoint for retrieving candlestick data for multiple markets. - Accepts up to 100 market tickers per request -...
kalshi-pp-cli markets batch-get-candlesticks - — Filter by market status. Possible values:
kalshi-pp-cli markets get,unopened,open,closed. Leave empty to return markets...settled - — Endpoint for getting the current order books for multiple markets in a single request. The order book shows all...
kalshi-pp-cli markets get-orderbooks - — Endpoint for getting data about a specific market by its ticker. A market represents a specific binary outcome...
kalshi-pp-cli markets get-ticker - — Endpoint for getting all trades for all markets. A trade represents a completed transaction between two users on a...
kalshi-pp-cli markets get-trades
milestones — Milestone endpoints
- — Minimum start date to filter milestones. Format: RFC3339 timestamp
kalshi-pp-cli milestones get - — Endpoint for getting data about a specific milestone by its ID.
kalshi-pp-cli milestones get-milestoneid
multivariate-event-collections — Manage multivariate event collections
- — Endpoint for creating an individual market in a multivariate event collection. This endpoint must be hit at least...
kalshi-pp-cli multivariate-event-collections create-market-in - — Endpoint for getting data about multivariate event collections.
kalshi-pp-cli multivariate-event-collections get - — Endpoint for getting data about a multivariate event collection by its ticker.
kalshi-pp-cli multivariate-event-collections get-multivariateeventcollections
portfolio — Portfolio and balance information endpoints
- — Endpoint for amending the max number of fillable contracts and/or price in an existing order. Max fillable contracts...
kalshi-pp-cli portfolio amend-order - — Endpoint for amending the price and/or remaining count of an existing event-market order using the V2...
kalshi-pp-cli portfolio amend-order-v2 - — Transfers funds between the authenticated user's subaccounts. Use 0 for the primary account, or 1-32 for numbered...
kalshi-pp-cli portfolio apply-subaccount-transfer - — Endpoint for cancelling a batch of orders. The maximum batch size scales with your tier's write budget — see [Rate...
kalshi-pp-cli portfolio batch-cancel-orders - — Endpoint for cancelling a batch of event-market orders using the V2 response shape. The maximum batch size scales...
kalshi-pp-cli portfolio batch-cancel-orders-v2 - — Endpoint for submitting a batch of orders. The maximum batch size scales with your tier's write budget — see [Rate...
kalshi-pp-cli portfolio batch-create-orders - — Endpoint for submitting a batch of event-market orders using the V2 request/response shape. The maximum batch size...
kalshi-pp-cli portfolio batch-create-orders-v2 - — Endpoint for canceling orders. The value for the orderId should match the id field of the order you want to...
kalshi-pp-cli portfolio cancel-order - — Endpoint for cancelling event-market orders using the V2 response shape. Returns `{order_id, client_order_id,...
kalshi-pp-cli portfolio cancel-order-v2 - — Endpoint for submitting orders in a market. Each user is limited to 200 000 open orders at a time.
kalshi-pp-cli portfolio create-order - — Creates a new order group with a contracts limit measured over a rolling 15-second window. When the limit is hit,...
kalshi-pp-cli portfolio create-order-group - — Endpoint for submitting event-market orders using the V2 request/response shape (single-book
kalshi-pp-cli portfolio create-order-v2/bidside and...ask - — Creates a new subaccount for the authenticated user. Subaccounts are numbered sequentially starting from 1. Maximum...
kalshi-pp-cli portfolio create-subaccount - — Endpoint for decreasing the number of contracts in an existing order. This is the only kind of edit available on...
kalshi-pp-cli portfolio decrease-order - — Endpoint for decreasing the remaining count of an existing event-market order using the V2 request/response shape....
kalshi-pp-cli portfolio decrease-order-v2 - — Deletes an order group and cancels all orders within it. This permanently removes the group.
kalshi-pp-cli portfolio delete-order-group - — Endpoint for getting the balance and portfolio value of a member. Both values are returned in cents.
kalshi-pp-cli portfolio get-balance - — Endpoint for getting all fills for the member. A fill is when a trade you have is matched. Fills that occurred...
kalshi-pp-cli portfolio get-fills - — Endpoint for getting a single order.
kalshi-pp-cli portfolio get-order - — Retrieves details for a single order group including all order IDs and auto-cancel status.
kalshi-pp-cli portfolio get-order-group - — Retrieves all order groups for the authenticated user.
kalshi-pp-cli portfolio get-order-groups - — Endpoint for getting an order's queue position in the order book. This represents the amount of orders that need to...
kalshi-pp-cli portfolio get-order-queue-position - — Endpoint for getting queue positions for all resting orders. Queue position represents the number of contracts that...
kalshi-pp-cli portfolio get-order-queue-positions - — Restricts the response to orders that have a certain status: resting, canceled, or executed. Orders that have been...
kalshi-pp-cli portfolio get-orders - — Restricts the positions to those with any of following fields with non-zero values, as a comma separated list. The...
kalshi-pp-cli portfolio get-positions - — Endpoint for getting the total value, in cents, of resting orders. This endpoint is only intended for use by FCM...
kalshi-pp-cli portfolio get-resting-order-total-value - — Endpoint for getting the member's settlements historical track.
kalshi-pp-cli portfolio get-settlements - — Gets balances for all subaccounts including the primary account.
kalshi-pp-cli portfolio get-subaccount-balances - — Gets the netting enabled settings for all subaccounts.
kalshi-pp-cli portfolio get-subaccount-netting - — Gets a paginated list of all transfers between subaccounts for the authenticated user.
kalshi-pp-cli portfolio get-subaccount-transfers - — Resets the order group's matched contracts counter to zero, allowing new orders to be placed again after the limit...
kalshi-pp-cli portfolio reset-order-group - — Triggers the order group, canceling all orders in the group and preventing new orders until the group is reset.
kalshi-pp-cli portfolio trigger-order-group - — Updates the order group contracts limit (rolling 15-second window). If the updated limit would immediately trigger...
kalshi-pp-cli portfolio update-order-group-limit - — Updates the netting enabled setting for a specific subaccount. Use 0 for the primary account, or 1-32 for numbered...
kalshi-pp-cli portfolio update-subaccount-netting
series — Manage series
- — Endpoint for getting data about a specific series by its ticker. A series represents a template for recurring events...
kalshi-pp-cli series get - — Get Series Fee Changes
kalshi-pp-cli series get-fee-changes - — Endpoint for getting data about multiple series with specified filters. A series represents a template for recurring...
kalshi-pp-cli series get-list
structured-targets — Structured targets endpoints
- — Page size (min: 1, max: 2000)
kalshi-pp-cli structured-targets get - — Endpoint for getting data about a specific structured target by its ID.
kalshi-pp-cli structured-targets get-structuredtargets
account — 管理账户
- — 获取与已认证用户关联的API层级限制的端点。
kalshi-pp-cli account get-api-limits - — 列出配置的令牌成本与默认成本不同的API v2端点。使用默认...
kalshi-pp-cli account get-endpoint-costs
api-keys — API密钥管理端点
- — 使用用户提供的公钥创建新API密钥的端点。该端点允许高级或...
kalshi-pp-cli api-keys create - — 删除现有API密钥的端点。该端点会永久删除API密钥,删除后无法...
kalshi-pp-cli api-keys delete - — 自动生成密钥对来创建新API密钥的端点。该端点会同时生成公钥...
kalshi-pp-cli api-keys generate - — 获取与已认证用户关联的所有API密钥的端点。API密钥允许以编程方式访问...
kalshi-pp-cli api-keys get
communications — 报价请求(RFQ)端点
- — 接受报价的端点,需要报价方确认
kalshi-pp-cli communications accept-quote - — 确认报价的端点,会启动订单执行计时器
kalshi-pp-cli communications confirm-quote - — 响应RFQ创建报价的端点
kalshi-pp-cli communications create-quote - — 创建新RFQ的端点,最多可同时存在100个未关闭的RFQ
kalshi-pp-cli communications create-rfq - — 删除报价的端点,删除后报价无法再被接受
kalshi-pp-cli communications delete-quote - — 通过ID删除RFQ的端点
kalshi-pp-cli communications delete-rfq - — 获取登录用户通信ID的端点
kalshi-pp-cli communications get-id - — 获取特定报价的端点
kalshi-pp-cli communications get-quote - — 获取报价列表的端点
kalshi-pp-cli communications get-quotes - — 通过ID获取单个RFQ的端点
kalshi-pp-cli communications get-rfq - — 获取RFQ列表的端点
kalshi-pp-cli communications get-rfqs
events — 事件端点
- — 获取所有事件,不包含多变量事件。如需获取多变量事件,请使用GET...
kalshi-pp-cli events get - — 通过代码获取事件数据的端点。事件代表可被...的现实世界事件
kalshi-pp-cli events get-eventticker - — 获取多变量(组合)事件。这些是从多变量事件集合中动态创建的事件...
kalshi-pp-cli events get-multivariate
exchange — 交易所状态和信息端点
- — 获取所有交易所公告的端点
kalshi-pp-cli exchange get-announcements - — 获取交易所日程的端点
kalshi-pp-cli exchange get-schedule - — 获取交易所状态的端点
kalshi-pp-cli exchange get-status - — 交易所事件通常会有短暂延迟才会反映到API端点中。尽可能...
kalshi-pp-cli exchange get-user-data-timestamp
fcm — FCM成员专属端点
- — FCM成员按交易员ID筛选订单的端点,需要FCM成员访问权限...
kalshi-pp-cli fcm get-fcmorders - — FCM成员按交易员ID筛选市场持仓的端点,需要FCM成员访问权限...
kalshi-pp-cli fcm get-fcmpositions
historical — 历史数据管理
- — 返回定义实时和历史数据边界的截止时间戳。## 截止字段 -...
kalshi-pp-cli historical get-cutoff - — 获取成员所有历史成交记录的端点。成交记录指您的交易已匹配完成
kalshi-pp-cli historical get-fills - — 从历史数据库中通过代码获取特定市场数据的端点
kalshi-pp-cli historical get-market - — 获取已归档市场历史K线数据的端点。时间...
kalshi-pp-cli historical get-market-candlesticks - — 获取已归档到历史数据库的市场列表的端点,筛选条件互斥
kalshi-pp-cli historical get-markets - — 获取已归档到历史数据库的订单列表的端点
kalshi-pp-cli historical get-orders - — 获取所有市场历史交易记录的端点。截止时间之前的成交记录...
kalshi-pp-cli historical get-trades
incentive-programs — 激励计划端点
- — 列出激励计划,支持可选筛选。激励计划是针对特定市场交易活动的奖励计划
kalshi-pp-cli incentive-programs
kalshi-trade-manual-search — Kalshi交易手动搜索管理
- — 按运动项目检索可用筛选条件。该端点返回每个运动项目的可用筛选选项...
kalshi-pp-cli kalshi-trade-manual-search
kalshi-trade-manual-search-2 — Kalshi交易手动搜索2管理
- — 按系列分类检索标签。该端点返回系列分类与对应...的映射关系
kalshi-pp-cli kalshi-trade-manual-search-2
live-data — 实时数据端点
- — 获取多个里程碑的实时数据
kalshi-pp-cli live-data get - — 获取特定里程碑的实时数据
kalshi-pp-cli live-data get-by-milestone - — 获取特定里程碑的逐场比赛统计数据。支持的运动项目:职业橄榄球、大学橄榄球、职业...
kalshi-pp-cli live-data get-game-stats
markets — 市场数据端点
- — 批量获取多个市场K线数据的端点。- 每次请求最多接受100个市场代码 -
kalshi-pp-cli markets batch-get-candlesticks - — 按市场状态筛选,可选值:
kalshi-pp-cli markets get、unopened、open、closed。留空则返回所有...settled - — 批量获取多个市场当前订单簿的端点。订单簿显示所有...
kalshi-pp-cli markets get-orderbooks - — 通过代码获取特定市场数据的端点。市场代表特定的二元结果...
kalshi-pp-cli markets get-ticker - — 获取所有市场交易记录的端点。交易记录指两个用户在某个...上完成的交易
kalshi-pp-cli markets get-trades
milestones — 里程碑端点
- — 筛选里程碑的最早开始日期,格式:RFC3339时间戳
kalshi-pp-cli milestones get - — 通过ID获取特定里程碑数据的端点
kalshi-pp-cli milestones get-milestoneid
multivariate-event-collections — 多变量事件集合管理
- — 在多变量事件集合中创建单个市场的端点,必须至少调用一次...
kalshi-pp-cli multivariate-event-collections create-market-in - — 获取多变量事件集合数据的端点
kalshi-pp-cli multivariate-event-collections get - — 通过代码获取多变量事件集合数据的端点
kalshi-pp-cli multivariate-event-collections get-multivariateeventcollections
portfolio — 投资组合和余额信息端点
- — 修改现有订单的最大可成交合约数量和/或价格的端点。最大可成交合约...
kalshi-pp-cli portfolio amend-order - — 使用V2格式修改现有事件市场订单的价格和/或剩余数量的端点...
kalshi-pp-cli portfolio amend-order-v2 - — 在已认证用户的子账户之间转账。主账户用0表示,子账户用1-32表示...
kalshi-pp-cli portfolio apply-subaccount-transfer - — 批量取消订单的端点,最大批量大小取决于您的层级写入额度 — 参见[Rate...
kalshi-pp-cli portfolio batch-cancel-orders - — 使用V2响应格式批量取消事件市场订单的端点,最大批量大小取决于...
kalshi-pp-cli portfolio batch-cancel-orders-v2 - — 批量提交订单的端点,最大批量大小取决于您的层级写入额度 — 参见[Rate...
kalshi-pp-cli portfolio batch-create-orders - — 使用V2请求/响应格式批量提交事件市场订单的端点,最大批量大小...
kalshi-pp-cli portfolio batch-create-orders-v2 - — 取消订单的端点,orderId值应与您要取消的订单的id字段匹配...
kalshi-pp-cli portfolio cancel-order - — 使用V2响应格式取消事件市场订单的端点,返回`{order_id, client_order_id,...
kalshi-pp-cli portfolio cancel-order-v2 - — 在市场中提交订单的端点,每个用户最多可同时存在200000个未成交订单
kalshi-pp-cli portfolio create-order - — 创建新订单组,设置15秒滚动窗口内的合约限额。当达到限额时...
kalshi-pp-cli portfolio create-order-group - — 使用V2请求/响应格式提交事件市场订单的端点(单簿
kalshi-pp-cli portfolio create-order-v2/bid方向和...ask - — 为已认证用户创建新子账户,子账户从1开始顺序编号,最多...
kalshi-pp-cli portfolio create-subaccount - — 减少现有订单合约数量的端点,这是唯一可用的编辑类型...
kalshi-pp-cli portfolio decrease-order - — 使用V2请求/响应格式减少现有事件市场订单剩余数量的端点...
kalshi-pp-cli portfolio decrease-order-v2 - — 删除订单组并取消其中所有订单,该操作会永久移除组
kalshi-pp-cli portfolio delete-order-group - — 获取成员余额和投资组合价值的端点,两个值均以美分返回
kalshi-pp-cli portfolio get-balance - — 获取成员所有成交记录的端点,成交记录指您的交易已匹配完成,发生在...
kalshi-pp-cli portfolio get-fills - — 获取单个订单的端点
kalshi-pp-cli portfolio get-order - — 获取单个订单组的详细信息,包括所有订单ID和自动取消状态
kalshi-pp-cli portfolio get-order-group - — 获取已认证用户的所有订单组
kalshi-pp-cli portfolio get-order-groups - — 获取订单在订单簿中排队位置的端点,代表需要先成交的订单数量...
kalshi-pp-cli portfolio get-order-queue-position - — 获取所有未成交订单排队位置的端点,排队位置代表需要先成交的合约数量...
kalshi-pp-cli portfolio get-order-queue-positions - — 限制响应为特定状态的订单:未成交、已取消或已执行。已...的订单
kalshi-pp-cli portfolio get-orders - — 限制响应为指定字段非零的持仓,字段用逗号分隔。该...
kalshi-pp-cli portfolio get-positions - — 获取未成交订单总价值(美分)的端点,仅适用于FCM...
kalshi-pp-cli portfolio get-resting-order-total-value - — 获取成员历史结算记录的端点
kalshi-pp-cli portfolio get-settlements - — 获取所有子账户(包括主账户)的余额
kalshi-pp-cli portfolio get-subaccount-balances - — 获取所有子账户的净额结算启用设置
kalshi-pp-cli portfolio get-subaccount-netting - — 获取已认证用户子账户之间所有转账的分页列表
kalshi-pp-cli portfolio get-subaccount-transfers - — 将订单组的已匹配合约计数器重置为零,达到限额后允许再次下单...
kalshi-pp-cli portfolio reset-order-group - — 触发订单组,取消组内所有订单并阻止新订单,直到组被重置
kalshi-pp-cli portfolio trigger-order-group - — 更新订单组的合约限额(15秒滚动窗口)。如果更新后的限额立即触发...
kalshi-pp-cli portfolio update-order-group-limit - — 更新特定子账户的净额结算启用设置,主账户用0表示,子账户用1-32表示...
kalshi-pp-cli portfolio update-subaccount-netting
series — 系列管理
- — 通过代码获取特定系列数据的端点,系列代表重复事件的模板...
kalshi-pp-cli series get - — 获取系列费用变更记录
kalshi-pp-cli series get-fee-changes - — 通过指定筛选条件获取多个系列数据的端点,系列代表重复事件的模板...
kalshi-pp-cli series get-list
structured-targets — 结构化目标端点
- — 页面大小(最小值:1,最大值:2000)
kalshi-pp-cli structured-targets get - — 通过ID获取特定结构化目标数据的端点
kalshi-pp-cli structured-targets get-structuredtargets
Finding the right command
查找合适的命令
When you know what you want to do but not which command does it, ask the CLI directly:
bash
kalshi-pp-cli which "<capability in your own words>"which02--help当您知道要执行的操作但不知道对应的命令时,可以直接询问CLI:
bash
kalshi-pp-cli which "<用您自己的语言描述功能>"which02--helpRecipes
使用示例
Politics-category P&L this quarter
本季度政治分类盈亏情况
bash
kalshi-pp-cli portfolio attribution --since 2026-01-01 --by category --agent --select 'rows.category,rows.realized_pnl,rows.fills'Realized P&L attributed to Kalshi taxonomy; --select narrows the response to the three fields agents need.
bash
kalshi-pp-cli portfolio attribution --since 2026-01-01 --by category --agent --select 'rows.category,rows.realized_pnl,rows.fills'按Kalshi分类法统计已实现盈亏;参数将响应限制为Agent所需的三个字段。
--selectTrack the Fed-cut market on a watchlist
关注美联储降息市场
bash
kalshi-pp-cli watch add KXFEDFUNDS-26FEB && kalshi-pp-cli watch diff --since 24h --agentAdd ticker to local watchlist, then ask for the per-ticker delta since yesterday.
bash
kalshi-pp-cli watch add KXFEDFUNDS-26FEB && kalshi-pp-cli watch diff --since 24h --agent将代码添加到本地关注列表,然后查询自昨日以来的每个代码价格变化。
Correlate inflation and rate-cut markets
关联通胀和降息市场
bash
kalshi-pp-cli markets correlate KXFEDFUNDS-26FEB KXCPI-26FEB --window 30d --agentPearson r computed locally over snapshot price series for both markets.
bash
kalshi-pp-cli markets correlate KXFEDFUNDS-26FEB KXCPI-26FEB --window 30d --agent基于两个市场的快照价格序列在本地计算皮尔逊相关系数。
Safe paper-trading session
安全模拟交易会话
bash
KALSHI_READ_ONLY=1 kalshi-pp-cli portfolio create-order --ticker KXTEST-2026 --side yes --count 1 --yes-price 50 --action buy --dry-runBoth safety floors engaged: client-side read-only lock + dry-run; never reaches the API.
bash
KALSHI_READ_ONLY=1 kalshi-pp-cli portfolio create-order --ticker KXTEST-2026 --side yes --count 1 --yes-price 50 --action buy --dry-run启用双重安全保障:客户端只读锁 + 试运行模式;不会向API发送请求。
Movers in sports markets, last 24h
过去24小时体育市场波动最大的标的
bash
kalshi-pp-cli markets movers --window 24h --category sports --limit 5 --agentComputes price deltas from market_price_history snapshots; works offline after a sync.
bash
kalshi-pp-cli markets movers --window 24h --category sports --limit 5 --agent基于market_price_history快照计算价格变化;同步后可离线使用。
Auth Setup
认证设置
Kalshi requires composed RSA-PSS signature auth: a UUID access key id (KALSHI_API_KEY) plus an RSA private key file (KALSHI_PRIVATE_KEY_PATH or KALSHI_PRIVATE_KEY). Kalshi issues two key tiers — read-only and read/write — and the CLI honors KALSHI_READ_ONLY=1 (or --read-only) as a client-side lock that blocks every POST/PUT/PATCH/DELETE before signing, regardless of which tier is loaded. Write commands run against a read-only key will surface a 403 from Kalshi; pair with --dry-run while debugging.
Run to verify setup.
kalshi-pp-cli doctorKalshi需要RSA-PSS组合签名认证:UUID访问密钥ID(KALSHI_API_KEY)加上RSA私钥文件(KALSHI_PRIVATE_KEY_PATH或KALSHI_PRIVATE_KEY)。Kalshi提供两种密钥层级——只读和读写,CLI会遵守KALSHI_READ_ONLY=1(或)作为客户端锁,在签名前阻止所有POST/PUT/PATCH/DELETE请求,无论加载的是哪个层级的密钥。使用只读密钥执行写入命令会收到Kalshi返回的403错误;调试时可搭配参数。
--read-only--dry-run执行验证设置是否正确。
kalshi-pp-cli doctorAgent Mode
Agent模式
Add to any command. Expands to: .
--agent--json --compact --no-input --no-color --yes-
Pipeable — JSON on stdout, errors on stderr
-
Filterable —keeps a subset of fields. Dotted paths descend into nested structures; arrays traverse element-wise. Critical for keeping context small on verbose APIs:
--selectbashkalshi-pp-cli api-keys get --agent --select id,name,status -
Previewable —shows the request without sending
--dry-run -
Offline-friendly — sync/search commands can use the local SQLite store when available
-
Non-interactive — never prompts, every input is a flag
在任何命令后添加参数,等效于:。
--agent--json --compact --no-input --no-color --yes-
可管道传输 — 标准输出为JSON,错误信息输出到标准错误
-
可筛选 —参数保留指定字段子集,点路径可深入嵌套结构;数组会遍历每个元素。对于冗长的API,这是缩小上下文的关键:
--selectbashkalshi-pp-cli api-keys get --agent --select id,name,status -
可预览 —参数显示请求内容但不发送
--dry-run -
离线友好 — 同步/搜索命令在可用时可使用本地SQLite存储
-
非交互式 — 从不提示,所有输入均通过标志参数提供
Response envelope
响应信封
Commands that read from the local store or the API wrap output in a provenance envelope:
json
{
"meta": {"source": "live" | "local", "synced_at": "...", "reason": "..."},
"results": <data>
}Parse for data and to know whether it's live or local. A human-readable summary is printed to stderr only when stdout is a terminal — piped/agent consumers get pure JSON on stdout.
.results.meta.sourceN results (live)从本地存储或API读取数据的命令会将输出包装在来源信封中:
json
{
"meta": {"source": "live" | "local", "synced_at": "...", "reason": "..."},
"results": <data>
}解析获取数据,表示数据是实时还是本地的。当标准输出为终端时,会在标准错误输出中打印人类可读的摘要;管道/Agent消费者仅会在标准输出中获取纯JSON。
.results.meta.sourceN results (live)Agent Feedback
Agent反馈
When you (or the agent) notice something off about this CLI, record it:
kalshi-pp-cli feedback "the --since flag is inclusive but docs say exclusive"
kalshi-pp-cli feedback --stdin < notes.txt
kalshi-pp-cli feedback list --json --limit 10Entries are stored locally at . They are never POSTed unless is set AND either is passed or . Default behavior is local-only.
~/.kalshi-pp-cli/feedback.jsonlKALSHI_FEEDBACK_ENDPOINT--sendKALSHI_FEEDBACK_AUTO_SEND=trueWrite what surprised you, not a bug report. Short, specific, one line: that is the part that compounds.
当您(或Agent)发现此CLI存在问题时,可以记录反馈:
kalshi-pp-cli feedback "--since参数是包含性的,但文档说是排他性的"
kalshi-pp-cli feedback --stdin < notes.txt
kalshi-pp-cli feedback list --json --limit 10反馈条目存储在本地文件中,除非设置了且传递了参数或设置了,否则不会发送到服务器。默认行为仅存储在本地。
~/.kalshi-pp-cli/feedback.jsonlKALSHI_FEEDBACK_ENDPOINT--sendKALSHI_FEEDBACK_AUTO_SEND=true请记录让您感到意外的内容,而非正式的错误报告。简短、具体、单行描述:这样的反馈更有价值。
Output Delivery
输出交付
Every command accepts . The output goes to the named sink in addition to (or instead of) stdout, so agents can route command results without hand-piping. Three sinks are supported:
--deliver <sink>| Sink | Effect |
|---|---|
| Default; write to stdout only |
| Atomically write output to |
| POST the output body to the URL ( |
Unknown schemes are refused with a structured error naming the supported set. Webhook failures return non-zero and log the URL + HTTP status on stderr.
每个命令都支持参数,输出会发送到指定的接收器(同时或替代标准输出),因此Agent无需手动管道即可路由命令结果。支持三种接收器:
--deliver <sink>| 接收器 | 效果 |
|---|---|
| 默认值;仅输出到标准输出 |
| 原子性地将输出写入 |
| 将输出体POST到指定URL( |
不支持的协议会返回结构化错误,并列出支持的类型。Webhook失败时返回非零退出码,并在标准错误输出中记录URL和HTTP状态码。
Named Profiles
命名配置文件
A profile is a saved set of flag values, reused across invocations. Use it when a scheduled agent calls the same command every run with the same configuration - HeyGen's "Beacon" pattern.
kalshi-pp-cli profile save briefing --json
kalshi-pp-cli --profile briefing api-keys get
kalshi-pp-cli profile list --json
kalshi-pp-cli profile show briefing
kalshi-pp-cli profile delete briefing --yesExplicit flags always win over profile values; profile values win over defaults. lists all available profiles under so introspecting agents discover them at runtime.
agent-contextavailable_profiles配置文件是一组保存的标志值,可在多次调用中复用。适用于定时Agent每次运行都使用相同配置调用同一命令的场景——即HeyGen的"Beacon"模式。
kalshi-pp-cli profile save briefing --json
kalshi-pp-cli --profile briefing api-keys get
kalshi-pp-cli profile list --json
kalshi-pp-cli profile show briefing
kalshi-pp-cli profile delete briefing --yes显式标志始终优先于配置文件值;配置文件值优先于默认值。会在下列出所有可用配置文件,因此Agent可在运行时自动发现它们。
agent-contextavailable_profilesExit Codes
退出码
| Code | Meaning |
|---|---|
| 0 | Success |
| 2 | Usage error (wrong arguments) |
| 3 | Resource not found |
| 4 | Authentication required |
| 5 | API error (upstream issue) |
| 7 | Rate limited (wait and retry) |
| 10 | Config error |
| 代码 | 含义 |
|---|---|
| 0 | 成功 |
| 2 | 使用错误(参数错误) |
| 3 | 资源未找到 |
| 4 | 需要认证 |
| 5 | API错误(上游问题) |
| 7 | 速率限制(等待后重试) |
| 10 | 配置错误 |
Argument Parsing
参数解析
Parse :
$ARGUMENTS- Empty, , or
help→ show--helpoutputkalshi-pp-cli --help - Starts with → ends with
install→ MCP installation; otherwise → see Prerequisites abovemcp - Anything else → Direct Use (execute as CLI command with )
--agent
解析:
$ARGUMENTS- 为空、或
help→ 显示--help输出kalshi-pp-cli --help - 以开头 → 以
install结尾 → 安装MCP;否则 → 参见顶部的前提条件mcp - 其他情况 → 直接使用(添加参数执行CLI命令)
--agent
MCP Server Installation
MCP服务器安装
- Install the MCP server:
bash
go install github.com/mvanhorn/printing-press-library/library/other/kalshi/cmd/kalshi-pp-mcp@latest - Register with Claude Code:
bash
claude mcp add kalshi-pp-mcp -- kalshi-pp-mcp - Verify:
claude mcp list
- 安装MCP服务器:
bash
go install github.com/mvanhorn/printing-press-library/library/other/kalshi/cmd/kalshi-pp-mcp@latest - 注册到Claude Code:
bash
claude mcp add kalshi-pp-mcp -- kalshi-pp-mcp - 验证:
claude mcp list
Direct Use
直接使用
- Check if installed: If not found, offer to install (see Prerequisites at the top of this skill).
which kalshi-pp-cli - Match the user query to the best command from the Unique Capabilities and Command Reference above.
- Execute with the flag:
--agentbashkalshi-pp-cli <command> [subcommand] [args] --agent - If ambiguous, drill into subcommand help: .
kalshi-pp-cli <command> --help
- 检查是否已安装:如果未找到,提供安装选项(参见顶部的前提条件)。
which kalshi-pp-cli - 将用户查询与上述独特功能和命令参考中的最佳命令匹配。
- 添加参数执行:
--agentbashkalshi-pp-cli <command> [subcommand] [args] --agent - 如果存在歧义,查看子命令帮助:。
kalshi-pp-cli <command> --help