Skip to contents

Users can create custom helpers using the .helper_add() function; after passing the function a chore and prompt, the helper will be available in the chores addin.

Most users should not need to interact with these functions. prompt_new() and friends can be used to create prompts for new helpers, and those helpers can be registered with chores using directory_load() and friends. The helpers created by those functions will be persistent across sessions.

Usage

.helper_add(chore, prompt = NULL, interface = c("replace", "prefix", "suffix"))

.helper_remove(chore)

Arguments

chore

A single string giving a descriptor of the helper's functionality. Cand only contain letters and numbers.

prompt

A single string giving the system prompt. In most cases, this is a rather long string, containing several newlines.

interface

One of "replace", "prefix", or "suffix", describing how the helper will interact with the selection. For example, the cli helper "replace"s the selection, while the roxygen helper "prefixes" the selected code with documentation.

Value

NULL, invisibly. Called for its side effect: a helper for chore chore is registered (or unregistered) with the chores package.