npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@nlci/cli

v0.1.0

Published

Command-line interface for NLCI - Neural-LSH Code Intelligence

Readme

@nlci/cli

Command-line interface for NLCI - Neural-LSH Code Intelligence.

Installation

npm install -g @nlci/cli
# or
pnpm add -g @nlci/cli

Quick Start

# Initialize NLCI in your project
nlci init

# Scan your codebase to build the index
nlci scan ./src

# Query for similar code
nlci query --file ./src/my-function.ts

# Generate a clone detection report
nlci report

Commands

nlci init

Initialize NLCI configuration in the current directory.

nlci init [options]

Options:
  -f, --force       Overwrite existing configuration
  --typescript      Use TypeScript configuration file
  --json            Use JSON configuration file

nlci scan

Scan a directory and build the code similarity index.

nlci scan [path] [options]

Arguments:
  path                    Path to scan (defaults to current directory)

Options:
  -o, --output <path>     Output path for index file (default: ".nlci-index")
  -c, --config <path>     Path to configuration file
  -i, --include <patterns...>   Glob patterns to include
  -e, --exclude <patterns...>   Glob patterns to exclude
  --min-tokens <n>        Minimum tokens per code block (default: 10)
  --max-tokens <n>        Maximum tokens per code block (default: 10000)
  -l, --languages <langs...>    Languages to include
  -v, --verbose           Show detailed output
  -f, --force             Force rebuild of existing index

nlci query

Query for similar code blocks.

nlci query [options]

Options:
  -x, --index <path>      Path to index file (default: ".nlci-index")
  -f, --file <path>       Query using code from a file
  -c, --code <code>       Query using inline code snippet
  -t, --threshold <value> Minimum similarity threshold (default: 0.85)
  -n, --limit <n>         Maximum number of results (default: 10)
  --type <type>           Filter by clone type (1, 2, 3, 4)
  --format <format>       Output format: table, json, compact (default: table)
  -v, --verbose           Show detailed output

nlci report

Generate a code clone report.

nlci report [options]

Options:
  -x, --index <path>      Path to index file (default: ".nlci-index")
  -o, --output <path>     Output file path
  -f, --format <format>   Report format: console, json, html, markdown
  -t, --threshold <value> Minimum similarity threshold (default: 0.85)

nlci serve

Start a local API server for code similarity queries.

nlci serve [options]

Options:
  -x, --index <path>      Path to index file (default: ".nlci-index")
  -p, --port <port>       Port to listen on (default: 3000)
  -h, --host <host>       Host to bind to (default: localhost)

API Endpoints:

  • GET /health - Health check
  • GET /stats - Index statistics
  • POST /query - Query for similar code
  • POST /clones - Get all detected clones

nlci stats

Display index statistics.

nlci stats [options]

Options:
  -x, --index <path>      Path to index file (default: ".nlci-index")
  --json                  Output as JSON

Configuration

NLCI looks for configuration in these locations (in order):

  1. nlci.config.js / nlci.config.ts
  2. nlci.config.json
  3. .nlcirc / .nlcirc.json
  4. package.json (nlci field)

Example Configuration

// nlci.config.js
module.exports = {
  lsh: {
    numTables: 20, // Number of hash tables (L)
    numBits: 12, // Bits per hash (K)
    dimension: 384, // Embedding dimension
  },
  embedding: {
    model: 'sentence-transformers/all-MiniLM-L6-v2',
    batchSize: 32,
    maxLength: 512,
  },
  parser: {
    minBlockSize: 10,
    maxBlockSize: 10000,
    includePatterns: ['**/*.ts', '**/*.js'],
    excludePatterns: ['**/node_modules/**'],
  },
};

Clone Types

| Type | Similarity | Description | | ------ | ---------- | -------------------------------------------------- | | Type-1 | ≥99% | Exact clones (whitespace/comment differences only) | | Type-2 | 95-99% | Parameterized clones (identifier renaming) | | Type-3 | 85-95% | Near-miss clones (statement modifications) | | Type-4 | 70-85% | Semantic clones (different syntax, same logic) |

Performance

  • Indexing: O(n) - Linear time to scan codebase
  • Query: O(1) - Constant time lookups using LSH
  • Memory: Efficient bucket-based storage

License

AGPL-3.0-or-later