Communitygithub.com

cli-anything-slay-the-spire-ii

一個狀態化的命令列介面,透過本機 HTTP API 控制真實的《殺戮尖塔 2》遊戲。

cli-anything-slay-the-spire-ii 是什麼?

此技能提供一個命令列工具,讓 AI 代理程式或開發者能直接操控本機執行的《殺戮尖塔 2》遊戲。它透過 `STS2_Bridge` 模組與遊戲內部通訊,讀取正規化的遊戲狀態,並發送動作指令(例如出牌、選擇路線、領取獎勵)。支援《殺戮尖塔 2》中的所有主要遊戲環節:主選單、戰鬥、地圖、事件、商店、休息處、卡牌/遺物選擇等。代理程式應先讀取 `state` 指令回傳的 `decision` 欄位,以判斷目前畫面,再執行對應指令(如 `play-card`、`choose-map`)。每次動作後建議重新讀取狀態,因為戰鬥中的索引與能量值會持續變化。此工具適用於需要自動化測試、強化學習訓練、或開發遊戲 AI 的場景,支援 Python 3.10+ 及 Steam 版《殺戮尖塔 2》。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/HKUDS/CLI-Anything/tree/main/skills/cli-anything-slay-the-spire-ii

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

cli-anything-slay-the-spire-ii 是做什麼的?

一個狀態化的命令列介面,用於透過本機 STS2_Bridge 模組控制真實的《殺戮尖塔 2》遊戲。CLI 會讀取正規化的遊戲狀態,並透過本機 HTTP API (localhost:15526) 發送動作指令。

安裝說明

此 CLI 需要在遊戲程序中執行一個橋接模組。CLI 與橋接模組都從同一個儲存庫發布:

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

1. 安裝 CLI

git clone https://github.com/HKUDS/CLI-Anything.git
cd CLI-Anything/slay_the_spire_ii/agent-harness
pip install -e .

2. 建置與安裝橋接模組

橋接模組是一個必須編譯並安裝到遊戲目錄的 .NET 9 插件。完整說明請參考儲存庫的 README,簡要步驟如下:

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

如果建置腳本無法自動偵測遊戲資料目錄,請明確設定 STS2_GAME_DATA_DIR:

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

3. 啟用模組並驗證

透過 Steam 啟動《殺戮尖塔 2》,在模組管理器中啟用 STS2_Bridge 模組,然後驗證連線:

cli-anything-sts2 state

如果回傳 JSON,表示 CLI 與橋接模組已成功連線。

必要條件:

  • Python 3.10+
  • 已啟用 STS2_Bridge 模組的 Steam 版《殺戮尖塔 2》
  • .NET 9 SDK(僅用於建置橋接模組)

使用方式

基本指令

# 讀取正規化的遊戲狀態(始終從此開始)
cli-anything-sts2 state

# 啟動互動式 REPL 模式(預設)
cli-anything-sts2

# 顯示所有可用指令
cli-anything-sts2 --help

指令群組

狀態檢查

指令說明
state包含 decision 欄位的正規化狀態
raw-state原始橋接 JSON

主選單

指令說明
continue-game繼續存檔進度
start-game --character IRONCLAD --ascension 0開始新遊戲
abandon-game放棄當前存檔
return-to-main-menu從任何畫面返回主選單

角色:IRONCLAD、SILENT、DEFECT、NECROBINDER、REGENT

戰鬥

指令說明
play-card <index> [--target <enemy_id>]從手牌中出牌
use-potion <slot> [--target <enemy_id>]使用藥水
end-turn結束當前回合

地圖與房間流程

指令說明
choose-map <index>選擇地圖節點
proceed離開當前房間

獎勵

指令說明
claim-reward <index>領取戰鬥獎勵
pick-card-reward <index>選擇卡牌獎勵
skip-card-reward跳過卡牌獎勵
claim-treasure-relic <index>領取寶箱遺物
select-relic <index>選擇遺物
skip-relic-selection跳過遺物選擇

事件與休息處

指令說明
event <index>選擇事件選項
advance-dialogue推進純對話事件
rest <index>選擇營火行動

商店

指令說明
shop-buy <index>從商店購買

卡牌/遺物選擇覆疊

指令說明
select-card <index>在覆疊中選擇卡牌
confirm-selection確認當前選擇
cancel-selection取消當前選擇
combat-select-card <index>在戰鬥覆疊中選擇卡牌
combat-confirm-selection確認戰鬥卡牌選擇

