LSP Indexing CLI Reference

March 8, 2026 · View on GitHub

This document provides comprehensive documentation for all CLI commands related to Probe's LSP indexing system.

Command Overview

Probe's LSP indexing functionality is accessible through several command groups:

probe [GLOBAL_OPTIONS] COMMAND [COMMAND_OPTIONS]

Global LSP Options

These options can be used with any command that supports LSP features:

OptionTypeDefaultDescription
--lspFlagfalseEnable LSP features for this command
--lsp-timeout <MS>Integer30000Request timeout in milliseconds
--lsp-no-cacheFlagfalseDisable caching for this request
--lsp-socket <PATH>StringAutoCustom daemon socket path

Core Commands

probe extract (with LSP)

Extract code with enhanced LSP information including call hierarchy.

probe extract <FILE_PATH>#<SYMBOL> --lsp [OPTIONS]

Arguments

ArgumentRequiredDescription
<FILE_PATH>YesPath to source file
<SYMBOL>YesSymbol name (function, class, etc.)

Options

OptionTypeDefaultDescription
--lspFlagfalseEnable LSP call hierarchy extraction
--output <FORMAT>StringtextOutput format: text, json, xml
--context-lines <N>Integer5Additional context lines around symbol
--include-testsFlagfalseInclude test files in call hierarchy
--max-depth <N>Integer3Maximum call hierarchy depth

Examples

# Basic LSP extraction
probe extract src/auth.rs#authenticate --lsp

# JSON output for programmatic use
probe extract src/calculator.rs#calculate --lsp --output json

# Extended context with test inclusion
probe extract src/api.rs#handle_request --lsp \
  --context-lines 10 \
  --include-tests \
  --max-depth 5

# No caching for debugging
probe extract src/main.rs#main --lsp --lsp-no-cache

Sample Output

$ probe extract src/calculator.rs#add --lsp

File: src/calculator.rs
Lines: 15-20
Type: function
Language: Rust

LSP Information:
  Incoming Calls:
    - calculate_total (src/billing.rs:42)
    - run_computation (src/main.rs:28)
    - test_addition (tests/calc_test.rs:15)
  
  Outgoing Calls:
    - validate_input (src/validation.rs:10)
    - log_operation (src/logging.rs:5)

fn add(a: i32, b: i32) -> i32 {
    validate_input(a, b);
    let result = a + b;
    log_operation("add", &[a, b], result);
    result
}

probe search (with LSP)

Enhanced search with LSP symbol information.

probe search <QUERY> [PATH] --lsp [OPTIONS]

Arguments

ArgumentRequiredDescription
<QUERY>YesSearch query using elastic search syntax
<PATH>NoDirectory to search (default: current)

Options

OptionTypeDefaultDescription
--lspFlagfalseEnrich results with LSP information
--max-results <N>Integer50Maximum number of results
--language <LANG>StringAllFilter by language
--symbol-type <TYPE>StringAllFilter by symbol type
--include-call-infoFlagfalseInclude incoming/outgoing call counts

Examples

# Search with LSP enrichment
probe search "authenticate" src/ --lsp

# Filter by symbol type
probe search "handler" --lsp --symbol-type function

# Include call hierarchy statistics
probe search "calculate" --lsp --include-call-info --max-results 20

LSP Daemon Commands

probe lsp status

Display daemon status and workspace information.

probe lsp status [OPTIONS]

Options

OptionTypeDefaultDescription
--detailedFlagfalseShow detailed server and cache statistics
--memoryFlagfalseInclude memory usage information
--jsonFlagfalseOutput in JSON format
--refreshFlagfalseForce refresh of cached status

Examples

# Basic status
probe lsp status

# Detailed status with memory info
probe lsp status --detailed --memory

# JSON output for scripts
probe lsp status --json

Sample Output

$ probe lsp status --detailed

LSP Daemon Status: Running
Uptime: 2h 34m 12s
PID: 12345
Socket: /tmp/probe-lsp-daemon.sock
Memory Usage: 156 MB

Active Language Servers: 3
 rust-analyzer (2 workspaces, ready)
 typescript-language-server (1 workspace, ready)  
 pylsp (1 workspace, ready)

Workspaces (4 total):
  /home/user/rust-project (Rust) - Ready
  /home/user/web-app/frontend (TypeScript) - Ready
  /home/user/web-app/backend (Rust) - Ready
  /home/user/scripts (Python) - Ready

Cache Statistics:
  Call Hierarchy: 1,243 entries (89% hit rate)
  Definitions: 856 entries (92% hit rate)
  References: 432 entries (85% hit rate)
  Hover: 234 entries (94% hit rate)
  Total Memory: 45 MB

Recent Activity:
  Requests (last hour): 127
  Average Response Time: 15ms
  Errors (last hour): 2

