Skip to content

dsmd CLI ​

dsmd is a git-like working copy of your workspace. Clone it once and every part is on your disk as plain files: the Markdown datasheet, the unified parameters, the pin table, the CAD configuration - and a ready KiCad library built from them. Edit the files, look at the diff, push it back.

bash
pip install datasheets-md

Why a working copy ​

A component library is shared data that many people and tools touch. The web app is the right place to browse and review; a working copy is the right place to work in bulk. With dsmd your library is files you can search with grep, edit with any editor, script against, and hand to an AI agent - and every change still goes through the same server, the same checks and the same history as an edit in the browser.

Install ​

bash
pip install datasheets-md          # or: pipx install datasheets-md
dsmd login                         # sign in through the browser

Python 3.10 or newer, on Windows, macOS and Linux. On Ubuntu and Debian use pipx or a virtual environment. dsmd update upgrades dsmd the way it was installed, and a one-line notice tells you once a day when a new release is out.

Prefer buttons? pip install datasheets-md-gui adds dBsync, a desktop window with Sign in, Clone, Pull and Push that runs the same sync underneath.

What lands on your disk ​

text
my-library/
├── dsmd.toml                          what to pull and what to build
├── settings/
│   ├── mappings/10-workspace-default.yaml   your category mappings
│   └── symbol_style.yaml              symbol style and reference designators
├── parts/
│   └── BSS138_onsemi/                 one folder per family
│       ├── datasheet.md               the Markdown datasheet (read-only)
│       ├── images/                    its figures
│       ├── BSS138-D.pdf               the original PDF
│       └── BSS138/                    one folder per part number
│           ├── part.yaml              identity: manufacturer, category, links
│           ├── parameters.jsonl       the unified datasheet, one row per line
│           ├── pins.csv               the pin table
│           └── cad.yaml               symbol, footprint and package
└── library/                           rebuilt on every pull
    ├── datasheets.kicad_sym           KiCad symbols
    ├── datasheets.pretty/             KiCad footprints
    ├── sym-lib-table  fp-lib-table    library tables for KiCad
    ├── datasheets.kicad_dbl           KiCad database library
    └── datasheets.sqlite              the parameters, one table per category
  • The datasheet - the family's Markdown datasheet, with markers that tie every table row and paragraph to its source, plus its figures and the original PDF.
  • The parameters - the unified datasheet as JSON lines, one parameter per line, each with its min / typ / max, unit, condition, review state and source.
  • The pins - the pin table as CSV: number, name, electrical type, and the figure it came from.
  • The CAD - which symbol and footprint the part uses, its package dimensions and pin map.

Files are formats your tools already read: CSV, JSON lines, YAML, Markdown. Pull only what you need: dsmd.toml can skip the PDFs or the Markdown, and dsmd clone --parts makes a sparse copy.

Your library in KiCad, with no import step ​

Every pull rebuilds library/: a KiCad symbol library, a footprint library and the library tables that point at them through ${KIPRJMOD}. Open the folder as a KiCad project and the parts are there. For a parametric library, add datasheets.kicad_dbl as a database library: every category is a table of the SQLite file, with the parameters as columns. The symbol fields follow your workspace's category mapping and the symbols and footprints follow your CAD settings, so the library looks like your engineers drew it.

The workflow ​

CommandWhat it does
dsmd clone <workspace> [dir]Make a working copy; run again to resume a broken clone
dsmd pullFetch the server's changes, merge them, rebuild library/
dsmd status / dsmd diffWhat you changed, as a list or as a diff
dsmd restore [part]Throw local changes away
dsmd push -m "why"Send your changes, with a message saying what and why
dsmd log [part]The history of pushes: who, when, why
dsmd part add <PN> / part rm <PN>Add a catalog part to the workspace, or remove one
dsmd confirm <part> [items]Confirm CAD review items or parameter rows
dsmd pdf <part> / dsmd open <part>The part's PDF, or its page in the web app

Pull merges row by row. The merge is three-way against the last version you pulled. Parameters merge by row and pins by pin, so you and a colleague editing different rows of the same part never conflict. A real conflict is marked in the file the way git marks it, and push refuses to send a file that still has markers.

Push is checked by the server. Only the parameters, the pins, the CAD configuration and the settings are editable; the datasheet and the generated library are not. Each part is applied on its own, all or nothing: applied, stale (someone changed it since you pulled; pull and push again), or rejected with the file and line that is wrong. Every push is recorded with its message, so dsmd log reads like a commit history.

Fixing a part, end to end ​

The session at the top of this page is a real one. The onsemi BSS138 came out of extraction with its source and drain typed as power inputs - wrong for a MOSFET, and the reason it could not take the MOSFET glyph. One edit to pins.csv, a look at the diff, a push; with passive source and drain the part takes the standard N-channel MOSFET glyph, and the pin map and symbol are confirmed as reviewed. In the web app:

The CAD data pane of the onsemi BSS138 after the dsmd pushes: Pin table and mapping and Symbol confirmed (2 of 4), the N-channel MOSFET glyph with gate on pin 1, source on pin 2 and drain on pin 3, and the pin map on the SOT-23 footprint
The same part in the web app: drawn with the N-channel MOSFET glyph (gate 1, source 2, drain 3), its pin table and symbol confirmed.

Settings as files ​

The workspace's settings sync too, for owners and admins: every category mapping as a YAML file, and the symbol style with the reference designators. Change your library's field names or a category's reference designator in a text editor, review the diff, push it - and the next pull rebuilds the KiCad library with it.

For AI agents ​

dsmd is made to be driven by an agent as much as by a person. The working copy is the agent's context: it can grep every datasheet in the library, read the exact table row behind a value, and change the data with ordinary file edits.

  • Headless sign-in - set DSMD_TOKEN to an API key created in the web app. The key carries its own permissions, so an agent can be allowed to edit parameters but not CAD, or to read only.
  • Machine output - every command takes --json, and exit codes say whether a run was clean, had conflicts or rejected parts.
  • A guide built in - dsmd help agents prints the rules an agent should follow: keep row and pin ids, cite the source block of the datasheet when correcting a value, show the diff to a person before pushing.
  • Reviews - dsmd confirm <part> lists the CAD review items, each with the figures of the datasheet that prove it, so an agent can check the pin map against the pinout and confirm it. A confirmation carries the name of the person whose key made it, and a later change to the data reopens it.
  • Feedback - when the agent hits something it cannot do, dsmd feedback tells us.

A typical instruction: "Pull the library, check every MOSFET's pin types against its pinout figure, fix what is wrong, show me the diff, then push with a message per part."

dsmd and the MCP server complement each other: MCP for questions and single parts in a chat, dsmd for work across the whole library, in files, under version history.

In CI ​

The same token and --json make dsmd usable in a pipeline: clone or pull the library in a build step, check it, publish the generated KiCad library as an artefact. The update notice is off when the CI variable is set.

coming Today every change rebuilds the whole library/; rebuilding only the parts that changed is planned for large libraries.