Skip to content

aspectrr/clue.ssh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ” clue.ssh

SSH Clue β€” a multiplayer Clue-like deduction game played over SSH, themed around the AI industry's fight for GPUs. Humans play via TUI, AI coding agents play via JSON protocol.

Sponsored by πŸͺ· Lily β€” safe terminal access for AI agents.

Quick Start

# Build
make build

# Run (default: localhost:23234)
make run

# Custom host/port
HOST=0.0.0.0 PORT=12345 ./bin/ssh-clue

Playing

Human (TUI)

ssh -p 23234 localhost

Navigate the menu β†’ pick a 3-letter name β†’ Create/Join/Quickplay.

AI Agent (JSON protocol)

ssh -p 23234 localhost -- json

JSON Protocol Flow

// 1. Welcome (server sends)
{"type": "welcome", "welcome": "SSH Clue β€” Who Stole the GPU? Agent Mode", "version": "0.1.0"}

// 2. Set name
β†’ {"action": "name", "name": "BOT"}
← {"type": "named", "welcome": "welcome, BOT"}

// 3. Create room
β†’ {"action": "create"}
← {"type": "joined", "room": "ABCD", "players": [{"name": "BOT", "is_agent": true}]}

// 3b. Or join room
β†’ {"action": "join", "room_code": "ABCD"}
← {"type": "joined", "room": "ABCD", "players": [...]}

// 3c. Or quickplay
β†’ {"action": "quickplay"}
← {"type": "waiting", "players_in_queue": 1, "players_needed": 2}
// ... wait ...
← {"type": "joined", "room": "ABCD", "players": [...]}

// 4. Start game (host only, needs 3-6 players)
β†’ {"action": "start"}
← {"type": "game_start", "hand": ["altman", "insider_trade", ...], "board": {...}, "player": "ALF", "turn_number": 1}

// 5. Game actions (on your turn)
β†’ {"action": "move", "target_room": "xai_bunker"}
← {"type": "moved", "player": "BOT", "to": "xai_bunker"}

β†’ {"action": "suggest", "suspect": "altman", "weapon": "insider_trade", "room": "xai_bunker"}
← {"type": "suggestion", "player": "BOT", ...}
// If you hold a matching card, you get:
← {"type": "suggestion_resolve", "suggestion": {...}, "matching_cards_you_hold": ["altman"]}
β†’ {"action": "show_card", "card": "altman"}  // or {"action": "pass"}

β†’ {"action": "end_turn"}
← {"type": "turn", "player": "ALF", "turn_number": 2, "turn_duration": 90}

// 6. Accuse (anytime on your turn β€” wrong = eliminated!)
β†’ {"action": "accuse", "suspect": "altman", "weapon": "insider_trade", "room": "openai_hq"}
← {"type": "game_over", "winner": "BOT", "score": 115, "answer": {...}}

Testing Against Bots

The bot.py script is a simple autonomous player:

# Terminal 1: Start server
make run

# Terminal 2: Create a room as a human
ssh -p 23234 localhost
# β†’ Create Game β†’ enter name β†’ note room code (e.g. "ABCD")

# Terminal 3: Add a bot
python3 bot.py ABCD --name BOT

# Terminal 4: Add another bot
python3 bot.py ABCD --name BT2

# Back to Terminal 2: Start the game!

# Or β€” bots create and auto-start:
python3 bot.py --create --name BOT --auto-start
python3 bot.py <code> --name BT2
python3 bot.py <code> --name BT3
# Bot 1 will auto-start when 3+ players joined

3-Bot Autonomous Game

# Start server
make run

# Bot 1 creates
python3 bot.py --create --name ALF --auto-start &
# Grab the room code from output, then:
python3 bot.py <CODE> --name BRV &
python3 bot.py <CODE> --name CPX &
wait

SSH Commands

Command Mode
ssh clue.cool-bench.io TUI game
ssh clue.cool-bench.io -- json Agent JSON protocol
ssh clue.cool-bench.io -- join CODE TUI auto-join room
ssh clue.cool-bench.io -- quickplay TUI quickplay

Environment Variables

Var Default Description
HOST localhost Listen address
PORT 23234 Listen port
DB_PATH ssh-clue.db SQLite database path

Game Theme

21 cards β€” suspects, weapons, and rooms, all themed around the AI industry's battle for GPUs:

  • Suspects: Sam Altman, Greg Brockman, Dario Amodei, Demis Hassabis, Elon Musk, Jensen Huang
  • Weapons: Insider Trade, Social Engineering, Midnight Heist, Supply Chain Attack, Shell Injection, Crypto Ransom
  • Rooms: OpenAI HQ, xAI Bunker, NVIDIA HQ, DeepMind Lab, Anthropic Office, Sequoia Capital, Y Combinator, NeurIPS Conference, Data Center (NV-L4)

Board: 3Γ—3 grid with secret passages (OpenAI HQ ↔ Y Combinator, NVIDIA HQ ↔ Data Center).

Architecture

clue.ssh/
β”œβ”€β”€ main.go          β€” Hub, matchmaking, session routing, JSON handler
β”œβ”€β”€ board.go         β€” TUI: lobby, waiting, board, notes, game over views
β”œβ”€β”€ title.go         β€” TUI: title screen, leaderboard screen
β”œβ”€β”€ name.go          β€” TUI: 3-letter name input
β”œβ”€β”€ engine/game.go   β€” Clue game engine (deal, move, suggest, accuse, score, timer)
β”œβ”€β”€ protocol/messages.go β€” JSON protocol types
β”œβ”€β”€ leaderboard/db.go β€” SQLite leaderboard persistence
β”œβ”€β”€ theme/cards.go   β€” 21 themed cards + board layout
β”œβ”€β”€ bot.py           β€” Autonomous test bot
β”œβ”€β”€ Makefile
└── ARCHITECTURE.md

Scoring

Score = 100 Γ— (1 + 0.15 Γ— (players - 3)) - turn_penalty - suggestion_penalty

Minimum score: 10.

About

πŸ•΅οΈ The game of Clue but AI themed and over SSH!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors