@dzhng/jevgrep

中文文档
0.8.5发布于 2026/10/18MITES Module构建来源已验证近 30 天下载 2.7万

Content-aware source retrieval for coding agents

原始使用文档

Jevgrep (jg)

Ask a repository question and get relevant file locations plus verbatim source excerpts. Jevgrep helps a coding agent begin unfamiliar multi-file work with useful context; the agent still owns implementation and verification.

Requires Node.js 22 or newer on macOS, Linux, or Windows. Install and authenticate:

npm install --global @dzhng/jevgrep
jg auth
jg doctor
jg "How are telemetry events recorded and sent?" ./my-project

auth asks you to choose a provider or a custom endpoint, then saves its key in an owner-only config file. Run jg --help for the supported provider names. Searches use that provider until you run auth again. doctor verifies access with synthetic input and names the selected provider or endpoint host. When the provider rejects the request, doctor reports the HTTP status and its error message, when available. A working key can still lack model access or paid credits; follow the provider’s explanation before replacing the key. Saved keys and raw response bodies are excluded from diagnostic output. If a provider echoes a key with inserted separators, its message is omitted. For unattended setup, pipe the key from your secret manager to:

jg auth --provider opencode --stdin

Both options are required for piped setup. To send traffic through your own TypeSafe-compatible gateway, choose “Custom endpoint” in auth and enter its base URL and model ID, or pass both explicitly:

jg auth --provider custom --base-url https://gateway.example.com/typesafe/v1 --model gateway/jev-2 --stdin

Custom endpoints must use https://; http://localhost and http://127.0.0.1 are accepted for a local proxy. Auth and doctor name only the endpoint host, never the key. The saved endpoint and model are part of the cache identity, so custom answers stay separate from the preset providers’ answers and from other endpoints.

A custom base URL must contain only the scheme, host, and optional path: no embedded credentials, query string, or fragment. Jevgrep appends /systemone to that base URL and sends the saved key as a Bearer token.

For gateway implementers, Jevgrep's boolean questions arrive as noul questions without criteria. A minimal request and response are:

{
  "model": "your-model",
  "state": "source context",
  "questions": { "q": { "type": "noul", "instructions": "Relevant?" } }
}
{ "answers": { "q": { "type": "noul", "noul": 0.9 } } }

Return an answer for every question ID, with a finite noul value between 0 and 1. These answers need neither probabilities nor confidence. A server that demands criteria.true and returns HTTP 422 is incompatible with these requests. Run jg doctor against a custom gateway before searching a repository.

Credentials are saved under $XDG_CONFIG_HOME/jevgrep/credentials.json, or ~/.config/jevgrep/credentials.json. On Windows, config defaults to %APPDATA%\jevgrep and cache to %LOCALAPPDATA%\jevgrep. XDG_CONFIG_HOME and XDG_CACHE_HOME override their respective locations independently when set to absolute paths; relative values are ignored and platform defaults are used. Windows ignores POSIX file modes, so these files rely on the user profile's access controls. Existing saved records without a provider still mean Vercel, without a migration. API-key, endpoint, and model environment overrides are ignored; users who only configured an environment key must run auth. There is no automatic fallback or per-search provider override. Searches send eligible source to the saved service. Run jg files ./project first to see how many files and bytes that root makes eligible and how many paths each filter skips; it needs no key and sends nothing. Add --list to see the eligible relative paths, quoted and sorted. To remove a path you did not intend to send, repeat the preview with --exclude and use the same exclusions for the search. An incomplete preview lists only paths seen before the limit or interruption; search-time content checks can exclude more. Evaluation answers are cached locally; jg --help describes cache controls.

For a slow or unstable connection, try jg "question" ./project --concurrency 4 (or 1 to serialize requests). The default limit is 32 across all search stages, including retries. Waiting for a slot does not consume the request timeout, and queued source is revalidated before upload. This controls transport pressure, not relevance thresholds or cache identity.

An incomplete search reports one sanitized, unrecovered provider error alongside its issue counts, distinguishing HTTP failures, timeouts, and connection failures. A batch failure that recovers through splitting is not used as the diagnostic. The reported concurrency limit helps tune the next run. Only validated evaluation answers are cached: provider errors and the final search result are never stored. Rerunning after the connection recovers retries failed work while reusing valid answers; --no-cache additionally bypasses those valid cached answers.

Bounded resource limits are a backstop for large or changing trees. They remain visible as discovery incomplete and Issue: "resource_limit", but a result containing only those issues exits successfully so shells and coding agents do not mistake useful partial output for a failed command. Provider and other operational issues retain the incomplete exit status.

The summary comes first, followed by file and declaration locations and selected source. Locations are reading leads, not a checklist. Omitted excerpts are marked; --max-source-bytes 0 includes all selected source. An incomplete result can still be useful. Read what it supplies, then fill specific gaps with ordinary tools. Application output goes to stdout; jg does not create a report file.

Agent skill

Installing the CLI is only half of agent setup: install the skill too.

Install the canonical skill into the project where your coding agent works:

jg skill

The installer detects your coding agents (Claude Code, Codex, OpenCode and others) and asks where to install. jg skill also accepts --agent NAME (repeatable), --global, and --yes; these options come from the skills CLI, which it delegates to. jg skill installs the jevgrep skill from this repository's main branch with npm lifecycle scripts disabled and requires Node 22.20+ and npm/npx with network access for the pinned installer. Rerun jg skill to refresh the skill without waiting for a new npm release. Installer transitive dependencies remain an external trust boundary.

Installing the skill does not configure the provider key.

Search does not install skills or edit agent configuration. Only an explicit skill installation command invokes the installer. The skill directs the agent to read returned excerpts before further discovery, skip redundant searches when the needed context is already known, and handle incomplete results honestly.

There is no built-in upgrade command. Use npm install --global @dzhng/jevgrep@latest to upgrade the CLI, then rerun jg skill to update the agent's copy too. The installer records the GitHub source and skill path in skills-lock.json. Rerun jg skill on another machine or after changing your Node installation.

See the repository for architecture, official benchmark evidence and development. Jevgrep is MIT licensed.

版本与发布记录

@dzhng/jevgrep 共发布 20 个版本,首次发布于 2026/09/27;过去 12 个月发布了 20 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.8.5latest2026/10/1826 天前
0.8.42026/10/1826 天前
0.8.32026/10/1826 天前
0.8.22026/10/1826 天前
0.8.12026/10/1826 天前
0.8.02026/10/021 个月前

关于 @dzhng/jevgrep 的常见问题

@dzhng/jevgrep 是什么?

Content-aware source retrieval for coding agents

如何安装 @dzhng/jevgrep?

在项目目录运行 npm install @dzhng/jevgrep,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 jg,可以用 npx jg 直接运行。

@dzhng/jevgrep 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/dzhng__jevgrep 是否存在。

@dzhng/jevgrep 支持 ESM 还是 CommonJS?

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

@dzhng/jevgrep 需要什么版本的 Node.js?

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

@dzhng/jevgrep 可以商用吗?

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

@dzhng/jevgrep 的下载量有多少?

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

@dzhng/jevgrep 还在维护吗?

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