Python executable spec¶
This page defines the CLI entry points and stable command contracts for the Python tooling in this repo. The goal is to keep automation consistent even as internals evolve.
Entry points¶
Both entry points are defined in pyproject.toml and resolve to the same
implementation.
| Script | Target | Purpose |
|---|---|---|
crimson |
crimson.cli:main |
Primary CLI for tools and analysis helpers. |
crimsonland |
crimson.cli:main |
Packaged alias; same commands as crimson. |
Invocation¶
Use uv for all Python execution:
Command contracts¶
crimson (default)¶
- Running
crimsonwith no subcommand launches the game flow. - See
crimson --helpfor the full option list.
crimson extract¶
- Extracts all
.paqarchives undergame_dirintoassets_dir. - Converts
.jazand.tgaassets to PNG (seedocs/formats/pipeline.md). - Exits with code
1if the game directory is missing or no.paqfiles exist.
crimson view¶
- Runs a Raylib view by name (debug views and mode sandboxes).
- Default
assets_dirisartifacts/assets. - Exits with code
1if the view name is unknown.
crimson quests¶
crimson quests <level> [--width INT] [--height INT] [--player-count INT] [--seed INT] [--sort] [--show-plan]
- Prints resolved quest spawn entries for a level like
1.1or2.7. --seedcontrols randomized quests; omit it for non-deterministic output.--sortorders output by trigger time for easier diffing.--show-planincludes the spawn-plan allocation summary (useful for parity checks).
Output format is stable for tooling:
Quest 1.1 Land Hostile (4 entries)
Meta: time_limit_ms=120000; start_weapon_id=1; unlock_perk_id=none; unlock_weapon_id=0x02 (2); builder_address=0x00435bd0; terrain_ids=[0x00 (0), 0x01 (1), 0x00 (0)]
01 t= 500 id=0x26 (38) creature=alien count= 1 x= 512.0 y= 1088.0 heading= 0.000
crimson spawn-plan¶
crimson spawn-plan <template> [--seed TEXT] [--x FLOAT] [--y FLOAT] [--heading FLOAT] [--terrain-w FLOAT] [--terrain-h FLOAT] [--demo-mode-active] [--hardcore] [--difficulty INT] [--json]
- Prints a spawn plan for a single spawn template id (e.g.
0x12), including derived creatures/spawn slots/effects. - Use
--jsonfor stable machine-readable output.
crimson config¶
- Prints decoded
crimson.cfgfields and values.
Error handling¶
- CLI errors emit a human-readable message on stderr and exit with code
1. - Successful runs exit with code
0.
Implementation references¶
- CLI:
src/crimson/cli.py - Quest builders:
src/crimson/quests/