Skip to content

A Toolkit for Connecting R and Large Language Models

0packages depend
14.3Kdownloads / year
–test coverage
13/13flavors OK

Overview

About

A complete toolkit for connecting 'R' environments with Large Language Models (LLMs). Provides utilities for describing 'R' objects, package documentation, and workspace state in plain text formats optimized for LLM consumption. Supports multiple workflows: interactive copy-paste to external chat interfaces, programmatic tool registration with 'ellmer' chat clients, batteries-included chat applications via 'shinychat', and exposure to external coding agents through the Model Context Protocol. Project configuration files enable stable, repeatable conversations with project-specific context and preferred LLM settings.

Changes in 1.5.0

New features

  • Added btw cran versions <packages...> to look up CRAN release dates and versions, and versioned NEWS through btw(), btw_this(), the btw docs tools, and btw docs news. Use btw("@news dplyr v1.1.4") to paste a specific release's NEWS into a chat, or btw("@news dplyr") for the full file (#213).
  • btw docs and btw pkg src commands now auto-load an in-development package found in the current directory (or its pkg-r/, R/ subfolder) with pkgload::load_all() before running, so results reflect uncommitted local changes. Pass --no-dev to disable this and use the installed package instead (#212).
  • btw now supports shinychat >= 0.5.0 (#215):
  • btw_app() uses shinychat's new page_chat() layout, with the tool selection menu and the system prompt editor in offcanvas panels. When shinychat 0.4.x is installed, btw_app() falls back to the legacy sidebar layout and warns, suggesting you upgrade to shinychat 0.5.0.
  • Conversations are kept in a chat history. Past chats appear in the app's history drawer, so you can revisit a previous conversation at any time. When duckdb is installed, btw stores this history in a shared database in btw's user cache directory, with one history per project, so your chats are still there the next time you open the app in the same project. Without duckdb, conversations are not saved between sessions. btw prints a note that suggests installing duckdb.
  • btw's @ commands are also available as /btw-* slash commands, e.g. /btw-help dplyr::across, /btw-news dplyr v1.1.4, or /btw-url https://example.com. A slash command stages its context as an attachment on the chat input and shows a toast while it runs. Nothing is sent to the model until you submit your next message. If a command fails, btw_app() restores your input text and shows an error toast.
  • Skills are registered as slash commands under their own names, e.g. /skill-creator. Running a skill submits its instructions with your message to the model.
  • /new and /clear start a new chat. If chat history is enabled, btw_app() first saves the current conversation with shinychat's history-aware chat$new_chat() (posit-dev/shinychat#399), so the conversation isn't dropped from the history. The token and cost counters follow the active conversation and restore their totals when you load an old chat from the history.
  • Subagent reports use shinychat 0.5.0's HTML display protocol (contents_html()), with the full subagent conversation in a styled disclosure. btw_app() escapes untrusted markdown in subagent reports and in error toasts.
  • Tool results survive shinychat's conversation history serialization, so chats with tool results can be saved and restored. btw collapses multi-element character values to a single string, returns data frame results as JSON, and drops unserializable objects from run-R results.
  • Two new functions make the skill features reusable outside btw_app(). btw_skill_prompt() renders a skill's <skill> block, including its name, description, location, and optional compatibility and allowed-tools metadata. btw_skills_register_slash_commands() registers skills as slash commands on any shinychat chat_server().
Show all changes in 1.5.0Hide the rest of the changes in 1.5.0

Bug fixes

  • btw --version now works without a subcommand. Previously, Rapp's required top-level switch caused the CLI to print usage and exit before the version flag was ever checked.

Other changes

  • Local conversation history and project code-search indexes now use RSQLite, replacing DuckDB. Persistent data is stored in btw's user cache and separated by project; install RSQLite to enable this storage.
  • btw now requires ellmer (>= 0.4.2). The set_model() compatibility shim was removed, and client_get_models() now delegates to ellmer's models_list() generic, replacing a bespoke per-provider dispatch table (#214).
  • btw no longer reads the legacy user skills directory used by btw <= 1.2.0 (skills/ under tools::R_user_dir("btw", "config")) (#204).

From NEWS.md in the release

Install

Health

CRAN checks
13OK
Slowest check: 6.3 min · r-oldrel-windows-x86_64
Status changes
  • OK13 OK2026-09-29
  • ERROR12 OK, 1 ERROR2026-09-25
  • OK13 OK2026-09-11
  • ERROR12 OK, 1 ERROR2026-09-09
  • OK13 OK2026-09-04
Show 12 earlier changesHide 12 earlier changes
  • ERROR12 OK, 1 ERROR2026-08-06
  • OK13 OK2026-08-05
  • NOTE12 OK, 1 NOTE2026-08-01
  • OK13 OK2026-07-04
  • ERROR12 OK, 1 ERROR2026-07-03
  • OK13 OK2026-06-11
  • ERROR12 OK, 1 ERROR2026-06-08
  • OK13 OK2026-06-06
  • NOTE12 OK, 1 NOTE2026-06-05
  • OK13 OK2026-05-24
  • ERROR12 OK, 1 ERROR2026-05-14
  • OK14 OK2026-03-10
Advisories

none known

Documentation

In release 1.5.0
READMEYes · 402 wordsVignettesNoNEWSYes · 100% structured · mentions 1.5.0Citation fileNoWebsiteYes · pkgdown
Help pages
58 (2 internal)includes a package overview page
Examples that run
93%37 run in a plain check (16 of them under a condition) · 1 never run · 2 hold no code
Exported functions with examples
70%
Documented parameters
98%
Return-value docs
98%
Help pages citing references
0%

Downloads

14.3K
CRAN downloads in the past year
Rank #3,061 · ~39/day · ~1.2K/mo
Daily download trend is not available in this view yet.
1.6K30 days
4.2K90 days
14.3K1 year
Compare downloads with other packages →
Also on475 r2u18 autocran

Repository

141Stars
12Forks
20Open issues
4Open PRs
7Releases
998Commits
6Commit identities
aiai-agent-toolsellmerllmllm-toolsrstatsrstats-package
998 commits · Last activity 2026-10-06 · +2.9% stars, 30d · Default branch at 1.5.0.9000, ahead of CRAN 1.5.0 (checked 2026-10-11)
Responsiveness
How these are sampled
PRs merged (all time)
98%
Median days to close, 50 most recently updated closed issues
7
Median days to close, 50 most recently updated closed PRs
0

Stars over time

2025-10-17 · 672026-10-11 · 141
PracticesBeta

15 development-tooling and community-health practices detected across 8 families in the upstream repository

Checks run against github.com/posit-dev/btw on 2026-10-11.

Continuous integration (2)
GitHub ActionsR CMD check workflow

The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel

Governance and community (3)
Code of conductContributing guideSupport guide
Docs source (4)
README.Rmdpkgdown

GitHub Pages site last deployed 2026-10-06 · The repository has a site deploy workflow

pkgdown site last built 2026-09-09

Coverage (2)
Coverage reporting (Codecov).covrignore
Show all practicesHide 4 practices
Reproducibility and dev environment (1)
data-raw/
CRAN release process (1)
cran-comments.md
For agents and models (1)
Agent skills
Lint, format, editor (1)
RStudio project
How this is detected·Detection ruleset v3 (2026-09-26)
AI coding toolsBeta

This repository shows signs of AI coding tools.

  • Claude Codefirst seen 2025-10-15
    Named in .Rbuildignore: .claude
    Named in .gitignore: .claude, .claude/skills
    Commits: at least 5 crediting it in the message
  • GitHub Copilotfirst seen 2025-12-08
    Pull request: opened by its own account
    Commits: 1 by its own account
  • Gemini CLIfirst seen on or before 2026-07-18
    Config: a file or ignore line, not recorded which
Shared conventions any agent may read, so they name no particular tool.
Seen in the repository: AGENTS.md
Counts are commits, not lines of code. Commits by a tool's accounts count once across all of its accounts. Commits crediting it are the largest count among its credit lines, a minimum.How this is detected·Detection ruleset v4 (updated 2026-09-27)

Dependencies

Declared dependencies
48 external dependencies (excludes base and recommended)

Installing btw adds 70 packages (41 with compiled code, 53 MB of source tarballs). Heaviest: stringi 11 MB, bslib 5.6 MB, promises 3.1 MB.

Depends (1)
R >= 4.2.0
LinkingTo (0)
none
Enhances (0)
none
Reverse dependencies
0direct
0indirect

Nothing depends on this yet.

People & History

People (7)
Author, Maintainer since 1.0.0 (2025)
Author
Copyright holder
Material Design Icons
Copyright holder
countUp.js author
Copyright holder · added in 1.1.0
@vscode/codicons
Copyright holder, Funder
Releases (7)

Pick two releases to compare their code metrics.

  • 1.5.0Latest
    record
    2026-09-09 · current release · diff ↗ ·
    added 3 exports
    btw_skill_prompt, btw_skills_register_slash_commands, btw_tool_cran_versions
  • 1.4.0
    record
    2026-08-05 · diff ↗
  • 1.3.0
    record
    2026-07-02 · diff ↗ ·
    added 2 exports
    btw_skill_install_project, btw_tool_files_patch
  • R
    R 4.6.0 released · 2026-04-24
  • 1.2.1
    record
    2026-03-23 · diff ↗
  • 1.2.0
    record
    2026-03-16 · diff ↗ ·
    added 20 exports
    btw_agent_tool, btw_skill_install_github, btw_skill_install_package, btw_task, btw_task_create_skill, btw_tool_agent_subagent, btw_tool_cran_package, btw_tool_cran_search, btw_tool_files_edit, btw_tool_files_list, btw_tool_files_read, btw_tool_files_replace, btw_tool_files_search, btw_tool_files_write, btw_tool_pkg_load_all, btw_tool_sessioninfo_is_package_installed, btw_tool_sessioninfo_package, btw_tool_sessioninfo_platform, btw_tool_skill, install_btw_cli
  • 1.1.0
    record
    2025-12-23 · diff ↗ ·
    added 5 exports
    btw_tool_pkg_check, btw_tool_pkg_coverage, btw_tool_pkg_document, btw_tool_pkg_test, btw_tool_run_r
  • 1.0.0
    record
    2025-11-04
  • R
    R 4.5.0 released · 2025-04-11

Package metadata

First published
2025-11-04
Total releases
7 / 1 yrs
License
MIT + file LICENSE OSI
Minimum R
≥ 4.2.0
Download size
905 KB

Cite

Cite this package

Run in R for the authors' preferred citation:

citation("btw")
Aden-Buie, G., Google, Jamie Perkins, Microsoft, Posit Software, PBC, Cheng, J., & Couch, S. (2026). btw: A Toolkit for Connecting R and Large Language Models (Version 1.5.0) [Computer software]. https://doi.org/10.32614/CRAN.package.btw

This package has no citation file, so citation() returns this entry built from DESCRIPTION.

Cite the R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for btw version 1.5.0 [Data set]. HJJB, LLC. Data release v2026-10-19. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-19, which the citation names so these numbers can be found later. More on citing and the projects behind them.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy