Skip to main content
ClaudeWave
Skill4.9k repo starsupdated today

olares-search

The olares-search skill performs full-text search across Olares user data via the olares-cli search command, querying a pre-built per-user index to find files by content keywords rather than filename alone. Use it when you need to locate files containing specific text within Drive or Sync libraries, with support for pagination, JSON output, and filtering by file type or application source.

Install in Claude Code
Copy
git clone --depth 1 https://github.com/beclab/Olares /tmp/olares-search && cp -r /tmp/olares-search/cli/skills/olares-search ~/.claude/skills/olares-search
Then start a new Claude Code session; the skill loads automatically.

SKILL.md

# search (Desktop global search)

**CRITICAL — before doing anything, load the `olares-shared` skill first (profile selection, login, token refresh, auth-error recovery). Flag reference: `olares-cli search --help`.**

> **Source of truth for flags is always `olares-cli search --help`.** This file only carries what `--help` cannot give: what the index covers, how `search` differs from `files`, the session model, and the error → fix matrix.

## When to use

- Find content by keyword across the user's data: "where is the file that mentions X", "search my drive for invoice", full-text / Text Search, Desktop global search.
- Data sources (`--app`): `drive` (user Drive files, default) and `sync` (Seafile / Sync libraries).
- Keywords: Olares search, full-text search, find by content, Text Search, global search, search drive, search sync.

> Anything outside this scope -> see the **Skill suite map** in [`../olares-shared/SKILL.md`](../olares-shared/SKILL.md) (already loaded as the suite prerequisite).

> **Mental model:** `search` answers *"which file CONTAINS this text"* by querying the pre-built per-user index. To LIST or READ a known path, use [`olares-files`](../olares-files/SKILL.md) (`files ls` / `files cat` / `files download`).

## What it is

`olares-cli search <keyword>` is the CLI mirror of the Olares Desktop global search dialog ("Text Search", reached via the Dock search icon / Shift+Space). It runs full-content retrieval against the per-user **search3** index — the same index the desktop SPA queries — so it returns hits by file *content*, not just filename.

- It is a **leaf command** (no subcommands): `olares-cli search <keyword>` runs the query directly. Multiple words are joined into one keyword (quote multi-word phrases to be explicit).
- Results show a title, a location (resource URI / path / repo), and a content snippet with the match. `--output json` emits the raw upstream rows verbatim (nothing the index returns is dropped).

## Search model

- `--app drive` (default) searches Drive via a **session**: the CLI bootstraps `/api/search/init`, pages deeper with `/api/search/more` (same `reqid`), and best-effort cleans up with `/api/search/cancel`. `--app sync` uses the simpler `/api/search/sync` endpoint.
- `--type aggregate` (default) is full-content search; `--type file_name` matches on filename only. **`--type` applies to `--app drive` only** — it is ignored for `--app sync`.
- `--limit` (default 20) caps results; `--offset` pages. For Drive, `--offset > 0` triggers the `/more` page after the init bootstrap.
- Indexing is asynchronous on the server: a just-created/just-uploaded file may not be searchable until the index catches up. A miss is "not indexed yet", not necessarily "absent" — confirm a known path with `files ls`, check progress with `olares-cli settings search status`, and force a full reindex with `olares-cli settings search rebuild` (both in the `olares-settings` skill).

## Index coverage (what is searchable)

Two distinct indexes back this search, and they cover different things — knowing which one a query hits explains most "why didn't it find X" cases.

