@ifc-lite/cli
v0.24.4
Published
CLI toolkit for IFC files — query, validate, export, create, and script BIM data
Maintainers
Readme
@ifc-lite/cli
BIM toolkit for the terminal. The ifc-lite command reads, queries, validates, exports, creates, merges, converts, and diffs IFC files, and can script them with the bim.* SDK. Output is pipe-friendly and every command supports --json for machine-readable results, which makes it a good fit for both humans and LLM terminals.
Install
npm install -g @ifc-lite/cliUsage
ifc-lite info model.ifc
ifc-lite query model.ifc --type IfcWall --json
ifc-lite props model.ifc --id 42
ifc-lite export model.ifc --format csv --type IfcWall --columns Name,Type,GlobalId
ifc-lite create wall --height 3 --thickness 0.2 --start 0,0,0 --end 5,0,0 --out wall.ifc
ifc-lite eval model.ifc "bim.query().byType('IfcWall').count()"
ifc-lite view model.ifcCommands
info- model summary: schema, entities, storeysquery- query entities by type, properties, quantities; supports--sum,--group-by,--spatialprops- all properties for a single entity (--id N)export- export tocsv,json,ifc, orhbjsonids- validate against buildingSMART IDS rulesvalidate- structural validation checksstats- auto-calculated model KPIs and health checkclash- geometric clash detection,--matrix,--bcfoutputbcf- create and inspect BCF collaboration filescreate- create IFC elements from scratch (walls, slabs, stairs, 30+ types)mutate- modify properties or attributes and savemerge- merge multiple IFC files into one federated fileconvert- convert between IFC schema versions (--schema IFC4)diff- compare two IFC fileseval/run- run SDK expressions or scripts against a modelask- natural language BIM queriesview- interactive 3D viewer in the browser, controllable via REST (/api/command)analyze- query plus colorize/isolate/heatmap results in the running viewermcp- start an MCP server bound to one or more IFC files (stdio or http)gym- reset/step/reward environment loop over the existing schema/clash/ids checks (see below)schema,bsdd,diagnose-geometry,extract-entities,generate-spaces,lod,ext- seeifc-lite --help
Global flags: --json, --out <file>, --verbose, --quiet, --debug, --log-level <level>.
gym
ifc-lite gym is a prototype reset/step/reward environment API over the existing headless checks: the skeleton of an RLVR environment for buildings (see docs/vision/moonshots-tech.md M2 and docs/vision/moonshots-execution-plan.md B0.4). It wraps a model - either a fixed file (--model) or a procedurally generated World Gym episode (--seed) - and lets an agent apply data-mutation ops, scoring each step against the same schema/clash/ids checks the validate, clash, and ids commands already run.
ifc-lite gym --model model.ifc --checks schema,clash
ifc-lite gym --model model.ifc --checks schema,clash,ids --ids rules.ids
ifc-lite gym --seed 42 --checks schema,clash # generated episode (repo checkout only)
ifc-lite gym --seed 8 --family frame --corrupt --checks schemaThe protocol is newline-delimited JSON: one JSON object per line, in both directions.
- On start,
gymprints one line:{"type":"reset","observation":{...},"channels":{...}}.observationhas sortedentityCounts(by IFC type),storeyCount, andschemaversion.boundsis alwaysnullin v0 (a known gap: no geometry pass runs onreset, see below). Generated episodes add anepisodefield:{seed, family, corrupted}. - Send
{"type":"step","ops":[...]}on stdin to apply ops and score the result.gymreplies{"type":"reward","channels":{...},"done":false}. A step batch is atomic: it either fully applies or (on any malformed op or scoring failure) leaves the session unchanged and replies with an error line. - Send
{"type":"reset"}to reload the pristine model; replies like the initial reset. - Send
{"type":"reset","seed":8}(optionalfamily,corruptORcorruptRate) to swap to a fresh generated episode mid-session. - Send
{"type":"close"}to exit 0. - Malformed JSON or an unknown command/op never crashes the process: it replies
{"type":"error","message":"..."}and keeps reading.
Episode factory: --seed <n> generates a deterministic World Gym benchmark model in-process instead of loading a file. --family frame|office|auto pins the family; corruption follows the benchmark's deterministic draw at the spec's corrupt rate unless --corrupt/--no-corrupt forces it or --corrupt-rate <p> overrides the rate (forcing and a rate are mutually exclusive). The generator is dynamically imported from a repo checkout (tools/world-gym/); the published npm package prints a clear error for --seed while --model keeps working.
Reward shaping: every channel's score is in [0, 1] and higher is better. The clash channel scores 1 for a clash-free model and strictly decreases as the clash count grows (the raw count is reported separately as totalClashes), so an agent maximizing any channel is never rewarded for making the model worse.
v0 ops mirror bim.mutate's method names exactly: setProperty, setAttribute, deleteProperty (all keyed by expressId). Geometry-creating ops (new walls, slabs, etc.) are out of scope for v0.
{"type":"step","ops":[{"op":"setProperty","expressId":42,"psetName":"Pset_WallCommon","propName":"IsExternal","value":true}]}Determinism: the same model plus the same op sequence yields byte-identical reward lines (sorted arrays, no timestamps, fixed-precision floats).
Links
- Docs: https://ifclite.dev/docs/
- Source: https://github.com/LTplus-AG/ifc-lite
License
MPL-2.0
