Logo Cad Viewer

Cad Viewer

Cộng đồngPhổ biến
earthtojake
cad-viewer

Khởi chạy CAD Viewer và trả về liên kết để xem xét các tệp CAD và mô tả robot. Dùng khi cần xem trực quan các tệp `.step`, `.stp`, `.glb`, `.stl`, `.3mf`, `.dxf`, `.urdf`, `.srdf` hoặc `.sdf`, đặc biệt là các tệp được bàn giao từ những kỹ năng tạo CAD, URDF, SRDF hoặc SDF.

Add to TypingMind

Tổng quan

Nhà phát hànhearthtojake
Kho mãtext-to-cad
Tên kỹ năngcad-viewer
Sao
16K
Bản fork
1.7K
Tệp đi kèm
3
Giấy phépMIT
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 3 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được earthtojake công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Cad Viewer trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/earthtojake/text-to-cad/tree/main/skills/cad-viewer
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/earthtojake/text-to-cad.git /tmp/text-to-cad
mkdir -p .claude/skills
cp -r /tmp/text-to-cad/skills/cad-viewer .claude/skills/cad-viewer
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Cad Viewer trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Cad Viewer ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Cad Viewer với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

CAD Viewer

Provenance: maintained in earthtojake/text-to-cad. Use the installed local skill files as the runtime source of truth; the repository link is only for provenance and release review. If the user asks to modify, debug, or iterate on CAD Viewer source itself, that is the repository's work, not this skill's — this skill runs the Viewer, it is not where you edit it.

Use this skill to open existing or newly generated CAD, robot-description, or DXF files in CAD Viewer and hand back live review links. The expected input is one or more explicit file paths.

Setup

The Viewer is part of cadgen: install this skill's requirements.txt into a Python >= 3.11 and the cadgen command carries the server and the prebuilt client. There is nothing else to install and no Node at run time.

bash
python -m pip install -r requirements.txt

cadgen doctor <this skill's directory> confirms the installed cadgen matches the version this skill was published against.

Start Viewer

Launching is unconditional: the command below always ends with the URL of a live Viewer for the launch directory. If one is already running for that directory with the same Viewer code on disk (the reuse key is realpath(directory) x an identity token — the cadgen version plus a content digest of its Python runtime and exact built client, so an upgraded Viewer or a different --dist never hands back a stale instance), its URL is returned ("action": "reused"); otherwise a new server starts on the first free port from 3245 upward ("action": "started"). Never pick or reason about ports — read the URL the command prints. Each instance serves ONE directory — the directory it is launched from — fixed for the life of the process. There is no flag for it: the cwd IS the served directory.

The base port 3245 is 0xCAD — "CAD" in hexadecimal.

bash
cd /absolute/project/models && cadgen viewer --host 127.0.0.1 --json

