@companion-ai/alpha-hub

中文文档
0.1.7发布于 2026/10/13MITTypeScriptES Module构建来源已验证近 30 天下载 8197

Unofficial alphaXiv-powered CLI and library for research agents

原始使用文档
文档目录5 节
  1. Install
  2. Quick Start
  3. Package Exports
  4. 0.1.6
  5. 0.1.5

Alpha Hub

Unofficial alphaXiv-powered CLI and library for research agents.

Install

Requires Node.js 22.22.0 or newer.

npm install -g @companion-ai/alpha-hub

If you installed the interim @advaitpaliwal/alpha-hub package, migrate once:

npm uninstall -g @advaitpaliwal/alpha-hub
npm install -g @companion-ai/alpha-hub

The commands remain alpha and alpha-mcp. Library consumers should use the @companion-ai/alpha-hub dependency and import scope; export paths such as /lib and /lib/auth are unchanged.

Quick Start

alpha login
alpha status
alpha search "attention mechanism"
alpha get 1706.03762
alpha ask 1706.03762 "What datasets were used for evaluation?"
alpha code https://github.com/openai/gpt-2 /

alpha login opens a browser and waits for the redirect to http://127.0.0.1:9876/callback. On a remote server, over SSH, or in a container, open the printed URL in any browser. After you sign in, paste the address the browser ends on (http://127.0.0.1:9876/callback?code=...) into the waiting terminal.

Package Exports

This package exposes:

  • alpha CLI
  • alpha-mcp CLI (stdio MCP server)
  • library helpers from @companion-ai/alpha-hub/lib (searchPapers, getPaper, askPaper, annotations, auth), plus /lib/auth, /lib/alphaxiv, /lib/papers, and /lib/annotations

See the repository README for the full export list.

0.1.6

  • alpha login ignores a callback or pasted URL whose OAuth state is not this login's (it answers 400 and keeps waiting) instead of aborting. An ?error= with the matching state still ends the login.
  • Token refreshes are shared within a process, so parallel requests no longer race refresh-token rotation. A refresh no longer overwrites auth.json if you logged out, or another process refreshed or logged in, while it was running.
  • An expired or revoked access token no longer fails alphaXiv calls. Previously, about an hour after login, long-running processes that kept one connection failed with Streamable HTTP error: Error POSTing to endpoint: {"error":{"message":"Invalid Authorization"}}, which was not recognized as an auth error. Now any call that gets this error refreshes the token once (shared with parallel calls), reconnects and retries once. If that fails, it reports alphaXiv session expired. Run \alpha login` to sign in again.`
  • alpha status now checks the login with alphaXiv (oauth2/userinfo, trying one token refresh if the token is rejected). It exits 1 when not logged in, when the session has expired, or when alphaXiv cannot be reached. The library's isLoggedIn() still only checks for stored tokens. The new verifyLogin() in /lib/auth does the server check.
  • auth.json is replaced atomically: a new owner-only file is written next to it and renamed over it.

0.1.5

  • alpha login accepts the pasted redirect URL when the browser cannot reach the local callback, for example on headless servers, SSH sessions, containers, and WSL. The OAuth state check still applies. On Linux without a display, alpha login no longer tries to open a browser. On WSL it tries wslview and then the Windows default browser. The login wait is now 5 minutes.
  • ~/.ahub/auth.json is written with owner-only permissions.
  • alpha get and alpha ask accept alphaXiv-hosted paper IDs from search results, such as 2607.some-paper-title. Search results give these papers arxivUrl: null.
  • If alphaXiv removes the discover_papers MCP tool, search falls back to alphaXiv's REST search.
  • alpha search --mode both and --mode all no longer hang after printing results, and no longer send duplicate requests. Library callers that ran searches in parallel also share one connection now.

版本与发布记录

@companion-ai/alpha-hub 共发布 8 个版本,首次发布于 2026/03/21;过去 12 个月发布了 8 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.1.7latest2026/10/1328 天前
0.1.62026/09/231 个月前
0.1.52026/09/231 个月前
0.1.42026/09/231 个月前
0.1.32026/03/267 个月前
0.1.22026/03/217 个月前

关于 @companion-ai/alpha-hub 的常见问题

@companion-ai/alpha-hub 是什么?

Unofficial alphaXiv-powered CLI and library for research agents

如何安装 @companion-ai/alpha-hub?

在项目目录运行 npm install @companion-ai/alpha-hub,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 alpha、alpha-mcp,可以用 npx alpha 直接运行。

@companion-ai/alpha-hub 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@companion-ai/alpha-hub 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@companion-ai/alpha-hub 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22.22.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@companion-ai/alpha-hub 可以商用吗?

@companion-ai/alpha-hub 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@companion-ai/alpha-hub 的下载量有多少?

根据 npm 官方下载统计,@companion-ai/alpha-hub 在 2026/10/11 – 2026/11/09 这 30 天内被下载 8,197 次,日均约 273 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@companion-ai/alpha-hub 还在维护吗?

最新版本 0.1.7 发布于 2026/10/13(28 天前);至今共发布 8 个版本,其中过去 12 个月发布了 8 个;首次发布于 2026/03/21。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。