@nodes/cad
v0.8.0
Published
CAD as code, for agents: a compiler from declarative model code into a queryable building database, with checks and emitters
Readme
@nodes/cad
CAD as code, for AI agents. The agent writes the model in TypeScript. cad build turns it into a checked model with drawings, quantities, cost, schedule and a 3D walk, and when a rule fails it names the exact line.
For teams who build real projects with AI agents: buildings, machines, any domain as a plugin.
Start
npx @nodes/cad bim init my-house
cd my-house
npx @nodes/cad login <Nodes licence key>
npm i @nodes/cad
npx cad buildbim init writes a building: one room that builds GREEN. npx @nodes/cad init my-project writes a project of no domain instead: one part, its own pack, a rule and a test.
With pnpm 11 or newer, a project denies or approves esbuild's build script in pnpm-workspace.yaml, or the install fails with ERR_PNPM_IGNORED_BUILDS: allowBuilds: { esbuild: false } denies it, true approves it.
init writes the denial when it detects pnpm: run it as pnpm dlx @nodes/cad bim init my-house, then pnpm add @nodes/cad.
login writes the licence into this project's .npmrc (--global: your ~/.npmrc), and the engine reads it there, or from NODES_LICENSE_KEY, to build, check, test and import. When the licence ends (after 7 days of grace) that new work stops with a message that says why; cad start, cad export and cad diff still work on what is built.
The loop
npx cad check # types (tsrs), compile and norms: GREEN, or RED with the exact line; writes nothing
npx cad test # the project tests in tests/: the documents' numbers against the model
npx cad build # all of it, and out/: the checked model, drawings, quantities, the 3D
npx cad dev # rebuilds on every save into .cad/dev/, with a live preview
npx cad start # serves out/ for people: walk, cost, schedule, checks, documents
npx cad export # files for other tools: IFC, PDF, XLSX, glTF (or only some: `export ifc xlsx`)
npx cad diff # what changed since the previous buildTo bring an IFC, an XLSX, a CSV, a PDF, a DWG or a DXF in, add it to inputs in cad.config.ts and run npx cad import <file>: it writes model code, a data module or (a PDF) the pages, texts, repeated symbols and scale hints as records into model/imported/, and a picture of each PDF page into .cad/import/; a DWG or DXF drawing becomes one JSON file of its layers, texts, dimensions and block references (its geometry is read on demand with dwg.entities in cad test -e; a DWG is a closed format and imports with a warning). An image the agent reads by eye and marks with seen(…).
To ask the built model a question, npx cad test -e "return db.sql('SELECT name, area_m2 FROM bim_space_view')".
The types are checked by the project's own tsrs, which init puts in devDependencies with @types/node; npx tsrs --noEmit runs the same check by hand.
All commands: npx cad --help.
For agents
init writes AGENTS.md, so Codex and Claude Code find the skill on their own: node_modules/@nodes/cad/skill/SKILL.md. cad build and cad dev keep the block of AGENTS.md that points at it current. A diagnostic with a page in the skill's reference/errors/ prints see: <path> under it.
When cad itself is wrong, the agent writes a note to .cad/feedback/ for you to read and send to Nodes. Nothing is sent for you.
Licence
The engine (@nodes/cad-engine) is for holders of a Nodes licence, as early access during 0.x. This package (types, skill, examples) is free to read and use. When the licence ends, new work with the engine stops, and you keep what was built: view, compare and export it. See LICENSE.
Get a licence: Telegram @AI_Nodes_Sales_Bot.
По-русски
Нужен Node 24 или новее. Лицензию можно получить в Telegram: https://t.me/AI_Nodes_Sales_Bot?start=cad.
- Создайте проект здания командой
npx @nodes/cad bim init my-houseи зайдите в его папку:cd my-house. Командаnpx @nodes/cad init my-projectсоздаёт проект без здания: одну деталь с правилом и тестом. - Войдите с ключом лицензии Nodes:
npx @nodes/cad login <ключ>. Ключ запишется в файл.npmrcвашего проекта; чтобы он действовал для всех проектов, добавьте--global, и он запишется в ваш домашний.npmrc. - Установите пакет по имени:
npm i @nodes/cad. - Соберите проект командой
npx cad build, и в конце вы увидите GREEN или RED с точной строкой ошибки. - Пока пишете модель, запускайте
npx cad check: он проверяет типы и нормы и ничего не записывает. Типы проверяет tsrs, он уже стоит в проекте послеinit. - Сверяйте модель с документами командой
npx cad test: тесты проекта лежат в папкеtests. - Если у вас есть IFC, XLSX или CSV, добавьте их в проект командой
npx cad import файл. - Чтобы показать результат людям, запустите
npx cad startи откройте адрес из консоли. - Чтобы отдать файлы в другие программы, запустите
npx cad export. - Агент сам найдёт правила работы в
AGENTS.mdи вnode_modules/@nodes/cad/skill/SKILL.md.
Когда лицензия заканчивается (после семи дней отсрочки), новая работа останавливается: build, check, test, dev и import не запустятся и скажут почему. Уже собранное по-прежнему можно смотреть, сравнивать и выгружать: npx cad start, npx cad diff и npx cad export работают без лицензии.
