Crates.io | e_ai_summarize |
lib.rs | e_ai_summarize |
version | |
source | src |
created_at | 2025-03-28 03:03:42.280316+00 |
updated_at | 2025-04-20 23:59:00.376545+00 |
description | A Rust code analyzer that summarizes functionality, crate usage, safety, and file operations. |
homepage | |
repository | https://github.com/davehorner/cargo-e |
max_upload_size | |
id | 1609151 |
Cargo.toml error: | TOML parse error at line 20, column 1 | 20 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
e_ai_summarize is a GenAI-powered Rust source code summarizer and crate recreator. It analyzes Rust source files to provide concise, insightful summaries—including key functionality, used crates, safety considerations, and file operations. Additionally, it now supports generating scripts (in Rust or Python) to recreate a crate from a given source folder.
Source Code Analysis:
SAFE_TO_RUN: YES/NO
verdict and explanation.FILE_OPERATIONS: YES/NO
verdict with details.Interactive Follow-up Mode:
Output Flexibility:
Crate Recreation:
src
subfolder when recreating the crate.Add e_ai_summarize as a dependency in your Cargo.toml
.
The tool now offers two main modes: Summarization and Crate Recreation.
Summarize a Rust source file:
cargo run -- path/to/source_file.rs
Interactive Follow-up Mode:
Run in interactive mode to ask follow-up questions after the summary is generated:
cargo run -- path/to/source_file.rs --stdin
Single Follow-up Question:
Provide a single follow-up question with the -q
option:
cargo run -- path/to/source_file.rs -q "Does this code handle errors properly?"
Enable Streaming Mode:
Use the --streaming
flag for streaming output:
cargo run -- path/to/source_file.rs --streaming
If no file is specified, e_ai_summarize will default to analyzing its own source code as a demonstration.
Generate a Rust script to recreate the crate:
Use the --recreate-crate-rs
flag. Optionally, provide a source folder (defaults to the current directory) and add --src-only
to process only the src
subfolder.
cargo run -- path/to/source_folder --recreate-crate-rs [--src-only]
Generate a Python script to recreate the crate:
Use the --recreate-crate-py
flag. Similar to the Rust mode, you can specify a source folder and use --src-only
if needed.
cargo run -- path/to/source_folder --recreate-crate-py [--src-only]
You can also integrate e_ai_summarize into your own Rust projects. For example:
use e_ai_summarize::summarizer::{self, ChatSession};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Summarize a source file
let (summary, mut session) = summarizer::summarize_source_session(Some("path/to/source_file.rs"), true).await?;
println!("Summary:
{}", summary);
// Optionally, ask a follow-up question
let followup = session.ask("Can you elaborate on the error handling?").await?;
println!("Follow-up Answer:
{}", followup);
Ok(())
}
Parsing Input:
src
subfolder.Prompt Construction:
GenAI-Powered Chat Session:
Interactive Querying:
Crate Recreation:
Contributions are welcome! Please feel free to open issues or submit pull requests for enhancements and bug fixes.
Distributed under the MIT License. See LICENSE for more information.
Thanks to the contributors of the GenAI library and the broader Rust community for their continuous support and innovation in open-source projects.
Enjoy using e_ai_summarize for all your Rust code analysis and crate recreation needs!
Created by Your David Horner around 3/25