radium is a platform (client and optional server) for viewing reference articles, cheat sheets, snippets etc.
radium
is a platform (client and optional server) for viewing
reference articles, cheat sheets etc. right from a shell. radium
is written in Go
(Golang
)
radium.yaml
file in ~
to customize)radium
requires Go 1.8+ to build. Simply run make
command in
the source directory to build and install the binary into your $GOPATH/bin
directory. If you just want to build the binary, run make build
You can run radium --help
to see the list of available commands.
radium query "append file in go"
radium query dir --attr platform:windows
radium query go
--attr
is not part of radium framework but part of the source
implementation itself. Weather to consume the attributes or not
is decided by the source implementation.
For this, you need to run radium
in server mode first using the
command: radium serve --addr=localhost:8080
Then
curl "localhost:8080/search?q=append+file+in+go"
curl "localhost:8080/search?q=dir&platform=windows"
curl "localhost:8080/search?q=go"
When using http api, all query parameters except
q
andstrategy
will be
assumed to be attributes
Run radium serve --clipboard
to start radium in server+clipboard
mode (pass --addr=""
to run in clipboard-only mode).
Now, everytime you copy some text into clipboard (which is less than
5 words), radium
is going to run a query and try to find some results.
If a result is found, it will be pasted back into the clipboard
radium
works by querying/scraping different knowledge sources
(e.g. tldr-pages, LearnXInYMinutes etc.). A Source
in radium
is a Go
interface and can be implemented to add new references
to provide more relevant results.
type Source interface {
Search(query Query) ([]Article, error)
}
Currently following implementations are available:
sources.TLDR
using the awesome tldr-pages projectsources.LearnXInY
using the awesome Learn X In Y Minutes projectcheatsh.CheatSh
using the awesome cheat.sh projectsources.Radium
which can be used to query other radium
servers to enable distributed setupwikipedia.Wikipedia
which queries and extracts first paragraph from Wikipediaduckduckgo.DuckDuckGo
which uses DuckDuckGo Instant Answer APISee sources/README.md for more information