New to Claude Skills? Learn how to install them →

hkuds on GitHub

Command-Line Interface for Slay the Spire 2

Free

Control Slay the Spire 2 through a powerful CLI.

by hkuds46.9k stars on hkuds/cli-anything
3 views
Updated Aug 3, 2026
Get this skill

Free · Opens the source repo

What Command-Line Interface for Slay the Spire 2 does

The Command-Line Interface for Slay the Spire 2 provides a direct way to interact with the game using a local bridge mod. This tool allows users to control various aspects of the game, including combat, navigation, and rewards, through a set of commands executed in a terminal. By leveraging a local HTTP API, the CLI reads the normalized game state and sends action commands, making it an efficient way to automate gameplay or experiment with different strategies without needing to rely solely on the game’s graphical interface.

To use this CLI, you must first install the STS2_Bridge mod, which acts as a bridge between the game and the CLI. This involves compiling a .NET 9 plugin and installing it into the game directory. Once set up, users can execute commands to inspect game states, manage menus, engage in combat, navigate maps, and handle rewards. The CLI is designed for users who are comfortable with command-line operations and want to enhance their gameplay experience by automating repetitive tasks or testing different scenarios.

This skill is particularly useful for developers and designers interested in game mechanics, as it provides a hands-on way to manipulate game states and observe the effects of various actions in real-time. Whether you are a modder looking to create custom gameplay experiences or a player wanting to streamline your sessions, this CLI offers a comprehensive toolkit to interact with Slay the Spire 2 effectively.

Overall, the Command-Line Interface for Slay the Spire 2 is a powerful addition for anyone looking to gain deeper insights into the game or automate their interactions with it. Its reliance on a local bridge mod means that users need to be prepared to handle some setup, but the flexibility and control it offers are well worth the effort.

When to use it

Use this CLI when you want to automate gameplay actions or inspect game states in Slay the Spire 2.

When not to use it

This is not suitable for users unfamiliar with command-line interfaces or those who prefer a purely graphical interface.

What you can build with it

Automating Gameplay

Use the CLI to automate repetitive actions in Slay the Spire 2, enhancing your efficiency during runs.

Testing Game Mechanics

Developers can use the CLI to manipulate game states and test various mechanics without manual input.

Streamlining Strategy Execution

Players can quickly execute a series of commands to implement specific strategies during gameplay.

How to install Command-Line Interface for Slay the Spire 2

View source

1. Install with the skills CLI

npx skills add hkuds/cli-anything/skills --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by hkuds

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

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

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:

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

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

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:

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

# Read normalized game state (always start here)
cli-anything-sts2 state

# Start interactive REPL mode (default)
cli-anything-sts2

# Show all available commands
cli-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

Frequently asked questions about Command-Line Interface for Slay the Spire 2

Similar skills