Liking cljdoc? Tell your friends :D

repling.agent.tool


*rg-command*clj

Shell command used for ripgrep lookups.

Shell command used for ripgrep lookups.
raw docstring

bashclj

(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:

  • required :dir - absolute working directory passed to shell/sh
  • :env - environment map passed to shell/sh
  • :in - stdin text passed to shell/sh
Runs 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`
raw docstring

file-editclj

(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"`
raw docstring

file-readclj

(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.
raw docstring

file-writeclj

(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"`
raw docstring

files-globclj

(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.
raw docstring

files-grepclj

(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.
raw docstring

tools-commonclj

(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.
raw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close