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
go install github.com/ka2n/miru/cmd/miru@latest
Package Installation
macOS
For macOS users, miru is available via Homebrew:
# Add the tap repository
brew tap ka2n/tap
# Install miru
brew install miru
Arch Linux
For Arch Linux users, miru is available in the AUR as miru-go-bin:
yay -S miru-go-bin
Alpine Linux
# Download the package
wget https://github.com/ka2n/miru/releases/download/v0.0.2/miru_0.0.2-1_amd64.apk
# Install the package
apk add --allow-untrusted ./miru_0.0.2-1_amd64.apk
Debian/Ubuntu
# Download the package
wget https://github.com/ka2n/miru/releases/download/v0.0.2/miru_0.0.2-1_amd64.deb
# Install the package
apt install ./miru_0.0.2-1_amd64.deb
RHEL/Rocky Linux
# Download the package
wget https://github.com/ka2n/miru/releases/download/v0.0.2/miru_0.0.2-1_amd64.rpm
# Install the package
rpm -i miru_0.0.2-1_amd64.rpm
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
miru [package] -o json # Output metadata in JSON format
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
# Output package metadata in JSON format
miru github.com/spf13/cobra -o json
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
MIRU_NO_CACHE=1 # Disable caching
By default, miru uses github.com/pkg/browser for browser integration.
Documentation Sources
miru supports fetching documentation from:
- 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