- **Filenames — indexed broadly by default.** Effectively every Drive file's *name* is indexed, so `--type file_name` hits almost anywhere. The only opt-outs are paths matching an **exclude pattern** (a per-user regex list: built-in non-removable entries plus user-added ones).
- **Full-text (content) — only `/Documents/` by default.** A `--type aggregate` query matches file *contents* only where content indexing is enabled, which by default is just the Drive `/Documents/` directory. Everywhere else you get filename matches but no in-content hits. Supported full-text formats: pdf, doc/docx, csv, rtf, txt/md/json/xml.
- **To make another directory full-text searchable**, add it to the full-content index: `olares-cli settings search dirs add <path>` (inspect the current set with `olares-cli settings search dirs list`). This lives in the `olares-settings` skill (`settings search`).
- **To see what is being blocked**, the exclude patterns are currently viewable/editable only in the Olares Settings SPA → Search → File search (the CLI's `settings search excludes` subcommand is not wired up); built-in patterns cannot be removed.
- **Full-text extraction can fail per file** (encrypted / corrupt / oversized), so a supported-format file in an indexed directory may still have no in-content hits. `olares-cli settings search status` surfaces a `Failures` count (use `-o json` for the per-file detail) — check it first when content search misses a file you expect.

## Examples

```bash
# Default: full-content search of Drive.
olares-cli search report

# Multi-word phrase, explicit app.
olares-cli search "design doc" --app drive

# Filename-only match, larger page.
olares-cli search invoice --app drive --type file_name --limit 50

# Search Sync (Seafile) libraries, paged, JSON for scripting.
olares-cli search notes --app sync --offset 20 -o json
```

## Common errors

| Symptom | Cause | Fix |
|---|---|---|
| `a non-empty search keyword is required` | No keyword given | Pass `<keyword>` (quote phrases) |
| `unsupported --app "<x>" (allowed: drive, sync)` | Unknown data source | Use `drive` or `sync` |
| `unsupported --type "<x>" (allowed: aggregate, file_name)` | Unknown search mode | Use `aggregate` or `file_name` (drive only) |
| `--limit must be a positive integer` / `--offset must not be negative` | Bad paging values | Use `--limit > 0`, `--offset >= 0` |
| `no results` but the file exists | Index hasn't caught up, or content not indexed | Check `settings search status` for progress/failures; verify the path with `files ls`. If it's a content miss, confirm the dir is in `settings search dirs`, then `settings search rebuild` |
| `server rejected the access token` / token invalidated | Auth | See [`../olares-shared/SKILL.md`](../olares-shared/SKILL.md) recovery table |
olares-chartSkill

Help a developer turn their own code or any open-source project into an app that runs on their own Olares. Two coupled axes: packaging the container image and authoring/refining the Olares app chart (OlaresManifest), then deploying it to the current Olares with an automatic upload + install + diagnose loop. Use when deploying a repo, docker-compose, or Helm chart to Olares, packaging an Olares app, wiring storage / system middleware / entrances / env / GPU, or fixing a failed install (ImagePullBackOff, permission denied / EACCES, app won't start). Publishing to the public Olares Market is the olares-publish skill.

olares-clusterSkill

Olares ControlHub K8s view via olares-cli cluster — pods, workloads, logs, scale/restart, jobs, cronjobs, middleware. Not for app lifecycle (market) or host install (node/os/gpu). Use for ControlHub, pods, logs, workloads.

olares-dashboardSkill

Olares Dashboard via olares-cli dashboard — CPU, memory, disk, network, pods, fan, GPU, ranking, applications; JSON envelope and --watch. Use for Olares Dashboard, overview, resource usage, Olares One fan.

olares-filesSkill

Olares Files via olares-cli files — ls, upload, download, edit, share, SMB/NFS mount, compress/extract archives, Seafile sync on drive/Home, drive/Data, drive/Common, cache, external, cloud. Use for Olares Files, drive, upload, download, share, SMB, NFS, compress, extract, archive, LarePass Files.

olares-marketSkill

Olares Market via olares-cli market — install, upgrade, uninstall, clone, stop, resume apps; catalog, status, chart upload, --watch. Use for Olares app store, my apps, 我的应用, install app, upload chart.

olares-settingsSkill

Olares Settings via olares-cli settings — mirror of Settings SPA: users, apps, VPN, backup, integration, GPU, search, me/whoami. Use for Olares Settings, role, VPN ACL, backup, integration accounts, language.

olares-sharedSkill

Set up and manage the Olares login/identity that every other olares-cli skill depends on — one profile per Olares ID, keychain-stored tokens, transparent token refresh, and auth-error recovery. Use for Olares ID, profile, login, 2FA/TOTP, refresh token, keychain, and auth errors (token rejected / invalidated / not logged in).

olares-publishSkill

Publish an Olares app that already runs on your own Olares to the public Olares Market — the release-target requirements matrix, the market-ready metadata/image/arch checklist, the PR to beclab/apps (GitBot rules + lifecycle), and pay-to-download (paid) listings. Use when the user wants to submit / list / distribute / 上架 an app to the public Market, open a beclab/apps PR, or sell a paid app. Authoring and deploying the chart itself lives in olares-chart; this skill is the public-distribution step that comes after the app already installs and runs locally.