labsUI

io.github.kznlabs由 GitHub 帳號 kznlabs 發布v0.2.1更新於 Nov 7, 2026

Search, add, diff and update labsUI React components in your project.

已驗證STDIO僅桌面檔案與儲存開發者工具

概覽

AI 產生的概覽

讓編碼代理透過 stdio 在你的專案中搜尋、檢視、加入、比對與更新 labsUI React 元件。

可以做什麼
  • 依名稱、匯出或意圖搜尋元件、區塊、hook、輔助工具與應用配方
  • 檢視某個項目的確切 props、型別、範例、相依套件以及根布局掛載需求
  • 把項目與其相依套件安裝到專案中,且不覆寫既有檔案
  • 執行一次性初始化並回傳根布局程式碼
  • 顯示目前版本到你已修改檔案的修補內容,並以三方合併方式更新項目
  • 執行環境檢查,逐項回報問題並提供修正方式
適用情境
當代理正在建置或維護使用 labsUI 元件的 React 應用,且應遵循該函式庫的慣例、而非猜測 props 或手動複製程式碼時使用。
執行需求
以 stdio 在本機執行,通常透過 npx 加上 mcp 參數啟動。目標專案需要 React 19、Tailwind CSS v4 以及 tsconfig.json 中的路徑別名;CLI 需要 Node.js 22 或更新版本,或 Deno。不共用工作區的用戶端(例如 Claude Desktop)需要加上 --cwd 指向應用資料夾。
安裝前請注意
它會寫入專案檔案:初始化會建立樣式、utils、theme 與 motion provider 檔案,add 會安裝元件與 npm 套件。--overwrite 會取代既有檔案,建議保留預設的不覆寫行為。更新會合併你的修改,可能留下需要手動解決的衝突標記。它只會寫入其執行所在專案資料夾內的檔案。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 labsUI,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

labsui

Add labsUI components to your project: clean React primitives with one smooth spring for every motion. Components are copied into your codebase, so you own and edit them.

Requires React 19, Tailwind CSS v4 and a path alias ("paths": { "@/*": ["./src/*"] } in tsconfig.json). The CLI runs on Node.js 22 or newer, or Deno. It has no dependencies and works offline.

Usage

sh
npx @kznlabs/labsui init                # once: styles, theme, utils, motion providernpx @kznlabs/labsui add button tabs     # components plus everything they importnpx @kznlabs/labsui search date range   # find by name, export or intentnpx @kznlabs/labsui view dialog         # props, examples, what it installsnpx @kznlabs/labsui update              # newer components, keeping your editsnpx @kznlabs/labsui doctor              # check the setup

Any runner works: bunx @kznlabs/labsui add button, pnpm dlx @kznlabs/labsui …, yarn dlx @kznlabs/labsui …, or from JSR with deno run -A jsr:@kznlabs/labsui add button. npm dependencies install with whatever package manager your lockfile shows.

The component registry ships inside the package: no network needed beyond installing npm dependencies, and each labsui version installs the same component code. npx @kznlabs/labsui@latest add … gets the newest components.

Global install

To type labsui instead of npx @kznlabs/labsui in every project:

sh
npm install -g @kznlabs/labsui    # or: bun add -g @kznlabs/labsuideno install -gA -n labsui jsr:@kznlabs/labsui

A global install pins its components to that version, the same way the registry ships inside each release. Update it when you want newer ones (npm install -g @kznlabs/labsui@latest); npx @kznlabs/labsui@latest always gets them.

Commands

init

  • Writes styles/labsui.css (tokens, accent presets, animations) and imports it right after @import "tailwindcss" in your stylesheet.
  • Adds lib/utils, lib/theme and components/motion-provider, and installs motion, clsx and tailwind-merge.
  • Saves labsui.json with the registry URL, your alias and its folder.
  • Prints the lines your root layout needs (theme script, MotionProvider).

Run it again any time: existing files are kept.

add

Resolves dependencies through the registry (data-table brings table, checkbox, pagination, …), writes each file under your alias folder and installs the npm packages it imports. Existing files are kept unless you pass --overwrite; a kept dependency whose code differs from this version is named, with the labsui update that brings it level, since the new item may need it. If your alias isn't @/, imports are rewritten to match. Components that live once in the root layout (toast, confirm) print the line to add there. A mistyped name gets a suggestion: buton suggests button.

list and search

list shows everything: components, blocks, hooks (use-disclosure, use-hotkey, …) and helpers (utils, theme, …). Hooks and helpers come along with the components that import them; add one by name to use it on its own.

