# Peeker
A fast CLI tool for extracting code structure from source files using [Tree-sitter](https://tree-sitter.github.io/).
## Features
- **Multi-language support**: Rust, Python, TypeScript, JavaScript, Go, Java, C, C++
- **Extracts**: imports, structs/classes, functions, traits/interfaces, enums
- **Output formats**: pretty (terminal), JSON, Markdown
- **Filter by visibility**: show only public/exported items with `--exports-only`
## Installation
```bash
cargo install peeker
```
## Usage
```bash
# Analyze a file
peeker src/main.rs
# JSON output
peeker src/main.rs --format json
# Markdown output
peeker src/main.rs --format markdown
# Show only public items
peeker src/lib.rs --exports-only
```
## Example Output
```
src/parser.rs
Imports
use anyhow::Result; (line 1)
use tree_sitter::Parser; (line 2)
Structs/Classes
pub struct CodeStructure (lines 8-14)
imports: Vec<Import>
structs: Vec<StructDef>
functions: Vec<FunctionDef>
Functions
pub fn parse_file(path: &Path) -> Result<CodeStructure> (lines 20-45)
```
## License
MIT