Skip to main content

cad-to-bom

Turn your CAD into a parts list. Your agent does the shopping.

Website · Docs · Agent skill

PyPI Tests MIT license

Quickstart

macOS and Linux:

curl -fsSL https://cadtobom.dev/install.sh | sh

Windows (PowerShell):

irm https://cadtobom.dev/install.ps1 | iex

The installer installs uv if it is missing, then the cad-to-bom command, then the cad-to-bom skill in each agent app it finds (Claude Code, Codex, and ~/.agents/skills for others). Run it again, or cad-to-bom update, to update. To install only the command: uv tool install cad-to-bom or pip install cad-to-bom.

As a plugin, in Claude Code:

/plugin install cad-to-bom --marketplace moaazsidat/cad-to-bom

The repository is a plugin for Codex, Cursor and Gemini CLI too. A plugin brings the skill; the command still comes from the installer or uv. More in docs/install.md.

Then ask your agent for a parts list:

Read BOM.md and the STL exports in lamp/, and write lamp/bom.toml with specs for anything with a size or rating.

Find every part on amazon.ca and AliExpress. Record the listings, and mark cheaper substitutes as alternatives.

What's left to buy, what needs my review, and what does it cost in CAD?

The agent writes bom.toml, finds listings with its browser and records them with the CLI. You review everything in a local page: cad-to-bom serve -c lamp --open. Try it on the example with cad-to-bom serve -c examples/desk-lamp --open.

Features

  • Bought parts from bom.toml, each linked to listings in any Amazon store, AliExpress or a shop you add.
  • Printed parts from your STL and 3MF exports, each with a 3D preview, its size and a filament cost estimate.
  • Spec checks: alternatives sit beside the original listing. Listings that don't match the part's specs are flagged and stay out of the total until you approve them.
  • Costs in any currency, with pack sizes handled: 4 screws from a 100-pack costs the whole pack.
  • A build checklist: each part is to buy, ordered or have, with notes. Filter, sort and search.
  • An agent skill that teaches the workflow, and a CLI for every action, so an agent never has to drive the page.
  • Plain files: it runs locally with no dependencies, and your progress is a JSON file you commit next to your design.

It works with any agent that supports skills, or any agent with a shell.

Reference

bom.toml

title = "My robot"
currency = "USD"                                  # default display currency
markets = ["amazon.com", "amazon.ca", "aliexpress"]

[[sections]]
id = "drive"
title = "Drive"

[[parts]]
section = "drive"
qty = 2                                           # a number, or text such as "1 m", "~60" or "4 + 2"
# buy = 1                                         # optional: how many listings to buy, when qty doesn't say
name = "608-2RS bearing"
search = "608 2RS bearing"                        # optional; the default is name
notes = "lead screw ends"
specs = { bore_mm = 8, od_mm = 22, width_mm = 7, seal = "2RS" }

  [[parts.links]]                                 # optional: listings can also be added on the page
  market = "amazon.com"
  url = "https://..."
  price = 9.99                                    # in the market's currency unless currency = "..." is set
  pack = 10
  specs = { bore_mm = 8, od_mm = 22, width_mm = 7, seal = "2RS" }

[[printed]]
section = "drive"
paths = ["STL/*.stl", "3MF/*.3mf"]                # globs, relative to bom.toml
material = "PETG"
qty = { motor_mount = 2 }                         # or name a file part_x2.stl

[printing]
price_per_kg = { PLA = 20, PETG = 22 }            # or a single number
currency = "USD"                                  # defaults to the project currency
fill = 0.6                                        # printed mass as a fraction of a solid part; a rough estimate
density = { PETG = 1.27 }                         # g/cm³; common materials are built in

Each part gets a stable id made from its section and name, such as drive-bought-608-2rs-bearing. Your progress is stored under that id. If you rename a part, set id = "..." on it to keep its history.

Marketplaces

The built-in marketplaces are:

  • Amazon: amazon.com, amazon.ca, amazon.co.uk, amazon.de, amazon.fr, amazon.it, amazon.es, amazon.nl, amazon.se, amazon.pl, amazon.co.jp, amazon.com.au, amazon.in, amazon.com.mx, amazon.com.br, amazon.sg, amazon.ae
  • aliexpress

You can add any other shop, or override a built-in one:

markets = [
  "amazon.co.uk",
  { id = "aliexpress", currency = "EUR" },        # the currency your AliExpress account shows
  { id = "mcmaster", name = "McMaster-Carr", currency = "USD", search = "https://www.mcmaster.com/{q}" },
]

Finding parts

cad-to-bom does not scrape shops. Each part shows a Find link for every marketplace, which opens that shop's search for the part. When you choose a listing, paste its URL, price and pack size into the side panel, or use the CLI (cad-to-bom link ...). Because the CLI and the JSON API are plain, a browser agent can fill in listings for you.

Alternatives, spec checks and approval

Each marketplace can hold one original listing (the part as specified) and any number of alternatives.

  • Give the part specs, and give each listing the specs it states. A listing's specs that don't match the part's, or that the listing doesn't state, show as a diff.
  • A listing needs review if it is an alternative, or if its specs differ from the part's. Until you approve it:
    • the part is flagged (filter: Review);
    • the listing is left out of the cost.
  • Approve fit marks it checked. Reject keeps it on record with a reason, so you don't evaluate it again.
  • If you change a listing's URL or specs, its verdict goes back to unverified.

From the CLI:

