Skip to content

armgit / raea

Public Imported from GitHub
0

Render Anything Engine: tell your AI what to make. Videos, motion graphics, 3D and games as React and TypeScript, rendered on your own GPU. Rust + Bevy, macOS, Linux and Windows.

IX13: raea index in the manual's CLI reference (Projects, beside library), its page indexer.md

shinyobjectzb24a4537c07b
diff --git a/docs/manual/reference/cli/index.md b/docs/manual/reference/cli/index.md
index d7c1461e..9da9aa21 100644
--- a/docs/manual/reference/cli/index.md
+++ b/docs/manual/reference/cli/index.md
@@ -56,6 +56,7 @@ The workspace, its projects and what a project holds.
| [`raea add`](add.md) | Add, remove and install npm packages for a project, with no Node or npm: raea.lock and node_modules. |
| [`raea brand`](brand.md) | Read a brand kit from a website on this machine: colours, fonts and logos into brand/ and BRAND.md. |
| [`raea library`](library.md) | Search and manage the person's media libraries in the raea app: folders and drives indexed on this machine, searched by meaning. |
+| [`raea index`](indexer.md) | Make every picture on a folder or a drive searchable by words, embedded on this Mac's Neural Engine, and keep the index open for the raea app. |
## Check
diff --git a/docs/manual/reference/cli/indexer.md b/docs/manual/reference/cli/indexer.md
new file mode 100644
index 00000000..3a2c0063
--- /dev/null
+++ b/docs/manual/reference/cli/indexer.md
@@ -0,0 +1,32 @@
+---
+title: "raea index"
+summary: "Make every picture on a folder or a drive searchable by words, embedded on this Mac's Neural Engine, and keep the index open for the raea app."
+order: 32
+sources: ["engine/cli/src/cli.rs"]
+---
+
+Make every picture on a folder or a drive searchable by words, on this Mac. `add` lists the folder and embeds each
+picture's small copy with SigLIP 2 on the Neural Engine, about 170 a second on an M5 Pro, with a counter as it goes;
+`search` gives the best matches for words; `status` lists the sources; `remove` takes one out; `serve` keeps the index
+open for the raea app, one JSON ask a line on stdin. Nothing leaves the machine.
+
+<!-- generated:begin by tools/manual-ref/cli.ts from `raea help --json`; edit only the flag descriptions -->
+
+## Usage
+
+```sh
+raea index add FOLDER... [--json] | raea index search WORDS... [--k N] [--source ID|FOLDER] [--json] | raea index status [--json] | raea index remove ID|FOLDER | raea index serve [--home DIR] (every picture on a folder or a drive made searchable by words on this Mac, fast: add lists it and embeds each picture's small copy with SigLIP 2 on the Neural Engine, a counter as it goes, JSON lines with --json; search gives the best for the words; status lists the sources and what each holds; remove takes one out; serve keeps the index open for the raea app, one JSON ask a line on stdin; the index lives in ~/.raea/library/fast, or --home / RAEA_INDEX_HOME)
+```
+
+Headless: it needs nothing running and opens no window. Takes any number of arguments besides its flags.
+
+## Flags
+
+| Flag | Takes | What it does |
+| --- | --- | --- |
+| `--home` | `DIR` | The index's folder (default ~/.raea/library/fast, or RAEA_INDEX_HOME). |
+| `--json` | – | Print JSON: progress lines for add, the hits for search, the sources for status. |
+| `--k` | `N` | How many hits search gives (10 by default). |
+| `--source` | `ID\|FOLDER` | Search only one source, by its id or the folder that was added. |
+
+<!-- generated:end -->
diff --git a/tools/manual-ref/cli.ts b/tools/manual-ref/cli.ts
index 57d6ec7e..4cc54d7d 100644
--- a/tools/manual-ref/cli.ts
+++ b/tools/manual-ref/cli.ts
@@ -26,13 +26,15 @@ const verbs: Verb[] = JSON.parse(run(["help", "--json"])).verbs
// the index's groups, in the order a reader meets them; every verb is in one
const GROUPS: [string, string, string[]][] = [
["Make", "Render, play and package what you wrote.", ["render", "play", "export-game", "export", "bundle", "app", "run"]],
- ["Projects", "The workspace, its projects and what a project holds.", ["init", "workspace", "project", "controller", "spec", "component", "part", "add", "brand", "library"]],
+ ["Projects", "The workspace, its projects and what a project holds.", ["init", "workspace", "project", "controller", "spec", "component", "part", "add", "brand", "library", "index"]],
["Check", "What's wrong before anyone watches it.", ["check", "judge", "fingerprint", "findings", "scene", "world", "solid", "next", "doctor", "hook", "traces"]],
["Footage", "Takes, cuts and the camera, from your own media.", ["media", "cut", "frame", "track", "splat", "mezz", "neural"]],
["Sound", "Music read, foley and instruments made on this machine.", ["song", "sounds", "sao", "tokensynth", "setup-audio"]],
["Generate and 3D tools", "Generated media, physics bakes, Blender and Godot.", ["gen", "physics", "blender", "godot"]],
["Agents and setup", "What an agent reads and shows the person, and the tools raea installs.", ["guide", "context", "notes", "show", "skill", "skills", "setup"]],
]
+/** A verb's page: VERB.md, but index.md is this section's own page, so raea index's is indexer.md */
+const pageOf = (verb: string) => (verb === "index" ? "indexer.md" : `${verb}.md`)
const groupOf = new Map(GROUPS.flatMap(([g, , vs]) => vs.map((v, i) => [v, { g, i }] as const)))
// a verb with its own parser lists its forms itself: that list is its usage
@@ -103,7 +105,7 @@ if (mode === "gen") mkdirSync(DIR, { recursive: true })
for (const v of verbs) {
const at = groupOf.get(v.verb)
if (!at) { problems.push(`${v.verb}: in no group (GROUPS in tools/manual-ref/cli.ts)`); continue }
- const file = path.join(DIR, `${v.verb}.md`)
+ const file = path.join(DIR, pageOf(v.verb))
const old = readPage(file)
const desc = old?.desc ?? new Map()
let head = old?.head ?? newHead(v)
@@ -126,7 +128,7 @@ const ihead = ib < 0 ? idx : idx.slice(0, ib), itail = ib < 0 ? "" : idx.slice(i
const list = [BEGIN.replace("; edit only the flag descriptions", ""), ""]
for (const [g, what, vs] of GROUPS) {
list.push(`## ${g}`, "", what, "", "| Verb | What it does |", "| --- | --- |")
- for (const v of vs) { const r = rows.get(g)?.find((x) => x.verb === v); if (r) list.push(`| [\`raea ${v}\`](${v}.md) | ${cell(r.summary)} |`) }
+ for (const v of vs) { const r = rows.get(g)?.find((x) => x.verb === v); if (r) list.push(`| [\`raea ${v}\`](${pageOf(v)}) | ${cell(r.summary)} |`) }
list.push("")
}
list.push(END)