Nouuu/GoPeek
GoPeek is a lightweight command-line tool that generates comprehensive documentation of project structures. It recursively scans directories to create a navigable Markdown document containing both the project tree and file contents, making it ideal for project exploration, documentation and AI context providing.
GoPeek
GoPeek is a lightweight command-line tool that generates comprehensive documentation of project structures. It recursively scans directories to create a navigable Markdown document containing both the project tree and file contents, making it ideal for project exploration, documentation and AI context providing.
Features
- π³ Recursive directory scanning with an intuitive tree structure
- π Automatic Markdown generation with file contents
- π Smart binary file detection
- β‘ Efficient large file handling with size limits
- π― Configurable ignore patterns (supports .gitignore)
- π Generated anchors for easy navigation
Installation
go install github.com/nouuu/gopeek/cmd/gopeek@latestOr build from source:
git clone https://github.com/nouuu/gopeek.git
cd gopeek
make buildYou can also install it from source :
git clone https://github.com/nouuu/gopeek.git
cd gopeek
make installUsage
Basic usage:
gopeek [path] [flags]Available flags:
Flags:
-o, --output string Output file path (default "project_knowledge.md")
-i, --ignore stringSlice Patterns to ignore
-v, --version Show version
--verbose Enable verbose outputExample:
# Scan current directory
gopeek .
# Scan specific directory with custom output
gopeek /path/to/project -o documentation.md
# Scan with custom ignore patterns
gopeek . -i "*.log" -i "build/*"Output Format
GoPeek generates a structured Markdown document with two main sections:
- Project Structure: A tree view of your project with clickable links
- File Contents: The content of each file with syntax highlighting
Example output:
# Project Structure
- π project
- π [main.go](#main-go)
- π internal
- π [types.go](#internal-types-go)
# Files Content
# π main.go
```go
package main
// ... file contentDevelopment
Prerequisites
- Go 1.22 or higher
- Make (for build automation)
Building
make buildTesting
make testContributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Roadmap πΊοΈ
Core Features β¨
- Basic directory scanning
- Markdown output generation
- Binary file detection
- .gitignore support
- CLI interface with cobra
- File size limits
- Github Actions CI/CD
Next Steps π
- Advanced Error Handling π‘οΈ
- Custom error types
- Error context and wrapping
- Operation summaries
- Extended Output Options π
- HTML with navigation
- JSON output
- Template customization
- Performance Features β‘
- Parallel file scanning
- Memory usage optimization
- Progress indicators
Acknowledgments
- Inspired by the need for better project documentation tools
- Built with Cobra