Skip to contents

Core functions

btw()
Plain-text descriptions of R objects
btw_this()
Describe something for use by an LLM
btw_client() btw_app()
Create a btw-enhanced ellmer chat client
btw_tools()
Tools: Register tools from btw
btw_mcp_server() btw_mcp_session()
Start a Model Context Protocol server with btw tools
install_btw_cli()
Install the btw CLI

Project Context

use_btw_md() edit_btw_md()
Create or edit a btw.md context file
btw_task_create_btw_md()
Task: Initialize Project Context File

Describe R stuff

btw_this()
Describe something for use by an LLM
btw_this(<character>)
Describe objects
btw_this(<data.frame>) btw_this(<tbl>)
Describe a data frame in plain text
btw_this(<environment>)
Describe the contents of an environment

Agent Skills

btw_tool_skill()
Tool: Load a skill
btw_skill_install_github()
Install a skill from GitHub
btw_skill_install_package()
Install a skill from an R package
btw_task_create_skill()
Task: Create a Skill

Tasks and Agents

Tasks, or agents, are higher-level functions that combine system prompts and tools to perform more complex operations.

Tasks are typically designed for interactive use (e.g. to collaboratively create a project context file), but they can also be used programmatically.

btw_task()
Run a pre-formatted btw task
btw_agent_tool()
Create a custom agent tool from a markdown file
btw_task_create_btw_md()
Task: Initialize Project Context File
btw_task_create_readme()
Task: Create a Polished README
btw_task_create_skill()
Task: Create a Skill

Tools

Register all of these tools with an ellmer chat using chat$register_tools(btw_tools()). These tools generally all have counterparts available via btw() and btw_this() for interactive use. The long and awkward function names are for LLMs and to avoid name clashes with other tools.

btw_tool_agent_subagent()
Tool: Subagent
btw_tool_cran_package()
Tool: Describe a CRAN package
btw_tool_cran_search()
Tool: Search for an R package on CRAN
btw_tool_docs_package_news()
Tool: Package Release Notes
btw_tool_env_describe_data_frame()
Tool: Describe data frame
btw_tool_env_describe_environment()
Tool: Describe an environment
btw_tool_files_edit()
Tool: Edit a text file
btw_tool_files_list()
Tool: List files
btw_tool_files_read()
Tool: Read a file
btw_tool_files_replace()
Tool: Replace exact strings in a text file
btw_tool_files_search()
Tool: Code Search in Project
btw_tool_files_write()
Tool: Write a text file
btw_tool_git_branch_checkout()
Tool: Git Branch Checkout
btw_tool_git_branch_create()
Tool: Git Branch Create
btw_tool_git_branch_list()
Tool: Git Branch List
btw_tool_git_commit()
Tool: Git Commit
btw_tool_git_diff()
Tool: Git Diff
btw_tool_git_log()
Tool: Git Log
btw_tool_git_status()
Tool: Git Status
btw_tool_github()
Tool: GitHub
btw_tool_ide_read_current_editor()
Tool: Read current file
btw_tool_docs_package_help_topics() btw_tool_docs_help_page() btw_tool_docs_available_vignettes() btw_tool_docs_vignette()
Tool: Describe R package documentation
btw_tool_pkg_check()
Tool: Run R CMD check on a package
btw_tool_pkg_coverage()
Tool: Compute package test coverage
btw_tool_pkg_document()
Tool: Generate package documentation
btw_tool_pkg_load_all()
Tool: Load package code
btw_tool_pkg_test()
Tool: Run package tests
btw_tool_run_r() experimental
Tool: Run R code
btw_tool_sessioninfo_is_package_installed()
Tool: Check if a package is installed
btw_tool_sessioninfo_package()
Tool: Gather information about a package or currently loaded packages
btw_tool_sessioninfo_platform()
Tool: Describe user's platform
btw_tool_skill()
Tool: Load a skill
btw_tool_web_read_url()
Tool: Read a Web Page as Markdown