V3 Alpha

Explore the next generation of MachineBlocks with V3 Alpha — an experimental, AI-first platform for developers and early adopters.

Feedback Welcome!  MachineBlocks V3 is still in alpha and may contain bugs or incomplete features. If you encounter any issues, please report them in our Discord channel. Your feedback helps us improve!
  1. Install a coding agent

    Install Cursor, or another coding agent that can edit a project on your computer. You will open the folder there and describe the brick in plain language. Download Cursor

  2. Install Node.js

    The MachineBlocks CLI runs on Node.js. Install the current LTS release. Download Node.js

  3. Install OpenSCAD Desktop

    V3 generates the models with OpenSCAD. Install OpenSCAD Desktop from the Development Snapshots. Use a snapshot build, not the stable release. Development Snapshots

  4. Create a project folder

    Create an empty folder and change into it. Name it however you like. myfolder is only an example.

    terminal shell
    mkdir myfolder
    cd myfolder
  5. Initialize the project

    In that folder, run init with a fully qualified name. The name is a reversed domain and must include a bml segment. com.acme.bml.test is an example — use your own domain, then bml, then a name for your bricks.

    terminal npx
    npx @machineblocks/cli init com.acme.bml.test

    For example

    • com.acme.bml.test
    • com.mydomain.bml.mybricks
    • de.whatever.bml.xyz.sub
    • ca.dom.bml.abc
  6. Open the folder

    Open the folder in Cursor, or in the coding agent you installed. If you kept the example name, that folder is myfolder.

  7. Describe the brick

    In Cursor, open the Agent chat for this folder and describe the brick in one sentence: what it is, a detail such as the color, and the package it belongs to. The agent writes the BlockML file, then runs the compiler, which renders that file to OpenSCAD. For the example name com.acme.bml.test, send:

    cursor prompt
    Create a red Brick 2x4 in the test package.

    The prompt asks for a red Brick 2x4 in the test package. The agent creates it as a BlockML file with the extension .bml, named Brick2x4. These files follow a Java-style package under the blocks folder. That folder is the source root, in the same role as src in a Java project, and the folders match the fully qualified name. For com.acme.bml.test the file lands here:

    blocks BlockML
    blocks/
    └── com/
        └── acme/
            └── bml/
                └── test/
                    └── Brick2x4.bml

    The agent then runs the compiler directly. Rendering from BlockML to OpenSCAD happens automatically, and the compiler is deterministic: the same .bml file always produces the same .scad file. The rendered file keeps the name Brick2x4 and uses the same package under blocks, with the bml segment replaced by scad. com.acme.bml.test is rendered as com.acme.scad.test:

    blocks OpenSCAD
    blocks/
    └── com/
        └── acme/
            └── scad/
                └── test/
                    └── Brick2x4.scad
  8. Open the SCAD file

    Open the rendered .scad file in OpenSCAD Desktop to see the brick. For this example, that file is blocks/com/acme/scad/test/Brick2x4.scad. Open it from OpenSCAD, or from Cursor:

    In OpenSCAD, choose Open and select the file.

    In Cursor, right-click Brick2x4.scad and choose Preview in OpenSCAD.

Stay on the latest version

From the project folder, run this whenever you want to update the project to the latest MachineBlocks version.

terminal npx
npx @machineblocks/cli@latest update
LEGO is a registered trademark of the LEGO Group. MachineBlocks is not affiliated with or sponsored by the LEGO Group.