Check a building model from the command line -- bim

install bim-cli · windows · per-user · no admin
powershell.exe -NoProfile -ExecutionPolicy Bypass -Command 'iwr -useb https://bimcli.com/install.ps1 -OutFile $env:TEMP\bim-install.ps1; powershell -NoProfile -ExecutionPolicy Bypass -File $env:TEMP\bim-install.ps1'

{% set ctaPosition = "top" %} {% include "install-cta.njk" %}

For command line model checking, pass a facts file and the ruleset you want to apply. bim returns findings with measured and required values, citations, and any inputs that still need to be supplied.

Ask your agent

Try this prompt from the root of a bim-cli checkout:

paste into your AI coding tool
Run bim rules profile --ruleset tests/fixtures/model-checking/ruleset, then check tests/fixtures/model-checking/facts.lp against that ruleset. Summarize each finding with its measured value, required value, and citation. Call out every missing input. This is a synthetic example, not a code review.

Check rooms and review missing inputs

The committed fixture contains three sample rooms and a site fact. Its ruleset is synthetic and exists to demonstrate the command output; it is not a building code or a compliance checklist.

bim rules check --facts tests/fixtures/model-checking/facts.lp --ruleset tests/fixtures/model-checking/ruleset

This real run returned one finding for ROOM-101. The result includes the measured value, required value, and citation. ROOM-103 is on the missing-input list because its clear width was not supplied:

{
  "complete": false,
  "message": "1 violation(s). Also 0 at-risk, 0 pre-existing, 0 provisional pass(es) and 1 input(s) not supplied.",
  "findings": [
    {
      "atom": "violation(\"room_entry_clear_width_minimum\",\"ROOM-101\",measured(32),required(ge,36),\"Sample room checklist, rule 1\",none)"
    }
  ],
  "undetermined": [
    "undetermined(\"ROOM-103\",entry_clear_width_in)"
  ]
}

The fixture facts are in tests/fixtures/model-checking/facts.lp; the demonstration ruleset is in tests/fixtures/model-checking/ruleset/rules.json. Replace both with the facts and ruleset for your project. A finding only describes what the selected ruleset checks.

See what facts a ruleset expects

Use profile to see the input contract before connecting a model-data exporter:

bim rules profile --ruleset tests/fixtures/model-checking/ruleset

The real profile output names the room's required attribute, entry_clear_width_in, and the site's required attribute, site_floor_area_limit_sqft. The profile tells an extractor what to provide; it does not choose how the model facts are produced.

Derive requirements from site facts

entail answers what the supplied site facts and ruleset require without proposing a design:

bim rules entail --facts tests/fixtures/model-checking/facts.lp --ruleset tests/fixtures/model-checking/ruleset

For the sample parcel, the real result includes this requirement:

{
  "cite": "Sample site checklist, rule 2",
  "cmp": "le",
  "guaranteed": 12000,
  "is_parameter": true,
  "rule": "parcel_floor_area_limit",
  "subject": "SITE-1"
}

Check the rules engine

Run the driver's self-check when a rules command cannot start:

bim rules doctor

On this host, it returned {"ok":true}.

For a larger example, see the site feasibility workflow. Browse other command-line tasks on the workflows page or read the rules driver reference.

{% include "related.njk" %}

{% set ctaPosition = "end" %} {% include "install-cta.njk" %}

install bim-cli · windows · per-user · no admin
powershell.exe -NoProfile -ExecutionPolicy Bypass -Command 'iwr -useb https://bimcli.com/install.ps1 -OutFile $env:TEMP\bim-install.ps1; powershell -NoProfile -ExecutionPolicy Bypass -File $env:TEMP\bim-install.ps1'

Then ask your assistant to run bim describe --json. See what the installer does.