Skip to main content

Crate forge_core

Crate forge_core 

Source
Expand description

ForgeKit - Deterministic Code Intelligence SDK

This crate provides core SDK for programmatic code intelligence operations.

§Overview

ForgeKit unifies several code intelligence tools into a single API:

  • Graph Module: Symbol and reference queries (native implementation)
  • Search Module: Semantic code search (via LLMGrep)
  • CFG Module: Control flow analysis (via Mirage)
  • Edit Module: Span-safe code editing (via Splice)

§Quick Start

use forge_core::Forge;

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    let forge = Forge::open("./my-project").await?;

    // Query code graph
    let symbols = forge.graph().find_symbol("main").await?;
    println!("Found: {:?}", symbols);

    Ok(())
}

Re-exports§

pub use error::ForgeError;
pub use error::Result;
pub use types::SymbolId;
pub use types::Location;
pub use storage::BackendKind;
pub use storage::UnifiedGraphStore;

Modules§

analysis
Analysis module - Combined analysis operations
cfg
CFG module - Control flow graph analysis.
edit
Edit module - Span-safe code editing
error
Error types for ForgeKit.
graph
Graph module - Symbol and reference queries using sqlitegraph.
search
Search module - Semantic code search via llmgrep
storage
Storage abstraction layer supporting dual backends.
treesitter
Tree-sitter based CFG extraction for C, Java, and Rust
types
Core types for ForgeKit.

Structs§

EdgeSpec
Edge specification for insertion operations.
Forge
Main entry point for ForgeKit SDK.
ForgeBuilder
Builder for configuring and creating a Forge instance.
GraphConfig
Complete configuration for graph construction.
GraphEntity
NodeSpec
Node specification for insertion operations.
SqliteGraph
Embedded SQLite-backed graph database.

Enums§

SqliteGraphBackendKind
Backend selection enum for choosing between storage implementations.

Functions§

open_graph
Open a graph with the specified configuration.