miru
Warning
This project is in early development (pre-0.1.0) and the API is not stable.
Breaking changes may occur without notice.
Use with caution.
A command-line tool for viewing package documentation with a man-like interface.
Features
- View package documentation in terminal with man-like interface
- Support for multiple package registries and documentation sources
- Open documentation in browser
- Search packages and their documentation
- Configurable browser integration
- [] View structured documentation
- Show documentation from symbols, types, and functions
Installation
go install github.com/ka2n/miru/cmd/miru@latest
Usage
View package documentation in terminal:
miru [package] # Display documentation in man-like interface
miru [package] -b # Open documentation in browser
miru [lang] [package] # Specify package language explicitly
miru [package] --lang [lang] # Specify package language with flag
Examples:
# View package documentation
miru github.com/spf13/cobra
# Open documentation in browser
miru golang.org/x/sync -b
# Specify language explicitly
miru go github.com/spf13/cobra
# Specify language with flag
miru github.com/spf13/cobra --lang go
Package Structure
github.com/ka2n/miru/
├── api/ # Core implementations for documentation fetching and rendering
├── cli/ # CLI interface implementation
├── mcp/ # Model Context Protocol server implementation
└── cmd/miru/ # Main command implementation
Configuration
Browser integration can be configured through environment variables:
MIRU_BROWSER=firefox # Specify browser to use
MIRU_BROWSER_PATH=/path/to/browser # Specify browser binary path
By default, miru uses go-openbrowser for browser integration.
Documentation Sources
miru supports fetching documentation from:
- go.pkg.dev
- pkg.go.dev
- GitHub repositories
- Local module documentation
Development
Requirements
Setup
- Clone the repository
git clone https://github.com/ka2n/miru.git
cd miru
- Build
go build ./cmd/miru
- Run tests
go test ./...
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
MIT License - see LICENSE for details