{"_id":"@akuzmenko/rgk","_rev":"6-6bfc665d816f68edc56cbbead2984a5a","name":"@akuzmenko/rgk","dist-tags":{"latest":"0.2.2"},"versions":{"0.1.0":{"name":"@akuzmenko/rgk","version":"0.1.0","keywords":["codex","llm","rg","ripgrep","search"],"author":{"name":"Anton Kuzmenko","email":"hotk@hey.com"},"license":"MIT","_id":"@akuzmenko/rgk@0.1.0","maintainers":[{"name":"akuzmenko","email":"hotk@hey.com"}],"homepage":"https://github.com/default-anton/rgk#readme","bugs":{"url":"https://github.com/default-anton/rgk/issues"},"bin":{"rgk":"bin/rgk.js"},"dist":{"shasum":"c9502f0726ac44590837117360f5c18537d843aa","tarball":"https://registry.npmjs.org/@akuzmenko/rgk/-/rgk-0.1.0.tgz","fileCount":32,"integrity":"sha512-gcr2wZByBs9Y/ckabj/SJD2171LO6G0GNzGgn6//bjPUdhMGrNqo267tZYhetlH1QXOdnzy51nqHw0Z0C1SuvQ==","signatures":[{"sig":"MEQCIHwqn+3tDi05JDAsgeUkcWHKgkZfQlGp5N5ll9OVtfQ3AiB9e01qMqSUUTjyxN+fZh5E0WDHD1uPgonrsx1HUoGY3g==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":76850},"type":"module","engines":{"node":">=24.0.0"},"gitHead":"b24927bd514b2f3a9b10bac01f2da246d6a728c7","scripts":{"lint":"oxlint . --deny-warnings","test":"pnpm run build && node --test test/*.test.mjs","build":"tsc","check":"tsc --noEmit","clean":"rm -rf dist","format":"oxfmt .","verify":"pnpm run format:check && pnpm run lint && pnpm run check && pnpm run test","prepack":"pnpm run build","pack:check":"pnpm run clean && npm pack --dry-run","format:check":"oxfmt --check .","prepublishOnly":"pnpm run verify"},"_npmUser":{"name":"akuzmenko","email":"hotk@hey.com"},"repository":{"url":"git+https://github.com/default-anton/rgk.git","type":"git"},"_npmVersion":"11.13.0","description":"ripgrep with an LLM-powered --keep post-filter","directories":{},"_nodeVersion":"24.14.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.33.0","devDependencies":{"oxfmt":"^0.48.0","oxlint":"^1.63.0","typescript":"^6.0.3","@types/node":"^25.6.2"},"_npmOperationalInternal":{"tmp":"tmp/rgk_0.1.0_1778301610738_0.5645529052686968","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@akuzmenko/rgk","version":"0.1.1","keywords":["codex","llm","rg","ripgrep","search"],"author":{"name":"Anton Kuzmenko","email":"hotk@hey.com"},"license":"MIT","_id":"@akuzmenko/rgk@0.1.1","maintainers":[{"name":"akuzmenko","email":"hotk@hey.com"}],"homepage":"https://github.com/default-anton/rgk#readme","bugs":{"url":"https://github.com/default-anton/rgk/issues"},"bin":{"rgk":"bin/rgk.js"},"dist":{"shasum":"e495b5ea5a69f58c408244e196e2a5ec4fe849a6","tarball":"https://registry.npmjs.org/@akuzmenko/rgk/-/rgk-0.1.1.tgz","fileCount":32,"integrity":"sha512-NyCmVmrsKnelnd879NUppoB2vOGabFkliwgKh6YHKpII71+tFxJCMJqUY+t9DTsuklMpsihsG866N7KVptJxLw==","signatures":[{"sig":"MEUCIQD+QShL0H2ufXaqi++yaxBuRdb2Eb9l5eWNon0YZ3eXywIgWi6vTe1sPV30OYVFfwCZh+ncdkCw2A6gXvK1MVOJp+E=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":76756},"type":"module","engines":{"node":">=24.0.0"},"gitHead":"e27889210fdf932ca666c615c3b8bd0d740e08eb","scripts":{"lint":"oxlint . --deny-warnings","test":"pnpm run build && node --test test/*.test.mjs","build":"tsc","check":"tsc --noEmit","clean":"rm -rf dist","format":"oxfmt .","verify":"pnpm run format:check && pnpm run lint && pnpm run check && pnpm run test","prepack":"pnpm run build","pack:check":"pnpm run clean && npm pack --dry-run","format:check":"oxfmt --check .","prepublishOnly":"pnpm run verify"},"_npmUser":{"name":"akuzmenko","email":"hotk@hey.com"},"repository":{"url":"git+https://github.com/default-anton/rgk.git","type":"git"},"_npmVersion":"11.13.0","description":"ripgrep with an LLM-powered --keep post-filter","directories":{},"_nodeVersion":"24.14.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.33.0","devDependencies":{"oxfmt":"^0.48.0","oxlint":"^1.63.0","typescript":"^6.0.3","@types/node":"^25.6.2"},"_npmOperationalInternal":{"tmp":"tmp/rgk_0.1.1_1778303812350_0.9114629821461688","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@akuzmenko/rgk","version":"0.1.2","keywords":["codex","llm","pi-package","rg","ripgrep","search"],"author":{"name":"Anton Kuzmenko","email":"hotk@hey.com"},"license":"MIT","_id":"@akuzmenko/rgk@0.1.2","maintainers":[{"name":"akuzmenko","email":"hotk@hey.com"}],"homepage":"https://github.com/default-anton/rgk#readme","bugs":{"url":"https://github.com/default-anton/rgk/issues"},"pi":{"extensions":["./extensions"]},"bin":{"rgk":"bin/rgk.js"},"dist":{"shasum":"ddd8f56c683812d7a52c5ee6b2445f51ba53c44f","tarball":"https://registry.npmjs.org/@akuzmenko/rgk/-/rgk-0.1.2.tgz","fileCount":33,"integrity":"sha512-r2b3wAmIYLQpgDCP1qmDqWNPft6KyLgYIgluyN5OhdTPVjQOSRjJKeSP7jcF8zbuqWTe2MeoqNFYXTEmagS/Cg==","signatures":[{"sig":"MEYCIQCuCOwmfLX5YbH6aSICMaxYoXvAaI9Gug1+A4SxHuS9IgIhAKW4gyi2auw+UapFWvf7JmDFBvHel0lohl0JwZeEivYM","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":77638},"type":"module","engines":{"node":">=24.0.0"},"gitHead":"aa69ef2abef2e49351412086d6cdbcfdc77b1d17","scripts":{"lint":"oxlint . --deny-warnings","test":"pnpm run build && node --test test/*.test.mjs","build":"tsc","check":"tsc --noEmit","clean":"rm -rf dist","format":"oxfmt .","verify":"pnpm run format:check && pnpm run lint && pnpm run check && pnpm run test","prepack":"pnpm run build","pack:check":"pnpm run clean && npm pack --dry-run","format:check":"oxfmt --check .","prepublishOnly":"pnpm run verify"},"_npmUser":{"name":"akuzmenko","email":"hotk@hey.com"},"repository":{"url":"git+https://github.com/default-anton/rgk.git","type":"git"},"_npmVersion":"11.13.0","description":"ripgrep with an LLM-powered --keep post-filter","directories":{},"_nodeVersion":"24.14.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.33.0","devDependencies":{"oxfmt":"^0.48.0","oxlint":"^1.63.0","typescript":"^6.0.3","@types/node":"^25.6.2"},"_npmOperationalInternal":{"tmp":"tmp/rgk_0.1.2_1778393119983_0.3699538449562527","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@akuzmenko/rgk","version":"0.2.0","keywords":["codex","llm","pi-package","rg","ripgrep","search"],"author":{"name":"Anton Kuzmenko","email":"hotk@hey.com"},"license":"MIT","_id":"@akuzmenko/rgk@0.2.0","maintainers":[{"name":"akuzmenko","email":"hotk@hey.com"}],"homepage":"https://github.com/default-anton/rgk#readme","bugs":{"url":"https://github.com/default-anton/rgk/issues"},"pi":{"extensions":["./extensions"]},"bin":{"rgk":"bin/rgk.js"},"dist":{"shasum":"e79538a7d749f0c66940ad6dfabefcdd2d45c4ec","tarball":"https://registry.npmjs.org/@akuzmenko/rgk/-/rgk-0.2.0.tgz","fileCount":37,"integrity":"sha512-VfsesNwl6YEuvsET0ykJWb4kKiVr2C/+2/5/Eqo4u3Km2OwGQPkkJvlY0VFHtvKvxebT7Mc6VZZRg7THoY28eQ==","signatures":[{"sig":"MEUCIElf0yyB4TlkqzdqpEhz9w1JhGoZkJpobfUGDLUU55ZHAiEA1Q2B0Aeo0i0K8N/h/STz8/cz5IYeDqg0pnlv0K5Xeec=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":94504},"type":"module","engines":{"node":">=24.0.0"},"gitHead":"9b9269fc910d40b082e519b6c63328a5d89cd33d","scripts":{"lint":"oxlint . --deny-warnings","test":"pnpm run build && node --test test/*.test.mjs","build":"tsc","check":"tsc --noEmit","clean":"rm -rf dist","format":"oxfmt .","verify":"pnpm run format:check && pnpm run lint && pnpm run check && pnpm run test","prepack":"pnpm run build","pack:check":"pnpm run clean && npm pack --dry-run","format:check":"oxfmt --check .","prepublishOnly":"pnpm run verify"},"_npmUser":{"name":"akuzmenko","email":"hotk@hey.com"},"repository":{"url":"git+https://github.com/default-anton/rgk.git","type":"git"},"_npmVersion":"11.13.0","description":"ripgrep with an LLM-powered --keep post-filter","directories":{},"_nodeVersion":"24.14.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.33.0","devDependencies":{"oxfmt":"^0.48.0","oxlint":"^1.63.0","typescript":"^6.0.3","@types/node":"^25.6.2"},"_npmOperationalInternal":{"tmp":"tmp/rgk_0.2.0_1778463748463_0.2635436578914636","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@akuzmenko/rgk","version":"0.2.1","keywords":["codex","llm","pi-package","rg","ripgrep","search"],"author":{"name":"Anton Kuzmenko","email":"hotk@hey.com"},"license":"MIT","_id":"@akuzmenko/rgk@0.2.1","maintainers":[{"name":"akuzmenko","email":"hotk@hey.com"}],"homepage":"https://github.com/default-anton/rgk#readme","bugs":{"url":"https://github.com/default-anton/rgk/issues"},"pi":{"extensions":["./extensions"]},"bin":{"rgk":"bin/rgk.js"},"dist":{"shasum":"7ce37141a4764941fbbf77913d04e5bd816a47ce","tarball":"https://registry.npmjs.org/@akuzmenko/rgk/-/rgk-0.2.1.tgz","fileCount":37,"integrity":"sha512-4L/oNPmmr3GYaDBixIRrLaRS4FMMMTKRlhHMgcDthdz2/vhsXabddEJMmSxVI8fCoVu6LH3MajA75QEta9GgrA==","signatures":[{"sig":"MEQCIAzelt1PWM+DjsxMvdUAOWg9CAShjs4c+tS6mkwdpP3vAiBxXC72DTErm3IcMDaFBUYiIb9hgxEgxYS5t/XfY3j+Nw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":94500},"type":"module","engines":{"node":">=24.0.0"},"gitHead":"58831240981a483720dd896df38952978b92d07d","scripts":{"lint":"oxlint . --deny-warnings","test":"pnpm run build && node --test test/*.test.mjs","build":"tsc","check":"tsc --noEmit","clean":"rm -rf dist","format":"oxfmt .","verify":"pnpm run format:check && pnpm run lint && pnpm run check && pnpm run test","prepack":"pnpm run build","pack:check":"pnpm run clean && npm pack --dry-run","format:check":"oxfmt --check .","prepublishOnly":"pnpm run verify"},"_npmUser":{"name":"akuzmenko","email":"hotk@hey.com"},"repository":{"url":"git+https://github.com/default-anton/rgk.git","type":"git"},"_npmVersion":"11.13.0","description":"ripgrep with an LLM-powered --keep post-filter","directories":{},"_nodeVersion":"24.14.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.33.0","devDependencies":{"oxfmt":"^0.48.0","oxlint":"^1.63.0","typescript":"^6.0.3","@types/node":"^25.6.2"},"_npmOperationalInternal":{"tmp":"tmp/rgk_0.2.1_1778464253904_0.6019888678008507","host":"s3://npm-registry-packages-npm-production"}},"0.2.2":{"name":"@akuzmenko/rgk","version":"0.2.2","description":"ripgrep with an LLM-powered --keep post-filter","keywords":["codex","llm","pi-package","rg","ripgrep","search"],"homepage":"https://github.com/default-anton/rgk#readme","bugs":{"url":"https://github.com/default-anton/rgk/issues"},"license":"MIT","author":{"name":"Anton Kuzmenko","email":"hotk@hey.com"},"repository":{"type":"git","url":"git+https://github.com/default-anton/rgk.git"},"bin":{"rgk":"bin/rgk.js"},"type":"module","publishConfig":{"access":"public"},"scripts":{"build":"tsc","check":"tsc --noEmit","clean":"rm -rf dist","format":"oxfmt .","format:check":"oxfmt --check .","lint":"oxlint . --deny-warnings","test":"pnpm run build && node --test test/*.test.mjs","verify":"pnpm run format:check && pnpm run lint && pnpm run check && pnpm run test","pack:check":"pnpm run clean && npm pack --dry-run","prepack":"pnpm run build","prepublishOnly":"pnpm run verify"},"devDependencies":{"@types/node":"^25.6.2","oxfmt":"^0.48.0","oxlint":"^1.63.0","typescript":"^6.0.3"},"engines":{"node":">=24.0.0"},"packageManager":"pnpm@10.33.0","pi":{"extensions":["./extensions"]},"gitHead":"3da2aa602e65230184fbf5cc0b26aaf4bf4f0f85","_id":"@akuzmenko/rgk@0.2.2","_nodeVersion":"24.14.0","_npmVersion":"11.13.0","dist":{"integrity":"sha512-XND6b3R/FoPYMaxaONPd4vijiLQI0FirLnHZn1XbLTUKk5A6KIiH5oOC95iUaI/pHSisXB/aUdnXPDqorPGnTg==","shasum":"e8758cc5c17a892fe6e810f64fc15556bfec25ba","tarball":"https://registry.npmjs.org/@akuzmenko/rgk/-/rgk-0.2.2.tgz","fileCount":37,"unpackedSize":94920,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCC4WIySBg3Mxnkqx6FQr8+7TZzDaMqfrsiGVVoU/2pigIgJdBNmdKabt+mzISY1peKBY1g/tMLfcTuPa0LcCd4tt0="}]},"_npmUser":{"name":"akuzmenko","email":"hotk@hey.com"},"directories":{},"maintainers":[{"name":"akuzmenko","email":"hotk@hey.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/rgk_0.2.2_1778516623507_0.5790858022471306"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-09T04:40:10.639Z","modified":"2026-05-11T16:23:43.785Z","0.1.0":"2026-05-09T04:40:10.911Z","0.1.1":"2026-05-09T05:16:52.512Z","0.1.2":"2026-05-10T06:05:20.127Z","0.2.0":"2026-05-11T01:42:28.604Z","0.2.1":"2026-05-11T01:50:54.024Z","0.2.2":"2026-05-11T16:23:43.661Z"},"bugs":{"url":"https://github.com/default-anton/rgk/issues"},"author":{"name":"Anton Kuzmenko","email":"hotk@hey.com"},"license":"MIT","homepage":"https://github.com/default-anton/rgk#readme","keywords":["codex","llm","pi-package","rg","ripgrep","search"],"repository":{"type":"git","url":"git+https://github.com/default-anton/rgk.git"},"description":"ripgrep with an LLM-powered --keep post-filter","maintainers":[{"name":"akuzmenko","email":"hotk@hey.com"}],"readme":"# rgk\n\n`rgk` is `rg` plus one extra option:\n\n```bash\nrgk PATTERN --keep \"natural language condition\"\n```\n\n`rg` still does the fast lexical search. `--keep` sends the matching lines to Codex, keeps only results that satisfy the condition, and prints kept results ranked strongest first.\n\nWithout `--keep`, `rgk` execs `rg` directly. `--help`, `-h`, and `--version` show normal `rg` output with a short `rgk` section appended.\n\n## Installation\n\n```bash\nnpm install -g @akuzmenko/rgk\n```\n\nFor Pi, install the package as an extension to make Pi's `bash` tool expand `rg` commands to `rgk`:\n\n```bash\npi install npm:@akuzmenko/rgk\n```\n\nRequirements:\n\n- Node.js 24+\n- `rg` on `PATH`\n- `codex` on `PATH`, authenticated and ready to run `codex exec`\n\n## Usage\n\n```bash\nrgk \"TODO\" --keep \"security-sensitive follow-up\"\nrgk \"fetch\" src --keep \"network calls without timeout\"\nrgk \"class .*Error\" --keep \"errors shown to end users\"\necho \"foo\\nbar\" | rgk foo --keep \"the foo line\"\n```\n\nRecommended global `AGENTS.md` instruction for coding agents:\n\n```md\n- Prefer `rgk` over `rg`; it accepts the same args. When exploring with `rgk`, add `--keep '<natural language condition>'` to Codex-filter/rank matched lines into `path:line:column:text`; omit `--keep` when using bare `rg` or when you need every literal match, e.g. refactors/edits.\n```\n\nRecommended global `AGENTS.md` instruction for Pi coding agents with the `rgk` extension installed:\n\n```md\n- Prefer `rg`/ripgrep for searching text in files. When exploring with `rg`, add `--keep '<natural language condition>'` (a Codex-only `rg` extension) to filter/rank matched lines into `path:line:column:text`; omit `--keep` when you need every literal match, e.g. refactors/edits.\n```\n\nIn `--keep` mode, output is normalized and match-centered for agents and scripts:\n\n```text\npath/to/file:line:column:compact matched text\n```\n\nLong lines are shortened around the matched span before they reach the agent context. Search semantics pass through to `rg`; presentation becomes plain, no-color, and line-oriented so ranking and filtering are reliable in pipes, editors, and coding-agent workflows. `--keep` rejects `rg` output modes that do not return match lines, such as count and files-with-matches modes.\n\n## Privacy\n\nWithout `--keep`, `rgk` execs `rg` directly and does not call Codex. With `--keep`, the keep condition, matched paths, and compact matched lines are sent to Codex for filtering and ranking. Narrow your `rg` query first when searching private or sensitive code.\n\n## Configuration\n\nEnvironment variables:\n\n| Variable                     | Default        | Description                                         |\n| ---------------------------- | -------------- | --------------------------------------------------- |\n| `RGK_MODEL`                  | `gpt-5.4-mini` | Codex model                                         |\n| `RGK_REASONING_EFFORT`       | `none`         | Codex reasoning effort                              |\n| `RGK_PROMPT_MAX_BYTES`       | `400000`       | Max prompt bytes per Codex request                  |\n| `RGK_TOTAL_PROMPT_MAX_BYTES` | `4000000`      | Max total keep prompt bytes processed               |\n| `RGK_PROMPT_LINE_MAX_BYTES`  | `600`          | Max matched-line bytes sent per candidate (min `4`) |\n| `RGK_OUTPUT_LINE_MAX_BYTES`  | `300`          | Max matched-line bytes printed per result (min `4`) |\n| `RGK_CODEX_CONCURRENCY`      | `4`            | Max concurrent Codex requests                       |\n| `RGK_CODEX_TIMEOUT_MS`       | `300000`       | Codex timeout                                       |\n| `RGK_RG_PATH`                | `rg`           | ripgrep executable                                  |\n| `RGK_CODEX_PATH`             | `codex`        | Codex executable                                    |\n| `RGK_DEBUG`                  | unset          | Set `1` or `true` to show Codex diagnostics         |\n\n## Exit codes\n\n- `0`: kept results printed\n- `1`: no `rg` matches, or no kept results\n- `2`: invalid usage, `rg` error, or Codex/filter failure\n\n## Development\n\n```bash\npnpm install\npnpm run verify\n```\n\n## License\n\nMIT\n","readmeFilename":"README.md"}