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

@yunzhencc/yz-gallery

v1.1.7

Published

Yz Gallery 一键部署工具

Downloads

1,966

Readme

Yz Gallery CLI

一键部署工具,实现完整的本地化图库系统部署。

✨ 核心特性

🚀 三层配置系统

  • Quick 模式: 最少配置,快速上手
  • Custom 模式: 灵活配置,适合大多数场景 ⭐ 推荐
  • Expert 模式: 完全控制,适合生产环境

🦙 Ollama 支持

  • ✅ 完全本地化运行
  • ✅ 自动检测和安装
  • ✅ 推荐模型选择
  • ✅ 零 API 费用

☁️ 多模型提供商

  • Ollama: 本地模型,免费隐私安全
  • AIHubMix: 云端 API,性能强大
  • 自定义: 完全自定义配置

🔧 完整配置选项

  • ✅ 数据库选择(Docker/外部/SQLite)
  • ✅ S3 对象存储(AWS/阿里云/腾讯云/MinIO)
  • ✅ 自定义挂载路径
  • ✅ 端口配置
  • ✅ 安全配置(JWT、密码策略)

🏠 本地 Qdrant

  • ✅ 完全本地化向量数据库
  • ✅ 数据无需上传云端
  • ✅ 自动初始化

快速开始

# 使用 npx(推荐)
npx yz-gallery@latest config

# 全局安装
npm install -g yz-gallery
yz-gallery config

开发环境

cd cli
npm install
npm run dev

构建和测试

# 构建
npm run build

# 本地测试
npm link
yz-gallery config --help

发布

# 发布到 npm
npm publish

# 发布到私有 registry
npm publish --registry https://your-registry.com

文件结构

cli/
├── src/
│   ├── index.ts           # CLI 入口
│   └── commands/
│       ├── config.ts      # 配置管理(三层配置系统)
│       ├── deploy.ts      # 部署命令
│       ├── init.ts        # 初始化命令
│       └── service.ts     # 服务管理命令
├── templates/
│   ├── docker-compose.yml # Docker Compose 模板
│   └── config.example.yaml # 配置示例
├── package.json
├── tsconfig.json
└── README.md

依赖

  • commander - CLI 框架
  • docker-compose - Docker Compose 控制
  • chalk - 终端颜色
  • ora - 加载动画
  • inquirer - 交互式提示
  • js-yaml - YAML 解析
  • dotenv - 环境变量
  • fs-extra - 文件系统操作扩展

命令参考

配置管理

yz-gallery config                    # 默认自定义配置
yz-gallery config --mode quick       # 快速配置
yz-gallery config --mode custom      # 自定义配置
yz-gallery config --mode expert      # 专家配置

部署命令

yz-gallery deploy                    # 一键部署
yz-gallery deploy --skip-build       # 跳过构建

服务管理

yz-gallery status                    # 查看状态
yz-gallery start                     # 启动服务
yz-gallery stop                      # 停止服务
yz-gallery logs                      # 查看日志
yz-gallery logs -f                   # 实时日志

配置文件结构

.yz-gallery/
├── docker-compose.yml    # 服务编排配置
├── config.yaml          # 应用详细配置
└── .env                 # 环境变量

环境变量

主要环境变量:

# 模型配置
MODEL_PROVIDER=ollama|aihubmix|custom
AIHUBMIX_API_KEY=sk-xxxxx
OLLAMA_BASE_URL=http://localhost:11434

# 数据库配置
DATABASE_URL=postgresql+asyncpg://...
POSTGRES_DB=yz_gallery
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres

# S3 存储
S3_ENDPOINT=https://s3.amazonaws.com
S3_BUCKET=your-bucket
S3_ACCESS_KEY=...
S3_SECRET_KEY=...

# 安全配置
JWT_SECRET=...
ADMIN_PASSWORD=...

开发指南

添加新的配置选项

  1. config.ts 中添加新的 prompt
  2. 更新 docker-compose.yml 模板
  3. 更新 config.yaml 模板
  4. 添加相应的环境变量处理

添加新的服务

  1. templates/docker-compose.yml 中添加服务定义
  2. deploy.ts 中添加服务初始化逻辑
  3. service.ts 中添加服务管理命令

测试

# 单元测试
npm test

# 集成测试
npm run test:integration

# E2E 测试
npm run test:e2e

相关文档

技术栈

  • Node.js 18+
  • TypeScript 5+
  • Docker + Docker Compose

许可证

MIT

贡献

欢迎提交 Pull Request 和 Issue!