
A context-aware AI assistant that sits at your cursor - no chat, no switching.
Codriver brings AI code assistance directly to your cursor - no chat
window, no context switching, no copy-pasting. Press Ctrl+/
and codriver reads your cursor position and selection in the RStudio
source editor to automatically choose the right action: generate new
code from a comment, complete a line, continue from context, edit
existing code, or suggest a comment. Results appear in-place as ghost
text or a diff suggestion.
Run this R command to install the latest release of codriver from CRAN:
install.packages("codriver")Run these R commands to install the development version of codriver from GitHub:
# 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 walk-through 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.
For diagnostic information about configuration and versions, run codriver_info():
codriver::codriver_info()To inspect the system prompt, user prompt, and raw assistant response
from the most recent codriver request, run codriver_last_request():
codriver::codriver_last_request()MIT License, see LICENSE file.