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 组件。

可以做什么
  • 按名称、导出或意图搜索组件、区块、钩子、辅助工具和应用配方
  • 查看某个条目的确切 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 分