(cadgen must be the one installed from this skill's requirements.txt. If it is not on PATH, python -m cadgen.viewer with that interpreter is the same launcher.)

Choose the launch directory deliberately — it is the whole ballgame. The cwd decides what the catalog SCANS (a project root drags in node_modules, .git and build output) and it is the instance REUSE key, so launching from wherever you happen to be can hand back a Viewer serving somewhere else. cd to the directory the user thinks of as their model workspace — usually the project's models/ directory — and launch from there. Never launch from inside this skill's directory: that serves the skill, not the models.

Flags: --json prints the machine-readable last stdout line ({"url", "port", "action": "started"|"reused"}) — always pass it and take the URL from there. --new forces a fresh instance instead of reusing. An explicit --port <n> is strict — "this port or fail" — and disables both reuse and rolling. cadgen viewer --help lists the rest.

URL shape

The page is the bare origin, and file= selects one artifact inside the served root:

text
http://127.0.0.1:3245/?file=gripper/STEP/gear_rack_gripper.step

The file= value is relative to the served directory. Nothing about the directory appears in the URL, so the same link means different files under different instances — the root is the server's, not the link's.

The launch directory is the workspace, not the file's folder. The Viewer scans it recursively, so the file browser lists every model beneath it and the user can switch files without a new link. Launch from the directory the user thinks of as their model workspace — typically the project's models/ directory, or the nearest common parent of the files you were asked to review — and put the rest of the path in file=. Launching from the artifact's own deep folder (cd .../models/gripper/STEP, ?file=gear_rack_gripper.step) opens the same model but hides the rest of the project, which is almost never what the user wants.

Port collisions are not your problem: the launcher rolls to a free port and the URL it prints is the truth. In sandboxed agent environments, local binding failures such as EPERM/EACCES can still occur; rerun with the needed permission/escalation.

cadgen viewer list shows every running instance with the directory it serves; cadgen viewer stop --port <n> ends one. (Both run from anywhere — only launching cares about the cwd.) To review a directory outside the current root, just cd there and launch again — reuse-or-start makes the second launch cheap and correct.

Generation is the CAD skill's job; documents compile in the Viewer

The Viewer is a static visualization tool: it renders artifacts that already exist. Generated models must be built first by running their model script (see the CAD skill); the Viewer never runs a script and never learns whether a document has one.

A .step/.stp document's status in the Viewer is one of four, decided from the file's bytes and the store alone: not compiled (the store has no tree for these bytes — the Viewer offers to compile, and compiles on open), compiling · n/total (a job in cadgen's build pool is producing a tree whose outputs include this document — the Viewer's own compile, a python model.py in a terminal, or a parent's child build alike), rendered, or failed (the last job for it failed; the message is shown). A compile is a job submitted to the same pool every cadgen door uses, so progress and errors come back as data. There is no "stale vs source" state: whether a document is behind its script is cadgen store why's question, not the Viewer's. When an agent is doing the work there is nothing to run first: just use the file and return the link.

Links

  • Before returning any link, resolve <directory>/<file> and confirm it exists. Pass the .step/.stp artifact itself — generated and imported alike. The catalog lists artifacts and names them exactly as they read on disk: moonwatch.step is moonwatch.step in the tab, the breadcrumb, the catalog row and the file picker, whether it was generated or imported. The Viewer never learns whether a document was generated: its status is artifact-side only (not compiled / compiling / rendered / failed), and the model script is not shown anywhere in the UI. A generated model's document must already exist (run the model script); a document the store has no tree for is compiled from its bytes on open. If the resolved path is missing, do not return the link; report the problem and point to the correct path.
  • Return one Viewer URL per requested file.
  • Start the Viewer once and pick one workspace root for the session. Every link is the same origin plus ?file=<path relative to that root>, so all of them share one browsable catalog. An artifact outside that root needs its own Viewer — launch again with that root (reuse-or-start makes this idempotent); a link alone cannot reach it.
  • For directory-only review links, return the origin without ?file=.
  • Do not stop an existing Viewer server unless the user asks.
  • If Viewer startup fails, report the failure and continue with the owning skill's non-GUI validation or artifacts.

References

  • Read references/viewer-features.md when you need supported file types, Viewer controls, or file-specific feature details.

Tệp đi kèm

Khi kỹ năng đã được tải, mô hình có thể đọc các tệp này nếu cần. Các tệp này chỉ dùng để đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI Cad Viewer làm được gì?

Khởi chạy CAD Viewer và trả về liên kết để xem xét các tệp CAD và mô tả robot. Dùng khi cần xem trực quan các tệp `.step`, `.stp`, `.glb`, `.stl`, `.3mf`, `.dxf`, `.urdf`, `.srdf` hoặc `.sdf`, đặc biệt là các tệp được bàn giao từ những kỹ năng tạo CAD, URDF, SRDF hoặc SDF.

Vì sao nên dùng Cad Viewer trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Cad Viewer là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Cad Viewer trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/earthtojake/text-to-cad/tree/main/skills/cad-viewer. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm rồi cài đặt cả gói dưới dạng một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Cad Viewer?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Cad Viewer với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Cad Viewer với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Cad Viewer có miễn phí không?

Có. Kỹ năng này được earthtojake phát hành trên GitHub theo giấy phép MIT. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