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
--scope notes restricts results to your notes and ignores --library and --path-glob — those filters are silently dropped rather than rejected.View Document Outline
DOC_ID is obtained from search results. You can view multiple documents at once, or pipe the IDs in with -:
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. 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:
--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:
Notes
Linkly AI keeps short Markdown notes in your library folder. They are ordinary local files — never uploaded — and they are indexed like any other document.note_id and current version, both of which linkly list --scope notes returns:
Shell Completions
bash, zsh, fish, powershell or elvish.
- zsh
- bash
- fish
- PowerShell
MCP Mode
Configure Claude Desktop and other local AI apps:
Add the following to the configuration file of Claude Desktop or similar apps:
- 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: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
Exit Codes
By default the CLI uses the conventional two values: 0 on success, 1 on failure. Note that “success” includes finding nothing — a search with no hits still exits 0. Pass--exit-code to tell the two apart:
The flag is opt-in because it changes what
1 means. Without it, 1 is “failed” — which is what existing scripts test for.
