peeker-1.1.0 is not a library.
Visit the last successful build:
peeker-1.2.0
Peeker
A fast CLI tool for extracting code structure from source files using Tree-sitter.
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 - MCP server: run as a Model Context Protocol server for AI tool integration
Installation
Usage
# Analyze a file
# JSON output
# Markdown output
# Show only public items
MCP Server
Peeker can run as an MCP (Model Context Protocol) server, exposing its code analysis capabilities to AI tools and agents.
# Start MCP server (JSON-RPC over stdio)
Integration with mcpd
Add to your mcpd configuration:
Available Tools
| Tool | Description |
|---|---|
peek |
Analyze source code structure. Parameters: file (required), exports_only (optional) |
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