Skip to main content

part-grimoire: a terminal tool to materialize CAD from code grimoires

part-grimoire

Test PyPI License: MIT

part-grimoire turns a part, written as a config file and Python CAD code, into a folder with everything to make it. It operates in the terminal, on your own computer, one stage after the other.

You write a chapter: a rubric (rubric.toml) and an incantation (a badcad Python file). Then you cast it. The cast writes a page for each aspect (variant) of the part. It seals each page into a spell (a zip file). A page has:

  • an STL and a STEP file for each talisman (printed piece)
  • a glyph (a DXF outline) of each talisman
  • the bound form (the assembled part) as STL, 3MF, and STEP, with one named, coloured solid for each item
  • the sigil (thumbnail) and an illumination (picture) of each talisman
  • an exploded view of each rite (assembly step), and the unveiling (an exploded view of all the rites)
  • the manifestation: a Bambu Studio print project and a sliced plate, with the print time and the filament weight
  • the reagents (the bill of materials) as CSV, JSON, and Markdown
  • the page text (a README) and the colophon (the build record)

The glossary gives the plain meaning of each term. part-grimoire is a terminal version of the model build pipeline of ExoWorks.

Install

With pip

pip install part-grimoire

For the MCP server for Claude, add the mcp extra: pip install "part-grimoire[mcp]". The installer adds it.

pip installs part-grimoire and its Python packages. It does not install the system libraries or the familiar (Bambu Studio). Without the familiar, use cast --no-manifest. part-grimoire augur shows what is missing.

With the installer

The installer installs everything, the familiar included:

git clone https://github.com/Spikeon-Studio/part-grimoire.git
cd part-grimoire && ./install.sh

The installer installs:

  1. The system packages: Python, git, the OpenGL and EGL libraries, Xvfb, and the cairo headers. It uses apt, dnf, pacman, or zypper, and sudo prompts you for your password.
  2. A Python environment in ~/.local/share/part-grimoire/venv with badcad, build123d, manifold3d, OCP, numpy, scipy, shapely, Pillow, moderngl, matplotlib, ezdxf, and pycairo.
  3. The part-grimoire command in ~/.local/bin.
  4. The familiar (Bambu Studio): the Docker image ghcr.io/spikeon/bambu-studio-mcp:latest if Docker is on the computer, else com.bambulab.BambuStudio from Flathub.

Then it starts part-grimoire augur, which checks each dependency.

Installer option Effect
--familiar docker Use the Docker image of Bambu Studio. Install Docker if it is missing.
--familiar flatpak Use Bambu Studio from Flathub. Install Flatpak if it is missing.
--familiar skip Do not install Bambu Studio. The casts make no manifestation.
--no-system Do not install system packages.
--dev Make an editable install with the test tools.
--uninstall Remove the environment, the command link, and the settings.

Quick start

part-grimoire inscribe my-box
part-grimoire cast my-box

The page is in my-box/pages/my-box/, and the spell is my-box/pages/my-box.spell.zip. To find and store a good camera for each picture:

part-grimoire divine my-box

Commands

Command Effect
part-grimoire cast [chapter] Cast the spell: make the page and the spell of each aspect.
part-grimoire divine [chapter] Find the cameras of the views and store them in visions.toml. --jev lets Jev find.
part-grimoire gaze [chapter] Open the scrying glass: a window to find the camera and the explode distances of each view by hand.
part-grimoire scry [chapter] Read the chapter. Show the talismans, the rites, and the reagent cost. Write nothing.
part-grimoire inscribe <folder> Make a chapter with an example part.
part-grimoire augur Check that the computer has all the dependencies.
part-grimoire lore <machine|process|filament> List the Bambu Studio profiles.

The command reference gives all the options.

A chapter

rubric.toml:

[chapter]
name = "cable-clip"
title = "Cable Clip"
version = "2.1"
incantation = "clip.py"

[aspects]
cable = [4, 6, 8]

[tinctures]
latch = "#d2691e"

[reagents."M3x12 screw"]
kind = "screw"
d = 3
length = 12
price = 7.49
pack = 100

[rites.latch]
title = "Attach the latch"
text = "Put the latch on the base. Install the screw."
camera = [-35, 15]

[manifestation]
printer = "Bambu Lab P1S 0.4 nozzle"

clip.py:

from partgrimoire import Ritual


def talismans(cable):
    return {"base": base(), "latch": latch(cable)}


def ritual(talismans, cable):
    r = Ritual()
    r.rite("latch")
    r.talisman("base", talismans["base"])
    r.talisman("latch", talismans["latch"], rite="latch", explode=0.8)
    r.reagent("M3x12 screw", at=(-9, 0, 6 + cable + 4.8), axis=(0, 0, 1), rite="latch", explode=2.0)
    return r

The full example is in examples/cable-clip.

Cameras

