TSG Indexer

by entrepeneur4lyf

331 downloads Not rated yet Activity

About

A library for indexing code repositories using Tree-sitter Stack Graphs, designed to be used in MCP servers and other tools.

Details

License
Activity

Explore

- Support for multiple languages:
- Rust
- Python
- JavaScript
- TypeScript
- Java
- Swift
- Objective-C
- CSS
- Scala
- Zig
- YAML
- Go
- PHP
- XML
- JSDoc
- Bash
- JSON
- HTML
- C#
- Ruby
- Markdown
- Lua
- Dart
- And more!
- Recursive directory traversal
- Multiple output formats:
- JSON
- DOT graph
- Feature flags for optional functionality:
- cli - Command-line interface support
- lsp - Language Server Protocol support

Add to your Cargo.toml:

[dependencies]
tsg_indexer = { version = "0.1.0", features = ["cli", "lsp"] }

Or clone and build the repository:


rust use tsg_indexer::{IndexerConfig, run_indexer}; use std::path::PathBuf;

fn main() -> anyhow::Result<()> {
// Create configuration
let config = IndexerConfig {
path: PathBuf::from("src/"),
format: "json".to_string(),
output: Some(PathBuf::from("output.json")),
verbose: true,
};

// Run the indexer
run_indexer(config)
}


When built with the cli feature:

bash

A library for indexing code repositories using Tree-sitter Stack Graphs, designed to be used in MCP servers and other tools.

Overview

TSG Indexer is a Rust library that uses Tree-sitter Stack Graphs to analyze code repositories and build graph representations of code structure. It captures relationships between definitions and references across files, enabling powerful code navigation and analysis capabilities.

Key features:

TSG Indexer is a library that uses tree-sitter-stack-graphs to analyze code repositories and build a graph representation of the code structure. This graph captures the relationships between definitions and references across files, enabling powerful code navigation and analysis.

Support for 20+ programming languages including Rust, Python, JavaScript, TypeScript, Java, and more
Recursive directory traversal for comprehensive codebase analysis
Multiple output formats (JSON, DOT graph)
Optional CLI and LSP support via feature flags
Ability to generate TSG files for unsupported languages
The library is designed to be integrated with Model Control Protocol (MCP) servers and other tools that need code indexing and navigation capabilities. It leverages the tree-sitter parsing system and stack-graphs technology from GitHub to create a comprehensive code analysis solution.

Features

- Support for multiple languages:
- Rust
- Python
- JavaScript
- TypeScript
- Java
- Swift
- Objective-C
- CSS
- Scala
- Zig
- YAML
- Go
- PHP
- XML
- JSDoc
- Bash
- JSON
- HTML
- C#
- Ruby
- Markdown
- Lua
- Dart
- And more!
- Recursive directory traversal
- Multiple output formats:
- JSON
- DOT graph
- Feature flags for optional functionality:
- cli - Command-line interface support
- lsp - Language Server Protocol support

Installation

Add to your Cargo.toml:

[dependencies]
tsg_indexer = { version = "0.1.0", features = ["cli", "lsp"] }

Or clone and build the repository:

```bash

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.