Getting started with chores

Chore helpers are persistent, ergonomic LLM assistants designed to help you complete repetitive, hard-to-automate tasks quickly.

library(chores)

The chores package ships with a number of pre-engineered “chore helpers.” A chore is a keyword that succinctly describes what the helper is intended to do and serves as an identifier to match the helper with its prompt and interface. A helper’s prompt is just a markdown file with enough context and examples to teach a model to carry out a given task well. A helper’s interface determines whether it replaces, prefixes, or suffixes the selected code. For example:

Choosing a model

The chores addin supports any model supported by ellmer. When choosing a model for use with chores, you’ll want to the use the most performant model possible that satisfies your privacy needs; chores automatically passes along your selected code to your chosen model, so it’s especially important to consider data privacy when using LLMs with chores.

chores uses the .chores_chat option to configure which model powers the addin. .chores_chat should be set to an ellmer Chat object. For example, to use Anthropic’s Claude, you might write options(.chores_chat = ellmer::chat_claude()). Paste that code in your .Rprofile via usethis::edit_r_profile() to always use the same model every time you start an R session.

If you’re using ellmer inside a organization, you’ll be limited to what your IT department allows, which is likely to be one provided by a big cloud provider, e.g. chat_azure(), chat_bedrock(), chat_databricks(), or chat_snowflake(). If you’re using ellmer for your own exploration, you’ll have a lot more freedom, so we have a few recommendations to help you get started:

The chores addin

Rather than through package functions directly, helpers are interfaced with via the chores addin. Once you have a default model set up, you’re ready to use the package in any RStudio session (even if you haven’t loaded the package yet).

Just:

A screencast of an RStudio session. An .R file is open in the editor with a function definition. The user selects various subsets of the function and, after selecting from a dropdown menu, the helper assistant converts erroring code and drafts function documentation.

Chore helpers are interfaced with the via the chores addin. For easiest access, we recommend registering the chores addin to a keyboard shortcut.

In RStudio, navigate to Tools > Modify Keyboard Shortcuts > Search "Chores"—we suggest Ctrl+Alt+C (or Ctrl+Cmd+C on macOS).

In Positron, you’ll need to open the command palette, run “Open Keyboard Shortcuts (JSON)”, and paste the following into your keybindings.json:

    {
        "key": "Ctrl+Cmd+C",
        "command": "workbench.action.executeCode.console",
        "when": "editorTextFocus",
        "args": {
            "langId": "r",
            "code": "chores::.init_addin()",
            "focus": true
        }
    }

The analogous keybinding on non-macOS is Ctrl+Alt+C. That said, change the "key" entry to any keybinding you wish!

Once those steps are completed, you’re ready to use helpers with a keyboard shortcut.

Adding custom helpers

While the chores package comes with three helpers for package development, one can use helpers for all sorts of coding tasks in R, from interactive data analysis to authoring with Quarto, or even for coding tasks in languages other than R! All you need to set up your own helper is a markdown file.

To learn more about adding custom helpers as well as how to share them with others, see the “Custom helpers” vignette with vignette("custom", package = "chores").