search ranks by name first, then by what an item exports, then by its description, and every word must match:

sh
labsui search useModal         # finds dialoglabsui search toast promise    # finds toastlabsui search --kind hook      # every hooklabsui search shop             # finds the shop recipe too

It also finds recipes: a prompt for a whole app (blog, docs, shop, comparison, portfolio) that ran on a fresh app before it shipped, with the components it used. labsui view shop prints one.

view

Everything you need before writing code with an item, without leaving the terminal:

  • Exact props and types of each export, read from the component source.
  • A usage line and the full examples from the docs.
  • What it brings along and which npm packages it installs.
  • What to mount in the root layout, if anything.

Imports in the examples use your alias. --source adds the files themselves. For a recipe, view prints its prompt, its components and the patterns the result needs.

update and diff

Components are yours to edit, so an update must not silently undo your changes. labsui.json records which labsui version wrote each item, and labsui update (or labsui update dialog) uses that version as the base:

  • Files you never edited are replaced.
  • Edited files are merged three ways: your changes and this version's changes both land.
  • Where both changed the same lines, the file gets <<<<<<< yours / >>>>>>> labsui markers and update lists it. labsui doctor fails until they are resolved.
  • New dependencies of updated items are added.

The base comes from JSR, which keeps every release's files. Offline, with a hosted registry, or for items installed before versions were recorded, edited files are left as they are. labsui diff lists installed items that differ from this version and, from the same base, whose change each file is: only labsUI's (update replaces it), only yours (update keeps it) or both (update merges). It also marks files that differ only in blank lines or indentation. labsui diff dialog prints the patch from this version's file to yours, or says dialog isn't installed.

doctor

Checks the setup and prints a fix for each problem: React 19 and Tailwind v4, the path alias and labsui.json, the stylesheet import, MotionProvider and the theme script, <Toaster /> and <Confirmer /> mounted when installed, missing npm packages, and files your installed components import but the project lacks. It also lists installed items that differ from this version, your edits or an older install. Exits with 1 when something is broken, so it can run in CI.

It reads your code, not a framework's conventions: it works the same in any React app.

Coding agents

MCP server

labsui mcp serves the same commands to any agent that speaks the Model Context Protocol, over stdio. Register it with your agent:

json
{	"mcpServers": {		"labsui": { "command": "npx", "args": ["-y", "@kznlabs/labsui", "mcp"] }	}}

It works in the folder your agent shares as its workspace (MCP roots), or the one it starts the server in. If your agent starts servers elsewhere and shares no workspace, add "--cwd", "/path/to/app" after "mcp"; --cwd always wins. Claude Desktop is one of those: it shares no workspace, so give it --cwd. On Windows, Desktop starts npx through cmd:

json
{	"mcpServers": {		"labsui": {			"command": "cmd",			"args": ["/c", "npx", "-y", "@kznlabs/labsui", "mcp", "--cwd", "C:\\path\\to\\app"]		}	}}
ToolDoes
searchfind items and recipes by name, export or intent
viewexact props, examples, dependencies; a recipe's prompt
addinstall items into the project (never overwrites a file)
initone-time setup; returns the root layout code
diffpatches from this version to your edited files
updateupdate items, merging your edits three ways
doctorthe setup checks, each problem with its fix

Recipes are MCP prompts too (prompts/list), so a client that shows prompts offers them by name.

On connect, the server also sends the labsUI coding rules (imports, tokens, motion, mounting), so the agent writes code the way the library expects. It runs in the folder the agent starts it in and writes only inside that project.

Without MCP

  • labsui rules prints the same coding rules as Markdown. Append them to the file your agent reads: labsui rules >> AGENTS.md.
  • --json on any command prints one JSON document on stdout; npm output goes to stderr. Errors are { "error": "…" } with exit code 1.

Options

FlagMeaning
--jsonmachine-readable output on stdout
--kind <kind>search only: component, block, hook, helper or setup
--sourceview only: include the source files
--overwritereplace files that already exist
--dry-runshow what would change, write nothing
--no-installprint the install command instead of running it
--registry <url>another registry (also LABSUI_REGISTRY, or registry in config)
--cwd <dir>run against another project folder

License

MIT. Every component is original, hand-made labsUI code.

來源:packages/cli/README.md,提交 e9ce1c5

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

6
  1. v0.2.1最新Nov 7, 2026
  2. v0.2.0Nov 5, 2026
  3. v0.1.14Nov 4, 2026
  4. v0.1.13Nov 3, 2026
  5. v0.1.11Oct 30, 2026
  6. v0.1.6Oct 30, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分