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

fish-scripts-ui

v0.0.2

Published

基于 React Router v7 (SSR) 的自动化脚本管理平台,旨在将繁琐的 CLI 操作转化为直观的 UI 操作。

Readme

🛠️ Scripts UI Manager

基于 React Router v7 (SSR) 的自动化脚本管理平台,旨在将繁琐的 CLI 操作转化为直观的 UI 操作。

💡 核心理念

  • 简单直观: 所有的 CLI 逻辑通过配置化 UI 展示,降低上手难度。
  • 配置共享: 全局共享服务器环境(Address, Token)与项目上下文(Space, Projects)。
  • 执行透明: 全局统一的日志流 (Execution Logs) 与执行状态管理。

🏗️ 架构设计

1. 技术栈

  • 框架: React Router v7 (SSR 模式)
  • 运行时: Bun (高性能 TS 支持)
  • UI 组件: Base UI + shadcn/ui + Tailwind CSS
  • 状态管理:
    • Zustand (Config): 持久化存储服务器、项目空间等偏好设置。
    • Zustand (Execution): 全局执行状态中心。记录所有脚本的运行状态、实时日志、执行结果。支持在不同脚本间切换而无需担心任务丢失。
  • 后端执行: 统一的 /api/run 路由分发器。

2. 核心模块

  • app/registry/: 脚本注册表。定义 UI 参数 Schema 及后端处理 Handler。
  • app/routes/api.run.tsx: 统一执行端点。接受任意脚本 ID 及上下文,调用对应 Handler 并返回标准化结果。
  • app/components/scripts/:
    • ScriptForm: 动态参数表单。
    • ExecutionConsole: 独立日志控制台。支持实时滚动、错误高亮及 JSON 结果展示。

⚙️ 核心流程 (SoC 架构)

  1. 统一输入输出: 无论什么脚本,入参统一为 paramscontext,回参统一为 ScriptExecutionResult (包含 success, logs, data, error)。
  2. 状态分离: UI 组件不再管理“正在运行”或“日志”等复杂状态,而是从 useExecutionStore 订阅。
  3. 支持并发: 用户可以在 Script A 运行时切换到 Script B。左侧侧边栏会通过状态圆点实时反馈后台任务的进度(黄:运行中,绿:成功,红:失败)。

🚀 路线图

  • [x] 模块化重构:将 Action 从 Home 路由剥离到独立 API 路由。
  • [x] 全局执行状态中心:支持多任务并行、状态持久化感知。
  • [x] 统一脚本调用契约:标准化所有脚本的 Log 与 Result 格式。
  • [x] 优化 Console体验:增加自动滚动、错误高亮、多任务日志记录。
  • [ ] 接入 XTerm.js 支持真色彩终端及交互。
  • [ ] 实现脚本执行队列管理 (Queue Manager)。