πΆ arf console
Alternative R Frontend
arf is a modern, cross-platform R console written in Rust. It provides a rich interactive experience with fuzzy help search, intelligent history navigation, and syntax highlightingβall with fast startup times.
[!WARNING] arf is under active development. The configuration file format and history file format are not yet stable and may change without notice in future versions.

Highlights
-
Single Binary, Zero Dependencies β One small executable with no runtime dependencies. Just download and run.
-
rig Integration β Seamless rig (R Installation Manager) support. Switch R versions with
--with-r-versionflag, or use the:switchmeta command to change versions within a running session. -
Fuzzy History Search β fzf-style history search with
Ctrl+R. Type fragments to find past commands quickly. Import your existing history from radian or R's.Rhistory. -
Syntax Highlighting β Tree-sitter based highlighting for R code with customizable colors.
-
Interactive Help Browser β Fuzzy search through R documentation with
:helpor:h. Find any function across all installed packages instantly.
Features
- Cross-platform: Linux, macOS, and Windows
- Vi and Emacs editing modes
- Multiline editing with proper indentation
- Auto-matching brackets and quotes (with smart skip-over)
- Tab completion for R objects, functions, and file paths inside strings
- Customizable keyboard shortcuts (
Alt+-β<-,Alt+Pβ|>) - Command status indicator (shows error symbol when previous command failed)
- Reprex mode with optional auto-formatting via Air
- Shell mode (
:shellto enter,:rto return) - Configurable prompts and colors with placeholders (
{version},{cwd},{status}) - Syntax highlighting with customizable colors
- SQLite-backed persistent history with import/export support
- IPC server for AI agent and CI integration
- Headless mode for non-interactive environments (CI, background jobs)
Installation
Pre-built binaries are available from GitHub Releases. You can install them using one of the following methods:
Shell Installer (Linux/macOS)
|
winget (Windows)
Scoop (Windows)
cargo-binstall
Manual Download
Download the archive for your platform from GitHub Releases and extract the binary to a directory in your PATH.
Build from Source
[!NOTE] For Windows: A fix for VT input handling (bracketed paste, etc.) is pending in an upstream dependency (crossterm#1030).
So installing from crates.io (
cargo install arf-console) is not recommended.
Third-Party distributions
AUR (Arch Linux/Manjaro)
# or use paru
Quick Start
# Launch arf
# Use a specific R version (requires rig)
# Enable reprex mode for reproducible examples
Interactive Help
Press :h or :help to open the fuzzy help browser:
β Help Search [12345 topics] βββββββββββββββββββββββββ
Filter: mutate_
> dplyr::mutate Create, modify, and delete columns
dplyr::mutate_all Mutate multiple columns
dplyr::mutate_at Mutate multiple columns
dplyr::mutate_if Mutate multiple columns
βββββββββββββββββββββββββββββββββββββββββββββββββββββ
ββ navigate Tab/Enter select Esc exit
Meta Commands
| Command | Description |
|---|---|
:help, :h |
Open interactive help browser |
:info, :session |
Show session information (version, config path, etc.) |
:shell |
Enter shell mode |
:r |
Return to R mode |
:system <cmd> |
Execute a single shell command inline |
:reprex |
Toggle reprex mode |
:autoformat, :format |
Toggle auto-formatting (requires Air) |
:switch <version> |
Restart with different R version (requires rig) |
:restart |
Restart R session |
:cd [path] |
Change working directory (no args β home) |
:pushd <path> |
Push current directory to stack and change to path |
:popd |
Pop directory from stack and change to it |
:history browse |
Browse and manage command history |
:history clear |
Clear command history (supports r, shell, all targets) |
:history schema |
Display history database schema and R examples |
:commands, :cmds |
Show available commands |
:quit, :exit |
Exit arf |
Configuration
arf uses a TOML configuration file located at:
- Linux:
~/.config/arf/arf.toml - macOS:
~/Library/Application Support/arf/arf.toml - Windows:
%APPDATA%\arf\arf.toml
Generate a default configuration with:
Example Configuration
[]
= "auto" # "auto", "rig", or { path = "/path/to/R" }
= true
# Initial mode settings (can be toggled at runtime)
[]
= false
= false # Requires Air CLI
[]
= "emacs" # "emacs" or "vi"
= true # Auto-close brackets and quotes
= "all" # "none", "all", or "cwd"
# Keyboard shortcuts (crokey format)
[]
= " <- "
= " |> " # Use "ctrl-shift-m" for RStudio-style
[]
= "{status}R {version}> "
= "+ "
= "[{shell}] $ "
= "prefix" # "prefix", "suffix", or "none"
# Command status indicator
[]
= { = "β " } # success = "" (empty) by default
= false
# R runtime configuration
[]
= true # Sync options(width) with terminal size
# Reprex static configuration
[]
= "#> "
# Syntax highlighting colors
[]
= "LightBlue"
= "Green"
= "DarkGray"
= "LightMagenta"
= "Yellow"
[]
= "LightGreen"
See the full Configuration Guide for all options.
Headless Mode & IPC
[!NOTE] This feature is experimental and may change in future versions.
Run R without a terminal and interact via IPC β useful for AI agents, CI, and editor extensions. Unlike MCP-based solutions that require R package installation and an MCP client, arf provides a single binary with a simple CLI for programmatic R access:
# Start headless R with IPC server
# From another terminal, evaluate R code
# Get session info as JSON
|
# Shut down when done
See the full IPC & Headless Mode Guide for details.
Experimental Features
Features in this section are under development and may change or be removed in future versions. Configure them under the [experimental] section.
Spinner
Displays an animated spinner at the start of the line while R is evaluating code, providing visual feedback that the system is busy. Disabled by default.
To enable, set the frames option:
[]
= "β β β Ήβ Έβ Όβ ΄β ¦β §β β " # Braille dots
= "Cyan" # Spinner color (default: Cyan)
Configuration options:
| Option | Default | Description |
|---|---|---|
frames |
"" (disabled) |
Animation frames (each character is one frame). |
color |
"Cyan" |
Spinner color. Accepts standard ANSI color names: Black, Red, Green, Yellow, Blue, Magenta, Cyan, White, and their Light variants (e.g., LightBlue). |
Frame style examples:
# Braille dots (recommended)
= "β β β Ήβ Έβ Όβ ΄β ¦β §β β "
# ASCII spinner (works in all terminals)
= "|/-\\"
# Block spinner
= "ββββ"
Auto-completion while typing
Show the completion menu automatically after typing a minimum number of characters, without requiring Tab.
[]
= 3 # Show completions after 3 characters
When not set, completion requires pressing Tab (the default behavior). This is similar to radian's complete_while_typing feature.
Fuzzy R completion
Use fuzzy matching for R code completions. When enabled, typing sf::geo can match sf::st_geometry and library(dpl can match dplyr. Disabled by default.
[]
= true
Both :: (exported names) and ::: (internal names) are supported. Package exports are cached per-package with a 5-minute TTL for performance.
The package_functions option controls which function calls trigger package-name fuzzy completion (defaults to ["library", "require"]). Users can add custom functions like "box::use":
[]
= true
= ["library", "require", "box::use"]
History forget
Automatically remove commands that produced errors from history. Similar to fish's sponge plugin.
[]
= true
= 2 # Keep last N failed commands for quick retry
= false # Purge on each prompt (false) or only on exit (true)
Configuration options:
| Option | Default | Description |
|---|---|---|
enabled |
false |
Enable automatic removal of failed commands. |
delay |
2 |
Number of recent failed commands to keep accessible for retry. Older failed commands are purged. |
on_exit_only |
false |
If true, only purge when session ends. If false, purge on each prompt. |
History export/import
[!CAUTION] These features are experimental and have not been thoroughly tested. The format and behavior may change in future versions.
Export
Export both R and shell history to a unified SQLite file for backup or transfer:
# Export to a unified file
# Export with custom table names
Options:
| Option | Description |
|---|---|
--file |
Path to output SQLite file (required) |
--r-table |
Table name for R history (default: r) |
--shell-table |
Table name for shell history (default: shell) |
Import
Import command history from radian, R's native .Rhistory, or another arf database:
# Preview what would be imported (dry run)
# Import from radian (default: ~/.radian_history)
# Import from R's native history
# Import from a unified export file (restores both R and shell history)
# Import from a single-database file (r.db or shell.db)
# Import with custom hostname (to distinguish from native entries)
Options:
| Option | Description |
|---|---|
--from |
Source format: radian, r, or arf (required) |
--file |
Path to source file (required for arf, defaults to standard locations for others) |
--hostname |
Custom hostname to mark imported entries |
--dry-run |
Preview without importing |
--import-duplicates |
Import duplicate entries instead of skipping them |
--unified |
Force unified file mode (import both R and shell from table names) |
--r-table |
Table name for R history in unified file (default: r) |
--shell-table |
Table name for shell history in unified file (default: shell) |
Supported sources:
| Source | Description | Timestamps | Multiline | Mode routing |
|---|---|---|---|---|
radian |
~/.radian_history |
Preserved | Preserved | By # mode: |
r |
.Rhistory or R_HISTFILE |
- | - | β r.db |
arf |
SQLite database (--file required) |
Preserved | Preserved | By filename or --unified |
Mode routing for arf format:
- Files named
r.dborshell.db: Single-database import (by filename) - Other filenames or
--unifiedflag: Unified import (by table names, imports both R and shell)
Notes:
- By default, duplicate entries are skipped during import (matched by command text and timestamp). Use
--import-duplicatesto import all entries regardless. - Self-import is detected and rejected when importing from an arf database to the same target file.
- Important: Exit arf before exporting to ensure the source databases are in a consistent state. The export itself uses atomic writes to prevent incomplete output files, but reading while arf is writing may capture inconsistent data.
Restore from backup:
# Restore history from a unified export file
Known Issues
Error detection uses options(error = ...)
arf uses R's options(error = ...) to detect errors from packages like dplyr/rlang that output error messages to stdout instead of stderr. This is necessary for accurate error tracking in command history and the status indicator.
Limitations:
- If you set a custom error handler via
options(error = ...), arf will chain to your handler, but arf's handler takes precedence. Your handler will still be called after arf records the error. - There is a slight performance overhead (~microseconds) on each prompt due to R API calls for checking and resetting error state. This is negligible in practice but may be noticeable in benchmarks.
Related Projects
-
radian β A 21st century R console written in Python. arf draws inspiration from radian's design philosophy.
-
sircon β Simple R Console. A Windows-only R console with powerful autocomplete and a macro language for custom shortcuts. Some of sircon's advanced features are future goals for arf.
Acknowledgements
arf is built upon the broad Rust ecosystem and the remarkable efforts of those who have created open-source tools for R. In particular, we would like to highlight the following projects:
-
ark β The
arf-librandarf-harpcrates are derived from ark'slibrandharpcrates, which provide the foundation for embedding R in Rust applications. Windows initialization follows ark's pattern. tree-sitter-r powers syntax highlighting and code analysis. -
radian β arf's design and many features are inspired by radian, including shell mode, stderr formatting, and tab completion patterns. The feedback and discussions in radian's GitHub issues over the years have also been invaluable.
-
felp β The interactive fuzzy help browser concept was inspired by felp's
fuzzyhelp()function. -
reedline β The line editor library from the Nushell project that powers arf's interactive editing.
-
mcp-repl β The headless mode's pager redirection and graphics device configuration are based on mcp-repl's approach for non-interactive R sessions.
-
MCPRepl.jl / Kaimon.jl β The IPC server design (shared REPL with agent code visibility, synchronous evaluation via backend queue) was heavily informed by these Julia MCP server implementations.
License
MIT