https://github.com/buraksezer/gdoc
Search GoDoc.org via command-line
https://github.com/buraksezer/gdoc
go godoc golang
Last synced: 6 months ago
JSON representation
Search GoDoc.org via command-line
- Host: GitHub
- URL: https://github.com/buraksezer/gdoc
- Owner: buraksezer
- License: gpl-3.0
- Created: 2018-03-04T11:39:31.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-03-08T14:58:55.000Z (over 7 years ago)
- Last Synced: 2025-04-06T06:29:11.328Z (6 months ago)
- Topics: go, godoc, golang
- Language: Go
- Size: 931 KB
- Stars: 10
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gdoc
[](https://goreportcard.com/report/github.com/buraksezer/gdoc)gdoc is a small utility to search on GoDoc.org. It's also suitable to read package documents via command-line.
**Warning:** This tool is only tested on Linux and OSX.
### Install
With a properly configured Go environment:```
go get -u github.com/buraksezer/gdoc
```### Usage
#### Search something:```
gdoc search
```
gdoc lists the first 10 package as default. If you want to increase or decrease that number, use `-c/--count` parameter:```
gdoc search -c 3
```
gdoc has an interactive mode. If you use the `-i/--interactive` parameter when you search something, gdoc lists packages with numbers and await for your action to fetch its document from GoDoc.org.Sample output:
```
gdoc search -i memberlist
==> (1) github.com/hashicorp/memberlist
==> imports: 192 stars: 804
memberlist is a library that manages cluster membership and member failure detection using a gossip based protocol.==> (2) github.com/Nitro/memberlist
==> imports: 3 stars: 0
memberlist is a library that manages cluster membership and member failure detection using a gossip based protocol.==> (3) github.com/journeymidnight/nentropy/memberlist
==> imports: 3 stars: 1
....
Give a number to read the document:
```
#### Read package documentation:```
gdoc read
```Sample usage:
```
gdoc read github.com/hashicorp/memberlist
```Fetches the package document from GoDoc.org in text format and pipes to an available pager. gdoc looks for `GDOC_PAGER` and `PAGER` environment variables to get the pager command as respectively. If you want to disable paging, use `--disable-pager` parameter:
```
gdoc read --disable-pager
```gdoc supports aliases to access easily the frequently used documents. If you set an alias for a package previously, just use `-a/--alias` to get the document for that package.
```
gdoc read -a
```#### Aliases:
In order to add an alias for a package:
```
gdoc alias set
```Sample usage:
```
gdoc alias set memberlist github.com/hashicorp/memberlist
```
If you want to delete previously setted alias, just use `del` subcommand:
```
gdoc alias del
```
You can use `list` subcommand to list already setted aliases.### Contribution
gdoc is a free software, you feel free to send PRs to improve gdoc.### License
gdoc is licensed under the GNU General Public License v3.0 - see LICENSE for more details.