Skip to content

A simple CLI written in Go that is used to open documentation in your default web browser.

Notifications You must be signed in to change notification settings

stamatim/go-docs-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docs-cli

A fast and convenient CLI tool to open developer documentation in your browser.
Quickly access official docs or GitHub repositories for your favorite languages, frameworks, and tools.


Features

  • 🔗 Open official documentation or GitHub repo for a given technology.
  • 📝 Easily extensible: add your own docs to the config file.
  • 🖥️ Simple CLI interface.
  • 🧪 Fully tested and CI-friendly.

Installation

Prerequisites

  • Go 1.20 or newer

Build and Install

Clone the repository:

git clone https://github.com/yourusername/go-docs-cli.git
cd go-docs-cli

Build the binary:

make build

Install the binary and default config (requires sudo for system-wide install):

sudo make install

This will:

  • Copy the docs binary to /usr/local/bin/
  • Copy the config.yaml to /usr/local/etc/docs/config.yaml

Usage

Open Documentation

docs <name>
  • Opens the official documentation for <name> in your default browser.

Example

docs go

Opens https://go.dev/doc/

Open GitHub Repository

docs <name> --github

Example

docs python --github

Opens https://github.com/python/cpython

List Available Docs

docs list

Configuration

The documentation sources are defined in a YAML config file (default: /usr/local/etc/docs/config.yaml).

Example config.yaml:

documentation:
  docker:
    official: https://docs.docker.com/
    github: https://github.com/docker/docker
  go:
    official: https://go.dev/doc/
    github: https://github.com/golang/go
  python:
    official: https://docs.python.org/3/
    github: https://github.com/python/cpython
  # Add more entries as needed

Custom Config Location

You can override the config path by setting the DOCS_CONFIG_PATH environment variable:

export DOCS_CONFIG_PATH=/path/to/your/config.yaml

Development

Run Tests

make test

Run Tests with Coverage

make test-coverage

Clean Build Artifacts

make clean

Uninstall

sudo make uninstall

Contributing

  • Fork the repo and create a feature branch.
  • Add or update tests for your changes.
  • Open a pull request!

License

MIT


Credits

About

A simple CLI written in Go that is used to open documentation in your default web browser.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published