Documentation Index
Fetch the complete documentation index at: https://linkly.ai/docs/llms.txt
Use this file to discover all available pages before exploring further.
Introduction to Linkly AI CLI
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
Installation
- macOS / Linux
- Windows
- Cargo
Run in your terminal:Or install via Homebrew:
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.Usage
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, callfind-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.Check Connection Status
Search Documents
View Document Outline
DOC_ID is obtained from search results. You can view multiple documents at once:
Search Patterns in Documents
Read Document Content
--offset to read progressively:
Find Paths (find-paths)
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.
Two-step workflow:
--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:
MCP Mode
- macOS / Linux
- Windows
Edit
~/.config/Claude/claude_desktop_config.json:- Name:
linkly-ai - Command:
linkly mcp
Update CLI
Connection Modes
The CLI supports three ways to connect to your Linkly AI knowledge base:| Mode | Flags | How it works |
|---|---|---|
| Local | (default, no flags needed) | Auto-discovers the desktop app via ~/.linkly/port |
| LAN | --endpoint <url> --token <token> | Direct connection to another device on the local network |
| Remote | --remote | Connects via https://mcp.linkly.ai cloud tunnel using API Key |
Local Mode (default)
No extra flags needed. The CLI reads~/.linkly/port to find the running desktop app:
LAN Mode
Connect to a Linkly AI instance running on another device in your local network. The token can be found in the desktop app under Settings → MCP:Remote Mode
Connect to your knowledge base from anywhere via the cloud tunnel. First, save your API key (from linkly.ai/dashboard):--remote with any command:
Parameter Reference
Global Options
| Option | Scope | Description |
|---|---|---|
--endpoint <URL> | LAN | 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 |
search Parameters
| Parameter | Description | Default |
|---|---|---|
<QUERY> | Search keywords or phrase (required) | — |
--limit <N> | Maximum number of results (1-50) | 20 |
--type <TYPES> | 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 (SQLite GLOB syntax). 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 | — |
find-paths Parameters
| Parameter | Description | Default |
|---|---|---|
--patterns <LIST> | 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. | — |
--library <NAME> | Restrict to a specific library | — |
--limit <N> | Maximum number of candidate folders (1-50) | 10 |
outline Parameters
| Parameter | Description | Default |
|---|---|---|
<ID...> | Document ID (required, supports multiple) | — |
grep Parameters
| Parameter | Description | Default |
|---|---|---|
<PATTERN> | Regular expression pattern (required) | — |
<DOC_ID> | Document ID to search (required) | — |
-C, --context | Lines of context before and after | 3 |
-B, --before | Lines of context before each match | — |
-A, --after | Lines of context after each match | — |
-i | Case-insensitive matching | — |
--mode | Output mode: content or count | content |
--limit | Maximum matches (max 100) | 20 |
--offset | Number of matches to skip | 0 |
--fuzzy-whitespace | Fuzzy whitespace matching: true to force on, false to force off, omit for auto (PDF on, others off) | auto |
read Parameters
| Parameter | Description | Default |
|---|---|---|
<ID> | Document ID (required) | — |
--offset <N> | Starting line number (from 1) | 1 |
--limit <N> | Number of lines to read (max 500) | 200 |

