Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Unlike traditional choice-based games, Kleene responds to free-form actions and improvisation. The temperature system lets you control how much the AI adapts - from traditional branching (temp 0) to fully emergent storytelling (temp 10).

🎮 [**Get Started in 5 Minutes**](GETTING_STARTED.md) | 📖 [Documentation](docs/) | 🤝 [Contributing](CONTRIBUTING.md)
🎮 [**Get Started in 5 Minutes**](docs/GETTING_STARTED.md) | 📖 [Documentation](docs/) | 🤝 [Contributing](CONTRIBUTING.md)


## Quick Start
Expand All @@ -26,7 +26,7 @@ Unlike traditional choice-based games, Kleene responds to free-form actions and
/kleene analyze
```

👉 **New to Kleene?** Check out the [Getting Started Guide](GETTING_STARTED.md)
👉 **New to Kleene?** Check out the [Getting Started Guide](docs/GETTING_STARTED.md)

---

Expand Down
57 changes: 57 additions & 0 deletions commands/kleene.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,21 @@ command -v yq >/dev/null 2>&1 && yq --version 2>&1 | head -1

Set `yaml_tool: yq` if output contains "mikefarah/yq" and version >= 4, otherwise `yaml_tool: grep`.

## Server Detection (at session start)

Check if a kleene-server local proxy is running:

```bash
curl -s --connect-timeout 1 http://localhost:8420/health 2>/dev/null
```

If the response contains `"status":"ok"`:
- Set `server_url: http://localhost:8420`
- Set `server_mode: true`
- Remote loading becomes available for all scenarios on the server

The server URL can also be set explicitly via `/kleene server [url]`.

## If no action provided, show menu FIRST

Use AskUserQuestion to present options:
Expand Down Expand Up @@ -533,6 +548,43 @@ Keywords: "export", "transcript", "save story", "save journey", "summary", "stat
If no active game:
"No active game to export. Start a game with /kleene play first."

### Server Actions
Keywords: "server", "connect", "proxy", "remote", "mmo"

**Set Server URL** (`/kleene server [url]`):
1. If URL provided: set `server_url` and test connection
2. If no URL: show current server status

```bash
curl -s --connect-timeout 2 [url]/health 2>/dev/null
```

If response contains `"status":"ok"`:
- Store `server_url` in context
- Set `server_mode: true`
- Report: "Connected to kleene-server at [url] ([mode] mode)"

If connection fails:
- Report: "Cannot reach kleene-server at [url]. Is it running?"

**Show Server Status** (`/kleene server`):
```
Kleene Server Status
URL: http://localhost:8420
Mode: local
Connected: yes
Scenarios: 3 available

Use: /kleene server [url] Set server URL
/kleene server off Disconnect from server
```

**Disconnect** (`/kleene server off`):
1. Clear `server_url` and `server_mode`
2. Confirm: "Disconnected from server. Using local scenarios only."

When `server_mode: true`, the Play menu shows both local and remote scenarios. Remote scenarios are loaded via the server API instead of local files. The game loop uses remote loading mode (see `lib/framework/scenario-file-loading/remote-loading.md`).

### Help Actions
Keywords: "help", "how", "what", "?"

Expand Down Expand Up @@ -599,6 +651,11 @@ SETTINGS
off = Show choice menu (default)
/kleene choice [on|off] Toggle choice mode (inverse of parser)

SERVER
/kleene server Show server connection status
/kleene server [url] Connect to kleene-server
/kleene server off Disconnect from server

DURING GAMEPLAY
Select "Other" or type freely Improvise beyond scripted choices
Your actions shape the story Explore, interact, experiment!
Expand Down
Loading