Install
openclaw skills install linkly-aiSearch, browse, and read the user's documents indexed by Linkly AI — both local documents and linked cloud libraries. This skill should be used when the user asks to 'search my documents', 'find files about a topic', 'read a local document', 'search my knowledge base', 'browse document outlines', 'list knowledge libraries', 'explore my documents', 'search a cloud library', or any task involving searching, browsing, or reading stored documents (PDF, Markdown, DOCX, TXT, HTML). Also triggered by: 'linkly not working', 'can not connect to linkly', 'cloud library', 'linked library', '搜索我的文档', '查找文件', '知识库搜索', '云端知识库', '浏览文档大纲', '列出知识库', '连接不上', '故障排查'. Provides full-text search, structural outlines, and paginated reading via CLI or MCP tools.
openclaw skills install linkly-aiLinkly AI indexes documents on the user's local machine (PDF, Markdown, DOCX, TXT, HTML, etc.) and can also reach cloud libraries the user has linked via Linkly Web. It exposes them through a progressive disclosure workflow: search → grep or outline → read.
Before executing any document operation, detect what's available and pick a mode. CLI and MCP are two independent access paths — check both, don't treat MCP as a CLI fallback.
Run both checks independently (skip a check if its prerequisite isn't there):
linkly --version. Success → CLI is installed. Then run linkly status to confirm the desktop app is reachable; if the status reports a connection problem, run linkly doctor (see references/troubleshooting.md).search, find_paths, outline, grep, read, list_libraries, and explore are accessible in the current environment. They may come from the linkly-ai server (local Desktop MCP) or the linkly-ai-cloud server (the mcp.linkly.ai cloud gateway, which exposes both local and linked cloud libraries).| Available | Action |
|---|---|
| Both CLI and MCP | Prefer CLI mode — clearer error messages and exit codes are easier to surface back to the user. |
| CLI only | Use CLI mode. |
| MCP only | Use MCP mode. This is the normal state for sandboxed agent environments such as Claude Code, Typeless, or Cursor with a restricted shell — the desktop app and MCP integration are fully configured but the CLI binary isn't installed inside the sandbox. Don't tell the user to install the CLI; MCP is sufficient. |
| Neither | If Bash works, recommend installing the CLI: Install Linkly AI CLI. Otherwise inform the user that Linkly AI requires either the CLI or the MCP integration and stop. |
Cloud vs local availability: cloud-library tasks work even when the desktop is offline — both CLI
--remoteand thelinkly-ai-cloudMCP gateway reach cloud content directly. Only local content needs the desktop online; a local / default-scope call made while the desktop is offline returns an error with reconnect guidance. If you have no path to Linkly at all (neither CLI nor an MCP connection), tell the user instead of retrying.
The CLI supports three connection modes:
~/.linkly/port. Requires the app to be running locally.--endpoint <url> --token <token> to connect to a Linkly AI instance on the local network.--remote to connect via the https://mcp.linkly.ai tunnel, reaching both your local and linked cloud libraries. Cloud libraries are served by the gateway and stay reachable even when the desktop is offline; only local / default-scope calls need the desktop online (an offline local call returns a gateway error with reconnect guidance, not a client-side abort). Requires prior setup: linkly auth set-key <api-key>.See references/mcp-tools-reference.md for MCP parameter schemas and response formats.
When the user names a container by a fuzzy or cross-language word — folder, app, project, repo, or cloud drive (e.g. "in my WeChat", "in my Notion notes", "in the linkly-ai repo", "in my iCloud Drive") — and you don't yet know the on-disk path, run find_paths first. Pass several variants in a single call, then pipe a distinctive segment of any returned folder path into linkly search as --path-glob. This also works inside a Linkly cloud library; candidates there carry a cloud://owner/slug reference to pass to the follow-up search's library (see references/mcp-tools-reference.md).
linkly find-paths --patterns WeChat,微信,wxid --limit 5
linkly search "购物订单" --path-glob "*xinWeChat*"
Skip this step for pure content queries ("find resumes"), file-type filters (use search --type pdf directly), or queries with no container intent.
Zero-directory fallback: if find_paths returns 0 directories, the patterns may have only matched filenames, not directory segments — fall back to linkly search directly (without --path-glob); the filename BM25 field will still pick those up.
For aggregation behaviour and the full when-to-use matrix, see references/search-strategies.md ("Locate the container first") and references/mcp-tools-reference.md (find_paths).
Find documents matching a query. Always start here — never guess document IDs.
linkly search "query keywords" --limit 10
linkly search "machine learning" --type pdf,md --limit 5
linkly search "API design" --library my-research --limit 10
linkly search "notes" --path-glob "*meeting-notes*"
linkly search "Q3 report" --modified-after 2024-07-01 --modified-before 2024-09-30
linkly search "weekly retro" --time-sort newest --limit 5
linkly search "购物订单" --path-glob "*xinWeChat*" --time-sort newest --limit 5
Search uses BM25 + vector hybrid retrieval (OR logic for keywords, semantic matching for meaning). For advanced query strategies, see references/search-strategies.md.
Tips:
--type filter when the user mentions a specific format.--library only when the user explicitly specifies a library name.--path-glob to filter by file path patterns (SQLite GLOB syntax, always case-sensitive). When the actual path is unknown, run Step 0 (find_paths) first.--modified-after / --modified-before (ISO 8601 UTC) for explicit windows like "in 2024" / "after July 1, 2024"; --time-sort newest|oldest|default for "most recent / earliest" without a fixed window (default or omitting the flag both keep relevance ordering). See "Tool Response Metadata" below for how to derive relative dates.doc_id — save these verbatim for subsequent steps. They are opaque strings (e.g. local://1044, or cloud://owner/slug/... for cloud documents); never reshape or strip them.Don't: guess --path-glob when the user names a fuzzy container — run find_paths (Step 0) first to get the real on-disk path.
Silent-drop check: if you used --modified-after / --modified-before / --time-sort and the response has no [meta] now= footer (Markdown) or _meta.now field (JSON), the desktop app is below v0.4.1 and silently dropped your filter. Run linkly status to confirm and ask the user to update — see references/troubleshooting.md ("Desktop app version outdated").
Get structural overviews of documents before reading.
linkly outline <ID>
linkly outline <ID1> <ID2> <ID3>
Don't mix backends: a single outline call must contain only local IDs or only cloud IDs, never both. After a mixed local + cloud search, split the IDs into separate outline calls — mixing them returns a conflict error.
When to use: The document has has_outline: true and is longer than ~50 lines.
When to skip: The document is short (<50 lines) or has has_outline: false — use grep to find specific patterns or go directly to read.
Search for exact regex pattern matches within specific documents.
linkly grep "pattern" <ID>
linkly grep "function_name" <ID> -C 3
linkly grep "error|warning" <ID> -i --mode count
When to use: You need to find specific text (names, dates, terms, identifiers, or any pattern) within known documents. When you already know the exact text to find, grep is more precise than search.
When to skip: You need to understand the overall document structure — use outline instead.
Read document content with line numbers and pagination.
linkly read <ID>
linkly read <ID> --offset 50 --limit 100
Reading strategies:
offset by limit on each call (e.g., offset=1 limit=200, then offset=201 limit=200).Don't: call read without first running search to obtain a real doc_id. Document IDs are stable but never invented — guessing one returns "Document not found".
Every successful tool response carries now (ISO 8601 UTC) so you can compute relative dates ("last 7 days", "after July 1, 2024", "in 2024") without guessing from training cutoff:
[meta] now=<iso>_meta.nowErrors don't carry this. When the user phrases a relative date, take the most recent now you've seen and do the date math before passing --modified-after / --modified-before to linkly search. First-call bootstrap: if you have no prior tool response yet (e.g. the user opened with "find files from last month"), run a tiny linkly search "anything" --limit 1 first purely to capture now from the meta footer, then issue the real query. See references/mcp-tools-reference.md ("Response Metadata") for the exact format.
Libraries let you scope a search to one knowledge domain. There are two kinds:
local://<id> (a plain library name also works, for backward compatibility).cloud://<owner>/<slug> (the two-segment owner/slug form is required; a single segment is rejected).Call list_libraries to discover both kinds and their identifiers — it is the only way to learn a cloud library's cloud://owner/slug.
--library my-researchlist_libraries, then scope with library="cloud://<owner>/<slug>"list_libraries (lists both local and cloud)libraryDefault scope: when library is omitted, the search covers all your local indexed content only — cloud libraries are never included by default. To search a cloud library you must name it explicitly.
Reaching cloud libraries: the linkly-ai-cloud MCP gateway (e.g. an OAuth connector in ChatGPT / Claude.ai) and the CLI's --remote both serve cloud content directly — the desktop need not be online for cloud libraries. (Local content still requires the desktop online; an offline local call returns a gateway error with reconnect guidance.)
linkly list-libraries
linkly search "deep learning" --library my-research --limit 10
The explore tool provides a bird's-eye overview of all indexed documents or a specific library. It returns document type distribution, directory structure with file counts, top keywords with source attribution, and recent activity (directories with changes in the last 7 days) — without reading any document content. For a cloud library (library="cloud://<owner>/<slug>"), it also returns the library's README (if present) before the overview.
linkly explore
linkly explore --library my-research
When to use:
When NOT to use: The user already knows what they're looking for — go directly to Search.
After getting an overview, use the top keywords, directory names, and recent activity from the explore output to craft targeted search queries with search.
When users report connection issues, search failures, or other problems with Linkly AI:
linkly doctor to diagnose. It checks port file, HTTP connectivity, app status, and MCP round-trip. Share the output with the user and follow the advice printed for each failing check.cloud://owner/slug id with list_libraries.For detailed troubleshooting steps, see references/troubleshooting.md.
grep instead of scanning with outline + read.explore first, then follow up with targeted searches based on the keywords and directories it reveals.--library when the user explicitly requests it.--json for search, default output for read. JSON output is easier to scan programmatically when processing many search results; default Markdown output is more readable when displaying document content to the user.linkly doctor and inform the user with actionable next steps.find_paths before search; pipe a distinctive segment into --path-glob.now from response metadata for relative dates. Use [meta] now= (Markdown) or _meta.now (JSON); never guess the current date from training cutoff.references/cli-reference.md — CLI installation, all commands, and options.references/mcp-tools-reference.md — MCP tool schemas, parameters, and response formats.references/search-strategies.md — Advanced query crafting, multi-round search, and complex retrieval patterns.references/troubleshooting.md — Diagnosing and resolving connection and search issues.