Shell command used for ripgrep lookups.
Shell command used for ripgrep lookups.
(bash command)(bash command {:keys [dir env in] :as opts})Runs a bash command string via clojure.java.shell/sh.
Supported form:
[command opts]opts accepts:
:dir - absolute working directory passed to shell/sh:env - environment map passed to shell/sh:in - stdin text passed to shell/shRuns a bash command string via `clojure.java.shell/sh`. Supported form: - `[command opts]` `opts` accepts: - required `:dir` - absolute working directory passed to `shell/sh` - `:env` - environment map passed to `shell/sh` - `:in` - stdin text passed to `shell/sh`
(file-edit path find replace)(file-edit path
find
replace
{:keys [replace-all? charset] :or {charset "UTF-8"}})Edits a file via simple string replacement.
Supported forms:
[path find replace][path find replace opts]path must be an absolute file path.
opts accepts:
:replace-all? - when truthy, replaces every occurrence instead of only the
first:charset - Java charset name, defaults to "UTF-8"Edits a file via simple string replacement. Supported forms: - `[path find replace]` - `[path find replace opts]` `path` must be an absolute file path. `opts` accepts: - `:replace-all?` - when truthy, replaces every occurrence instead of only the first - `:charset` - Java charset name, defaults to `"UTF-8"`
(file-read path)(file-read path charset)Reads a text file.
Supported forms:
[path] uses UTF-8[path charset]path must be an absolute file path. charset must be a valid Java charset
name.
Reads a text file. Supported forms: - `[path]` uses UTF-8 - `[path charset]` `path` must be an absolute file path. `charset` must be a valid Java charset name.
(file-write path content)(file-write path content {:keys [append? charset] :or {charset "UTF-8"}})Writes a text file, creating parent directories when needed.
Supported forms:
[path content][path content opts]path must be an absolute file path.
opts accepts:
:append? - when truthy, appends instead of truncating the file:charset - Java charset name, defaults to "UTF-8"Writes a text file, creating parent directories when needed. Supported forms: - `[path content]` - `[path content opts]` `path` must be an absolute file path. `opts` accepts: - `:append?` - when truthy, appends instead of truncating the file - `:charset` - Java charset name, defaults to `"UTF-8"`
(files-glob path pattern)Lists files under a path that match a glob pattern.
path must be an absolute path pointing to a directory to search recursively
or to a single file. pattern must be a non-empty Java glob expression.
Returns a map with :matches as the vector of matched file paths.
Lists files under a path that match a glob pattern. `path` must be an absolute path pointing to a directory to search recursively or to a single file. `pattern` must be a non-empty Java glob expression. Returns a map with `:matches` as the vector of matched file paths.
(files-grep path pattern)(files-grep path pattern glob-pattern)(files-grep path pattern glob-pattern ignore-case?)Searches file contents with ripgrep when available, otherwise with Java.
Supported forms:
[path pattern][path pattern glob-pattern][path pattern glob-pattern ignore-case?]path must be an absolute directory or file path. glob-pattern narrows
which files are searched. ignore-case? toggles case-insensitive matching.
Searches file contents with ripgrep when available, otherwise with Java. Supported forms: - `[path pattern]` - `[path pattern glob-pattern]` - `[path pattern glob-pattern ignore-case?]` `path` must be an absolute directory or file path. `glob-pattern` narrows which files are searched. `ignore-case?` toggles case-insensitive matching.
(tools-common)Returns the standard built-in tool var vector.
This is the easiest way to register the common file, shell, and search tools on a new agent.
Returns the standard built-in tool var vector. This is the easiest way to register the common file, shell, and search tools on a new agent.
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 |