cli-anything-slay-the-spire-ii
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesecli-anything-slay-the-spire-ii
cli-anything-slay-the-spire-ii
A stateful command-line interface for controlling the real Slay the Spire 2
game through the local mod. The CLI reads normalized game state
and sends action commands via a local HTTP API at .
STS2_Bridgelocalhost:15526一个有状态的命令行界面,通过本地 mod控制真实的《杀戮尖塔2》游戏。该CLI通过本地HTTP API(地址为)读取标准化游戏状态并发送操作指令。
STS2_Bridgelocalhost:15526Installation
安装
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此CLI需要一个运行在游戏进程内的桥接mod。CLI和桥接mod均从同一仓库分发:
https://github.com/HKUDS/CLI-Anything1. Install the CLI
1. 安装CLI
bash
git clone https://github.com/HKUDS/CLI-Anything.git
cd CLI-Anything/slay_the_spire_ii/agent-harness
pip install -e .bash
git clone https://github.com/HKUDS/CLI-Anything.git
cd CLI-Anything/slay_the_spire_ii/agent-harness
pip install -e .2. Build and install the bridge mod
2. 构建并安装桥接mod
The bridge mod is a plugin that must be compiled and installed into
the game directory. Full instructions are in the repository README, but the
short version is:
.NET 9bash
cd CLI-Anything/slay_the_spire_ii/agent-harness/bridge/plugin
./build.sh
cd ../install
./install_bridge.shIf the build script cannot auto-detect the game data directory, set
explicitly:
STS2_GAME_DATA_DIRbash
STS2_GAME_DATA_DIR="/path/to/data_sts2" ./build.sh桥接mod是一个插件,必须编译后安装到游戏目录中。完整说明见仓库README,以下是简化步骤:
.NET 9bash
cd CLI-Anything/slay_the_spire_ii/agent-harness/bridge/plugin
./build.sh
cd ../install
./install_bridge.sh如果构建脚本无法自动检测游戏数据目录,请显式设置:
STS2_GAME_DATA_DIRbash
STS2_GAME_DATA_DIR="/path/to/data_sts2" ./build.sh3. Enable the mod and verify
3. 启用mod并验证
Launch Slay the Spire 2 via Steam, enable the mod in the mod
manager, then verify the connection:
STS2_Bridgebash
cli-anything-sts2 stateIf this returns JSON, the CLI and bridge are connected.
Prerequisites:
- Python 3.10+
- Slay the Spire 2 (Steam) with mod enabled
STS2_Bridge - (only needed to build the bridge mod)
.NET 9 SDK
通过Steam启动《杀戮尖塔2》,在mod管理器中启用 mod,然后验证连接:
STS2_Bridgebash
cli-anything-sts2 state如果返回JSON数据,则说明CLI与桥接mod已成功连接。
前置要求:
- Python 3.10+
- 已启用mod的Steam版《杀戮尖塔2》
STS2_Bridge - (仅构建桥接mod时需要)
.NET 9 SDK
Usage
使用方法
Basic Commands
基础命令
bash
undefinedbash
undefinedRead normalized game state (always start here)
读取标准化游戏状态(建议从该命令开始)
cli-anything-sts2 state
cli-anything-sts2 state
Start interactive REPL mode (default)
启动交互式REPL模式(默认模式)
cli-anything-sts2
cli-anything-sts2
Show all available commands
查看所有可用命令
cli-anything-sts2 --help
undefinedcli-anything-sts2 --help
undefinedCommand Groups
命令分组
State Inspection
状态检查
| Command | Description |
|---|---|
| Normalized state with |
| Raw bridge JSON |
| 命令 | 描述 |
|---|---|
| 包含 |
| 桥接mod返回的原始JSON数据 |
Main Menu
主菜单
| Command | Description |
|---|---|
| Continue a saved run |
| Start a new run |
| Abandon the current save |
| Return to menu from any screen |
Characters: , , , ,
IRONCLADSILENTDEFECTNECROBINDERREGENT| 命令 | 描述 |
|---|---|
| 继续已保存的游戏进程 |
| 开启新游戏进程 |
| 放弃当前存档 |
| 从任意界面返回主菜单 |
可选角色:, , , ,
IRONCLADSILENTDEFECTNECROBINDERREGENTCombat
战斗
| Command | Description |
|---|---|
| Play a card from hand |
| Use a potion |
| End the current turn |
| 命令 | 描述 |
|---|---|
| 使用手牌中的指定卡牌 |
| 使用指定槽位的药水 |
| 结束当前回合 |
Map & Room Flow
地图与房间流程
| Command | Description |
|---|---|
| Select a map node |
| Leave the current room |
| 命令 | 描述 |
|---|---|
| 选择地图节点 |
| 离开当前房间 |
Rewards
奖励
| Command | Description |
|---|---|
| Claim a combat reward |
| Pick a card reward |
| Skip the card reward |
| Claim a treasure relic |
| Select a relic |
| Skip relic selection |
| 命令 | 描述 |
|---|---|
| 领取战斗奖励 |
| 选择卡牌奖励 |
| 跳过卡牌奖励选择 |
| 领取宝藏遗物 |
| 选择遗物 |
| 跳过遗物选择 |
Events & Rest Sites
事件与休息站点
| Command | Description |
|---|---|
| Choose an event option |
| Advance dialogue-only events |
| Choose a campfire action |
| 命令 | 描述 |
|---|---|
| 选择事件选项 |
| 推进纯对话类事件 |
| 选择营火操作 |
Shop
商店
| Command | Description |
|---|---|
| Buy from the shop |
| 命令 | 描述 |
|---|---|
| 从商店购买物品 |
Card/Relic Selection Overlays
卡牌/遗物选择弹窗
| Command | Description |
|---|---|
| Select a card in overlay |
| Confirm the current selection |
| Cancel the current selection |
| Select a card during combat overlay |
| Confirm combat card selection |
| 命令 | 描述 |
|---|---|
| 在弹窗中选择卡牌 |
| 确认当前选择 |
| 取消当前选择 |
| 在战斗弹窗中选择卡牌 |
| 确认战斗卡牌选择 |
Raw Action
原始操作
| Command | Description |
|---|---|
| Send a raw bridge action |
| 命令 | 描述 |
|---|---|
| 发送原始桥接mod操作指令 |
Decision States
决策状态
The command returns JSON with a field indicating the current
game screen. Route your next command based on this value:
statedecision| Decision | Meaning | Typical Next Commands |
|---|---|---|
| Main menu | |
| In combat, your turn | |
| Card selection overlay | |
| Map node selection | |
| Run ended | |
| Post-combat rewards | |
| Card reward pick | |
| Event screen | |
| Campfire | |
| Shop screen | |
| Card selection screen | |
| Relic selection | |
| Treasure room | |
statedecision| 决策值 | 含义 | 典型后续命令 |
|---|---|---|
| 主菜单 | |
| 战斗中,我方回合 | |
| 卡牌选择弹窗 | |
| 地图节点选择界面 | |
| 游戏进程结束 | |
| 战后奖励界面 | |
| 卡牌奖励选择界面 | |
| 事件界面 | |
| 营火界面 | |
| 商店界面 | |
| 卡牌选择界面 | |
| 遗物选择界面 | |
| 宝藏房间 | |
Configuration
配置
| Option | Default | Description |
|---|---|---|
| | Bridge API URL |
| | HTTP timeout in seconds |
| 选项 | 默认值 | 描述 |
|---|---|---|
| | 桥接mod API地址 |
| | HTTP请求超时时间(秒) |
For AI Agents
面向AI Agent的指南
- Always read first to get the
statefielddecision - Re-read state after each action - indices and energy change during combat
- Check return codes - 0 for success, non-zero for errors
- Parse stdout for JSON output
- **始终先读取**以获取
state字段decision - 每次操作后重新读取状态 - 战斗中卡牌索引和能量值会发生变化
- 检查返回码 - 0表示成功,非0表示出错
- 解析标准输出获取JSON格式的返回数据