Reference

CLI Reference

Complete reference for all Semantiq CLI commands.

semantiq index

Index a directory to create or update the semantic database.

semantiq index [PATH] [OPTIONS]

Arguments:
  [PATH]  Directory to index (default: current directory)

Options:
  -v, --verbose     Show detailed output
  -f, --force       Force re-index all files
      --exclude     Patterns to exclude (can be repeated)
  -h, --help        Print help

Examples

# Index current directory
semantiq index

# Index with verbose output
semantiq index . --verbose

# Force re-index everything
semantiq index --force

# Exclude specific directories
semantiq index --exclude node_modules --exclude dist

semantiq search

Search for code patterns, symbols, or text in the indexed codebase.

semantiq search <QUERY> [OPTIONS]

Arguments:
  <QUERY>  Search query (supports regex)

Options:
  -l, --limit     Maximum number of results (default: 20)
  -t, --type      Filter by symbol type (function, class, etc.)
      --json      Output results as JSON
  -h, --help      Print help

Examples

# Search for a pattern
semantiq search "authentication"

# Search with limit
semantiq search "handler" --limit 5

# Filter by type
semantiq search "User" --type class

# Output as JSON
semantiq search "config" --json

semantiq find-refs

Find all references to a symbol including definitions and usages.

semantiq find-refs <SYMBOL> [OPTIONS]

Arguments:
  <SYMBOL>  Symbol name to find references for

Options:
  -l, --limit     Maximum number of results (default: 50)
      --json      Output results as JSON
  -h, --help      Print help

Examples

# Find all references to a function
semantiq find-refs handleRequest

# Find references to a class
semantiq find-refs UserService

# Output as JSON
semantiq find-refs Config --json

semantiq deps

Analyze the dependency graph for a file.

semantiq deps <FILE> [OPTIONS]

Arguments:
  <FILE>  File path to analyze

Options:
      --imports     Show only imports (what this file depends on)
      --dependents  Show only dependents (what depends on this file)
      --depth       Maximum depth for transitive dependencies
      --json        Output results as JSON
  -h, --help        Print help

Examples

# Analyze a file's dependencies
semantiq deps src/auth/handler.ts

# Show only imports
semantiq deps src/index.ts --imports

# Show only dependents
semantiq deps src/utils.ts --dependents

semantiq explain

Get detailed explanation of a symbol including definition, docs, and usage patterns.

semantiq explain <SYMBOL> [OPTIONS]

Arguments:
  <SYMBOL>  Symbol name to explain

Options:
      --json      Output results as JSON
  -h, --help      Print help

Examples

# Explain a function
semantiq explain handleAuth

# Explain a class
semantiq explain DatabaseConnection

semantiq serve

Start Semantiq as an MCP server for integration with AI assistants.

semantiq serve [OPTIONS]

Options:
      --stdio       Use stdio for MCP communication (default)
      --port        Use HTTP transport on specified port
  -h, --help        Print help

Examples

# Start MCP server (stdio)
semantiq serve

# Start with HTTP transport
semantiq serve --port 8080