xs-java2ai/niulai-pet 预览 preview

xs-java2ai/niulai-pet

牛来A股桌宠 (Electron + DSH 套件)

Project Overview项目介绍

Niulai Pet is a borderless, transparent, always-on-top desktop pet for A-share stock market investors, built on the Electron framework. It is packaged as a DSH native bundle plugin, so you can install it directly to any DSH profile. When you click the pet, it fetches real-time A-share price change data, plays a unique “Niulai (Bull is here)” audio when the index rises, and plays a “Mama (Oh my god)” audio when it falls. It only shows a silhouette of the bull pet, so it does not block other desktop content unnecessarily, and you can drag it to any position on your desktop that you prefer. The plugin follows DSH's packaging specifications, with a clear cordis patch manifest and plugin entry point.

You can run Niulai Pet either as a standalone desktop app or launch it automatically with your DSH profile after installing the plugin. It is designed for users who follow A-share market trends, and lets you keep the pet on your desktop permanently to check the latest index data with one click anytime. It supports window pinning, minimizing to system tray, auto-start on boot, automatic position saving, and runs as a single instance to avoid wasting system resources from duplicate launches. You can toggle the pet’s visibility quickly by clicking the system tray icon, which makes it easy to hide when you need more desktop space.

To run the project, you need Node.js version 20 or higher, and it works across Windows 10/11, macOS, and Linux desktop environments. You can install dependencies via npm or pnpm, and the project includes a pre-configured .npmrc that sets up the Electron mirror for users in mainland China to speed up downloads. The free financial APIs used do not guarantee service level agreements, so data may have delays, and the content is for display only and does not constitute investment advice. If you replace the pet image yourself, you will need to generate a transparent PNG channel for it to display correctly.

牛来桌宠是一个基于Electron构建的A股桌面宠物工具,同时以DSH bundle形式打包,可作为原生插件安装到任意DSH配置文件中。它是一个无边框、透明、置顶的桌面宠物,点击即可获取A股实时涨跌幅数据,上涨时播放“牛来了”定制音效,下跌时播放“妈呀”定制音效,整体仅显示宠物剪影,不会额外遮挡其他桌面内容,支持拖拽到任意位置。

它的典型使用流程是,安装依赖后既可以独立启动运行,也可以作为DSH插件随DSH profile启动,适合关注A股大盘走势的用户,将其放在桌面常驻,随时一键查看最新行情。支持窗口置顶、系统托盘最小化、开机自启、位置自动记忆,单实例运行避免重复启动占用资源,点击托盘图标即可快速切换显示或隐藏。

运行要求Node.js版本不低于20,支持Windows 10/11、macOS和Linux桌面环境,可通过npm或pnpm安装依赖,项目内置了npm配置文件,已为国内用户配置好Electron镜像加速。免费财经API不保证服务可用性,行情可能存在延迟,内容仅作展示不构成投资建议,自行替换素材需要处理图片透明通道。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 3 warnings3 项注意
  • No license declared - all rights reserved by default; ask the author before commercial use or redistribution未声明开源许可证 —— 默认「保留所有权利」,商用或再分发前先问作者
  • Only 4 stars - very few users, little community feedback星标只有 4,几乎没人在用,遇到问题缺少社区反馈
  • Desktop client: installation downloads an executable - verify the publisher and checksums桌面客户端:安装会下载可执行文件,请核对发布者与校验和
DSH walks through these 9 checksDSH 会逐条核对这 9 项

Compatibility兼容性

  • DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
  • External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
  • Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册

Security安全性

  • Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
  • Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
  • curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
  • Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
  • Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
  • Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式

Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。

Or use CLI install (for developers)或使用命令行安装(适合开发者)

CLI Install命令行安装

dsh plugin --profile web add github:xs-java2ai/niulai-pet

把 xs-java2ai/niulai-pet 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

牛来桌宠 (Niulai Pet)

一个无边框、透明、置顶的 A股桌面宠物。点击桌宠即可获取 A股实时涨跌幅:

  • 上涨 → 播放 niulai.mp3(牛来了!🔴)
  • 下跌 → 播放 mama.mp3(妈呀!🟢)

基于 Electron 构建,同时以 DSH bundle 形式打包,可作为插件安装进任意 DSH profile。

效果预览

正常状态 点击后(说话)
正常状态 说话状态

功能特性

  • ✅ 正常状态显示 ./assets/niu.png,点击切换为 ./assets/niu_speek.png(带弹跳动画)
  • ✅ 调用免费财经 API 获取 A股实时涨跌幅(上证指数,可配置)
  • ✅ 点击后弹出气泡展示名称 / 涨跌幅 / 现价 / 涨跌额(A股红涨绿跌)
  • ✅ 上涨 / 下跌播放不同音效,音频异步预加载
  • ✅ 无边框 + 透明窗口,只显示宠物剪影
  • ✅ 支持拖拽到桌面任意位置,位置自动记忆
  • ✅ 窗口置顶,常驻其他窗口之上
  • ✅ 最小化到系统托盘(单击托盘图标切换显示/隐藏)
  • ✅ 可选开机自启(开发模式可用,打包后更稳定)

目录结构

niulai/
├── assets/                 # 素材(打包进 asar,路径自动解析)
│   ├── niu.png             # 正常表情(已转透明)
│   ├── niu_speek.png       # 说话表情(已转透明)
│   ├── niulai.mp3          # 上涨音效
│   ├── mama.mp3            # 下跌音效
│   └── original/           # 原始(白底)图片备份
├── build/
│   └── icon.png            # 应用图标(由透明图自动生成)
├── scripts/
│   ├── make-transparent.cjs # 白底抠图脚本(可重复执行)
│   └── build.mjs            # 打包脚本(自动配置国内镜像)
├── src/
│   ├── main.js             # Electron 主进程(窗口/托盘/拖拽/自启/IPC)
│   ├── preload.cjs         # contextBridge 安全桥接
│   ├── stock.js            # A股行情获取(东方财富 + 腾讯备用)
│   ├── renderer/           # 渲染进程(UI/动画/音效)
│   └── pet/index.js        # DSH/Cordis 插件入口(拉起桌宠)
├── cordis.patch.yml        # DSH bundle patch 清单
├── package.json
└── README.md

环境要求

  • Node.js ≥ 20(推荐 20/22/24)
  • npm 或 pnpm
  • Windows 10/11、macOS、Linux(桌面环境)

一、依赖安装

# 在项目根目录
npm install

国内网络建议配置 Electron 镜像加速(项目已内置 .npmrc,也可用环境变量):

# PowerShell(等价于 .npmrc 配置;npm 11 已不接受 `npm config set` 写自定义键)
$env:ELECTRON_MIRROR = "https://npmmirror.com/mirrors/electron/"
$env:ELECTRON_BUILDER_BINARIES_MIRROR = "https://npmmirror.com/mirrors/electron-builder-binaries/"
npm install

项目内 .npmrc 已配置 electron 安装镜像;electron-builder 的打包镜像由 scripts/build.mjs 自动设置。海外网络可删除 .npmrc。

二、运行

npm start

启动后宠物出现在屏幕右下角,可拖动;点击宠物查看行情并播放音效;右键托盘图标可隐藏/刷新/退出。

三、打包分发

npm run pack     # 免安装目录版 → release/win-unpacked/
npm run dist     # 安装包(NSIS) → release/*.exe

开机自启 在开发模式与打包后均可用;打包后是独立 exe,不依赖源码目录,更稳定。

Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →

← 上一个 Prev agent-mcp 下一个 Next dsh-effort-tweak →