JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 142
  • Score
    100M100P100Q84985F
  • License MIT

Scientific literature search CLI powered by SciMaster. Ships both a `sci` command and a `sci-mcp` Model Context Protocol (MCP) server for Claude Code / Cursor / other MCP clients.

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (scimaster-cli) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    scimaster-cli

    命令行版的 SciMaster 文献检索工具。通过 PasaMaster 上游服务搜索学术论文,一行命令拿到论文清单 + BibTeX。

    环境要求

    • Node.js ≥ 20

    安装

    全局安装

    npm install -g scimaster-cli
    sci --help

    安装 / 升级到最新版

    npm install -g scimaster-cli@latest
    sci --version    # 验证当前版本

    直接通过 npx 运行(无需安装)

    # 强制走最新版(避免命中 npx 缓存的旧版本)
    npx -y scimaster-cli@latest search "CRISPR gene editing"

    bin 名为 sci,包名为 scimaster-clinpx scimaster-cli 会自动映射到 sci 入口。

    快速开始

    # 1. 配置 API Key(首次使用)
    sci init
    
    # 2. 选择 PasaMaster 搜索档位(影响是否扣费)
    sci model              # 交互式选择
    sci model low          # 或直接指定
    
    # 3. 搜索论文
    sci search "CRISPR gene editing 2024"                       # 用默认档位,结果写到当前目录
    sci search "machine learning protein" --limit 20            # --limit: 返回篇数(默认 10,范围 1-100)
    sci search "cancer immunotherapy" --mode mid --out ./papers # --mode: 本次临时覆盖档位(不改默认配置);--out: 输出目录(默认当前目录)
    
    # 查看免费额度和剩余次数
    sci usage

    选项详解见下方 sci search 一节;完整列表:--limit 返回篇数、--mode 临时档位、--out 输出目录、--prefix 文件名前缀。

    命令速查

    sci init

    交互式配置 API Key。已有 Key 会询问是否覆盖。

    也可以走非交互直接写入:

    sci --setApiKey <your-api-key>

    sci model [mode]

    切换 PasaMaster 搜索档位:

    档位 说明
    ultra_low 极速档:只走 SN 检索,不调用 LLM,不扣费
    low 基础档:触发 LLM 排序,按 token 扣费(默认推荐)
    mid 增强档:深度 LLM 评估,扣费更高
    high 极致档:最重模式,扣费最高
    sci model            # 交互式选择
    sci model mid        # 直接切到 mid
    sci model --show     # 查看当前档位

    sci search <query> [options]

    搜索论文,结果输出为卡片 + 写盘 .json / .bib

    sci search "<query>" \
      --limit 10 \             # 返回篇数,默认 10
      --mode <pasa-mode> \     # 临时覆盖档位,不写盘
      --out ./papers \         # 输出目录,默认 .
      --prefix search-results  # 输出文件名前缀,默认 search-results

    输出文件名会自动追加本地时间戳,形如 search-results-20260529-191700.json / .bib,多次搜索不会互相覆盖。

    sci search 走异步轮询:先短请求拿 task_id,然后每 3s 轮询服务端状态。运行中会同行刷新进度,例如:

    ℹ 正在检索: "machine learning protein" (最多 10 篇, 档位: mid)...
      ⏳ 已等待 9s(轮询 #3, task=tool-abc123456…)

    按一次 Ctrl+C 让 CLI 在下一次轮询前优雅停止;连按两次会硬退出(进程退出码 130)。

    整轮搜索最长等待 30 分钟,超时后会给出提示,可考虑切到更轻的档位重试。

    sci usage

    查看当前 OpenAPI 免费额度和按搜索档位估算的剩余调用次数。

    sci usage

    输出示例:

    ℹ 当前免费额度: 985.0000000000000000
    
    剩余次数(按当前余额估算):
      * low          65 次  基础档:触发 LLM 排序,按 token 扣费(默认推荐)
        mid          10 次  增强档:深度 LLM 评估,扣费更高

    实际扣费由服务端按 PasaMaster 返回的 LLM + SN 成本计算,剩余次数仅用于调用前估算。

    MCP 集成(Claude Code / Cursor)

    scimaster-cli 还内置了 Model Context Protocol (MCP) stdio serversci-mcp。装好包后,可直接让 Claude Code / Cursor 等 MCP 客户端通过 tool-call 调用论文检索,无需走 shell 解析输出。

    注册到 Claude Code

    claude mcp add --transport stdio scimaster -- npx -y scimaster-cli sci-mcp

    或者手工编辑 ~/.claude/settings.json

    {
      "mcpServers": {
        "scimaster": {
          "command": "npx",
          "args": ["-y", "scimaster-cli", "sci-mcp"]
        }
      }
    }

    如果已全局安装:

    {
      "mcpServers": {
        "scimaster": {
          "command": "sci-mcp"
        }
      }
    }

    注册到 Cursor

    .cursor/mcp.json(项目级)或 ~/.cursor/mcp.json(用户级):

    {
      "mcpServers": {
        "scimaster": {
          "command": "sci-mcp"
        }
      }
    }

    暴露的 Tool

    Tool 说明
    search_papers 输入 query / limit / mode,返回结构化论文清单(与 CLI sci search 共享同一份业务逻辑)

    返回结构(structured content):

    {
      "query": "CRISPR gene editing",
      "limit": 10,
      "mode": "low",
      "count": 10,
      "papers": [
        { "id": "arxiv:...", "title": "...", "authors": ["..."], "year": 2024,
          "abstract": "...", "doi": "...", "url": "...", "bib": "@article{...}" }
      ]
    }

    前置要求

    sci-mcp 读取 ~/.scimaster/config.json 拿 API Key,所以首次使用前必须先在终端跑过

    sci init
    sci model low        # 或其他档位

    之后 MCP server 拿着这份本地配置去调服务,跟你在终端跑 sci search 走同一份配置。

    配置文件

    ~/.scimaster/config.json   # 文件权限 0600,含 API Key

    字段:

    {
      "version": 1,
      "apiKey": "<your-api-key>",
      "apiBaseUrl": "https://scimaster.bohrium.com",
      "defaults": {
        "limit": 10,
        "mode": "low"
      }
    }

    错误处理

    场景 提示 退出码
    未配置 API Key 提示 sci init 1
    API Key 无效 (401/403) 提示重新 sci init 1
    单次 HTTP 请求超时 (30s) 提示检查网络 1
    整轮轮询超过 30min 提示切到更低档位重试 1
    Ctrl+C 用户中止 130
    服务端任务失败 透传服务端错误信息 1
    Rate Limit (429) 自动重试,最多 3 次
    非法档位 列出允许值 1

    License

    MIT