@rag-rat/bin
Advanced tools
+20
-0
@@ -23,2 +23,22 @@ const { Package } = require("./binary-install"); | ||
| const getPlatform = () => { | ||
| // Termux/Android reports os.type() === "Linux" but process.platform === "android", and needs the | ||
| // bionic aarch64-linux-android build (not a glibc/musl one). Resolve it before the Linux/libc path. | ||
| if (process.platform === "android") { | ||
| let androidArch = ""; | ||
| switch (os.arch()) { | ||
| case "arm64": | ||
| androidArch = "aarch64"; | ||
| break; | ||
| case "x64": | ||
| androidArch = "x86_64"; | ||
| break; | ||
| } | ||
| const androidPlatform = supportedPlatforms[`${androidArch}-linux-android`]; | ||
| if (!androidPlatform) { | ||
| error( | ||
| `Platform with type "android" and architecture "${os.arch()}" is not supported by ${name}.`, | ||
| ); | ||
| } | ||
| return androidPlatform; | ||
| } | ||
| const rawOsType = os.type(); | ||
@@ -25,0 +45,0 @@ const rawArchitecture = os.arch(); |
+14
-0
@@ -10,2 +10,16 @@ # Changelog | ||
| ## [0.17.0](https://github.com/cq27-dev/rag-rat/compare/rag-rat-core-v0.16.0...rag-rat-core-v0.17.0) - 2026-07-11 | ||
| ### Added | ||
| - *(plugin)* one-step plugin for Claude Code + Codex — MCP via npx, harness-neutral hooks ([#569](https://github.com/cq27-dev/rag-rat/pull/569)) | ||
| - *(account)* the stratified control-log fold (§11–§12) ([#622](https://github.com/cq27-dev/rag-rat/pull/622)) | ||
| - *(dist)* ship an android/Termux binary + make npx @rag-rat/bin work there ([#616](https://github.com/cq27-dev/rag-rat/pull/616)) ([#621](https://github.com/cq27-dev/rag-rat/pull/621)) | ||
| - *(account)* sync phase C1 wire/crypto layer + fold foundation ([#618](https://github.com/cq27-dev/rag-rat/pull/618)) | ||
| - *(doctor)* reclaim freelist dead space with `doctor --vacuum` ([#574](https://github.com/cq27-dev/rag-rat/pull/574)) ([#613](https://github.com/cq27-dev/rag-rat/pull/613)) | ||
| ### Fixed | ||
| - *(mcp)* boot a dormant server outside a rag-rat repo instead of dying ([#603](https://github.com/cq27-dev/rag-rat/pull/603)) ([#611](https://github.com/cq27-dev/rag-rat/pull/611)) | ||
| ## [0.16.0](https://github.com/cq27-dev/rag-rat/compare/rag-rat-core-v0.15.0...rag-rat-core-v0.16.0) - 2026-07-10 | ||
@@ -12,0 +26,0 @@ |
+24
-24
| { | ||
| "name": "@rag-rat/bin", | ||
| "version": "0.17.0", | ||
| "lockfileVersion": 3, | ||
| "name": "@rag-rat/bin", | ||
| "requires": true, | ||
| "packages": { | ||
| "": { | ||
| "name": "@rag-rat/bin", | ||
| "version": "0.17.0", | ||
| "hasInstallScript": true, | ||
| "license": "MIT", | ||
| "dependencies": { | ||
| "detect-libc": "^2.1.2" | ||
| }, | ||
| "bin": { | ||
| "rag-rat": "run-rag-rat.js" | ||
| }, | ||
| "dependencies": { | ||
| "detect-libc": "^2.1.2" | ||
| }, | ||
| "devDependencies": { | ||
@@ -18,22 +24,22 @@ "prettier": "^3.8.3" | ||
| "npm": ">=6" | ||
| }, | ||
| "hasInstallScript": true, | ||
| "license": "MIT", | ||
| "name": "@rag-rat/bin", | ||
| "version": "0.16.0" | ||
| } | ||
| }, | ||
| "node_modules/detect-libc": { | ||
| "version": "2.1.2", | ||
| "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", | ||
| "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", | ||
| "license": "Apache-2.0", | ||
| "engines": { | ||
| "node": ">=8" | ||
| }, | ||
| "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", | ||
| "license": "Apache-2.0", | ||
| "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", | ||
| "version": "2.1.2" | ||
| } | ||
| }, | ||
| "node_modules/prettier": { | ||
| "version": "3.8.3", | ||
| "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.8.3.tgz", | ||
| "integrity": "sha512-7igPTM53cGHMW8xWuVTydi2KO233VFiTNyF5hLJqpilHfmn8C8gPf+PS7dUT64YcXFbiMGZxS9pCSxL/Dxm/Jw==", | ||
| "dev": true, | ||
| "license": "MIT", | ||
| "bin": { | ||
| "prettier": "bin/prettier.cjs" | ||
| }, | ||
| "dev": true, | ||
| "engines": { | ||
@@ -44,11 +50,5 @@ "node": ">=14" | ||
| "url": "https://github.com/prettier/prettier?sponsor=1" | ||
| }, | ||
| "integrity": "sha512-7igPTM53cGHMW8xWuVTydi2KO233VFiTNyF5hLJqpilHfmn8C8gPf+PS7dUT64YcXFbiMGZxS9pCSxL/Dxm/Jw==", | ||
| "license": "MIT", | ||
| "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.8.3.tgz", | ||
| "version": "3.8.3" | ||
| } | ||
| } | ||
| }, | ||
| "requires": true, | ||
| "version": "0.16.0" | ||
| } | ||
| } | ||
| } |
+10
-3
| { | ||
| "artifactDownloadUrls": [ | ||
| "https://github.com/cq27-dev/rag-rat/releases/download/v0.16.0" | ||
| "https://github.com/cq27-dev/rag-rat/releases/download/v0.17.0" | ||
| ], | ||
@@ -84,5 +84,12 @@ "author": "Kristaps Karlsons", | ||
| "zipExt": ".tar.xz" | ||
| }, | ||
| "aarch64-linux-android": { | ||
| "artifactName": "rag-rat-aarch64-linux-android.tar.gz", | ||
| "bins": { | ||
| "rag-rat": "rag-rat" | ||
| }, | ||
| "zipExt": ".tar.gz" | ||
| } | ||
| }, | ||
| "version": "0.16.0", | ||
| "version": "0.17.0", | ||
| "volta": { | ||
@@ -92,2 +99,2 @@ "node": "18.14.1", | ||
| } | ||
| } | ||
| } |
+100
-40
@@ -52,22 +52,76 @@ # rag-rat | ||
| ## Install | ||
| ## Quickstart | ||
| For Claude Code and Codex, install the plugin. It registers the MCP server, adds the skills and | ||
| hooks, and installs a version-matched `rag-rat` binary on first run: | ||
| ```bash | ||
| cargo install rag-rat # from crates.io (FastEmbed included by default) | ||
| # Claude Code | ||
| claude plugin marketplace add cq27-dev/rag-rat | ||
| claude plugin install rag-rat@rag-rat | ||
| # Codex | ||
| codex plugin marketplace add cq27-dev/rag-rat | ||
| codex plugin add rag-rat@rag-rat | ||
| ``` | ||
| From a checkout: | ||
| After installing, approve the plugin so its tools and hooks run: | ||
| - **Claude Code** asks before each rag-rat MCP tool the first time it runs — choose "Yes, don't ask | ||
| again," or pre-allow them in `~/.claude/settings.json` with | ||
| `"permissions": { "allow": ["mcp__rag-rat__*"] }`. | ||
| - **Codex** shows a **"Hooks need review"** prompt on the first `codex` session started *inside the | ||
| repo* (the plugin ships grep-augmentation, clone-check, and session-digest hooks that run outside | ||
| the sandbox). Choose **"Trust all and continue"** to enable them. | ||
| Then open the repository and ask: | ||
| > Set up rag-rat in this repo. | ||
| The `init-rag-rat` skill scans the repo, explains the material choices, previews `rag-rat.toml`, | ||
| writes and indexes only after confirmation, and offers to set up the git hooks that keep the index | ||
| fresh. The MCP server starts dormant in an unconfigured repo; when setup finishes, reconnect it so it | ||
| restarts fully active against the new index. | ||
| Then put it to work — the loop rag-rat is built for is in [Try it](#try-it). | ||
| <details> | ||
| <summary><strong>Manual installation and other agents</strong></summary> | ||
| Use this path for the standalone CLI, agents without plugin support, or building from source. | ||
| ### Install the CLI | ||
| The prebuilt package needs no Rust toolchain and supports Apple Silicon macOS, glibc ≥2.38 Linux | ||
| (x86-64 and arm64), Windows x64, and Android/Termux arm64: | ||
| ```bash | ||
| npm install -g @rag-rat/bin | ||
| # or run it without installing: | ||
| npx @rag-rat/bin --help | ||
| ``` | ||
| `@rag-rat/bin` fetches the full binary from the matching GitHub release. FastEmbed's ONNX Runtime is | ||
| statically linked. | ||
| To build from source instead: | ||
| ```bash | ||
| cargo install rag-rat | ||
| # or from a checkout: | ||
| cargo install --path crates/rag-rat-cli --bin rag-rat | ||
| ``` | ||
| Add `--no-default-features` for a smaller hash-only build without real embeddings. SQLite is bundled | ||
| (compiled in via `rusqlite`), so there is no system-library prerequisite — see | ||
| [Platform support](#platform-support) for the per-OS C-toolchain note. | ||
| The default source build needs glibc ≥2.38 and is unavailable for Intel macOS and musl/Alpine. On | ||
| those platforms, including Ubuntu 22.04, use the pure-Rust embedder: | ||
| ## Quickstart | ||
| ```bash | ||
| cargo install rag-rat --no-default-features --features model2vec | ||
| ``` | ||
| From the repository you want to index: | ||
| `--no-default-features` alone produces a smaller hash-only build without real embeddings. SQLite is | ||
| bundled; see [Platform support](#platform-support) for toolchain details. | ||
| ### Initialize the repository | ||
| ```bash | ||
@@ -78,11 +132,10 @@ cd /path/to/your/repo | ||
| `init` scans the repo, prompts for languages and path bindings, writes `rag-rat.toml`, indexes, | ||
| offers to install the local embedding model, and can install git hooks; on completion it prints the | ||
| one command to connect your agent. Preview without writing anything with `rag-rat init --dry-run`; | ||
| `--yes` runs the non-interactive defaults. | ||
| `init` scans the repo, guides language and embedding choices, writes `rag-rat.toml`, and builds the | ||
| initial index. Use `rag-rat init --dry-run` to preview without writing, or `--yes` for | ||
| non-interactive defaults. Configuration reference: [`docs/config.md`](docs/config.md). | ||
| **Install the agent skills.** `init` wires up the index and MCP server; a pair of skills teaches your | ||
| agent to actually reach for them. Install into whatever agents you have (Claude Code, Codex, Cursor, | ||
| and 70+ others, detected automatically): | ||
| ### Add skills and connect MCP | ||
| Install the skills for Claude Code, Codex, Cursor, and 70+ other detected agents: | ||
| ```bash | ||
@@ -92,22 +145,15 @@ npx @rag-rat/skills | ||
| That installs **`using-rag-rat`** (reach for the MCP tools before grep; record durable findings as | ||
| memories) and **`dream-review`** (triage the memory-maintenance worklist). See | ||
| [`skills/README.md`](skills/README.md) for `update` / `list` / `remove` and per-agent flags. | ||
| That installs `using-rag-rat`, `dream-review`, `init-rag-rat`, and | ||
| `configure-rag-rat-dream`. See [`skills/README.md`](skills/README.md) for per-agent flags and | ||
| `update`, `list`, and `remove`. | ||
| Manual setup and every config knob live in [`docs/config.md`](docs/config.md). For a large repo where | ||
| the default local embedder is too slow, see [Embedding backends](#embedding-backends). | ||
| The MCP server uses STDIO: the client launches `rag-rat mcp` from the repository so it discovers the | ||
| correct `rag-rat.toml` and repository scope in the consolidated machine-global store. | ||
| ## Connect it to your agent (MCP) | ||
| The MCP server is STDIO — the client launches `rag-rat` as a child process. Registering it is **one | ||
| command**, run from the repo directory so the server resolves that repo's `rag-rat.toml` and each | ||
| repo gets its own index: | ||
| ```bash | ||
| claude mcp add --scope project rag-rat -- rag-rat mcp # Claude Code | ||
| codex mcp add rag-rat -- rag-rat mcp # Codex | ||
| claude mcp add --scope project rag-rat -- rag-rat mcp | ||
| codex mcp add rag-rat -- rag-rat mcp | ||
| ``` | ||
| `rag-rat init` prints this command on completion — it does not register the server for you. Or add a | ||
| project `.mcp.json` / equivalent: | ||
| Or add the equivalent project configuration: | ||
@@ -122,14 +168,26 @@ ```json | ||
| > **Don't pin a single global server to one repo's config.** A user-scoped server with a hardcoded | ||
| > `--config /some/repo/rag-rat.toml` serves *that* repo's index and memories everywhere — so browsing | ||
| > a different codebase loads the wrong context. Register the server per project and let it resolve | ||
| > `rag-rat.toml` from the repo it runs in. (`--config <path>` still exists for the rare case you need | ||
| > to point at a specific profile.) | ||
| `rag-rat init` prints the registration command but does not register the server itself. Pass | ||
| `rag-rat mcp --json` if the client must parse JSON; tool text defaults to [TOON](#output). Full tool | ||
| schemas: [`docs/mcp-tools.md`](docs/mcp-tools.md). | ||
| Pass `rag-rat mcp --json` if your client must parse tool text as JSON (results are | ||
| [TOON](#output) by default). Full tool schemas: [`docs/mcp-tools.md`](docs/mcp-tools.md). | ||
| <details> | ||
| <summary>Claude Code tool permissions</summary> | ||
| Claude Code asks once before each rag-rat MCP tool first runs. Choose "Yes, don't ask again," or | ||
| allow the tool namespace in `~/.claude/settings.json`: | ||
| ```json | ||
| { "permissions": { "allow": ["mcp__rag-rat__*"] } } | ||
| ``` | ||
| </details> | ||
| > **Do not pin a global server to one repository's config.** A user-scoped server with | ||
| > `--config /some/repo/rag-rat.toml` serves that repository everywhere. Register MCP per project and | ||
| > let the process discover the config from its working directory. | ||
| </details> | ||
| ## Try it | ||
| Right after `rag-rat init` the code graph, symbols, git history, semantic search, and clone | ||
| Once the repo is indexed, the code graph, symbols, git history, semantic search, and clone | ||
| detection are ready — these answer on the first query. Repo memories start **empty**: they accrue as | ||
@@ -228,3 +286,3 @@ agents record findings with `memory_create` and then surface automatically in later answers. (GitHub | ||
| rag-rat exposes **46 MCP tools** — the full catalog with JSON schemas lives in | ||
| rag-rat's **MCP tools** — the full catalog with JSON schemas lives in | ||
| [`docs/mcp-tools.md`](docs/mcp-tools.md). The ones you'll reach for most: | ||
@@ -396,3 +454,5 @@ | ||
| push to main; macOS and Windows are exercised on release, so `cargo install rag-rat` builds and | ||
| links on all three. | ||
| links on all three. Android (aarch64, bionic) is also a release target — a prebuilt binary is | ||
| attached to each release and published to `@rag-rat/bin`, so `npx @rag-rat/bin` works on Termux; see | ||
| [Quickstart](#quickstart). | ||
| SQLite is bundled (compiled from source via `rusqlite`), so there's no system-library prerequisite, | ||
@@ -399,0 +459,0 @@ but each platform needs a C toolchain: Linux ships one; on macOS install the Xcode Command Line |
| /node_modules | ||
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 2 instances
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 2 instances
81433
4.8%497
4.41%503
13.54%9
-10%