Skip to content

Repository files navigation

Toolpath

Official open-source SDKs, UI primitives, and examples for building applications with the Toolpath API.

Toolpath analyzes a CAD part so you can understand whether it fits your shop, how it can be machined, and what it may cost.

Where to start

I want to…UseDocumentation
Call Toolpath from JavaScript@toolpath/apiTypeScript SDK
Call Toolpath from PythontoolpathPython SDK
Show a part in a React app@toolpath/viewerViewer
Build Toolpath-styled UI@toolpath/uiUI kit
Collect vendor tool data@toolpath/tool-scraperTool scraper
Draw a tool and its holder@toolpath/tool-drawingTool drawing
Share the cutting-tool domain@toolpath/tool-supportTool support
Share application logic@toolpath/app-supportApp support
See usage examplesTypeScript, Python, or ReactExamples
Start a customer applicationPart Viewer templatetoolpath-template
Call the API without an SDKHTTP, cURL, or another languageAPI documentation

The SDKs are generated from the same OpenAPI document, so their request and response types match the public API contract retained in this repository. They also provide a focused helper for directly uploading to the presigned URL returned by the create-part operation.

Before you begin

To analyze a part, you need:

  1. A Toolpath account and API key. Create a key in your Toolpath account.
  2. A STEP CAD file to upload.
  3. One supported programming environment:

Examples

The TypeScript and Python examples create a part and upload its STEP file; your application controls analysis and report retrieval through the generated API bindings:

The React example renders a finished part with @toolpath/viewer instead of uploading one:

Run the examples from source

1. Install the development tools

ToolWhat it doesRequired for
GitDownloads the repository and tracks source changesAll source workflows
Node.js 24.18+Runs the JavaScript tools; its installer also provides npmAll source workflows
CorepackActivates the exact pnpm version declared by this repositoryAll source workflows
pnpmInstalls and runs this repository's JavaScript dependenciesAll source workflows
DockerRuns the pinned TypeScript OpenAPI generator imageSDK generation and pnpm check
Python 3.11+Runs the Python SDK and examplePython only
uvCreates the Python environment and installs its dependenciesPython only

These are development tools for this repository, and so is the Node.js 24.18+ floor above. A package installed from npm needs neither Corepack nor pnpm, and runs on Node.js 20 or newer.

Verify that Git and Node.js are available:

git --version
node --version

The Node.js version must be v24.18.0 or newer within the v24 release line.

2. Download and prepare the repository

Open PowerShell, Command Prompt, Terminal, or your editor's terminal, then run:

git clone https://github.com/toolpath/ui-packages.git
cd ui-packages
corepack enable pnpm
pnpm install --frozen-lockfile

3. Run the TypeScript part analysis example

Replace the sample key and file path with your own values.

Windows PowerShell:

$env:TOOLPATH_API_KEY="your-api-key"
pnpm --filter @toolpath/example-typescript analyze --"C:\path\to\part.step"

Windows Command Prompt:

setTOOLPATH_API_KEY=your-api-key
pnpm --filter @toolpath/example-typescript analyze -- "C:\path\to\part.step"

macOS or Linux:

TOOLPATH_API_KEY="your-api-key" pnpm --filter @toolpath/example-typescript analyze -- "/path/to/part.step"

The command prints the complete analysis report after the report is ready.

4. Run the Python part analysis example

Install uv using its platform-specific instructions, then set TOOLPATH_API_KEY as shown above.

Windows:

uv run --project examples/python python examples/python/src/analyze_part.py "C:\path\to\part.step"

macOS or Linux:

uv run --project examples/python python examples/python/src/analyze_part.py "/path/to/part.step"

Contributing

Agent and contributor instructions live in AGENTS.md; it is the fuller guide, and this section is the short version.

pnpm check is the gate. It runs openapi:verify, generate:check, lint, build, check-types, and test, in that order. While implementing, run the narrowest thing instead — pnpm --filter @toolpath/viewer test for one package — and save the full gate for the end.

Docker must be running for pnpm check. Its second step regenerates both SDKs in a pinned openapi-generator container and compares the result against what is checked in, so a stopped Docker daemon fails the gate before it ever reaches lint.

A consumer-visible change to a public package needs a Changeset in the same pull request. CI enforces this and will fail the pull request without one. Add it with pnpm changeset, naming every package the change affects, and see AGENTS.md for which paths belong to which package and which bump to use. Never edit a package version or changelog by hand: the release workflow generates both.

Publishing a new npm package

New packages need a one-time bootstrap publish before npm trusted publishing can take over. See Bootstrapping npm packages.

License

This project is licensed under the MIT License.

About

Toolpath API SDKs and reference implementations

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages