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

@hocgin/wenyan-cli

v3.0.4

Published

A CLI tool for Wenyan markdown rendering & publishing

Readme

文颜 CLI

npm License NPM Downloads Docker Pulls Stars

简介

文颜(Wenyan) 是一款多平台 Markdown 排版与发布工具,支持将 Markdown 一键转换并发布至:

  • 微信公众号
  • 知乎
  • 今日头条
  • 以及其它内容平台(持续扩展中)

文颜的目标是:让写作者专注内容,而不是排版和平台适配

文颜的不同版本

文颜目前提供多种形态,覆盖不同使用场景:

特性

  • 一键发布 Markdown 到微信公众号草稿箱
  • 自动上传本地图片与封面
  • 支持远程 Server 发布(绕过 IP 白名单限制)
  • 内置多套精美排版主题
  • 支持自定义主题
  • 可作为 CI/CD 自动发文工具
  • 可集成 AI Agent 自动发布

快速开始

# 安装
npm install -g @wenyan-md/cli
# 发布文章到公众号
wenyan publish -f article.md

命令概览

wenyan <command> [options]

| 命令 | 说明 | | ------- | --------- | | publish | 发布文章 | | render | 渲染 HTML | | theme | 管理主题 | | serve | 启动 Server |

概念

内容输入

内容输入是指如何把 Markdown 文章分发给 wenyan-cli,支持以下四种方式:

| 方式 | 示例 | 说明 | | ------- | --------- |--------- | | 本地路径(推荐) | wenyan publish -f article.md |cli直接读取磁盘上的文章 | | URL | wenyan publish -f http://test.md |cli直接读取网络上的文章 | | 参数 | wenyan publish "# 文章" |适用于快速发布短内容 | | 管道 | cat article.md \| wenyan publish |适用于 CI/CD,脚本批量发布 |

环境变量配置

[!IMPORTANT]

请确保运行文颜的机器已配置如下环境变量,否则上传接口将调用失败。

  • WECHAT_APP_ID
  • WECHAT_APP_SECRET

微信公众号 IP 白名单

[!IMPORTANT]

请确保运行文颜的机器 IP 已加入微信公众号后台的 IP 白名单,否则上传接口将调用失败。

配置说明文档:https://yuzhi.tech/docs/wenyan/upload

文章格式

为了正确上传文章,每篇 Markdown 顶部需要包含一段 frontmatter

---
title: 在本地跑一个大语言模型(2) - 给模型提供外部知识库
cover: /Users/xxx/image.jpg
author: xxx
source_url: http://
---

字段说明:

  • title 文章标题(必填)
  • cover 文章封面
    • 本地路径或网络图片
    • 如果正文中已有图片,可省略
  • author 文章作者
  • source_url 原文地址

示例文章

文内图片和文章封面

把文章发布到公众号之前,文颜会按照微信要求自动处理文章内的所有图片,将其上传到公众号素材库。目前文颜对于以下两种图片都能很好的支持:

  • 本地硬盘绝对路径(如:/Users/xxx/image.jpg
  • 网络路径(如:https://example.com/image.jpg

仅当“内容输入”方式为“本地路径”时,以下路径也能完美支持:

  • 当前文章的相对路径(如:./assets/image.png

Server 模式

相较于纯本地运行的本地模式(Local Mode)wenyan-cli还提供了 远程客户端模式(Client–Server Mode)。两种模式运行效果完全一致,你可以根据运行环境和网络条件选择最合适的方式。

在本地模式下,CLI 直接调用微信公众号 API 完成图片上传和草稿发布。

flowchart LR
    CLI[Wenyan CLI] --> Wechat[公众号 API]

在远程客户端模式下,CLI 作为客户端,将发布请求发送到部署在云服务器上的 Wenyan Server,由 Server 完成微信公众号 API 调用。

flowchart LR
    CLI[Wenyan CLI] --> Server[Wenyan Server] --> Wechat[公众号 API]

适用于:

  • 无本地固定 IP,需频繁添加IP 白名单的用户
  • 需团队协作的用户
  • 支持 CI/CD 自动发布
  • 支持 AI Agent 自动发布

Server 模式部署

客户端调用 Server 发布:

wenyan publish -f article.md --server https://api.example.com --api-key your-api-key

赞助

如果你觉得文颜对你有帮助,可以给我家猫咪买点罐头 ❤️

https://yuzhi.tech/sponsor

License

Apache License Version 2.0