Skip to content

Headless BSP CLI ​

cli:bsp parses a BSP file supplied as an ordinary filesystem path. Unlike cli:game, it does not resolve a map name through the PK3 index.

Usage ​

bash
npm run cli:bsp -- info path/to/map.bsp

If the first argument is a path rather than a command, info is used.

Commands ​

CommandPurpose
infoHeader, lump, face-type, and PVS summary
entitiesEntity counts by classname
texturesReferenced textures and important flags
effectsBSP effects lump
buildBuild meshes using Babylon NullEngine
collisionExercise collision data
clipbrushesAnalyze clip-brush coverage
liquidsAudit liquid surfaces and contents
testRun the tool self-test

For a map that remains inside a PK3, use:

bash
npm run cli:game -- --exec 'bsp load wdm2; bsp info; quit'

The direct parser API is synchronous:

ts
const bytes = readFileSync(file);
const data = bytes.buffer.slice(bytes.byteOffset, bytes.byteOffset + bytes.byteLength);
const bsp = BspLoader.load(data);

See src/cli/headless-bsp.ts for current command output and arguments.

Released under the MIT License.