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

ruabot-cli

v2.4.2

Published

Beautiful cross-platform CLI tool for RuaBot management

Readme

RuaBot CLI v2.0

一个美观、现代化的跨平台 RuaBot 管理工具。

✨ 特性

🎨 精美界面

  • 圆角边框: 现代化设计风格
  • 自适应布局: 自动适配各种终端尺寸
  • 彩色输出: 清晰的视觉层次

🎮 流畅交互

  • 方向键导航: ↑↓ 选择命令
  • 回车确认: 快速执行
  • 实时反馈: Spinner 动画和进度提示
  • 状态指示: 运行状态一目了然

🌐 跨平台

  • ✅ Windows (PowerShell / CMD)
  • ✅ Linux (Bash / Zsh)
  • ✅ macOS (Terminal / iTerm2)

🚀 独立运行

  • 纯 Node.js 实现
  • 不依赖 bash/sh 脚本
  • 跨平台进程管理
  • 统一的用户体验

📦 安装

前置要求

  • Node.js >= 14
  • npm >= 6

安装步骤

# 直接安装最新版
npm install -g ruabot-cli

验证安装

ruabot --help

🧱 多框架管理

# 列出所有框架
ruabot framework list

# 安装框架(可指定路径与实例名)
ruabot framework install --path /data/RuaBot --name prod

# 切换当前实例
ruabot framework use prod

# 查看当前实例
ruabot framework current

# 卸载实例
ruabot framework uninstall --framework prod --yes

🎯 使用

方式一:交互式菜单(推荐)

ruabot

使用方向键选择操作,回车确认。支持的操作包括:

  • 🚀 启动服务
  • 🛑 停止服务
  • 🔄 重启服务
  • 📊 查看状态
  • 📝 查看日志
  • 🔍 完整性检查
  • ⬆️ 更新框架
  • 🏥 环境自检
  • 📋 显示环境信息
  • 🧹 系统维护

方式二:命令行模式

# 服务管理
ruabot start        # 启动
ruabot stop         # 停止
ruabot restart      # 重启
ruabot status       # 状态

# 信息查看
ruabot logs         # 日志
ruabot check        # 检查
ruabot info         # 信息
ruabot requirements # 自检

# 维护操作
ruabot update       # 更新
ruabot clean        # 清理

# 框架管理
ruabot framework list
ruabot framework install --path /path/to/RuaBot
ruabot framework use <name>
ruabot framework uninstall --framework <name>

📸 界面预览

Logo 和欢迎界面

ooooooooo.   ooooo     ooo       .o.       oooooooooo.    .oooooo.   ooooooooooooo 
`888   `Y88. `888'     `8'      .888.      `888'   `Y8b  d8P'  `Y8b  8'   888   `8 
 888   .d88'  888       8      .8"888.      888     888 888      888      888      
 888ooo88P'   888       8     .8' `888.     888oooo888' 888      888      888      
 888`88b.     888       8    .88ooo8888.    888    `88b 888      888      888      
 888  `88b.   `88.    .8'   .8'     `888.   888    .88P `88b    d88'      888      
o888o  o888o    `YbodP'    o88o     o8888o o888bood8P'   `Y8bood8P'      o888o     

╭────────────────────────────────────────────────────────────────────────────╮
│                                                                            │
│  Version: 2.0                                                              │
│                                                                            │
│  RuaBot · 运维管理工具 - 使用方向键选择,回车确认                             │
│  GitHub: https://github.com/ValkyrieEY/RuaBot                              │
│  提示: ruabot help 查看所有命令                                             │
│                                                                            │
╰────────────────────────────────────────────────────────────────────────────╯

状态显示

╭────── STATUS ───────╮
│                     │
│   RuaBot 运行状态   │
│                     │
╰─────────────────────╯

● 状态: 运行中
[INFO] PID: 12345
[INFO] 运行时长: 2:34:56
[INFO] 内存占用: 234.56 MB
[INFO] CPU 占用: 5.2%

环境自检

╭──── DIAGNOSTICS ────╮
│                     │
│   RuaBot 环境自检   │
│                     │
╰─────────────────────╯

[1] 操作系统
  ✓ Windows 10.0.26200
[2] Git
  ✓ git version 2.52.0
[3] Node.js
  ✓ Node.js v24.12.0
[4] Python
  ✓ Python 3.10.0
[5] 磁盘空间
  ✓ 可用空间: 15.47 GB
[6] RuaBot 安装目录
  ✓ 目录存在

══════════════════════════════════════════
✓ 通过: 6  ⚠ 警告: 0  ✗ 失败: 0
══════════════════════════════════════════

⚙️ 配置

安装目录

默认安装目录:

  • Windows: %USERPROFILE%\RuaBot
  • Linux/macOS: ~/RuaBot

自定义安装目录:

Windows (PowerShell):

$env:RUABOT_INSTALL_DIR="D:\MyPath\RuaBot"

Linux/macOS:

export RUABOT_INSTALL_DIR="/opt/ruabot"

永久设置请添加到系统环境变量。

🎨 界面设计

颜色方案

  • 青色 (Cyan): 边框和标题
  • 绿色 (Green): 成功消息和运行状态
  • 黄色 (Yellow): 警告和提示
  • 红色 (Red): 错误和停止状态
  • 蓝色 (Blue): 信息提示
  • 灰色 (Gray): 次要信息

布局特点

  • 圆角边框: 使用 ╭─╮╰╯ 字符
  • 自适应宽度: 根据终端动态调整
  • 图标支持: Emoji 增强可读性
  • 分隔线: 清晰的功能分组

交互体验

  • 无阻塞: 操作流畅
  • 即时反馈: Spinner 实时提示
  • 容错处理: 友好的错误提示
  • 确认机制: 危险操作需确认

🔧 高级功能

系统维护

进入维护菜单:

ruabot maintenance

或直接执行:

ruabot clean

维护选项:

  1. 清理缓存: 释放图片缓存、Python 缓存、node 缓存
  2. 清理临时文件: 删除过期临时文件
  3. 清理日志: 删除旧日志,截断大文件
  4. 全部清理: 一键执行所有清理
  5. 磁盘占用: 查看各目录大小

更新框架

ruabot update

安全更新流程:

  1. 自动备份数据
  2. Git 同步代码
  3. 恢复备份
  4. 升级依赖
  5. 可选启动

完整性检查

ruabot check

检查项目:

  • ✓ 必需文件存在
  • ✓ Python 环境正常
  • ✓ Node.js 环境正常
  • ○ 可选组件状态

📚 技术实现

核心依赖

{
  "inquirer": "^8.2.5",    // 交互式 CLI
  "chalk": "^4.1.2",       // 终端颜色
  "boxen": "^5.1.2",       // 边框绘制
  "ora": "^5.4.1",         // 进度 Spinner
  "terminal-kit": "^3.0.1" // 终端控制
}

跨平台进程管理

  • 使用 Node.js child_process 模块
  • 支持 Windows 和 Unix 系统
  • PID 文件跟踪
  • 优雅关闭机制

文件系统操作

  • 跨平台路径处理
  • 递归目录遍历
  • 大小计算
  • 备份恢复

🚀 性能

  • 启动速度: < 1 秒
  • 菜单响应: 即时
  • 操作执行: 实时反馈
  • 内存占用: < 50 MB

🔐 安全性

  • 操作前备份数据
  • 危险操作需确认
  • PID 文件锁定
  • 优雅退出机制

🤝 贡献

欢迎提交 Issue 和 Pull Request!

📄 许可

MIT License

🔗 相关链接


Made with ❤️ for RuaBot