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

deep-radar

v1.1.4

Published

用于采集 X 帖子并上传轮次数据的 Node.js CLI。

Readme

deep-radar

deep-radar 是一个用于采集 X 帖子并上传轮次数据的 Node.js CLI。

使用方法

npm install
npm start -- --help

安装完成后,或在本地通过 npm link 链接后,可以直接运行:

deep-radar --help

默认用户目录是 ~/.deep-radar/

默认配置文件是 ~/.deep-radar/deep-radar.json

采集 X 帖子:

deep-radar collect --source x
deep-radar 采集 --source x

采集完成后可以选择直接用 ACP 调用本地安装的 codex / claude / opencode 做翻译:

deep-radar collect --source x --translate
deep-radar collect --source x --translate --agent codex
deep-radar collect --source x --upload
deep-radar collect --source x --translate --upload

使用 --output-format 控制采集结果写出哪些文件。支持的值是 both(默认)、jsonmarkdown

deep-radar collect --source x --output-format both
deep-radar collect --source x --output-format json
deep-radar collect --source x --output-format markdown

把已采集的 X 轮次上传到 deep-radar-server

deep-radar upload 2026-04-23-01.json
deep-radar upload /absolute/path/to/2026-04-23-01.json
deep-radar 上传 2026-04-23-01.json

upload 命令会读取轮次 JSON,并自动查找相关的 articles-data/*.json 和引用到的媒体文件,然后在一次请求里一并上传。

默认情况下,原始采集结果会写入 ~/.deep-radar/raw/x

每次采集都会生成一个带日期的 Markdown 文件,例如:

~/.deep-radar/raw/x/2026-04-21-01.md

在默认的 --output-format both 模式下,采集器还会在 Markdown 旁边额外写出同名 JSON,例如 ~/.deep-radar/raw/x/2026-04-21-01.json。这个 JSON 里的每条 tweet 都包含单独的 ID 字段、英文 interactionType 枚举值(postrepostquote),以及合并后的 author 对象;如果账号池里有元数据,也会一起写入。collectedBy 只会出现在转发和引用的条目中。对于 X Articles,轮次 JSON 只保留轻量的 article 元数据(titlepreviewTextdataPath 引用),详细的富文本文章内容会单独写到 articles-data/ 目录下,并与 articles/ 使用同样的基础文件名。普通 Tweets/Posts 会直接写入轮次 Markdown。X Articles 仍然会单独保存到 articles/ 目录,并在轮次 Markdown 中链接过去。媒体文件会下载到类似 media/2026-04-21/ 这样的按日期分组目录中,并通过相对路径引用。

当使用 --output-format json 时,只会写出轮次 JSON 和 articles-data/*.json。当使用 --output-format markdown 时,只会写出轮次 Markdown 和 articles/*.md。无论哪种模式,去重索引 index.json 都会更新。upload 命令仍然要求输入轮次 JSON 文件,所以如果后面还要上传,请使用 bothjson

使用 --output-dir 可以覆盖原始输出根目录:

deep-radar collect --source x --output-dir /tmp/deep-radar-raw

使用 --hours 可以覆盖采集时间范围,默认是 24 小时:

deep-radar collect --source x --hours 6

也可以对已经采集好的文件单独执行翻译,JSON 和 Markdown 都支持:

deep-radar translate 2026-04-23-01.json
deep-radar translate 2026-04-23-01.md
deep-radar translate --agent codex 2026-04-23-01.json 2026-04-24-01.json
deep-radar translate --upload 2026-04-23-01.json
deep-radar 翻译 2026-04-23-01.json

collecttranslate 现在都支持 --upload。加上这个参数后,命令会在采集或翻译结束后自动调用上传流程。

collect 同时使用 --translate --upload 时,如果当前轮次同时生成了 Markdown 和 JSON,会先翻译这两个文件,再上传翻译后生成的 *-cn.jsontranslate --upload 也会上传翻译后生成的 .json 文件,比如把 2026-04-26-03.json 翻译后上传 2026-04-26-03-cn.json;如果这次翻译里没有任何可上传的翻译后 .json 文件,会直接报错。

也可以直接新增一个 acp 命令,把提示词交给默认 agent 或显式指定的 agent:

deep-radar acp 帮我总结今天采集到的重点
deep-radar acp --agent claude 帮我把这批内容翻译成中文

如果没有传 --agent,会优先读取 ~/.deep-radar/deep-radar.json 里的 translateAgent,没有配置时默认使用 codex

翻译实现优先复用本地依赖,不依赖 npx 动态安装。仓库里使用的 ACP 相关依赖包括:

npm install
npm install acpx@latest

HTTP 读取服务已经拆分到独立的 deep-radar-server 项目中。

可以用那个项目来读取和服务 ~/.deep-radar/raw/x 或任意自定义采集目录下的数据。

~/.deep-radar/deep-radar.json 示例:

{
  "apikey": "drsk_your_api_key",
  "serverUrl": "http://127.0.0.1:3000",
  "translateAgent": "codex",
  "storage": {
    "rawDir": "~/.deep-radar/raw"
  },
  "collect": {
    "timeRangeHours": 24
  },
  "x": {
    "authToken": "your_auth_token",
    "ct0": "your_ct0"
  }
}

开发

npm test