Tool provisioning: descriptions and install hints per package manager.
(require-tool :ripgrep) => (ok {:path "/usr/bin/rg"}) or (err :tool/missing {:hints [...]})
What a tool is CALLED is not stated here — it is one fact, owned by
shell.binary, which shell.search reads too. This namespace answers
"is it here, and how do I install it"; that one answers "what is it
called".
Tool provisioning: descriptions and install hints per package manager.
(require-tool :ripgrep) => (ok {:path "/usr/bin/rg"})
or (err :tool/missing {:hints [...]})
What a tool is CALLED is not stated here — it is one fact, owned by
`shell.binary`, which `shell.search` reads too. This namespace answers
"is it here, and how do I install it"; that one answers "what is it
called".(list-tools)List all registered tools with their availability status.
:bin is the upstream name; :resolved-bin is the name that answered here,
present only when the two differ. Availability is decided by probing every
name the tool goes by — probing :bin alone reported a distro-renamed tool
as unavailable while require-tool found it, so the two disagreed about the
same machine.
List all registered tools with their availability status. `:bin` is the upstream name; `:resolved-bin` is the name that answered here, present only when the two differ. Availability is decided by probing every name the tool goes by — probing `:bin` alone reported a distro-renamed tool as unavailable while `require-tool` found it, so the two disagreed about the same machine.
(register-tool! tool-key {:keys [bin bin-alts desc install] :as spec})Dynamically register a new tool. Returns SPEC.
:bin and :bin-alts are forwarded to shell.binary and are NOT stored
here, so a name declared through this call is the same fact shell.search
reads. Omit them for a tool whose id is already a registered identity.
Dynamically register a new tool. Returns SPEC. `:bin` and `:bin-alts` are forwarded to `shell.binary` and are NOT stored here, so a name declared through this call is the same fact `shell.search` reads. Omit them for a tool whose id is already a registered identity.
(require-tool tool-key)(require-tool tool-key pkg-managers)Check if a tool is available. Returns (ok {:path ... :bin ...}) or (err :tool/missing {:tool ... :hints ...}).
The :bin in a successful Result is the name that actually ANSWERED, which
on a distro that renamed the program is not the upstream one — spawn THAT.
The names probed, and their order, come from shell.binary.
Available package managers are detected once and cached.
Check if a tool is available. Returns (ok {:path ... :bin ...})
or (err :tool/missing {:tool ... :hints ...}).
The `:bin` in a successful Result is the name that actually ANSWERED, which
on a distro that renamed the program is not the upstream one — spawn THAT.
The names probed, and their order, come from `shell.binary`.
Available package managers are detected once and cached.(require-tools tool-keys)Check multiple tools at once. Returns a map of {:available {...} :missing {...}}.
Check multiple tools at once. Returns a map of {:available {...} :missing {...}}.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |