Command-line interface for Linkly AI — search your local documents from the terminal.
The CLI connects to the Linkly AI desktop app's MCP server, giving you fast access to your indexed documents without leaving the terminal.
By default, the Linkly AI desktop app must be running with MCP server enabled. The CLI automatically discovers the app via ~/.linkly/port. Alternatively, use LAN mode (--endpoint + --token) or Remote mode (--remote with a saved API key) — see Connection Modes.
curl -sSL https://updater.linkly.ai/cli/install.sh | shirm https://updater.linkly.ai/cli/install.ps1 | iexbrew tap LinklyAI/tap
brew install linklycargo install linkly-ai-cliPre-built binaries for all platforms are available on the Releases page.
| Platform | File |
|---|---|
| macOS (Apple Silicon) | linkly-aarch64-apple-darwin.tar.gz |
| macOS (Intel) | linkly-x86_64-apple-darwin.tar.gz |
| Linux (x86_64) | linkly-x86_64-unknown-linux-gnu.tar.gz |
| Linux (ARM64) | linkly-aarch64-unknown-linux-gnu.tar.gz |
| Windows (x64) | linkly-x86_64-pc-windows-msvc.zip |
cargo install --path .linkly search "machine learning"
linkly search "API design" --limit 5
linkly search "notes" --type pdf,md,docx| Option | Description |
|---|---|
--limit <N> |
Maximum results (default: 20, max: 50) |
--type <types> |
Filter by document types, comma-separated (e.g. pdf,md,docx,txt,html) |
Get structural outlines for one or more documents (IDs come from search results):
linkly outline <doc-id>
linkly outline <id1> <id2> <id3>linkly grep "pattern" <doc-id>
linkly grep "error|warning" <doc-id> -C 3 -i
linkly grep "TODO" <doc-id> --mode count| Option | Description |
|---|---|
-C, --context |
Lines of context before and after each match |
-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 |
--limit |
Maximum matches (default: 20, max: 100) |
linkly read <doc-id>
linkly read <doc-id> --offset 50 --limit 100| Option | Description |
|---|---|
--offset <N> |
Starting line number (1-based) |
--limit <N> |
Number of lines to read (max: 500) |
linkly statusRun as a stdio MCP server for Claude Desktop, Cursor, or other MCP clients:
linkly mcpClaude Desktop configuration (claude_desktop_config.json):
{
"mcpServers": {
"linkly-ai": {
"command": "linkly",
"args": ["mcp"]
}
}
}linkly self-updateThe CLI supports three connection modes:
| Mode | Flags | Auth | How it works |
|---|---|---|---|
| Local | (default) | None (localhost) | Reads ~/.linkly/port, connects to 127.0.0.1 |
| LAN | --endpoint <url> --token <token> |
Bearer token from desktop app | Direct connection to a LAN device |
| Remote | --remote |
API Key via auth set-key |
Connects via https://mcp.linkly.ai tunnel |
Note:
--endpointand--tokenare required together for LAN access and conflict with--remote. For remote access, uselinkly auth set-key. Themcpcommand also accepts--endpointalone (without--token).
# Save your API Key (from https://linkly.ai/dashboard)
linkly auth set-key lkai_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# Search via remote tunnel
linkly search "machine learning" --remote# Connect to another device on the same network (token from desktop Settings → MCP)
linkly search "report" --endpoint http://192.168.1.100:60606/mcp --token your_lan_tokenConnection options (--endpoint, --token, --remote) are available on search, grep, outline, read, and status commands. --endpoint alone is also available on mcp. --json is available on all commands.
| Flag | 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 https://mcp.linkly.ai tunnel (conflicts with --endpoint, requires auth set-key) |
--json |
Global | Output in JSON format (useful for scripting) |
-V, --version |
Global | Print version |
-h, --help |
Global | Print help |
# Local search (default, requires desktop app running)
linkly search "budget report"
# Search across LAN with token
linkly search "budget report" --endpoint http://192.168.1.100:60606/mcp --token abc123
# Search via remote tunnel
linkly search "TODO" --remote
# JSON output for scripting
linkly search "TODO" --json | jq '.content'
# Pipe document content
linkly read abc123 --limit 50 | head -20Apache-2.0