Use bim-cli with OpenAI Codex

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'

Codex can run shell commands on your Windows machine. With bim-cli installed on PATH, it can check drawing sets, look up a flood zone or zoning for an address, build a site report PDF, shrink a PDF, and help with Revit work without opening Revit.

Short answer

The simplest setup is to install bim-cli, then ask Codex to run its commands in the terminal. bim describe --index shows which drivers and commands are installed. If you prefer tool calls, bim mcp can expose those same installed commands through an MCP server. MCP is optional; the shell route is a good default and keeps the available tools easier to scan.

Give Codex this setup prompt

Paste this prompt into Codex to install and orient it before giving it a task:

paste into Codex
Install bim-cli on this Windows machine and use it for my AEC tasks.
Run this installer command exactly:
  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'
Refresh PATH in this PowerShell session:
  $env:Path += ";$env:LOCALAPPDATA\bim-cli"
Check readiness with `bim doctor --json`, then run `bim describe --index` to see the installed commands.
Summarize what is ready and wait for my task.

Option 1: shell commands

Run Codex natively on the Windows machine where bim-cli is installed. The bim program must be available on PATH in the terminal Codex uses. Start with bim describe --index to see available drivers and verbs, then ask for a concrete task such as checking a drawing set or shrinking a PDF.

For example, bim pdf set check set.pdf checks a drawing set. A verified run returned a JSON result with the input file, sheet count, findings, and summary. Codex can inspect that output and explain what needs attention. The command details depend on which drivers are installed; bim describe --json provides their full argument schema.

Some tasks need network access. Local PDF operations can work without a network connection, while flood-zone and zoning lookups need to reach their public data services. Codex runs with network access off by default; its documentation explains how to allow network access for the workspace-write sandbox or choose another route. If your environment blocks network access, use an MCP setup only if that route is permitted by your Codex configuration.

Codex also reads AGENTS.md files before working in a project. A short project note can remind it that bim-cli is installed and point it to the live command list.

Option 2: MCP server

Use MCP if you want the installed bim commands to appear as tools in Codex. The quick command adds a global server:

codex mcp add bim -- bim mcp

Codex stores MCP server configuration in ~/.codex/config.toml. The resulting entry looks like this:

[mcp_servers.bim]
command = "bim"
args = ["mcp"]

For longer-running site requests, set a longer timeout. For unattended codex exec runs, allow the server's tool calls with default_tools_approval_mode:

[mcp_servers.bim]
command = "bim"
args = ["mcp"]
tool_timeout_sec = 120
default_tools_approval_mode = "approve"

Interactive Codex sessions can keep their normal approval setting. The approval option is for unattended runs that otherwise cannot approve an MCP call. The tool_timeout_sec setting gives site requests more time when their own data fetch takes a while.

In a verified Codex session, the flood lookup tool appeared as mcp__bim__site_flood_lookup. Its response included the flood-zone result and source metadata. The MCP server creates tools dynamically from installed driver capabilities; a full installation returned 361 tools in the verified check. That breadth is another reason the shell command route is a comfortable starting point for many tasks.

See the Codex MCP configuration guide for server settings, the Codex approvals and security guide for sandbox and approval behavior, and Codex instructions with AGENTS.md for project guidance.

Tell Codex about bim in AGENTS.md

Add a few lines to your project AGENTS.md so Codex knows to orient itself before choosing a command:

## bim-cli
- bim-cli is installed on this Windows machine and available as `bim` in PowerShell.
- Run `bim describe --index` before choosing a bim command.
- Use the installed command schema; ask me when a task or file is ambiguous.
- Site lookups need network access. Local PDF checks do not need Revit.

Codex reads project instructions from AGENTS.md; see the official AGENTS.md instructions guide for how those files are applied.

Limits and what was checked

bim-cli is a Windows program. The shell setup described here assumes Codex is running on Windows where bim is installed and on PATH. The shell command route and the MCP route were checked with Codex. The PDF set check returned structured output, and a site flood lookup returned a result through MCP.

We did not test bim-cli inside Codex's workspace-write sandbox. Do not assume that shell commands will work in that sandbox on your machine. Codex's security documentation says network access is off by default; site verbs need network access to reach their data sources. The MCP configuration follows Codex's documented settings, and tool approval can be needed for unattended codex exec runs.

FAQ

Do I need the MCP server?

No. Codex can call bim from its shell. Use MCP when you want the installed commands presented as tools; both routes use the same local bim-cli installation.

Which jobs work without Revit?

Drawing-set checks, flood and zoning lookups, site reports, and PDF compression do not require Autodesk Revit. Revit-specific jobs need Revit, but some can run without opening its interface.

Why does a site lookup time out?

Check that Codex can reach the network and that the site service is available. If using MCP, the server tool timeout can be configured; tool_timeout_sec = 120 gives a longer window for slower requests.

Where does Codex keep the MCP setup?

Codex's user configuration is in ~/.codex/config.toml. A project-specific configuration can be used for a trusted project, as described in the Codex MCP guide.

How does Codex learn the available commands?

Ask it to run bim describe --index for a compact list or bim describe --json for the full schema. The installed drivers determine which verbs are available.

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.