concept-analyzer 0.1.1

A unified pipeline that analyzes code repositories and extracts first-principles instructions for AI agents
Documentation
//! Basic usage example for concept_analyzer
//!
//! This example shows how to analyze a repository and publish results to S3.
//!
//! Run with: cargo run --example basic_usage

use anyhow::Result;
use concept_analyzer::analyze_repository;
use std::path::Path;

#[tokio::main]
async fn main() -> Result<()> {
    // Initialize logging
    env_logger::init();

    // Get configuration from environment
    let llm_api_key =
        std::env::var("LLM_API_KEY").expect("LLM_API_KEY environment variable must be set");

    // Analyze the current directory
    let repo_path = Path::new(".");
    let s3_bucket = "my-analysis-bucket";
    let s3_key = "analyses/example-project.json";

    println!("Analyzing repository: {}", repo_path.display());

    // Run the analysis - this is all you need!
    let s3_url = analyze_repository(
        repo_path,
        s3_bucket,
        s3_key,
        llm_api_key,
        None, // Use default number of workers
    )
    .await?;

    println!("\nAnalysis complete!");
    println!("Results published to: {}", s3_url);

    Ok(())
}