cad-to-bom link drive-bought-608-2rs-bearing aliexpress https://... --alt --price 3.20 --pack 10 \
    --spec bore_mm=8 --spec od_mm=22 --spec width_mm=7 --spec seal=ZZ
cad-to-bom list --listings                        # shows verdicts and diffs
cad-to-bom verify drive-bought-608-2rs-bearing l2 rejected --reason "ZZ shields, need 2RS seals"

Currencies

Prices are stored in the currency they were listed in, and converted when shown; converted prices are marked ≈. Rates are the European Central Bank's daily reference rates, fetched from frankfurter.app and cached for 12 hours in .cad-to-bom/. To work offline, or to pin rates, set them per USD:

[fx]
rates = { CAD = 1.40, GBP = 0.79 }

Costs

  • A bought part's cost is the number of packs needed times the pack price. A quantity with a unit ("375 g", "2 m") counts as one listing; set buy = n on the part to say otherwise. It uses the listing you mark "use for cost"; otherwise it uses the cheapest usable listing.
  • A printed part's cost is mesh volume × density × fill × price per kg. Treat it as an estimate.
  • The top bar shows the total, what you have spent so far (ordered plus have), what is still to buy, and how many parts have no price yet.

Using it with text-to-cad

Export your printed parts from the models. You can do this one at a time:

cadgen export <model id> STL/bracket.stl

Or let the project's exports.py write them all. Then list the folders in [[printed]]. The page rescans on every load, so a fresh export appears when you reload.

To print more than one copy of a part, add _x<n> to its file name (clip_x4.stl) or set a qty table.

Command line

Command What it does
cad-to-bom init [dir] Writes a starter bom.toml.
cad-to-bom serve [-c bom.toml] [--host] [--port] [--open] Serves the page.
cad-to-bom list [--missing] [--listings] [--currency EUR] [--json] Lists items, their listings and diffs.
cad-to-bom summary [--currency EUR] Shows cost totals per section.
cad-to-bom search [ids...] [--market amazon.de] [--open] Prints search links for parts that have no listing.
cad-to-bom link <id> <market> <url> [--price] [--pack] [--currency] [--alt] [--spec k=v] Records a listing.
cad-to-bom verify <id> <listing> approved|rejected|unverified [--reason] Records whether a listing fits.
cad-to-bom status todo|ordered|have <ids...> Sets the status of one or more parts.
cad-to-bom import-md BOM.md Turns markdown BOM tables (with Qty and Part columns) into [[parts]].
cad-to-bom doctor [-c bom.toml] Checks the install, the agent skill and the project. Include its output in bug reports.
cad-to-bom update [--skill-only] Upgrades cad-to-bom with uv and refreshes the agent skill.

While serve is running, the page uses a small JSON API: GET /api/project?cur=EUR returns the full report, and POST /api/item with {"id": ..., ...} updates an item.

Files

File Contents Commit it?
bom.toml What the design needs. Yes.
bom-state.json Status, notes, listings and verdicts, written by the page and the CLI. Yes, to share progress; ignore it to keep progress private.
.cad-to-bom/ Cached exchange rates and mesh measurements. No.

Security

serve listens on 127.0.0.1 and has no authentication. Anyone who can reach the port can read and edit your BOM. To use it from other devices, put it behind something that does authenticate, such as an SSH tunnel, a VPN, or tailscale serve, rather than binding to 0.0.0.0 on an untrusted network.

Community

  • text-to-cad: design physical products with AI. cad-to-bom turns its exports into a parts list.
  • build123d: the Python CAD library text-to-cad builds on.
  • uv: installs cad-to-bom.

Contributing

Bug reports are welcome in issues: include the output of cad-to-bom doctor -c <your project> and your bom.toml (or the part of it that matters). If the skill made your agent do the wrong thing, say what it did; that's as useful as a fix. Skill changes go in skills/cad-to-bom/.

CONTRIBUTING.md covers setting up a checkout and testing a change in an agent app; AGENTS.md is the map of the repository. Report security problems privately, as SECURITY.md says.

License

MIT

Metadata

Release files for cad-to-bom 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cad-to-bom 0.2.0
File Size Uploaded Provenance Actions
cad_to_bom-0.2.0.tar.gz 230.9 kB With provenance Details for cad_to_bom-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cad-to-bom 0.2.0
File Interpreter ABI Platform Actions
cad_to_bom-0.2.0-py3-none-any.whl Python 3 none any Details for cad_to_bom-0.2.0-py3-none-any.whl

Total release size: 266.9 kB

Release files / cad_to_bom-0.2.0.tar.gz

Download URL cad_to_bom-0.2.0.tar.gz
Size 230.9 kB
Tags Source
SHA-256 checksum
How to use checksums
26100d7414cc2d5648cc9344ae1741103949c2d2c5f1ea16b01f57affe37f5c1
BLAKE2b-256 checksum
How to use checksums
e557405f639ea0e891328b8b12573522df30c9ca0cfec0be7a1e1211e3f35e2f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.

Transparency log

Release files / cad_to_bom-0.2.0-py3-none-any.whl

Download URL cad_to_bom-0.2.0-py3-none-any.whl
Size 36.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0b84bf762c2a18b69de637b85784ffcbf13c921d729f847147b45c8ef246b8c4
BLAKE2b-256 checksum
How to use checksums
eec7b3b67dfbf79aab37b9d56215ac0f870ec5d50b6369bb7aee797bfbc54b45
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.

Transparency log

Security for cad-to-bom 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for cad_to_bom-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page