npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

tasklens

v0.1.0

Published

TaskLens 源码分发 CLI:npx tasklens add 把 Agent 执行 UI 的 .vue 源码复制进你的仓库(shadcn 模式,零运行时依赖)

Readme

tasklens(CLI)

TaskLens 的源码分发命令行:npx tasklens add <component> 把 .vue / .ts / .css 源码复制进你的仓库(shadcn 模式),而不是装一个运行时包。

  • 零运行时依赖(dependencies 为空)
  • registry 清单与源码模板都随包分发,装完即可离线使用
  • 单文件 ESM 产物:dist/cli.mjs(带 shebang,0o755)

命令

npx tasklens init                    # 写入 tasklens.config.json
npx tasklens list                    # 列出 registry 全部条目(--json 输出原始 JSON)
npx tasklens add agent-task-panel    # 复制源码(自动带上全部 registryDependencies)
npx tasklens telemetry --show        # 查看匿名统计到底采集了什么

tasklens add <items...>

| 选项 | 说明 | | --- | --- | | --all | 安装 registry 里的全部条目 | | --overwrite | 覆盖已存在的文件(默认打印 skip (exists) 并跳过) | | --dry-run | 只打印将要发生的事,不写任何文件 | | --dir <path> | 组件文件的目标目录(覆盖 components 别名;lib / styles / composables 仍走各自别名) | | --registry <path> | 用本地 registry.json 覆盖内置清单(v0.1 不支持 URL,传 URL 会明确报错) | | --cwd <path> | 指定项目根(默认从当前目录向上找最近的 package.json) |

结束时会打印三件事:每个文件的 created / skip (exists) 状态、依赖的安装命令 (按 lockfile 自动选 pnpm add / yarn add / npm install / bun add),以及可直接粘贴的 import 片段。

import 片段规则(保持简单、确定):

  • 配置里用了路径别名(@/components/tasklens)→ 原样使用别名;
  • 否则退化为相对项目根的路径并补 ./ 前缀,例如 ./src/components/tasklens/StatusBadge.vue。

文件落到哪里

registry 条目的每个文件都有 target(别名 key)与 name(落地文件名),最终路径是 <项目根>/<aliases[target]>/<name>。别名来自 registry 的 aliases,可被 tasklens.config.json 的 aliases 覆盖(@/x、~/x 按社区惯例映射到 src/x)。

源码从哪里来(resolveSourcePath)

按顺序尝试,找不到就报错并列出全部尝试过的路径(不会静默成功):

  1. --registry 所在目录及其向上各级目录(本地开发时指向 monorepo 根);
  2. <包目录>/dist/templates/<仓库相对路径>(发布后源码随包分发,走这一条);
  3. 从 CLI 文件向上查找包含该路径的 monorepo 根(在仓库里直接跑源码时走这一条)。

匿名使用统计:纯本地,永不联网

TaskLens 是离线优先软件 —— 没有服务器,也没有任何埋点上报通道。 「匿名统计」在这里的实现只有一件事:往 <项目根>/.tasklens/telemetry.log 追加一行 JSON。

  • 默认开启(PRD 要求),首次运行会打印一次说明(标记文件:~/.tasklens/telemetry-notice-shown);
  • 三种关闭方式(任意一种生效即关闭): --no-telemetry / 环境变量 TASKLENS_TELEMETRY=0(也接受 false / off / no)/ tasklens.config.json 里 "telemetry": false;
  • 采集字段用 tasklens telemetry --show 查看,最近记录用 tasklens telemetry --log 查看;
  • 采集内容只有:事件名、命令名、CLI 版本、时间、成功与否、耗时、条目名(registry 里的公开名字)、 Node 版本 / 平台 / 架构、是否 --dry-run。不含任何路径、项目名、用户名、IP、机器指纹;
  • TASKLENS_HOME 可以覆盖家目录(CI / 测试里隔离标记文件用)。

代码里没有 fetch、没有 http/https 请求、没有任何 URL —— 这是设计约束,不是待办事项。 测试里有一条用例专门守住这条线(test/telemetry.spec.ts 的「离线保证」)。

建议把 .tasklens/ 加进项目的 .gitignore(首次运行提示里也会说一次)。

构建

pnpm --filter tasklens build

等价于:

  1. vite build —— SSR/node 库模式,产物是自包含的 dist/cli.mjs(banner 注入 shebang, closeBundle 里 chmod 0o755;版本号在构建期内联,运行时不读 package.json);
  2. node scripts/copy-assets.mjs —— 把仓库根的 registry/registry.json 拷成 dist/registry.json, 并把每个条目的源码拷成 dist/templates/<仓库相对路径>(保留相对路径,便于直接拼接)。

源码缺失时第 2 步只告警不失败(开发期 packages/vue/src/** 可能还没写完); CI 发布时可以设 TASKLENS_CLI_ASSETS_STRICT=1 让它硬失败。

测试

pnpm --filter tasklens test        # vitest run --root ../.. packages/cli
pnpm --filter tasklens typecheck   # tsc -p tsconfig.json --noEmit