原始動作

指令說明
action <name> --kv key=value發送原始橋接動作

決策狀態

state 指令回傳的 JSON 中包含一個 decision 欄位,用於指示當前的遊戲畫面。請根據此值來決定下一步指令:

決策狀態含義常用的後續指令
menu主選單continue-game, start-game
combat_play戰鬥中,你的回合play-card, use-potion, end-turn
hand_select卡牌選擇覆疊combat-select-card, combat-confirm-selection
map_select地圖節點選擇choose-map
game_over遊戲結束return-to-main-menu
combat_rewards戰鬥後獎勵claim-reward, proceed
card_reward卡牌獎勵選擇pick-card-reward, skip-card-reward
event_choice事件畫面event, advance-dialogue
rest_site營火rest
shop商店畫面shop-buy, proceed
card_select卡牌選擇畫面select-card, confirm-selection
relic_select遺物選擇select-relic, skip-relic-selection
treasure寶箱房間claim-treasure-relic, proceed

設定

選項預設值說明
--base-urlhttp://localhost:15526橋接 API URL
--timeout10.0HTTP 逾時秒數

給 AI 代理程式的提示

  1. 務必先讀取 state 以取得 decision 欄位
  2. 每次動作後重新讀取狀態——戰鬥中的索引與能量會持續變化
  3. 檢查回傳碼——0 代表成功,非零值代表錯誤
  4. 解析 stdout 以取得 JSON 輸出

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

cli-anything-adguardhome

>-

cli-anything-anygen

>-

cli-anything-audacity

>-

cli-anything-blender

>-

cli-anything-browser

Browser automation CLI using DOMShell MCP server. Maps Chrome

cli-anything-calibre

>-

cli-anything-ccswitch

CLI interface for CC Switch — manage AI coding tool configurations from the terminal

cli-anything-chromadb

>-

cli-anything-cloudanalyzer

Command-line interface for CloudAnalyzer — Agent-friendly harness for CloudAnalyzer, a QA platform for mapping, localization, and perception outputs. Supports 27 commands across 8 groups: point cloud evaluation, trajectory evaluation, ground segmentation QA, config-driven quality gates, baseline evolution, processing, visualization, and interactive REPL.

cli-anything-cloudcompare

Command-line interface for CloudCompare — Agent-friendly harness for CloudCompare, the open-source 3D point cloud and mesh processing software. Supports 41 commands across 9 groups: project management, session control, point cloud operations (subsample, filter, segment, analyze), mesh operations, distance computation (C2C, C2M), transformations (ICP, matrix), export (LAS/LAZ/PLY/PCD/OBJ/STL/E57), and interactive REPL.

cli-anything-comfyui

>-

cli-anything-dify-workflow

Wrapper for the Dify workflow DSL CLI. Create, inspect, validate, edit, and export Dify workflow files through a CLI-Anything harness.

cli-anything-drawio

>-

cli-anything-eez-studio

Use EEZ Studio from the command line: inspect and modify native .eez-project files, edit LVGL screens/widgets, manage SCPI commands, and invoke the real EEZ Studio backend for LVGL builds.

cli-anything-eth2-quickstart

>-

cli-anything-exa

>-

cli-anything-firefly-iii

Firefly III CLI - Personal finance management via CLI-Anything

cli-anything-freecad

Complete CLI harness for FreeCAD parametric 3D CAD modeler (258 commands). Covers ALL workbenches: Part (29 primitives + boolean + mirror + loft + sweep), Sketcher (26 cmds: geometry + constraints + editing), PartDesign (38 cmds: pad/pocket/groove/fillet/chamfer/patterns/hole/datum), Assembly (11 cmds), Mesh (16 cmds), TechDraw (15 cmds: views + dimensions + PDF/SVG), Draft (33 cmds: 2D shapes + arrays + transforms), FEM (12 cmds), CAM/CNC (10 cmds), Surface (6 cmds), Spreadsheet (7 cmds), Import (13 formats), Export (17 formats), Measure (12 cmds), Materials (21 presets). Headless FreeCAD export to STEP/IGES/STL/OBJ/DXF/PDF/glTF/3MF.

cli-anything-gimp

>-

cli-anything-godot

>-

相關技能