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

gudong-xiexia-cli

v0.1.0

Published

CLI tool that lets AI agents read and write your Xiexia (写下) diary from S3/WebDAV. No MCP needed, just a command.

Readme

gudong-xiexia-cli

CLI tool that lets AI agents read and write your Xiexia (写下) diary from S3/WebDAV. No MCP, no server, just a command.

📚 本 CLI 的 src/entry/types.ts 是写下日记 JSON 格式的 TS 镜像,协议权威源在 ../RiJian/shared/src/commonMain/kotlin/name/gudong/xiexia/sync/EntryJson.kt

Why

写下(Xiexia) 是一款本地优先、一天一页的私人日记 App,通过 S3 或 WebDAV 同步。这个 CLI 让 AI coding agent(ZCode / Codex / Claude / Cursor 等)用普通 shell 命令直接读写你的日记——无 MCP 协议、无服务端、App 零改动(agent 写入云端,App 下次同步自然拉到)。

架构与 gudong-inbox-cli 同构(Skill + CLI + 云端直连),按日记语义定制。

Quick Start

# 安装
npm install -g gudong-xiexia-cli

# 配置(WebDAV 示例,与 App「同步设置」用同一账号)
gudong-xiexia config init \
  --cloud-type webdav \
  --url https://dav.jianguoyun.com/dav \
  --username [email protected] \
  --password app-password \
  --root-dir Xiexia \
  --timezone Asia/Shanghai

# 验证
gudong-xiexia config test

# 用
gudong-xiexia today
gudong-xiexia search --query "加班"
gudong-xiexia append --content "今天去了海边,风很大。"

Commands

| Command | Description | |---------|-------------| | today | Today's page (all entries, chronological) | | day --date 2026-09-04 | One day's page | | list | Days with entries (summaries, --since/--until/--limit) | | read --id <id> | Full text of one entry | | search --query "kw" | Full-text search | | stats [--month 2026-09] | Total / streaks / monthly counts | | append --content "..." [--date] | Append an entry (default today) | | update --id <id> --text "..." | Rewrite one entry's text | | delete --id <id> --confirm | Soft-delete (tombstone, App trash semantics) | | config init/show/test | Credential management (secrets masked in show) |

所有命令成功输出 JSON 到 stdout,失败 stderr + exit 1,写入冲突 exit 2。

同步协议(与 App 的契约)

  • 云端布局:{rootDir}/entries/{id}.json(默认 rootDir Xiexia),一条日记一个 JSON
  • 写入纪律:改写前重读远端做冲突检测;updatedAt = nowrevision = 远端 revision + 1
  • 删除 = 写 removed: true 墓碑(正文保留,App 回收站可恢复),附件文件不动
  • 新条目 id:entry-<毫秒时间戳>-<uuid前8位>(对齐 App 的 DiaryIds)
  • calendarDate(yyyy-MM-dd)= occurredAttimezone 下的折算,默认 Asia/Shanghai

Config

~/.gudong-xiexia/config.json(chmod 600,config init 生成)。环境变量回退:CLOUD_TYPES3_ENDPOINTWEBDAV_URL 等。磁盘增量缓存在 ~/.gudong-xiexia/cache.json(按 etag/lastModified 增量刷新,删掉即全量重建)。

Skill for AI Agents

skills/gudong-xiexia/SKILL.md 随包分发,复制到 agent 的 skill 目录(如 ~/.zcode/skills/~/.codex/skills/)即生效。Skill 内含读写安全铁律:读取免确认,写入必须两阶段确认;追加优先不改写;日记隐私不外传。

How it works

AI agent (ZCode / Codex / Claude / Cursor)
        ↓ exec_command
  gudong-xiexia (standalone CLI process)
        ↓ S3 API / WebDAV PROPFIND-GET-PUT
  your cloud storage  ←→  写下 App(Android / iOS / macOS,同一协议)

Development

npm test        # vitest(协议解析 / 冲突 / 软删 / 缓存)
npm run build
npm run dev     # tsx 直跑

WebDAV 往返可配合 RiJian 仓库的 scripts/webdav-test-server.py 本地服务器实测。

License

MIT