miru

module
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 14, 2025 License: MIT

README

miru

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
  • Go 1.21 or later
Setup
  1. Clone the repository
git clone https://github.com/ka2n/miru.git
cd miru
  1. Build
go build ./cmd/miru
  1. Run tests
go test ./...

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT License - see LICENSE for details

Directories

Path Synopsis
api
Package cli implements the command-line interface for miru.
Package cli implements the command-line interface for miru.
cmd
miru command
Command miru provides a command-line tool for viewing package documentation.
Command miru provides a command-line tool for viewing package documentation.
Package mcp implements the Model Context Protocol server for miru.
Package mcp implements the Model Context Protocol server for miru.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL