Communitygithub.com

cli-anything-slay-the-spire-ii

一个状态化的命令行界面,通过本地 STS2_Bridge 模组控制真实的《杀戮尖塔 2》游戏。

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

该技能提供了一个命令行界面(CLI),用于通过本地 HTTP API(localhost:15526)与《杀戮尖塔 2》游戏进行交互。它依赖于一个运行在游戏进程内的桥接模组 `STS2_Bridge`,CLI 和桥接模组均从同一个仓库(https://github.com/HKUDS/CLI-Anything)分发。安装过程包括克隆仓库、安装 Python CLI 工具、构建并安装 .NET 9 桥接模组,最后在 Steam 中启用模组。该 CLI 支持丰富的命令组,包括状态检查、主菜单导航、战斗操作(打牌、使用药水、结束回合)、地图与房间流程、奖励领取、事件与休息处、商店、卡牌/遗物选择覆盖层以及发送原始桥接动作。特别适合 AI 智能体使用:推荐先执行 `state` 命令获取带有 `decision` 字段的标准化游戏状态,然后根据 `decision` 的值路由下一步命令,并在每次动作后重新读取状态以确保索引和能量值正确。支持平台包括 Linux、macOS 和 Windows(需安装 Python 3.10+ 和 .NET 9 SDK 进行构建)。

兼容平台~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 模组的《杀戮尖塔 2》(Steam)
  • .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

>-

相关技能