agrep-cli 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +19 -0
  2. package/bin.js +44 -0
  3. package/package.json +13 -0
package/README.md ADDED
@@ -0,0 +1,19 @@
1
+ # agrep
2
+
3
+ grep your AI coding agents' chat history — Claude Code, Codex, opencode, Antigravity,
4
+ Kimi CLI, Cline — straight from the shell. One searchable cross-agent history, a context-window command
5
+ (`agrep around`) built for agents and humans, native session resume, and a local web
6
+ explorer (`agrep ui`).
7
+
8
+ This npm package is a thin shim: agrep is a python package with a bundled rust binary,
9
+ and the shim runs it through [uv](https://docs.astral.sh/uv/) (or pipx). uv manages
10
+ python itself, so this works even on a machine with no python installed.
11
+
12
+ ```
13
+ npm i -g agrep-cli
14
+ agrep "race condition" # first run indexes your agent stores, then greps
15
+ ```
16
+
17
+ Prefer the direct route? `uv tool install agrep` — same thing, no node in the middle.
18
+
19
+ Full docs: https://github.com/dannyisbad/agrep
package/bin.js ADDED
@@ -0,0 +1,44 @@
1
+ #!/usr/bin/env node
2
+ // agrep is a python package with a bundled rust binary; this npm shim just finds a
3
+ // runner for it. uv is preferred because uvx manages python itself — it works on a
4
+ // box with no python at all. pipx is the fallback. If neither exists we print the
5
+ // one-liner that fixes it instead of half-installing anything ourselves.
6
+ //
7
+ // AGREP_PYPI_SPEC overrides what gets run (e.g. a local wheel path, or agrep==0.1.0).
8
+
9
+ "use strict";
10
+ const { spawnSync } = require("child_process");
11
+
12
+ const SPEC = process.env.AGREP_PYPI_SPEC || "agrep";
13
+ const args = process.argv.slice(2);
14
+
15
+ function has(cmd) {
16
+ const probe = spawnSync(cmd, ["--version"], { stdio: "ignore", shell: false });
17
+ return probe.status === 0;
18
+ }
19
+
20
+ function run(cmd, cmdArgs) {
21
+ const r = spawnSync(cmd, cmdArgs, { stdio: "inherit", shell: false });
22
+ if (r.error) {
23
+ console.error(`agrep: failed to launch ${cmd}: ${r.error.message}`);
24
+ process.exit(1);
25
+ }
26
+ process.exit(r.status === null ? 1 : r.status);
27
+ }
28
+
29
+ if (has("uv")) {
30
+ // `uvx agrep` == `uv tool run agrep`; --from lets AGREP_PYPI_SPEC point anywhere
31
+ run("uv", ["tool", "run", "--from", SPEC, "agrep", ...args]);
32
+ } else if (has("pipx")) {
33
+ run("pipx", ["run", "--spec", SPEC, "agrep", ...args]);
34
+ } else {
35
+ console.error(
36
+ "agrep needs uv (or pipx) to run — it's a python package with a bundled rust binary.\n" +
37
+ "install uv (one line, manages python itself):\n\n" +
38
+ (process.platform === "win32"
39
+ ? ' powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"'
40
+ : " curl -LsSf https://astral.sh/uv/install.sh | sh") +
41
+ "\n\nthen `agrep` works. (or skip npm entirely: `uv tool install agrep`)"
42
+ );
43
+ process.exit(1);
44
+ }
package/package.json ADDED
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "agrep-cli",
3
+ "version": "0.1.0",
4
+ "description": "grep your AI coding agents' chat history (Claude Code, Codex, opencode, Antigravity, Kimi, Cline) — npm shim that runs the real package via uv/pipx",
5
+ "bin": { "agrep": "bin.js" },
6
+ "files": ["bin.js", "README.md"],
7
+ "engines": { "node": ">=16" },
8
+ "keywords": ["claude", "codex", "opencode", "kimi", "cline", "agent", "chat", "history", "grep", "cli"],
9
+ "repository": { "type": "git", "url": "git+https://github.com/dannyisbad/agrep.git" },
10
+ "homepage": "https://github.com/dannyisbad/agrep#readme",
11
+ "author": "mundy (https://mundy.sh)",
12
+ "license": "MIT"
13
+ }