
A context-aware AI assistant for RStudio that is literally at your fingertips.
Codriver works directly in the RStudio source editor, without switching context or opening a separate chat window. When you press the keyboard shortcut, codriver reads your cursor position and selection to choose one of five modes β complete, generate, continue, edit, or comment β and presents suggestions in-place.
Run these R commands:
# Install remotes package if necessary
install.packages("remotes")
# Install codriver from GitHub
remotes::install_github("vdwulp/codriver")Configure codriver to connect to your LLM provider or local model server:
# OpenAI
codriver::codriver_configure("openai", model = "gpt-4.1")
# Anthropic Claude
codriver::codriver_configure("anthropic", model = "claude-sonnet-4-5")
# OpenAI-compatible endpoint
codriver::codriver_configure("openai_compatible",
base_url = "https://llmproxy.example.com/v1",
model = "gpt-4.1"
)Codriver builds on ellmer
and supports any LLM provider ellmer supports, covering a wide range of
cloud and local model servers. For most providers, ellmer reads API
credentials from an environment variable, for example
OPENAI_API_KEY, ANTHROPIC_API_KEY or
GOOGLE_API_KEY. See Getting
started for more information on provider configuration.
Restart RStudio after configuration for the keyboard shortcut to take effect.
βΆοΈ Invoke codriver β press
Ctrl+/ in the RStudio source editor.
Codriver takes it from there.
A keyboard shortcut is strongly recommended for the best codriver
experience. If you skipped registering the default shortcut
Ctrl+/ during configuration or want to change it later, use
Tools > Modify Keyboard Shortcuts in
RStudio.
Codriver determines the mode from your cursor position and any selection. At a high level:
| Mode | Trigger | Action |
|---|---|---|
| complete | At end of a code line | Completes the line |
| generate | On a comment line | Uses the comment as an instruction to generate new code |
| continue | In whitespace | Generates a new line or block from context only |
| edit | In existing code | Suggests improvements or fixes |
| comment | In an inline comment | Suggests or improves a short inline comment |
Results appear as ghost text - gray italic, accept
with TAB, dismiss by moving the cursor - or as an
edit suggestion with green/red highlighting - accept
with TAB or Apply, dismiss with
Escape or Discard.
See Using codriver for a full walkthrough of all modes and result presentation.
Codriver sends (parts of) your editor context and session information directly to the LLM provider or model server you configure. There is no intermediary server. Sent information includes metadata about objects in the RStudio global environment (names, named elements, types and dimensions), but not data values. Be aware of this before using Codriver in projects with sensitive or proprietary information.
Please review your providerβs data policy before use.
MIT License, see LICENSE file.