Skip to content
PDF

Command line and MCP

Everything you do in BIMopen is a command. A click on Wall and two points in the plan run the same wall command you can type yourself. This chapter describes the command line of the window, the bimopen-cli program, which runs the same commands without a window, and the MCP server, through which an AI agent can model, check and render a project.

The command line in the window

The command line sits under the drawing area. Its upper part is the log; its last row is where you type.

  • You do not need to click it first: whatever you type while no other field is being edited goes there.
  • Enter runs the line. The command is echoed in the log after a >, followed by its result; an error is shown in red and changes nothing.
  • Up and Down bring back the lines typed before.
  • On the left of the row, the prompt says what is expected: Command: when no tool is active, or the request of the active tool, such as WALL next point [Esc to finish]:.
  • help lists every command with a line of description; help wall shows the usage of one. ? ▸ Commands in the title bar does the same as help.

Typed shortcuts start the tools

A command typed without arguments starts the interactive tool, as if you clicked its button: WA (or wall) starts the wall tool, DR the door tool, VG opens Visibility/Graphics. The same command with arguments does the work at once, without the tool: wall 0,0 5,0 draws a wall from the origin to 5 m along x.

Command names, their short forms and their arguments are the same in every language of the interface; most also accept an Italian name, such as muro for wall. Parameter names, type names and view names follow the language of the interface: in English you type set Unconnected Height 2.7m, in Italian set Altezza non collegata 2.7m. The keyboard shortcuts chapter lists every short form.

Points and lengths

You type It means
3,4 The point x = 3 m, y = 4 m
@2,0 2 m along x and 0 along y from the previous point
@4<90 4 m from the previous point, at 90° (angles counter-clockwise from the x axis)
2.7m, 270cm, 2700mm A length with its unit
2.7 or 2,7 A length in metres: at the command line a number without unit is in metres

For example, wall 0,0 @6,0 @4<90 0,4 c draws a 6 × 4 m rectangle; the final c closes it.

Warning

At the command line set Unconnected Height 2700 means 2700 metres. Write the unit: 2700mm. In the Properties palette, instead, a number without unit is in the project's units, millimetres in a new project.

Arguments in JSON

Every command also takes its arguments as a JSON object, which gives access to all its options. The usage line of help lists them:

wall 0,0 10,0 {"height":3.2,"location":"Linea d'asse del muro"}
roof walls {"slope":30,"overhang":0.5}
sheet A102 Plans {"title_block":"A3"}
export doors.csv {"schedule":"doors"}

Commands you will use often

Command What it does
new, sample A new project, the sample project
open house.bimopen, save house.bimopen Opens and saves a project
undo, redo Undoes and redoes the last change
view 3d, view Ground Floor Opens the default 3D view, or the plan of a level
wall, door, window, floor, roof Model elements: see the usage with help
select walls, select all, deselect Selects by category, everything, nothing
set <parameter> <value> Sets a parameter of the selection, as in the Properties palette
type <type name> Changes the type of the selection, or of the next element
move 1,0, copy 0,3, rotate 90 Modifies the selection
delete Deletes the selection
list walls, params 102, info Lists elements, the parameters of one, a summary of the project
schedule doors Shows a schedule at the command line
export house.ifc Exports IFC, SVG, PNG or CSV, by the file's extension

Every element has a number, its id, shown in brackets after it is created: Door «Single swing door 80x210» in wall 102 (106). Commands accept it where they need an element: params 106, delete 106.

bimopen-cli

bimopen-cli runs BIMopen without a window: to convert files, to build a project from a script, to check a model, or to serve agents over MCP. Build it with cargo build --release -p bimopen-cli.

bimopen-cli info <file>
bimopen-cli convert <in> <out> [--level NAME] [--view 3d] [--schedule walls|doors|windows|floors|rooms|materials]
bimopen-cli run [<file> | --sample] [--cmd LINE]… [--script FILE] [--save FILE] [--export FILE]…
bimopen-cli commands
bimopen-cli mcp [<file> | --sample]
Subcommand What it does
info <file> A summary of the project and, in JSON, its levels, element counts and active view
convert <in> <out> Opens <in> (.bimopen or .rvt) and writes <out>: .ifc, .svg or .png of a plan (the lowest level, or --level), .png of the 3D view (--view 3d), .csv of a schedule (--schedule), or .bimopen
run Opens a file, the sample, or a new project, then runs the options in order: --cmd one line, --script a file of lines (empty lines and lines starting with # are skipped), --save and --export a file
commands Every command, with its description and usage
mcp The MCP server on standard input and output
--version The version

The messages are in the language of the environment variable BIMOPEN_LANG (it, en, de, fr, es, ar), or of the system (LANG), or Italian. bimopen-cli ends with code 0 when everything worked, 1 when a command failed (the message says which), and 2 when the arguments are wrong (it prints the usage).

export BIMOPEN_LANG=en
bimopen-cli run --script house.txt --save house.bimopen --export house.ifc
bimopen-cli convert house.bimopen plan.svg
bimopen-cli convert house.bimopen doors.csv --schedule doors
bimopen-cli convert house.bimopen first.png --level "First Floor"
bimopen-cli convert house.bimopen house-3d.png --view 3d
bimopen-cli convert project.rvt project.bimopen

A script is a text file with one command per line, exactly as typed at the command line:

# a small house
wall 0,0 10,0 10,6 0,6 c
door 5,0
window 10,3
floor walls
roof walls

The schedules are written as CSV with ; between the columns, the headings in the language of the messages and a total row at the end.

MCP: BIMopen for AI agents

The Model Context Protocol (MCP) lets an AI agent use programs as tools. bimopen-cli mcp is an MCP server: it speaks JSON-RPC 2.0 on standard input and output, one message per line, and keeps one project open for the whole conversation. Without a file it starts from a new project; --sample starts from the sample house.

To add it to an agent, give the agent the command to start. For example, in Claude Code:

claude mcp add bimopen -- bimopen-cli mcp --sample

or, in a client configured with JSON:

{ "mcpServers": { "bimopen": { "command": "bimopen-cli", "args": ["mcp", "--sample"] } } }

The server offers seven tools:

Tool Arguments What it does
command_line line Types a line at the command line, exactly as a person would
execute command, args Runs a command with its arguments in JSON
inspect_model – A summary: levels, element counts, active view, selection
query_elements category (optional) The elements, with id, category and name: walls, doors, windows, floors, rooms, roomseps, grids, levels, types
get_params id Every parameter of an element
schedule kind A schedule: walls, doors, windows, floors, rooms or materials
render view, width, height, yaw, pitch A PNG image of a view: 3d, the name of a level for its plan, of a section, elevation, callout or drafting view, or the number or name of a sheet; yaw and pitch turn the 3D camera, in degrees

The answers carry the message of the command and, when there is one, its data in JSON, such as the ids of the elements created. An agent can check its own work by asking for a render.

Tip

Ask the agent to render the plan and the 3D view after each step: it sees what it built and corrects itself.