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

@listenfeng/mw-wiki-cli

v1.2.1

Published

Multi-instance Confluence Wiki CLI - CRUD, search, and manage pages across multiple Wiki instances

Downloads

561

Readme

@listenfeng/mw-wiki-cli

多实例 Confluence Wiki CLI 工具,一个命令管理多个 Wiki。

安装

npm install -g @listenfeng/mw-wiki-cli

快速开始

1. 创建配置文件

mkdir -p ~/.mw-wiki-cli

创建 ~/.mw-wiki-cli/wiki-config.json

{
  "defaults": {
    "user": "[email protected]",
    "password": "${WIKI_PASSWORD}"
  },
  "instances": {
    "inst1": { "baseUrl": "http://wiki1.example.com", "desc": "Wiki 实例 1" },
    "inst2": { "baseUrl": "http://wiki2.example.com", "desc": "Wiki 实例 2" }
  }
}

2. 设置密码环境变量

# Windows
setx WIKI_PASSWORD "your_password"

# Linux/Mac
echo 'export WIKI_PASSWORD="your_password"' >> ~/.bashrc && source ~/.bashrc

3. 使用

wiki-cli list_instances
wiki-cli get_page inst1 123456
wiki-cli search inst1 "title~'接口'"
wiki-cli list_children inst1 123456
wiki-cli list_spaces inst2

命令列表

| 命令 | 参数 | 说明 | |------|------|------| | list_instances | 无 | 列出所有已配置 Wiki 实例 | | get_page | <instance> <pageId> | 获取页面内容 | | create_page | <instance> <spaceKey> <title> <body> [parentId] | 创建新页面(body 支持 HTML 字符串或文件路径) | | update_page | <instance> <pageId> <body> [title] | 更新页面内容(body 支持 HTML 字符串或文件路径,自动递增版本号) | | delete_page | <instance> <pageId> | 删除页面(移入回收站) | | search | <instance> <cql> [limit] | CQL 搜索文档 | | list_children | <instance> <pageId> | 列出子页面 | | list_spaces | <instance> | 列出空间列表 | | list_attachments | <instance> <pageId> | 获取页面附件列表 | | list_comments | <instance> <pageId> | 获取页面评论 | | add_comment | <instance> <pageId> <body> | 添加评论 | | get_page_tree | <instance> <pageId> | 获取页面树(所有后代页面) |

配置说明

  • defaults — 公共默认值,每个实例自动继承
  • instances — 实例列表,每个实例可覆盖 defaults 中的任意字段
  • ${WIKI_PASSWORD} — 环境变量占位符,运行时自动替换

实例级覆盖示例(独立账号):

"internal_wiki": {
  "baseUrl": "http://internal.wiki.com",
  "user": "special_user",
  "password": "${INTERNAL_WIKI_PWD}",
  "desc": "内部Wiki"
}

配置文件查找优先级

  1. 环境变量 WIKI_CLI_CONFIG 指定路径
  2. ~/.mw-wiki-cli/wiki-config.json(推荐)
  3. 当前工作目录 wiki-config.json

CQL 搜索语法

# 按标题搜索
wiki-cli search inst1 "title~'接口文档'"

# 按空间搜索
wiki-cli search inst1 "space=DEV AND type=page"

# 全文搜索
wiki-cli search inst1 "text~'用户认证'"

# 按创建者搜索
wiki-cli search inst1 "creator=admin AND space=DEV"

body 参数说明

create_pageupdate_page 的 body 参数支持两种方式:

# 方式1:直接传 HTML 字符串
wiki-cli create_page wk DEV "标题" "<p>Hello</p>"
wiki-cli update_page wk 123456 "<p>更新内容</p>"

# 方式2:传 HTML 文件路径(适合长内容、中文、复杂 HTML)
wiki-cli create_page wk DEV "标题" ./body.html 123456
wiki-cli update_page wk 123456 ./body.html

判断规则:如果参数值对应的文件存在,则读取文件内容作为 body;否则当作 HTML 字符串。

环境要求

  • Node.js >= 14