Skip to contents

Users can create custom pals using the .pal_add() function; after passing the function a role and prompt, the pal will be available in the pal addin.

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

Usage

.pal_add(role, prompt = NULL, interface = c("replace", "prefix", "suffix"))

.pal_remove(role)

Arguments

role

A single string giving a descriptor of the pal'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 pal will interact with the selection. For example, the cli pal "replace"s the selection, while the roxygen pal "prefixes" the selected code with documentation.

Value

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