probe lsp start

Start the LSP daemon.

probe lsp start [OPTIONS]

Options

OptionTypeDefaultDescription
-f, --foregroundFlagfalseRun in foreground (don't daemonize)
--log-level <LEVEL>StringinfoLog level: error, warn, info, debug, trace
--socket <PATH>StringAutoCustom socket path
--max-connections <N>Integer100Maximum concurrent connections
--cache-size <N>Integer500Cache entries per operation type
--cache-ttl <SECONDS>Integer1800Cache TTL in seconds
--memory-limit <MB>IntegerNoneMemory limit in megabytes
--config <PATH>StringAutoConfiguration file path

Examples

# Start daemon with default settings
probe lsp start

# Development mode (foreground with debug logging)
probe lsp start -f --log-level debug

# Production configuration
probe lsp start \
  --cache-size 2000 \
  --cache-ttl 7200 \
  --memory-limit 1024 \
  --max-connections 200

# Custom socket path
probe lsp start --socket /var/run/probe-lsp.sock

probe lsp restart

Restart the LSP daemon.

probe lsp restart [OPTIONS]

Options

OptionTypeDefaultDescription
--timeout <SECONDS>Integer30Shutdown timeout
--preserve-cacheFlagfalseKeep cache during restart
--waitFlagtrueWait for restart to complete

Examples

# Basic restart
probe lsp restart

# Quick restart with cache preservation
probe lsp restart --preserve-cache --timeout 10

# Restart without waiting
probe lsp restart --no-wait

probe lsp shutdown

Stop the LSP daemon.

probe lsp shutdown [OPTIONS]

Options

OptionTypeDefaultDescription
--timeout <SECONDS>Integer30Graceful shutdown timeout
--forceFlagfalseForce shutdown (SIGKILL)
--cleanupFlagtrueClean up socket and cache files

Examples

# Graceful shutdown
probe lsp shutdown

# Force shutdown with cleanup
probe lsp shutdown --force --cleanup

# Quick shutdown
probe lsp shutdown --timeout 5

Direct LSP Operations

Probe provides direct access to all LSP operations through the probe lsp call command family, offering IDE-level code intelligence from the command line.

probe lsp call definition

Find the definition of a symbol.

probe lsp call definition <LOCATION> [OPTIONS]

Arguments

ArgumentRequiredDescription
<LOCATION>YesLocation in format file:line:column or file#symbol

Options

OptionTypeDefaultDescription
--output <FORMAT>StringtextOutput format: text, json
--workspace-hint <PATH>StringAutoWorkspace root hint for context

Examples

# Find definition by line:column
probe lsp call definition src/main.rs:42:10

# Find definition by symbol name
probe lsp call definition src/main.rs#main_function

# JSON output
probe lsp call definition src/auth.rs#authenticate --output json

probe lsp call references

Find all references to a symbol.

probe lsp call references <LOCATION> [OPTIONS]

Arguments

ArgumentRequiredDescription
<LOCATION>YesLocation in format file:line:column or file#symbol

Options

OptionTypeDefaultDescription
--include-declarationFlagfalseInclude the declaration/definition in results
--output <FORMAT>StringtextOutput format: text, json
--workspace-hint <PATH>StringAutoWorkspace root hint for context

Examples

# Find references without declaration
probe lsp call references src/api.rs:25:8

# Include declaration in results
probe lsp call references src/auth.rs#validate_user --include-declaration

# JSON output for scripting
probe lsp call references src/types.rs#UserAccount --output json

probe lsp call hover

Get hover information (documentation, types) for a symbol.

probe lsp call hover <LOCATION> [OPTIONS]

Arguments

ArgumentRequiredDescription
<LOCATION>YesLocation in format file:line:column or file#symbol

Options

OptionTypeDefaultDescription
--output <FORMAT>StringtextOutput format: text, json, markdown
--workspace-hint <PATH>StringAutoWorkspace root hint for context

Examples

# Get hover information
probe lsp call hover src/lib.rs:18:5

# Get hover by symbol name
probe lsp call hover src/types.rs#UserAccount

# Markdown format for documentation
probe lsp call hover src/api.rs#process_request --output markdown

probe lsp call document-symbols

List all symbols in a document.

probe lsp call document-symbols <FILE> [OPTIONS]

Arguments

ArgumentRequiredDescription
<FILE>YesFile path to analyze

Options

OptionTypeDefaultDescription
--output <FORMAT>StringtextOutput format: text, json, tree
--symbol-type <TYPE>StringAllFilter by symbol type
--workspace-hint <PATH>StringAutoWorkspace root hint for context

Examples

# List all symbols in file
probe lsp call document-symbols src/lib.rs

# Filter by symbol type
probe lsp call document-symbols src/main.rs --symbol-type function

# Tree view output
probe lsp call document-symbols src/types.rs --output tree

probe lsp call workspace-symbols

Search for symbols across the workspace.

probe lsp call workspace-symbols <QUERY> [OPTIONS]

Arguments

ArgumentRequiredDescription
<QUERY>YesSymbol search query

Options

OptionTypeDefaultDescription
--max-results <N>Integer50Maximum number of results
--output <FORMAT>StringtextOutput format: text, json
--workspace-hint <PATH>StringAutoWorkspace root hint for context

Examples

# Search for symbols containing "user"
probe lsp call workspace-symbols "user"

# Limit results
probe lsp call workspace-symbols "auth" --max-results 10

# JSON output for processing
probe lsp call workspace-symbols "handler" --output json

probe lsp call call-hierarchy

Get call hierarchy information for a symbol.

probe lsp call call-hierarchy <LOCATION> [OPTIONS]

Arguments

ArgumentRequiredDescription
<LOCATION>YesLocation in format file:line:column or file#symbol

Options

OptionTypeDefaultDescription
--output <FORMAT>StringtextOutput format: text, json, graph
--max-depth <N>Integer5Maximum call hierarchy depth
--workspace-hint <PATH>StringAutoWorkspace root hint for context

Examples

# Get call hierarchy
probe lsp call call-hierarchy src/calculator.rs#calculate

# Limit depth for complex hierarchies
probe lsp call call-hierarchy src/main.rs:42:10 --max-depth 3

# Graph format output
probe lsp call call-hierarchy src/api.rs#handle_request --output graph

probe lsp call implementations

Find all implementations of an interface or trait.

probe lsp call implementations <LOCATION> [OPTIONS]

Arguments

ArgumentRequiredDescription
<LOCATION>YesLocation in format file:line:column or file#symbol

Options

OptionTypeDefaultDescription
--output <FORMAT>StringtextOutput format: text, json
--workspace-hint <PATH>StringAutoWorkspace root hint for context

Examples

# Find trait implementations
probe lsp call implementations src/traits.rs#Display

# Find interface implementations
probe lsp call implementations src/interfaces.ts:15:8

probe lsp call type-definition

Go to the type definition of a symbol.

probe lsp call type-definition <LOCATION> [OPTIONS]

Arguments

ArgumentRequiredDescription
<LOCATION>YesLocation in format file:line:column or file#symbol

Options

OptionTypeDefaultDescription
--output <FORMAT>StringtextOutput format: text, json
--workspace-hint <PATH>StringAutoWorkspace root hint for context

Examples

# Find type definition
probe lsp call type-definition src/main.rs:42:10

# Type definition by symbol
probe lsp call type-definition src/types.rs#user_variable

Cache Management

The LSP daemon provides comprehensive cache management commands for the persistent cache system.

Workspace Cache Commands

probe lsp cache list

List all workspace caches.

probe lsp cache list [OPTIONS]
Options
OptionTypeDefaultDescription
--detailedFlagfalseShow detailed information for each workspace cache
--format <FORMAT>StringterminalOutput format: terminal, json
Examples
# List all workspace caches
probe lsp cache list

# Detailed view
probe lsp cache list --detailed

# JSON output
probe lsp cache list --format json

probe lsp cache info

Show detailed information about workspace caches.

probe lsp cache info [OPTIONS]
Options
OptionTypeDefaultDescription
--workspace <PATH>StringAllWorkspace path to get info for
--format <FORMAT>StringterminalOutput format: terminal, json
Examples
# Info for all workspaces
probe lsp cache info

# Info for specific workspace
probe lsp cache info --workspace /path/to/project

# JSON format
probe lsp cache info --format json

probe lsp cache clear-workspace

Clear workspace caches.

probe lsp cache clear-workspace [OPTIONS]
Options
OptionTypeDefaultDescription
--workspace <PATH>StringAllWorkspace path to clear (all if not specified)
--forceFlagfalseForce clear without confirmation
--format <FORMAT>StringterminalOutput format: terminal, json
Examples
# Clear specific workspace cache
probe lsp cache clear-workspace --workspace /path/to/project

# Clear all workspace caches with confirmation
probe lsp cache clear-workspace

# Force clear without confirmation
probe lsp cache clear-workspace --force

Global Cache Commands

probe lsp cache stats

Display detailed cache performance statistics and information.

probe lsp cache stats [OPTIONS]

Options

OptionTypeDefaultDescription
--detailedFlagfalseShow detailed statistics including file breakdown
--git-infoFlagfalseInclude git-related cache information
--jsonFlagfalseOutput in JSON format
--operation <TYPE>StringAllShow stats for specific operation type

Examples

# Basic cache statistics
probe lsp cache stats

# Detailed view with git information
probe lsp cache stats --detailed --git-info

# JSON output for programmatic use
probe lsp cache stats --json

# Statistics for specific operation
probe lsp cache stats --operation CallHierarchy

Sample Output

$ probe lsp cache stats --detailed

=== LSP Cache Statistics ===

Performance Overview:
  Cache Hit Rate: 89.3% (4,127 hits / 4,622 requests)
  Average Response Time: 2.1ms
  Total Cache Size: 1,847 entries
  Memory Usage: 127 MB

Layer Performance:
  L1 (Memory):     78% hit rate, <1ms avg
  L2 (Persistent): 11% hit rate, 3ms avg  
  L3 (LSP Server): 11% miss rate, 487ms avg

Persistent Cache:
  Database Size: 245 MB
  Total Files Tracked: 1,203
  Git Commits Tracked: 47
  Oldest Entry: 12 days ago
  Cleanup Due: In 18 days

Operation Breakdown:
  CallHierarchy: 2,341 entries (87% hit rate)
  Definition:    1,204 entries (92% hit rate)
  References:      892 entries (85% hit rate)
  Hover:           410 entries (94% hit rate)

Recent Performance (last hour):
  Requests: 234
  Cache Hits: 198 (84.6%)
  Average Response: 1.8ms
  Peak Memory: 142 MB

probe lsp cache clear

Clear cache data with fine-grained control options.

probe lsp cache clear [OPTIONS]

Options

OptionTypeDefaultDescription
--operation <TYPE>StringAllClear specific operation type
--file <PATH>StringAllClear cache for specific file
--branch <BRANCH>StringAllClear cache for specific git branch
--older-than <DAYS>IntegerAllClear entries older than N days
--memory-onlyFlagfalseClear only in-memory cache
--persistent-onlyFlagfalseClear only persistent cache
--dry-runFlagfalseShow what would be cleared
--forceFlagfalseSkip confirmation prompts

Operation Types

  • CallHierarchy - Call hierarchy information
  • Definition - Go-to-definition data
  • References - Find references data
  • Hover - Hover information
  • WorkspaceSymbols - Workspace symbol data

Examples

# Clear all cache data
probe lsp cache clear

# Clear specific operation type
probe lsp cache clear --operation CallHierarchy

# Clear cache for specific file
probe lsp cache clear --file src/main.rs

# Clear old entries (older than 30 days)
probe lsp cache clear --older-than 30

# Clear git branch-specific cache
probe lsp cache clear --branch feature/new-api

# Clear only memory cache (keep persistent)
probe lsp cache clear --memory-only

# Dry run to see what would be cleared
probe lsp cache clear --older-than 7 --dry-run

# Force clear without confirmation
probe lsp cache clear --force

probe lsp cache export

Export cache data for sharing or backup purposes.

probe lsp cache export <OUTPUT_FILE> [OPTIONS]

Arguments

ArgumentRequiredDescription
<OUTPUT_FILE>YesOutput file path (will be compressed)

Options

OptionTypeDefaultDescription
--operation <TYPE>StringAllExport specific operation type
--include-git-metadataFlagfalseInclude git branch/commit info
--compression-level <N>Integer6Gzip compression level (0-9)
--format <FORMAT>StringbinaryExport format: binary, json
--filter-branch <BRANCH>StringAllExport only specific branch
--newer-than <DAYS>IntegerAllExport entries newer than N days

Examples

# Export entire cache
probe lsp cache export team-cache.gz

# Export with git metadata
probe lsp cache export full-cache.gz --include-git-metadata

# Export specific operation type
probe lsp cache export call-hierarchy.gz --operation CallHierarchy

# Export in JSON format
probe lsp cache export cache-backup.json.gz --format json

# Export recent entries only
probe lsp cache export recent-cache.gz --newer-than 7

# Export specific branch cache
probe lsp cache export feature-cache.gz --filter-branch feature/new-api

probe lsp cache import

Import previously exported cache data.

probe lsp cache import <INPUT_FILE> [OPTIONS]

Arguments

ArgumentRequiredDescription
<INPUT_FILE>YesInput cache file path

Options

OptionTypeDefaultDescription
--mergeFlagtrueMerge with existing cache
--replaceFlagfalseReplace existing cache
--filter-operation <TYPE>StringAllImport only specific operation type
--validateFlagtrueValidate cache integrity
--dry-runFlagfalseShow what would be imported
--skip-git-checkFlagfalseSkip git compatibility checks

Examples

# Import shared team cache
probe lsp cache import team-cache.gz

# Replace existing cache completely
probe lsp cache import backup.gz --replace

# Import only call hierarchy data
probe lsp cache import cache.gz --filter-operation CallHierarchy

# Dry run to validate import
probe lsp cache import cache.gz --dry-run

# Import without git validation
probe lsp cache import external-cache.gz --skip-git-check

probe lsp cache compact

Optimize persistent cache database storage.

probe lsp cache compact [OPTIONS]

Options

OptionTypeDefaultDescription
--aggressiveFlagfalsePerform aggressive compaction
--vacuumFlagtrueReclaim unused space
--defragmentFlagfalseDefragment database files
--backupFlagtrueCreate backup before compaction

Examples

# Standard compaction
probe lsp cache compact

# Aggressive compaction with defragmentation
probe lsp cache compact --aggressive --defragment

# Compact without backup (faster)
probe lsp cache compact --no-backup

Sample Output

$ probe lsp cache compact --aggressive

=== Cache Compaction ===

Pre-compaction Analysis:
  Database Size: 245 MB
  Unused Space: 67 MB (27.3%)
  Fragmentation: 18.2%
  
Performing compaction...
 Creating backup: cache.backup.db
 Compacting nodes tree (89% complete)
 Compacting file index (94% complete)  
 Compacting git index (100% complete)
 Reclaiming space (100% complete)

Post-compaction Results:
  Database Size: 178 MB (27% reduction)
  Unused Space: 8 MB (4.5%)
  Fragmentation: 2.1%
  Space Reclaimed: 67 MB
  
Compaction completed in 3.2 seconds

probe lsp cache cleanup

Remove expired and unused cache entries.

probe lsp cache cleanup [OPTIONS]

Options

OptionTypeDefaultDescription
--max-age <DAYS>Integer30Remove entries older than N days
--max-size <MB>IntegerNoneTrim cache to maximum size
--remove-orphanedFlagtrueRemove entries for deleted files
--dry-runFlagfalseShow what would be cleaned
--forceFlagfalseSkip confirmation prompts

Examples

# Standard cleanup (30 days)
probe lsp cache cleanup

# Aggressive cleanup (7 days)
probe lsp cache cleanup --max-age 7

# Size-based cleanup
probe lsp cache cleanup --max-size 100

# Cleanup orphaned entries only
probe lsp cache cleanup --remove-orphaned --max-age 0

# Dry run to see cleanup impact
probe lsp cache cleanup --max-age 14 --dry-run

Workspace Management

probe lsp init-workspaces

Initialize language servers for discovered workspaces.

probe lsp init-workspaces <PATH> [OPTIONS]

Arguments

ArgumentRequiredDescription
<PATH>YesRoot path to scan for workspaces

Options

OptionTypeDefaultDescription
-r, --recursiveFlagfalseScan directories recursively
-l, --languages <LANGS>StringAllComma-separated language list
--timeout <SECONDS>Integer30Initialization timeout per workspace
--parallelFlagtrueInitialize workspaces in parallel
--forceFlagfalseForce re-initialization
--dry-runFlagfalseShow what would be initialized

Supported Languages

  • rust - Rust projects (Cargo.toml)
  • typescript - TypeScript/JavaScript projects (package.json)
  • python - Python projects (pyproject.toml, setup.py)
  • go - Go projects (go.mod)
  • java - Java projects (pom.xml, build.gradle)
  • cpp - C/C++ projects (compile_commands.json)

Examples

# Initialize all workspaces in current directory
probe lsp init-workspaces .

# Recursive initialization
probe lsp init-workspaces /home/user/projects --recursive

# Initialize only specific languages
probe lsp init-workspaces . --languages rust,typescript,python

# Dry run to see what would be initialized
probe lsp init-workspaces . --recursive --dry-run

# Sequential initialization for debugging
probe lsp init-workspaces . --recursive --no-parallel --timeout 60

# Force re-initialization
probe lsp init-workspaces . --force

Sample Output

$ probe lsp init-workspaces . --recursive

Discovering workspaces in: /home/user/projects
Scanning recursively...

Found 5 workspaces:
 /home/user/projects/rust-app (Rust)
 /home/user/projects/web-frontend (TypeScript)
 /home/user/projects/api-server (Rust)
 /home/user/projects/scripts (Python)
 /home/user/projects/mobile-app (TypeScript)

Initializing language servers...
 rust-analyzer for /home/user/projects/rust-app (3.2s)
 typescript-language-server for /home/user/projects/web-frontend (2.1s)
 rust-analyzer for /home/user/projects/api-server (1.8s)
 pylsp for /home/user/projects/scripts (1.5s)
 typescript-language-server for /home/user/projects/mobile-app (2.3s)

Summary:
  Initialized: 5 workspaces
  Languages: rust (2), typescript (2), python (1)
  Total time: 4.2s
  Errors: 0

probe lsp workspaces

List and manage registered workspaces.

probe lsp workspaces [SUBCOMMAND] [OPTIONS]

Subcommands

SubcommandDescription
listList all registered workspaces (default)
add <PATH> <LANGUAGE>Manually add a workspace
remove <PATH>Remove a workspace
refresh <PATH>Refresh workspace state

Options for list

OptionTypeDefaultDescription
--language <LANG>StringAllFilter by language
--status <STATUS>StringAllFilter by status
--jsonFlagfalseJSON output
--detailedFlagfalseShow detailed information

Examples

# List all workspaces
probe lsp workspaces list

# List only Rust workspaces
probe lsp workspaces list --language rust

# Detailed workspace information
probe lsp workspaces list --detailed

# Add workspace manually
probe lsp workspaces add /path/to/project rust

# Remove workspace
probe lsp workspaces remove /path/to/project

# Refresh workspace state
probe lsp workspaces refresh /path/to/project

Logging and Monitoring

probe lsp logs

View and follow LSP daemon logs.

probe lsp logs [OPTIONS]

Options

OptionTypeDefaultDescription
-n, --lines <N>Integer50Number of recent log entries
-f, --followFlagfalseFollow logs in real-time
--level <LEVEL>StringAllFilter by log level
--grep <PATTERN>StringNoneFilter by regex pattern
--since <TIME>StringNoneShow logs since timestamp
--jsonFlagfalseOutput in JSON format
--no-colorFlagfalseDisable colored output

Log Levels

  • error - Error conditions
  • warn - Warning messages
  • info - Informational messages
  • debug - Debug information
  • trace - Detailed tracing

Examples

# View recent logs
probe lsp logs

# Follow logs in real-time
probe lsp logs --follow

# View only errors
probe lsp logs --level error -n 100

# Filter by pattern
probe lsp logs --grep "rust-analyzer" -n 200

# Logs since specific time
probe lsp logs --since "2024-01-01 10:00:00"

# JSON output for processing
probe lsp logs --json -n 1000 | jq '.[] | select(.level == "error")'

Sample Output

$ probe lsp logs -n 10

2024-01-15 14:30:15.123 INFO  [lsp_daemon] Starting LSP daemon on socket /tmp/probe-lsp-daemon.sock
2024-01-15 14:30:15.124 INFO  [server_manager] Registered rust-analyzer for language Rust
2024-01-15 14:30:15.125 INFO  [server_manager] Registered typescript-language-server for language TypeScript
2024-01-15 14:30:16.200 INFO  [workspace_resolver] Discovered workspace: /home/user/rust-project (Rust)
2024-01-15 14:30:17.156 INFO  [call_graph_cache] Cache HIT for calculate_total at src/main.rs:42:8
2024-01-15 14:30:18.203 DEBUG [lsp_protocol] Incoming call hierarchy request for src/auth.rs:15:4
2024-01-15 14:30:18.204 DEBUG [lsp_protocol] Outgoing: prepareCallHierarchy request to rust-analyzer
2024-01-15 14:30:18.267 DEBUG [lsp_protocol] Incoming: prepareCallHierarchy response from rust-analyzer
2024-01-15 14:30:18.268 INFO  [call_graph_cache] Cache MISS for authenticate at src/auth.rs:15:4
2024-01-15 14:30:18.345 INFO  [call_graph_cache] Cached call hierarchy for authenticate (45 nodes)

probe lsp stats

Display daemon performance statistics.

probe lsp stats [OPTIONS]

Options

OptionTypeDefaultDescription
--detailedFlagfalseShow detailed statistics
--resetFlagfalseReset statistics after display
--watch <SECONDS>IntegerNoneContinuously update every N seconds
--jsonFlagfalseJSON output
--csvFlagfalseCSV output for analysis

Examples

# Basic statistics
probe lsp stats

# Detailed stats
probe lsp stats --detailed

# Watch stats in real-time
probe lsp stats --watch 5

# CSV output for analysis
probe lsp stats --csv > lsp-stats.csv

Indexing Management

probe lsp index

Start indexing a workspace with language-specific processing pipelines.

probe lsp index [OPTIONS]

Arguments & Options

OptionTypeDefaultDescription
--workspace <PATH>String.Workspace path to index
--languages <LIST>StringAllComma-separated language list
--recursiveFlagfalseIndex nested workspaces recursively
--max-workers <N>IntegerCPU countMaximum worker threads
--memory-budget <MB>Integer512Memory budget in MB
--format <FORMAT>StringterminalOutput format: terminal, json
--progressFlagtrueShow progress bar
--waitFlagfalseWait for completion before returning

Examples

# Index current workspace with all languages
probe lsp index

# Index specific languages only
probe lsp index --languages rust,typescript,python

# Recursive indexing with custom settings
probe lsp index --recursive --max-workers 16 --memory-budget 2048

# Index and wait for completion
probe lsp index --wait --progress

# JSON output for scripting
probe lsp index --format json --languages go

probe lsp index-status

Show detailed indexing status and progress.

probe lsp index-status [OPTIONS]

Options

OptionTypeDefaultDescription
--format <FORMAT>StringterminalOutput format: terminal, json
--detailedFlagfalseShow per-file progress details
--followFlagfalseFollow progress like tail -f
--interval <SECS>Integer1Update interval for follow mode

Examples

# Basic status
probe lsp index-status

# Detailed per-file status
probe lsp index-status --detailed

# Follow indexing progress
probe lsp index-status --follow --interval 2

# JSON output for monitoring
probe lsp index-status --format json --detailed

probe lsp index-stop

Stop ongoing indexing operations.

probe lsp index-stop [OPTIONS]

Options

OptionTypeDefaultDescription
--forceFlagfalseForce stop even if in progress
--format <FORMAT>StringterminalOutput format: terminal, json

Examples

# Graceful stop
probe lsp index-stop

# Force stop
probe lsp index-stop --force

# JSON output
probe lsp index-stop --format json

probe lsp index-config

Configure indexing settings and behavior.

probe lsp index-config <SUBCOMMAND> [OPTIONS]

Subcommands

SubcommandDescription
showShow current configuration
setSet configuration options
resetReset to defaults

probe lsp index-config show

probe lsp index-config show [--format FORMAT]

probe lsp index-config set

probe lsp index-config set [OPTIONS]
OptionTypeDescription
--max-workers <N>IntegerMaximum worker threads
--memory-budget <MB>IntegerMemory budget in MB
--exclude <PATTERNS>StringComma-separated exclude patterns
--include <PATTERNS>StringComma-separated include patterns
--max-file-size <MB>IntegerMaximum file size to index
--incrementalBooleanEnable incremental indexing

probe lsp index-config reset

probe lsp index-config reset [--format FORMAT]

Examples

# Show current config
probe lsp index-config show

# Set performance options
probe lsp index-config set --max-workers 20 --memory-budget 4096

# Set file patterns
probe lsp index-config set --exclude "*.log,target/*,node_modules/*"

# Enable incremental mode
probe lsp index-config set --incremental true

# Reset to defaults
probe lsp index-config reset

Cache Management

probe lsp cache

Manage LSP caches with content-addressed storage.

probe lsp cache <SUBCOMMAND> [OPTIONS]

Subcommands

SubcommandDescription
statsShow comprehensive cache statistics
clearClear cache entries with optional filtering
exportExport cache contents to JSON
listList all workspace caches
infoShow detailed workspace cache information
clear-workspaceClear workspace-specific caches

Note: Cache uses content-addressed storage with MD5 hashing for automatic invalidation when files change. Cache provides 250,000x+ performance improvements for repeated queries.

Per-Workspace Caching: Probe automatically creates separate cache instances for each workspace, providing cache isolation and better performance for monorepos. Each workspace cache is stored in ~/Library/Caches/probe/lsp/workspaces/{hash}_{name}/.

probe lsp cache stats

Show comprehensive cache statistics including hit rates and performance metrics.

probe lsp cache stats

No options required - displays full cache statistics:

  • Total cached nodes and unique symbols
  • Files tracked in cache
  • Cache hit rates for all operations
  • Memory usage and average response times
  • Per-operation statistics (CallHierarchy, Definition, References, Hover)

probe lsp cache clear

probe lsp cache clear [OPTIONS]
OptionTypeDefaultDescription
--operation <OP>StringAllClear specific operation cache
--file <PATH>StringNoneClear entries for specific file
--confirmFlagfalseSkip confirmation prompt

probe lsp cache export

probe lsp cache export [OPTIONS]
OptionTypeDefaultDescription
--operation <OP>StringAllExport specific operation cache
--output <PATH>StringStdoutOutput file path
--format <FORMAT>StringjsonExport format: json, csv

Examples

# View comprehensive cache statistics
probe lsp cache stats
# Output shows: nodes, symbols, files, hit rates, memory usage, response times

# Clear all cache entries
probe lsp cache clear

# Clear specific operation cache
probe lsp cache clear --operation CallHierarchy
probe lsp cache clear --operation Definition
probe lsp cache clear --operation References
probe lsp cache clear --operation Hover

# Export all cache data to JSON
probe lsp cache export

# Export specific operation cache
probe lsp cache export --operation CallHierarchy

# Monitor cache performance in real-time
watch -n 1 'probe lsp cache stats'

Workspace Cache Commands

probe lsp cache list

List all workspace caches with their status and basic statistics.

probe lsp cache list [OPTIONS]
OptionTypeDefaultDescription
--detailedFlagfalseInclude cache statistics for each workspace
--format <FORMAT>StringterminalOutput format: terminal, json

probe lsp cache info

Show detailed information about workspace caches.

probe lsp cache info [WORKSPACE_PATH] [OPTIONS]
OptionTypeDefaultDescription
WORKSPACE_PATHStringAllOptional workspace path to get info for
--format <FORMAT>StringterminalOutput format: terminal, json

probe lsp cache clear-workspace

Clear caches for specific workspaces.

probe lsp cache clear-workspace [WORKSPACE_PATH] [OPTIONS]
OptionTypeDefaultDescription
WORKSPACE_PATHStringAllOptional workspace path to clear (clears all if not specified)
--forceFlagfalseSkip confirmation prompt
--format <FORMAT>StringterminalOutput format: terminal, json

Workspace Cache Examples

# List all workspace caches
probe lsp cache list

# List with detailed statistics
probe lsp cache list --detailed

# Get JSON output for scripting
probe lsp cache list --format json

# Show info for all workspaces
probe lsp cache info

# Show info for specific workspace
probe lsp cache info /path/to/my-project

# Clear all workspace caches (with confirmation)
probe lsp cache clear-workspace

# Clear specific workspace cache
probe lsp cache clear-workspace /path/to/my-project

# Force clear without confirmation
probe lsp cache clear-workspace --force

# Clear specific workspace without confirmation
probe lsp cache clear-workspace /path/to/my-project --force

Example Output:

$ probe lsp cache list --detailed

Workspace Caches (3 active, 5 total):

✓ abc123_my-rust-project
  Path: /Users/dev/projects/my-rust-project
  Size: 45.2 MB (3,421 entries)
  Hit Rate: 94.5%
  Last Used: 2 minutes ago
  
✓ def456_backend-api
  Path: /Users/dev/monorepo/backend
  Size: 23.1 MB (1,897 entries)
  Hit Rate: 91.2%
  Last Used: 5 minutes ago

○ ghi789_frontend-app
  Path: /Users/dev/monorepo/frontend
  Size: 12.4 MB (892 entries)
  Hit Rate: 88.7%
  Last Used: 2 hours ago (evicted from memory)

Memory Usage: 68.3 MB / 800 MB (8.5%)
Active Caches: 3 / 8 max
LRU Evictions: 2 total

Configuration Management

probe lsp config

Manage LSP configuration.

probe lsp config <SUBCOMMAND> [OPTIONS]

Subcommands

SubcommandDescription
get [KEY]Get configuration value(s)
set <KEY> <VALUE>Set configuration value
reset [KEY]Reset to default value(s)
validateValidate configuration
pathsShow configuration file paths
initCreate default configuration

Examples

# View all configuration
probe lsp config get

# Get specific value
probe lsp config get cache.size_per_operation

# Set configuration value
probe lsp config set cache.ttl_seconds 7200

# Reset to defaults
probe lsp config reset cache

# Validate configuration
probe lsp config validate

# Show config file locations
probe lsp config paths

# Create default config file
probe lsp config init

Troubleshooting Commands

probe lsp check

Run system health checks.

probe lsp check [OPTIONS]

Options

OptionTypeDefaultDescription
--fixFlagfalseAttempt to fix issues automatically
--verboseFlagfalseShow detailed check results
--jsonFlagfalseJSON output

Examples

# Basic health check
probe lsp check

# Detailed check with auto-fix
probe lsp check --fix --verbose

probe lsp debug

Debug LSP operations.

probe lsp debug <OPERATION> [OPTIONS]

Operations

OperationDescription
request <FILE> <SYMBOL>Debug specific LSP request
cache-lookup <KEY>Debug cache lookup
workspace <PATH>Debug workspace resolution
server <LANGUAGE>Debug language server state

Examples

# Debug LSP request
probe lsp debug request src/main.rs main

# Debug cache lookup
probe lsp debug cache-lookup "src/main.rs:main:42:8"

# Debug workspace resolution
probe lsp debug workspace /path/to/project

Exit Codes

All LSP commands use standard exit codes:

CodeMeaning
0Success
1General error
2Command line argument error
3Configuration error
4Network/communication error
5Permission error
6File not found error
7Timeout error
8Cache error
9Language server error

Shell Completion

Generate shell completion scripts:

# Bash
probe lsp completion bash > /etc/bash_completion.d/probe-lsp

# Zsh  
probe lsp completion zsh > ~/.zsh/completions/_probe-lsp

# Fish
probe lsp completion fish > ~/.config/fish/completions/probe-lsp.fish

# PowerShell
probe lsp completion powershell > $PROFILE

Environment Variables

See reference/environment-variables.md and probe lsp index-config --help for current runtime options.

Next Steps