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

scip-cli requires two external tools for indexing:

For TypeScript/JavaScript projects:

# 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
scip --version

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.0.tar.gz (14.9 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.0-py3-none-any.whl (17.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: scip_cli-1.0.0.tar.gz
  • Upload date:
  • Size: 14.9 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.0.tar.gz
Algorithm Hash digest
SHA256 db6a7abab46a2eca6570c2957ba712e366938c2d5a99ed3548a6fdd44d9fc0ab
MD5 bc34b6243a027446650372030773d60b
BLAKE2b-256 79668831761830ce77e8bea9f5e59daa1a4c17b5060d6b101375248d00435022

See more details on using hashes here.

File details

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

File metadata

  • Download URL: scip_cli-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 17.1 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 12b84e380bd583138bb2a33ea8d8d369bfef4e217a7d7155f92ba80a32d68374
MD5 9dd6d25b695e44e121a51c1d8875c6b9
BLAKE2b-256 8e623d6314570439ccd516fe890b5b3b0b84aee65ccba2efff6404fad5bec182

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