Each picture can store its own camera (camera, zoom, center) in the rubric. part-grimoire divine finds cameras that show the items best, and stores them in visions.toml. part-grimoire gaze opens the scrying glass, where you turn the camera and pull the items by hand. See The scrying glass. With --jev, the Jev decision model finds from the best cameras. Jev is optional, and a stored camera always wins. See Scrying and cameras.

Claude Code plugin

The part-grimoire plugin lets Claude Code inscribe, scry, cast, and read a chapter, and show you its pictures. Install part-grimoire first. Then type this line in Claude Code:

/plugin install part-grimoire --marketplace Spikeon-Studio/part-grimoire

Type y to add the marketplace, then select a scope. On Claude Code before 2.1.275, use two lines:

/plugin marketplace add Spikeon-Studio/part-grimoire
/plugin install part-grimoire@spikeon-studio

The plugin has:

Part Use
The grimoire skill Claude uses it when you talk about a chapter, a rubric, an incantation, or a cast. It knows the commands, the page layout, and the grimoire terms.
/part-grimoire:cast [chapter] [options] Scry and cast the chapter. Then show the sigil, the unveiling, the reagent cost, the print time, and the warnings.
/part-grimoire:show [page] [picture] Show a picture of a page: sigil, unveiling, talisman:<name>, or rite:<key>.
The MCP server part-grimoire mcp. It gives Claude the tools augur, inscribe, scry, cast, divine, lore, read_page, view, and show_page. The tools return JSON and small pictures. It needs the mcp extra.
The page viewer show_page opens an interactive viewer in the chat: the pictures, a 3D view of the bound form that you can turn, and the reagent list. Claude Desktop and claude.ai show it. Claude Code does not show MCP Apps.

Claude Desktop and other MCP clients

The MCP server works without the plugin. Add it to the MCP configuration of the client, for example claude_desktop_config.json for Claude Desktop:

{
  "mcpServers": {
    "part-grimoire": { "command": "part-grimoire", "args": ["mcp"] }
  }
}

If part-grimoire is not in the PATH of the client, give the full path, for example /home/<user>/.local/bin/part-grimoire. The client does not expand ~.

The plugin is in claude/. Its references are copies of docs/. After a change in docs/, run python claude/sync_references.py.

Documentation

Page Contents
Get started Install, inscribe, scry, cast, and divine
The incantation talismans(), ritual(), and the Ritual methods
The scrying glass The window of part-grimoire gaze: cameras, exploded views, steps, words, pictures, and reagents
Scrying and cameras The pictures, the stored cameras, divine, and Jev
Reagents Hardware items, prices, and the reagent list
Fasteners Screws, nuts, washers, and inserts, and the holes that install them
The familiar Bambu Studio: backends, profiles, and print settings
The page The outputs, the glyphs, the colophon, and the seal
Rubric reference Each table and key, with its type and default
Command reference All commands and options
Glossary The grimoire terms
Troubleshooting Errors and their causes

Tests

./install.sh --dev
~/.local/share/part-grimoire/venv/bin/python -m pytest

The tests use only the fixture chapter in tests/fixtures. They do not start the familiar or Jev. GitHub Actions does the tests on Python 3.12 and 3.14 for each push to main and each pull request.

Metadata

Release files for part-grimoire 0.5.1

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

Source distribution (sdist)

Source distribution for part-grimoire 0.5.1
File Size Uploaded Provenance Actions
part_grimoire-0.5.1.tar.gz 100.5 kB With provenance Details for part_grimoire-0.5.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for part-grimoire 0.5.1
File Interpreter ABI Platform Actions
part_grimoire-0.5.1-py3-none-any.whl Python 3 none any Details for part_grimoire-0.5.1-py3-none-any.whl

Total release size: 187.9 kB

Release files / part_grimoire-0.5.1.tar.gz

Download URL part_grimoire-0.5.1.tar.gz
Size 100.5 kB
Tags Source
SHA-256 checksum
How to use checksums
d63d972e5d5a8f2b634d990bdc504cf974c6e43b103fc0ea281a6caad06c4e2c
BLAKE2b-256 checksum
How to use checksums
9021fdcb1db17b0683da166c8227c2ab785b141959e4c8444570144e17ed6986
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 Nov 30, 2026.

Transparency log

Release files / part_grimoire-0.5.1-py3-none-any.whl

Download URL part_grimoire-0.5.1-py3-none-any.whl
Size 87.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
046395620424b2e5ee67f70aee6fcad262caaf73dd05c2749f64c4c1ac7d7ff3
BLAKE2b-256 checksum
How to use checksums
384bbf51fbda85fbb266e698e65427b1e689140913df224e1eae276ae3951c68
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 Nov 30, 2026.

Transparency log

Security for part-grimoire 0.5.1

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 part_grimoire-0.5.1.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 Nov 30, 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