Cli Anything Slay The Spire Ii

作者 hkuds34f519533bc1無授權條款51K 個星標收錄於 2026年10月8日更新於 2026年10月8日儲存庫2 週前更新

Command-line interface for Slay the Spire 2 - Control the real game through a local bridge mod HTTP API. Reads normalized game state and sends action commands for combat, navigation, rewards, and menu management.

僅含說明Other
AI 產生的概覽

透過本機橋接模組 HTTP API 控制《殺戮尖塔 2》,讀取遊戲狀態並送出操作指令。

功能
提供具狀態的命令列介面,透過本機 HTTP API 從 STS2_Bridge 模組讀取正規化遊戲狀態,並回傳操作指令。涵蓋戰鬥、地圖與房間移動、獎勵、事件、休息點、商店,以及卡牌或遺物選擇畫面。state 命令會傳回含 decision 欄位的 JSON,用來指出目前畫面並提示下一步可用命令。
適用情境
適合以程式方式操作《殺戮尖塔 2》的即時對局,例如自動執行戰鬥回合、選擇地圖節點或領取獎勵。也適合需要先檢查遊戲狀態、再依目前畫面送出對應操作的代理工作流程。
執行需求
需要 Python 3.10+、Steam 版《殺戮尖塔 2》並啟用 STS2_Bridge 模組,以及位於 localhost:15526 的本機 HTTP 橋接服務。建置橋接模組需要 .NET 9 SDK 與遊戲資料目錄。此技能僅包含說明文件,未附指令碼。

cli-anything-slay-the-spire-ii

A stateful command-line interface for controlling the real Slay the Spire 2 game through the local STS2_Bridge mod. The CLI reads normalized game state and sends action commands via a local HTTP API at localhost:15526.

Installation

This CLI requires a bridge mod that runs inside the game process. Both the CLI and the bridge are distributed from the same repository:

https://github.com/HKUDS/CLI-Anything

1. Install the CLI

bash
git clone https://github.com/HKUDS/CLI-Anything.gitcd CLI-Anything/slay_the_spire_ii/agent-harnesspip install -e .

2. Build and install the bridge mod

The bridge mod is a .NET 9 plugin that must be compiled and installed into the game directory. Full instructions are in the repository README, but the short version is:

bash
cd CLI-Anything/slay_the_spire_ii/agent-harness/bridge/plugin./build.shcd ../install./install_bridge.sh

If the build script cannot auto-detect the game data directory, set STS2_GAME_DATA_DIR explicitly:

bash
STS2_GAME_DATA_DIR="/path/to/data_sts2" ./build.sh

3. Enable the mod and verify

Launch Slay the Spire 2 via Steam, enable the STS2_Bridge mod in the mod manager, then verify the connection:

bash
cli-anything-sts2 state

If this returns JSON, the CLI and bridge are connected.

Prerequisites:

  • Python 3.10+
  • Slay the Spire 2 (Steam) with STS2_Bridge mod enabled
  • .NET 9 SDK (only needed to build the bridge mod)

Usage

Basic Commands

bash
# Read normalized game state (always start here)cli-anything-sts2 state
# Start interactive REPL mode (default)cli-anything-sts2
# Show all available commandscli-anything-sts2 --help

Command Groups

State Inspection

CommandDescription
stateNormalized state with decision field
raw-stateRaw bridge JSON

Main Menu

CommandDescription
continue-gameContinue a saved run
start-game --character IRONCLAD --ascension 0Start a new run
abandon-gameAbandon the current save
return-to-main-menuReturn to menu from any screen

Characters: IRONCLAD, SILENT, DEFECT, NECROBINDER, REGENT

Combat

CommandDescription
play-card <index> [--target <enemy_id>]Play a card from hand
use-potion <slot> [--target <enemy_id>]Use a potion
end-turnEnd the current turn

Map & Room Flow

CommandDescription
choose-map <index>Select a map node
proceedLeave the current room

Rewards

CommandDescription
claim-reward <index>Claim a combat reward
pick-card-reward <index>Pick a card reward
skip-card-rewardSkip the card reward
claim-treasure-relic <index>Claim a treasure relic
select-relic <index>Select a relic
skip-relic-selectionSkip relic selection

Events & Rest Sites

CommandDescription
event <index>Choose an event option
advance-dialogueAdvance dialogue-only events
rest <index>Choose a campfire action

Shop

CommandDescription
shop-buy <index>Buy from the shop

Card/Relic Selection Overlays

CommandDescription
select-card <index>Select a card in overlay
confirm-selectionConfirm the current selection
cancel-selectionCancel the current selection
combat-select-card <index>Select a card during combat overlay
combat-confirm-selectionConfirm combat card selection

Raw Action

CommandDescription
action <name> --kv key=valueSend a raw bridge action

Decision States

The state command returns JSON with a decision field indicating the current game screen. Route your next command based on this value:

DecisionMeaningTypical Next Commands
menuMain menucontinue-game, start-game
combat_playIn combat, your turnplay-card, use-potion, end-turn
hand_selectCard selection overlaycombat-select-card, combat-confirm-selection
map_selectMap node selectionchoose-map
game_overRun endedreturn-to-main-menu
combat_rewardsPost-combat rewardsclaim-reward, proceed
card_rewardCard reward pickpick-card-reward, skip-card-reward
event_choiceEvent screenevent, advance-dialogue
rest_siteCampfirerest
shopShop screenshop-buy, proceed
card_selectCard selection screenselect-card, confirm-selection
relic_selectRelic selectionselect-relic, skip-relic-selection
treasureTreasure roomclaim-treasure-relic, proceed

Configuration

OptionDefaultDescription
--base-urlhttp://localhost:15526Bridge API URL
--timeout10.0HTTP timeout in seconds

For AI Agents

  1. Always read state first to get the decision field
  2. Re-read state after each action - indices and energy change during combat
  3. Check return codes - 0 for success, non-zero for errors
  4. Parse stdout for JSON output

來源與署名

來源:hkuds/cli-anything位於skills/cli-anything-slay-the-spire-ii提交34f5195

授權條款: 無授權條款

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架