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

whyj-quant

v1.2.0

Published

WhyJ Quant — Interactive AI-powered quantitative analysis terminal

Readme

WhyJ Quant

交互式量化分析终端 — AI Agent 驱动,slash commands 操作,本地数据存储。

npm

WhyJ Quant terminal homepage

What's New in 1.2.0

  • Artifact 升级为华尔街终端风格的量化 Dashboard:K 线、NAV/收益曲线、风险收益指标、因子与数据覆盖度各司其职,并统一使用 WhyJ TUI 主题色。
  • Trajectory 按 Turn 完整复原用户输入、模型输入、Tool/Bash/Skill calls、Call ID、returns、thinking/compact 与最终 outputs;命令和关键结果会重点高亮。
  • /artifact 收敛为报告浏览与恢复入口;Auto Artifacts 只在 /config 开启,量化 turn 完成后自动生成并打开浏览器,失效报告会在展示前清理。
  • Overview 刷新链路可从失败和超时中恢复,开放式基金代码保留 .OF 语义;无有效行情时显示 --,不再伪造 0.00
  • Slash command、Settings 与外部 Skills 配置统一为简洁的一层语义,Codex/Claude/Agents/pi 用户级 skills 合并到单一 External Skills 开关。

完整变更见 CHANGELOG

Quick Start

全局安装:

npm i -g whyj-quant
whyj

本地开发:

bun install
bun run src/index.ts

首次启动后先打开配置面板:

Q > /config

Settings 面板按语义分成三组:

  • Agent Runtime:Model、Thinking、Provider Key、Provider URL。
  • Research Data:Market Data、Data Token、Active Portfolio。
  • Workspace Experience:External Skills、Overview Dock、Auto Artifacts。

面板只显示设置项与当前值;完整字段语义、默认值和迁移规则见 WhyJ Quant 配置参考

也可以直接写入默认配置文件 .ohquant/settings.json

{
  "version": 3,
  "env": {
    "WHYJ_QUANT_API_KEY": "sk-...",
    "WHYJ_QUANT_BASE_URL": "https://api.deepseek.com/anthropic",
    "WHYJ_QUANT_AUTH_TOKEN": "sk-...",
    "WHYJ_QUANT_CONTEXT_WINDOW": "1000000",
    "WHYJ_QUANT_COMPACT_TRIGGER_TOKENS": "800000",
    "WHYJ_QUANT_TUSHARE_TOKEN": "your_token",
    "WHYJ_QUANT_FINANCIAL_DATASETS_KEY": "your_key",
    "WHYJ_QUANT_LLMQUANT_API_KEY": "your_key"
  },
  "model": "sonnet",
  "thinkingLevel": "high",
  "showPortfolioPanel": true,
  "artifactGeneration": { "auto": false },
  "skillIntegrations": { "external": false }
}

模型上下文相关变量:

| 环境变量 | 作用 | 示例 | |----------|------|------| | WHYJ_QUANT_CONTEXT_WINDOW | 当前模型支持的上下文 token 总量;覆盖模型注册表/fallback 元数据,并用于底栏容量与占用百分比 | "1000000" | | WHYJ_QUANT_COMPACT_TRIGGER_TOKENS | 当前上下文估算达到该 token 数后,在下一次 prompt 发送前自动 compact | "800000" |

两个值都应写成正整数字符串。compact 阈值独立于模型窗口;若配置值大于 context window,运行时会将其限制为 context window。未配置 compact 阈值时,默认使用 contextWindow - 16384

模型选择校验:如果 env 中配置了 WHYJ_DEFAULT_SONNET_MODELWHYJ_DEFAULT_OPUS_MODELWHYJ_DEFAULT_HAIKU_MODEL,顶层 model 必须是对应别名(sonnet / opus / haiku)或其中一个映射值。其他值会在 settings 加载/保存时强制回退到第一个已配置别名,优先级为 sonnet、opus、haiku。未配置任何角色映射时,仍允许直接模型 ID。

External Skills 默认关闭,只加载项目量化 skills;开启后统一加载用户级 Codex、Claude、Agents 和 pi skills。

配置完成后直接提问:

Q > 分析平安银行的动量因子和风险指标

Commands

Shell-level commands:

| 命令 | 说明 | |------|------| | whyj | 启动交互式 REPL | | whyj --help | 查看 CLI 入口帮助 | | whyj --json doctor | 检查 runtime、配置目录、auth 来源 | | whyj -c "/help" | 执行单条 slash command 后退出 | | whyj --json -c "/portfolio" | 执行单条 slash command 并输出 JSON envelope |

Slash commands:

| 命令 | 一级描述 | 结果 | |---|---|---| | /compact | Compact current session context | 压缩当前 session,可附带关注点 | | /resume | Browse and restore saved sessions | 浏览并恢复历史 session | | /portfolio | Browse and select local portfolios | 浏览并选择本地 portfolio | | /config | Review and edit runtime settings | 查看或编辑 Settings | | /doctor | Configure and diagnose runtime | 首次配置或诊断 runtime readiness | | /skill | Discover, inspect, and run skills | 发现、查看和运行 skills | | /help | Browse commands and shortcuts | 查看命令与快捷键 | | /clear | Clear conversation and reset agent | 清空对话并重置 agent | | /artifact | Browse, restore, and open reports | 浏览报告,恢复来源 session 并在浏览器打开 | | /exit | Exit WhyJ Quant | 退出 WhyJ Quant |

/ 前缀直接输入自然语言 → AI Agent 分析。因子、回测、风险与策略评分由 agent 调用内置 Quant tools(Quant.FactorQuant.BacktestQuant.RiskQuant.Benchmark)完成;行情拉取与缓存由 agent 通过已配置的 Source 自动处理。

报告自动生成默认关闭,只能在 /config 面板通过 Auto Artifacts 开启。开启后,量化研究类 turn 完成并写入完整调用轨迹时自动生成 Dashboard + Trajectory,同时打开浏览器预览;/artifact 本身只负责浏览、恢复和打开已有报告。

完整的 TUI/非 TUI 行为、参数与兼容边界见 Slash Command 参考

Dev

bun install
bun run src/index.ts
bun run src/index.ts -- -c "/help"   # one-shot mode
bun run src/index.ts -- --json doctor

JSON Policy

--json 输出稳定 envelope:

{
  "ok": true,
  "command": "skill",
  "message": "human-readable summary",
  "data": {}
}

错误不会打印密钥:

{
  "ok": false,
  "command": "skill",
  "error": {
    "code": "command_failed",
    "message": "safe error message"
  }
}

doctor 报告凭证是否存在、来源类别和 redacted value fingerprint;不会打印完整 secret。whyj --json doctor/doctor 使用同一套报告逻辑。

Docs

Architecture & System

CLI & UX

TUI

Agent Tools & Skills

Data

  • Source Providers — official interfaces, source priority, agent/runtime injection
  • Source Module — provider adapters, fallback rules, module test layout

参考

  • 量化资源索引 — 数据源 provider、Python 库、API 参考(已合并至此)
  • Skill 系统 — 外部 skill 生态、AI 交易平台、学习资源(已合并至此)
  • Personal Notes — 投资知识库:notes.md(原则/法则/框架)+ funder.md(16 位大师索引)+ daily.md(每日笔记)。其中 notes.mdfunder.md/insight 管道消费,自动生成为 Agent 思考时展示的投资格言