Skip to content

entrepeneur4lyf/fast-context

Repository files navigation

Fast-Context

Repository npm PyPI

Fast-Context is a Rust codebase analysis library with Node.js and Python bindings.

It is built around Tree-sitter parsing, symbol extraction, dependency analysis, and graph operations. The project is meant for code search, indexing, editor tooling, and assistant-style codebase analysis.

Coming soon: the npm, PyPI, and crates.io packages have not been published yet. The repository and release flow are being finalized before the first public package release.

What It Does

  • analyzes multi-language repositories
  • extracts symbols and relationships
  • finds symbols by kind or file
  • resolves symbol dependencies
  • exposes graph types for traversal and metrics
  • supports file watching and incremental workflows

Current Surface

The actively maintained surfaces are:

  • Rust core library
  • Node.js package
  • Python bindings
  • Codex skills
  • Claude plugin skeleton

Installation

The commands below describe the intended package install surface after the first public release.

Node.js

npm install fast-context

Python

pip install fast-context

Hosts and MCP

For host-specific installation and setup, see docs/HOST_SETUP.md.

That document covers:

  • Codex skills, MCP setup, and optional hooks
  • Claude plugin installation, bundled skills, plugin MCP, and optional hooks
  • standalone MCP installation for non-Codex/non-Claude clients

Quick Start

Node.js

const { FastContextAnalyzer } = require('fast-context')

const analyzer = new FastContextAnalyzer({
  projectRoot: process.cwd(),
  ignorePatterns: ['node_modules/**', '.git/**', 'target/**'],
})

const result = analyzer.analyze()

console.log({
  files: result.fileCount,
  symbols: result.symbolCount,
  relationships: result.relationshipCount,
  skipped: result.skippedFileCount,
})

Python

import fast_context

config = fast_context.AnalyzerConfig(
    project_root=".",
    ignore_patterns=["node_modules/**", ".git/**", "target/**"],
)

analyzer = fast_context.FastContextAnalyzer(config)
result = analyzer.analyze()

print({
    "files": result.file_count,
    "symbols": result.symbol_count,
    "relationships": len(result.relationships),
    "skipped": len(result.skipped_files),
})

Node API Summary

FastContextAnalyzer currently exposes:

  • analyze()
  • getAnalysis()
  • startWatching()
  • stopWatching()
  • findSymbolsByKind(kind)
  • findSymbolsInFile(filePath)
  • findDependencies(symbolName)
  • findComplexSymbols(complexityThreshold)

Utility exports:

  • getVersion()
  • getSupportedLanguages()
  • detectLanguage(filePath)
  • checkConfiguration(config?)
  • getSystemInfo()

For the current typed contract, see index.d.ts and docs/API_REFERENCE.md.

Supported Languages

Fast-Context includes parsers for:

  • Rust
  • JavaScript
  • TypeScript
  • Python
  • Java
  • Go
  • C and C++
  • C#
  • Swift
  • Objective-C
  • PHP
  • Ruby
  • Scala
  • Zig
  • Lua
  • Bash
  • CSS
  • HTML
  • XML
  • JSON
  • YAML
  • Markdown

Development

Rust

cargo check
cargo test
cargo clippy --all-targets --all-features -- -D warnings
cargo run --bin fast-context --features cli -- --help

Node.js

npm install
npm run build:debug
npm test

Python

pytest tests/python

If you are building native bindings locally, use the versions and host environments exercised by CI where possible.

Documentation

Repository Notes

  • The generated Node typings live in index.d.ts.
  • The Node package metadata is rewritten during build/publish steps, so local package.json churn after native builds is expected.
  • Cross-platform native artifact truth should come from the GitHub Actions workflows, not a single local machine.

License

Apache-2.0

Support

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors