
Slay the Spire CLI
FreeControl Slay the Spire 2 through a command-line interface.
Free · Opens the source repo
What Slay the Spire CLI does
The Slay the Spire CLI provides a command-line interface (CLI) for interacting with the popular game Slay the Spire 2. This tool enables players to control the game through a local bridge mod that communicates with the game via an HTTP API. By reading the normalized game state, users can send various action commands for combat, navigation, and menu management directly from their terminal. This integration allows for a unique way to experience the game, especially for those who prefer command-line interactions or are looking to automate certain aspects of gameplay.
To get started, users must install both the CLI and the accompanying bridge mod, which is a .NET 9 plugin. The installation process involves cloning the repository, building the bridge, and ensuring that it is properly installed in the game directory. Once set up, players can launch Slay the Spire 2, enable the mod, and verify the connection to the CLI. The CLI allows for a range of commands, including inspecting the game state, managing combat actions, and navigating the game menus.
This skill is particularly useful for players who want to streamline their gameplay or automate repetitive tasks within Slay the Spire 2. It opens up possibilities for advanced users to create scripts or tools that can enhance their gaming experience. The CLI also supports a variety of commands for different game scenarios, making it flexible and adaptable to user preferences.
Overall, the Slay the Spire CLI is an innovative tool for players looking to interact with the game in a new way. It combines the power of command-line operations with the engaging mechanics of Slay the Spire 2, offering a unique experience for both casual and dedicated players.
When to use it
Use this CLI when you want to automate actions or manage your game state without relying solely on traditional gameplay controls.
When not to use it
This is not suitable for players who prefer a graphical interface or are not comfortable with command-line operations.
What you can build with it
Automate Combat Actions
Use the CLI to automate playing cards and using potions during combat, enhancing efficiency.
Quick Game State Inspection
Quickly check the current game state and make informed decisions based on the returned JSON.
Streamline Navigation
Easily navigate through menus and manage game actions without using the mouse.
How to install Slay the Spire CLI
View source1. Install with the skills CLI
npx skills add hkuds/cli-anything/cli-anything-slay-the-spire-ii --agent claude-code2. 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 hkudscli-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_Bridgemod 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
| Command | Description |
|---|---|
state | Normalized state with decision field |
raw-state | Raw bridge JSON |
Main Menu
| Command | Description |
|---|---|
continue-game | Continue a saved run |
start-game --character IRONCLAD --ascension 0 | Start a new run |
abandon-game | Abandon the current save |
return-to-main-menu | Return to menu from any screen |
Characters: IRONCLAD, SILENT, DEFECT, NECROBINDER, REGENT
Combat
| Command | Description |
|---|---|
play-card <index> [--target <enemy_id>] | Play a card from hand |
use-potion <slot> [--target <enemy_id>] | Use a potion |
end-turn | End the current turn |
Map & Room Flow
| Command | Description |
|---|---|
choose-map <index> | Select a map node |
proceed | Leave the current room |
Rewards
| Command | Description |
|---|---|
claim-reward <index> | Claim a combat reward |
pick-card-reward <index> | Pick a card reward |
skip-card-reward | Skip the card reward |
claim-treasure-relic <index> | Claim a treasure relic |
select-relic <index> | Select a relic |
skip-relic-selection | Skip relic selection |
Events & Rest Sites
| Command | Description |
|---|---|
event <index> | Choose an event option |
advance-dialogue | Advance dialogue-only events |
rest <index> | Choose a campfire action |
Shop
| Command | Description |
|---|---|
shop-buy <index> | Buy from the shop |
Card/Relic Selection Overlays
| Command | Description |
|---|---|
select-card <index> | Select a card in overlay |
confirm-selection | Confirm the current selection |
cancel-selection | Cancel the current selection |
combat-select-card <index> | Select a card during combat overlay |
combat-confirm-selection | Confirm combat card selection |
Raw Action
| Command | Description |
|---|---|
action <name> --kv key=value | Send 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:
| Decision | Meaning | Typical Next Commands |
|---|---|---|
menu | Main menu | continue-game, start-game |
combat_play | In combat, your turn | play-card, use-potion, end-turn |
hand_select | Card selection overlay | combat-select-card, combat-confirm-selection |
map_select | Map node selection | choose-map |
game_over | Run ended | return-to-main-menu |
combat_rewards | Post-combat rewards | claim-reward, proceed |
card_reward | Card reward pick | pick-card-reward, skip-card-reward |
event_choice | Event screen | event, advance-dialogue |
rest_site | Campfire | rest |
shop | Shop screen | shop-buy, proceed |
card_select | Card selection screen | select-card, confirm-selection |
relic_select | Relic selection | select-relic, skip-relic-selection |
treasure | Treasure room | claim-treasure-relic, proceed |
Configuration
| Option | Default | Description |
|---|---|---|
--base-url | http://localhost:15526 | Bridge API URL |
--timeout | 10.0 | HTTP timeout in seconds |
For AI Agents
- Always read
statefirst to get thedecisionfield - 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
Frequently asked questions about Slay the Spire CLI
Similar skills
Command-Line Interface for Slay the Spire 2
Control Slay the Spire 2 through a powerful CLI.
Faceless Explainer
Create explainer videos from text without real assets.
Create Video
Generate videos from text prompts effortlessly.
Avatar Video
Create customizable AI avatar videos with ease.
Meme Factory
Generate memes effortlessly with memegen.link API.
Podcast Generation
Transform text into engaging podcast audio.
