| Crates.io | arcella-inspect |
| lib.rs | arcella-inspect |
| version | 0.1.3 |
| created_at | 2025-12-06 05:02:19.481018+00 |
| updated_at | 2026-01-05 11:20:23.250331+00 |
| description | Static analysis of Rust code to extract structured metadata (functions, structs, calls) as YAML or structured data. |
| homepage | |
| repository | https://github.com/ArcellaTeam/arcella-rust-inspect/ |
| max_upload_size | |
| id | 1969632 |
| size | 58,607 |
arcella-inspectStatic code introspection for Rust โ structured, machine-readable metadata for AI agents, architecture tools, and automated analysis.
arcella-inspect is a Rust library and CLI tool that parses Rust source code and extracts rich structural metadata โ functions, structs, calls, attributes, documentation โ into a clean, hierarchical YAML 1.2 format. Designed for integration with AI-driven code understanding, dependency mapping, documentation generation, and architectural audits.
Part of the Arcella ecosystem.
synpub, async, unsafe, etc.)/// and #[doc = "..."]cargo install arcella-inspect
Cargo.toml)[dependencies]
arcella-inspect = "0.1"
# Analyze current directory
arc-inspect
# Analyze specific project
arc-inspect ./my-rust-project
# Pipe to file
arc-inspect > architecture.yaml
use arcella_inspect::{analyze_project, analysis_to_yaml};
let root = std::path::Path::new("./my-project");
let analysis = analyze_project(root)?;
let yaml = analysis_to_yaml(&analysis, root)?;
println!("{}", yaml);
version: "1.0"
subprojects:
- name: "auth-service"
root: "crates/auth"
functions:
- name: "validate_token"
file: "src/validator.rs"
line: 34
returns: "Result<Claims, AuthError>"
parameters:
- "token: &str"
- "secret: &[u8]"
attributes: ["pub", "async"]
docstring: "Validates a JWT token using the provided secret."
calls:
- name: "jsonwebtoken::decode"
external: true
- name: "metrics::record_auth_attempt"
file: "src/metrics.rs"
line: 12
๐ See the full output format specification for details.
Given src/lib.rs:
/// Adds two numbers.
pub fn add(a: i32, b: i32) -> i32 {
a + b
}
Running arc-inspect produces:
version: "1.0"
subprojects:
- name: "my-crate"
root: "."
functions:
- name: "add"
file: "src/lib.rs"
line: 2
returns: "i32"
parameters:
- "a: i32"
- "b: i32"
docstring: "Adds two numbers."
attributes: ["pub"]
calls: []
Dual-licensed under MIT or Apache 2.0 โ your choice.
Contributions are welcome! Please open an issue or PR on GitHub.
Planned improvements:
rust-analyzer LSP for real-time analysis