Linkly AI CLI is a command-line tool that connects to Linkly AI Desktop’s MCP service, allowing you to search, browse, and read local documents from the terminal. It also serves as a bridge between AI Agents (such as Claude Desktop, Cursor) and Linkly AI.
Terminal Search
Search your documents directly from the command line — ideal for developers
and power users
MCP Bridge
Run in stdio MCP mode, enabling Claude Desktop, Cursor, and other AI tools
to call Linkly AI
By default, the CLI discovers and connects to the local Linkly AI Desktop app
via ~/.linkly/port. You can also connect to a remote device via LAN or the
cloud tunnel — see Connection Modes below.
The CLI follows a search → grep or outline → read progressive workflow: first search to find target documents, then use grep to find patterns or view the outline to understand the structure, and finally read the specific content. When the user describes a container (“in my Notion notes”, “in my Dropbox papers folder”) whose actual path is unknown, call find-paths before search to discover the path.
Every successful command output ends with a [meta] now=2026-05-08T...Z UTC
timestamp line (or a top-level _meta.now field in JSON mode). This is
metadata Desktop provides to AI assistants for computing relative dates like
“last month” — human users can ignore it; for scripting, you may want to
filter out the last line before further parsing.
Searches your local documents and returns the most relevant results, including title, path, relevance score, and content snippet.Common parameters:
# Limit the number of results (default 20, max 50)linkly search "API design" --limit 5# Filter by document typelinkly search "meeting minutes" --type pdf,docx# Output in JSON format (suitable for scripting)linkly search "budget report" --json# Limit by time window (Q3 2024 quarterly reports)linkly search "quarterly report" --modified-after 2024-07-01 --modified-before 2024-09-30# Sort by time ("the latest", "the earliest" — when there's no fixed window)linkly search "weekly retro" --time-sort newest --limit 5
--modified-after / --modified-before accept ISO 8601 UTC: a bare date
2024-01-01 (treated as 00:00:00Z) or a full RFC 3339 timestamp
2024-01-01T00:00:00Z. --time-sort accepts newest / oldest; omit it to
keep the default BM25 + vector relevance order.
Retrieves the structured outline and metadata of a document. DOC_ID is obtained from search results. You can view multiple documents at once:
linkly outline id1 id2 id3
The outline feature works best with Markdown and DOCX documents, as their
heading structures can be parsed. For plain text or PDFs without bookmarks,
it’s recommended to use the read command directly.
Fuzzy-matches keywords against the file path field of indexed documents, aggregates matches at folder granularity, and returns the top folder candidates. It is positioned as a helper for search: when the user names a container (“in my Notion notes”, “in my Dropbox papers folder”) but you don’t know its on-disk path, call find-paths first, then pass a distinctive segment of the returned path to search as --path-glob. When a folder name contains glob metacharacters (* ? [), use the returned path_glob field directly — it is already escaped to match that folder literally.Two-step workflow:
# Step 1: locate the real pathlinkly find-paths --patterns Notion,notion --limit 5# Suppose it returns .../Documents/Notion-Export-abc/workspace (1240 files)# Step 2: search within that containerlinkly search "shopping receipt" --path-glob "*Notion-Export*"
Variant matching:--patterns takes a comma-separated list of keywords, OR-matched against the path. Pass several variants in one call (translation pairs, casing, real app/SDK identifiers when known) to maximise first-pass recall:
find-paths is a “find folders” tool, not a “find files” tool: only matches
on directory segments count. If keywords match only the filename segment
(an “orphan file”), they are silently dropped. If a query returns zero folders
even though you expect matching files, fall back to calling linkly search
directly without --path-glob.
Runs as a stdio MCP server, exposing Linkly AI’s tools to MCP-compatible AI clients.Configure Claude Desktop and other local AI apps:Add the following to the configuration file of Claude Desktop or similar apps:
Automatically checks for and updates to the latest version. The CLI also checks for updates in the background on each launch and will prompt you to run this command if a new version is available.
linkly search "machine learning" --remotelinkly status --remote
--endpoint and --token are required together for LAN access. They cannot
be combined with --remote. For remote access, use linkly auth set-key to
save your API key.
Connect to a specific MCP endpoint (e.g. http://192.168.1.100:60606/mcp), requires --token
--token <token>
LAN
Bearer token for LAN authentication (required with --endpoint, conflicts with --remote)
--remote
Remote
Connect via cloud tunnel at https://mcp.linkly.ai (conflicts with --endpoint)
--json
All commands
Output in JSON format (suitable for scripting and automation)
-V, --version
—
Display CLI version number
-h, --help
—
Display help information
--endpoint, --token, and --remote are available on search, grep,
outline, read, and status commands. --endpoint alone (without
--token) is also available on the mcp command. --json is available on
all commands.
Filter by document type (comma-separated, e.g. pdf,md,docx)
All
--library <NAME>
Restrict search to a specific library
—
--path-glob <PATTERN>
Filter by file path; substring-matched (may appear anywhere, no leading/trailing * needed). When the actual path is unknown, run linkly find-paths first
—
--modified-after <ISO>
Inclusive lower bound on modification time. ISO 8601 UTC: bare date 2024-01-01 or full 2024-01-01T00:00:00Z
—
--modified-before <ISO>
Inclusive upper bound on modification time. Same format as --modified-after
—
--time-sort <MODE>
Time-based reordering: newest / oldest. Omit to keep relevance ordering
Comma-separated keyword list (required). Multiple keywords are OR-matched; pass several variants in one call (translation pairs, casing). Case-insensitive for ASCII; CJK is literal.