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

deepevidence

v0.1.0

Published

DeepEvidence 官方命令行工具 — 医学智能问答交互式 CLI(OpenAI 兼容、流式对话、类 Claude Code 体验)

Downloads

25

Readme

deepevidence

DeepEvidence 官方命令行工具。基于企业开放 API,提供问答、会话、模型、项目附件、问答记录等命令。

安装

npm install -g deepevidence

安装后可用 deepevidence 命令。

老包名 @deepevid/cli 同步维护,兼容已安装老版的用户;新项目推荐使用 deepevidence

3 步上手

# 1. 登录(保存 API Key 到 ~/.deepevidence/config.json,权限 600)
deepevidence login

# 2. 验证可用性
deepevidence whoami

# 3. 问答
deepevidence ask "EGFR 突变晚期 NSCLC 一线治疗方案"

配置优先级

所有需要鉴权/base URL 的命令,按下列顺序选取:

  1. 命令行 flag:--api-key <key> / --base-url <url>
  2. 环境变量:DEEPEVID_API_KEY / DEEPEVID_BASE_URL
  3. ~/.deepevidence/config.json(由 deepevidence login 生成)
  4. 内置默认:https://deepevid.medsci.cn/api/v1(仅对 base URL 生效)

命令参考

鉴权

| 命令 | 说明 | | --- | --- | | deepevidence login [--api-key <key>] [--base-url <url>] [--force] | 写入本地 config | | deepevidence logout | 清除本地 config | | deepevidence whoami | 显示当前配置来源并验证可用性 |

问答 ask

deepevidence ask "<query>" [options]

# 流式(默认)
deepevidence ask "阿司匹林作用"

# 非流式,拿完整 JSON
deepevidence ask "阿司匹林作用" --no-stream -f json

# 续聊
deepevidence ask "再简述一遍" -c conv_123456

# 指定外部用户(对应 OpenAI user 字段)
deepevidence ask "..." -u crm_user_10001

# 带 system 提示
deepevidence ask "..." --system "你是一位医学信息助手"

# 从 stdin 读
echo "什么是高血压?" | deepevidence ask -

# 从文件读
deepevidence ask --file question.md

常用选项:

| 选项 | 说明 | | --- | --- | | -c, --conversation <id> | 续聊:传入已有 conversation_id | | -u, --user <id> | 外部用户 ID(user 字段) | | -m, --model <id> | 指定模型(默认走服务端默认) | | --project <id> | 绑定 project,缩小检索 | | --entity <id...> | 限定 entity_encryption_ids,可重复 | | --chat-mode <mode> | auto / fast / expert | | --system <text> | 插入 system 消息 | | --locale <locale> | zh-CN / en | | --no-stream | 非流式 | | --no-store | 不持久化会话 | | --file <path> | 从文件读 query | | --timeout <ms> | 请求超时,默认 180000 |

模型 models

deepevidence models               # 列出可用模型
deepevidence models show <id>     # 单个模型详情

会话 conv

deepevidence conv ls [--limit 20] [--offset 0] [-q 关键字] [-u 外部用户]
deepevidence conv show <id> [-u 外部用户]
deepevidence conv messages <id> [-u 外部用户]
deepevidence conv rm <id> [-u 外部用户] [-y]

项目附件 project

deepevidence project attachments <project_id> [--page 1] [--page-size 20]

问答记录 qa

deepevidence qa records \
  [--page 1] [--page-size 20] \
  [-c <conversation_id>] [-q <关键字>] \
  [--date-from 2024-01-01] [--date-to 2024-12-31] \
  [-u <外部用户>]

输出格式

所有查询类命令支持 -f, --format

| 值 | 用途 | | --- | --- | | table(默认) | 终端友好表格 | | json | 机器友好、管道给 jq | | yaml | 机器友好 + 易读 | | md | 贴进文档 |

例:

deepevidence conv ls -f json | jq '.data[].id'
deepevidence models -f md

退出码

遵循 Unix sysexits.h,便于 shell / CI 分支处理:

| 值 | 含义 | | --- | --- | | 0 | 成功 | | 1 | 通用错误 | | 2 | 参数错误(由 commander 抛出) | | 66 | 资源不存在(404) | | 69 | 服务不可用 / 网络故障 / 5xx | | 75 | 配额限制或临时故障(429) | | 77 | 无权限(401/403) | | 78 | 本地配置缺失(如未登录) | | 130 | Ctrl+C 中断 |

例:

deepevidence whoami || (( $? == 77 )) && deepevidence login

故障排查

  • -v / --verbose 打印 request / response 摘要到 stderr(不会泄漏 API Key)
  • deepevidence whoami 会告诉你当前 Key/base URL 来自 flag/env/file/default 中的哪一个
  • 集成测试建议:
    DEEPEVID_API_KEY=sk-xxx deepevidence models -f json > /tmp/models.json
  • Windows 下推荐使用 PowerShell 而非 CMD,颜色与宽度更稳定

本地开发

pnpm --filter deepevidence dev      # watch 编译
pnpm --filter deepevidence build    # 打包到 dist/
pnpm --filter deepevidence test     # 跑 vitest
node packages/cli/dist/bin.js ask "…" # 直接运行 dist

许可

内部项目,详见仓库根 LICENSE