Implementation:AIScientists Dev WorldSeed play CLI
Appearance
| Knowledge Sources | |
|---|---|
| Domains | Deployment, API_Design |
| Last Updated | 2026-10-26 18:00 GMT |
Overview
Concrete CLI command that launches the WorldSeed engine and FastAPI HTTP/WebSocket server, supporting both bare-engine and OpenClaw gateway modes with configurable DM model and host/port settings.
Description
The play function in `cli/play.py` (281 lines) is the server launch entry point. It:
- Loads the scene config via `load_config()`
- Creates a `LiteLLMDMProvider` if `--dm-model` is specified
- Creates a `RunRecorder` for persistence
- Creates a `WorldEngine` with config, DM provider, and recorder
- Creates a FastAPI app via `create_app()`
- Starts Uvicorn ASGI server with configurable host/port
- Waits for health via HTTP probe
- In OpenClaw mode: spawns the gateway, waits for agent registration
Two modes:
- none (default): Bare engine + HTTP/WS server. Agents driven externally via `POST /act`, `GET /perceive`. Ticks auto-start.
- openclaw (legacy): Auto-spawn OpenClaw gateway, wire WebSocket connector, wait for preset agents, then start ticks.
Usage
Run via CLI: `worldseed play --config <path> [options]`
Code Reference
Source Location
- Repository: WorldSeed
- File: src/worldseed/cli/play.py
Signature
def play(args: argparse.Namespace) -> None:
"""Start engine + server. Mode chosen by --agent-runtime."""
Import
from worldseed.cli.play import play
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| args.config | Path | Yes | Scene config YAML path |
| args.agent_runtime | str | No | "none" (default) or "openclaw" |
| args.port | int | No | HTTP server port |
| args.host | str | No | HTTP server host |
| args.dm_model | str | No | DM LLM model ID |
Usage Examples
CLI Launch
# Basic launch
worldseed play --config configs/teahouse.yaml
# With DM model and custom port
worldseed play --config configs/teahouse.yaml \
--dm-model "openai/gpt-4o" \
--port 8000
# With OpenClaw agent runtime
worldseed play --config configs/teahouse.yaml --agent-runtime openclaw
Related Pages
Implements Principle
Requires Environment
Page Connections
Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment