Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Implementation:AIScientists Dev WorldSeed play CLI

From Leeroopedia
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:

  1. Loads the scene config via `load_config()`
  2. Creates a `LiteLLMDMProvider` if `--dm-model` is specified
  3. Creates a `RunRecorder` for persistence
  4. Creates a `WorldEngine` with config, DM provider, and recorder
  5. Creates a FastAPI app via `create_app()`
  6. Starts Uvicorn ASGI server with configurable host/port
  7. Waits for health via HTTP probe
  8. 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