Skip to main content

Fast code intelligence via SCIP indexes

Project description

scip-cli

PyPI version License: MIT

Fast code intelligence CLI for TypeScript/JavaScript projects. Query SCIP indexes directly via SQLite for instant results.

Features

  • Fast: Direct SQLite queries, 100-500x faster than bash wrappers
  • Simple: Single binary with subcommands
  • Auto-indexing: Automatically indexes projects on first query
  • Token-efficient: Clean, minimal output optimized for AI consumption

Installation

1. Install scip-cli

pip install scip-cli

2. Install prerequisites (optional)

scip-cli can automatically download the required indexing tools when needed, or you can install them globally for faster performance:

Option A: Let scip-cli handle it (recommended)

Just use scip-cli - it will automatically download the required tools via npx on first use. No global installation needed.

Option B: Install globally for better performance

# Install scip-typescript (SCIP indexer)
npm install -g @sourcegraph/scip-typescript

# Install scip (SCIP CLI for index conversion)
npm install -g @sourcegraph/scip

Verify installation:

scip-cli --help
scip-typescript --version  # Only if you chose Option B
scip --version             # Only if you chose Option B

Prerequisites

  • Python 3.7+
  • scip-typescript (for indexing TypeScript/JavaScript)
  • scip CLI (for converting indexes)

Usage

All commands are subcommands of scip-cli:

scip-cli <command> [arguments]

Commands

  • refs <symbol> - Find all references to a symbol
  • def <symbol> - Find symbol definition with source code
  • search <pattern> - Search symbols by name pattern
  • symbols <file> - List all symbols in a file
  • rdeps <file> - Find files that depend on a file
  • members <symbol> - List members of a class/interface
  • skill [path] - Install or dump the SKILL.md

Examples

# Find where useDictation is used
scip-cli refs useDictation

# Get definition of useDictation
scip-cli def useDictation

# Search for symbols matching "Dictation"
scip-cli search Dictation

# List symbols in a file
scip-cli symbols src/hooks/useDictation.ts

# Find files that import from useDictation.ts
scip-cli rdeps src/hooks/useDictation.ts

# List members of a class
scip-cli members UseDictationOptions

# Install skill file
scip-cli skill ~/.claude/skills/scip/SKILL.md

How It Works

  1. On first query, automatically indexes the project using scip-typescript
  2. Converts the SCIP index to SQLite using scip expt-convert
  3. Caches the database in ~/.cache/scip-query/projects/<hash>/index.db
  4. Subsequent queries are instant SQLite lookups

Performance

Compared to bash wrappers:

  • refs: 6.4s → 0.03s (213x faster)
  • def: 2.8s → 0.05s (56x faster)
  • search: 2.6s → 0.03s (87x faster)
  • symbols: 0.3s → 0.02s (15x faster)
  • rdeps: 0.2s → 0.02s (10x faster)
  • members: 3.1s → 0.03s (103x faster)

Architecture

scip_cli/
├── __init__.py
├── __main__.py    # CLI entry point
├── lib.py         # Core utilities (indexing, symbol resolution)
└── commands/      # Subcommand implementations
    ├── refs.py
    ├── def_cmd.py
    ├── search.py
    ├── symbols.py
    ├── rdeps.py
    ├── members.py
    └── skill.py

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scip_cli-1.0.2.tar.gz (15.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

scip_cli-1.0.2-py3-none-any.whl (17.4 kB view details)

Uploaded Python 3

File details

Details for the file scip_cli-1.0.2.tar.gz.

File metadata

  • Download URL: scip_cli-1.0.2.tar.gz
  • Upload date:
  • Size: 15.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for scip_cli-1.0.2.tar.gz
Algorithm Hash digest
SHA256 43b099f6d3cb3a3e9a86623dfb6b3bd607ecce7fbd2d246c9313c2c5dc9b161b
MD5 e074f68fed09c63b383fc60632c3925d
BLAKE2b-256 a9626a8b1aead88b9b2bff234e830413db1fb503175ceaf678ed93bc4771e558

See more details on using hashes here.

File details

Details for the file scip_cli-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: scip_cli-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 17.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for scip_cli-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 69a8142c1c2ffd2b44a7a608ba45d2ea2ec73796cacc1efd9f3ffe94adf98508
MD5 6848db140f04eab7480dd63a80c73af8
BLAKE2b-256 fa02fb34a6222af8888978e7d44841e9cde918a0640b55686cec2b200f6a27d2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page