Skip to main content
skill CX Codex

cli-anything-slay-the-spire-ii — Claude Code skill: setup and use

Ships a CLI that drives the real Slay the Spire 2 through a local bridge mod, so the agent can read game state and issue moves.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add HKUDS/CLI-Anything --skill cli-anything-slay-the-spire-ii -a claude-code
Open on GitHub

What cli-anything-slay-the-spire-ii does

The skill hands your agent cli-anything-sts2, a command-line tool that controls an actual Slay the Spire 2 run through the STS2_Bridge mod. The bridge runs inside the game process and serves an HTTP API on localhost:15526, so the CLI can pull normalized state and push actions back — play a card, take a map node, claim a reward.

Start with state. It returns JSON with a decision field telling you which screen is up: combat, rewards, shop, campfire, relic pick. Route from there to play-card <index>, choose-map <index>, claim-reward <index> or end-turn. An interactive REPL is the default mode, and action <name> --kv key=value covers anything without a wrapper.

You need Python 3.10+ and the game on Steam with the mod enabled. Building the bridge also takes .NET 9 SDK, since it compiles as a plugin; the scripts build.sh and install_bridge.sh do the work, and STS2_GAME_DATA_DIR points the build at the game data if detection fails. Bridge URL and HTTP timeout are flags: --base-url and --timeout. Fair warning: with the game closed, state has nothing to talk to and returns an error instead of JSON.

What it helps with

  • read combat state as JSON and pick the next move
  • play a card from hand at a chosen enemy
  • walk the map node by node and leave a room
  • claim a combat reward and take the card
  • buy from a shop or choose a campfire action

Example prompts for the agent

  • Run cli-anything-sts2 state and tell me which screen we're on.
  • Play the card at index 0 on the enemy from state, then end the turn.
  • Start a fresh run with start-game --character IRONCLAD --ascension 0.

How to install cli-anything-slay-the-spire-ii

1Skills CLI (Vercel)

npx skills add HKUDS/CLI-Anything --skill cli-anything-slay-the-spire-ii -a claude-code

2Manually: put the files in place

~/.claude/skills/cli-anything-slay-the-spire-ii/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/cli-anything-slay-the-spire-ii/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about cli-anything-slay-the-spire-ii

How do I install cli-anything-slay-the-spire-ii in Claude Code?

With npx skills add HKUDS/CLI-Anything --skill cli-anything-slay-the-spire-ii -a claude-code. The skill lands at ~/.claude/skills/cli-anything-slay-the-spire-ii/SKILL.md.

What does cli-anything-slay-the-spire-ii do?

It gives the agent a CLI for a live Slay the Spire 2 game over the bridge mod: read state, play cards in combat, move across the map, handle rewards and the shop.

What do I need before it works?

Python 3.10+, Slay the Spire 2 on Steam with STS2_Bridge enabled, and .NET 9 SDK if you still have to build the bridge. Without the mod running, cli-anything-sts2 state returns no JSON.

Source text

SKILL.md · Apache-2.0
---
name: "cli-anything-slay-the-spire-ii"
description: >-
  Command-line interface for Slay the Spire 2 - Control the real game through a local bridge mod HTTP API. Reads normalized game state and sends action commands for combat, navigation, rewards, and menu management.
---

# 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

```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

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:

```bash
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:

```bash
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:

```bash
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

```bash
# 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

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

© HKUDS · Apache-2.0 · HKUDS/CLI-Anything

Similar skills

All skills for Agent setup: memory, context, orchestration →

From the same set55

cli-anything-safari Controls real Safari on macOS via a Python Click CLI wrapping the safari-mcp server. Useful for running browser automations while preserving existing logins. CX Codex +1 483installs cli-anything-renderdoc A skill that lets your agent inspect RenderDoc frame captures from the terminal: draw call tree, pipeline state, textures and buffers inside .rdc files. CX Codex +1 482installs cli-anything-cloudcompare CLI harness for CloudCompare point cloud and mesh processing across 41 commands. Automates subsampling, normal computation, SOR filtering, and conversions for AI agents. CX Codex +1 478installs cli-anything-anygen Provides a CLI wrapper around the AnyGen OpenAPI to build slides and diagrams. Useful when automating document workflows in AI agents. CX Codex +1 471installs cli-anything-wiremock A skill that hands your agent a terminal wrapper over the WireMock Admin API: stubs, request counts, scenario states. CX Codex +1 469installs cli-anything-intelwatch Pulls a company profile from a domain: financials, tech stack, and an AI due-diligence pass. Useful before a deal or a sales call. CX Codex +1 468installs cli-anything-mubu A skill that hands your agent a command line for Mubu: it finds documents in local backups, reads node trees and edits them through the live API. CX Codex +1 467installs cli-anything-cloudanalyzer Runs CloudAnalyzer checks for point clouds, trajectories, and ground segmentation. Use it when an agent needs QA thresholds or point-cloud processing from the terminal. CX Codex +1 464installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor