简体中文 GitHub ↗

zsh · Bash · Fish

Your terminal.
In your flow.

OPEN-SOURCE TERMINAL AUTOCOMPLETE · AN INDEPENDENT FIG-INSPIRED PROJECT

See candidates as you type. Press the right arrow to insert one. Completion menus and directory-scoped history suggestions work together—no separate autosuggestion plugin needed.

v0.3.1 supports zsh, Bash 4.4+, and Fish 3.6+. Shell support & requirements ↗

01 Appears as you type02 Nested completion03 Uses your environment
rfig — zsh⌘
❯ git checkout
→①feature/ui-refresh
●main
●release/0.1
↑ ↓ Select · → Insert · Enter Run
↳ One more level. Just as easy.

LIVE IN YOUR TERMINAL

Completion, right at your cursor.

Stay in your terminal without memorizing every subcommand. Insert a candidate and keep typing to explore the next level.

Recorded in a real terminalrfig / zsh
rfig in zsh: progressive Git completion from g to gi to git checkout and a dynamic branch, plus Brew services and npm scripts

↗ Type g, gi, and git to follow the completion context into checkout, then choose a live branch. The same recording shows dynamic Brew and npm candidates, arrow-key navigation, insertion, execution, and dismissal.

BUILT FOR FLOW

Fewer interruptions.
More focus.

Keep the terminal you know. Let rfig help you remember what comes next.

01 / AS YOU TYPE

History first. Completion next.

At most one history suggestion from the current directory appears first, marked ◷. Ordinary candidates complete only what you type. Browse with the arrow keys and insert with Right; selecting history fills the whole command without executing it. There is no inline gray text. Enter runs only your actual input, and Ctrl+E moves to the end of the line.

02 / IN CONTEXT
{git}

Candidates that follow your context.

Start with your shell’s completion definitions, then use available scripts, protocols, and cached help. Branches and paths follow your environment; nested completion depends on the source.

03 / YOUR HABITS
① Frequent  ② Next choice  ↳ More

Your habits shape the order.

Selections and executions build a score for each command context. Frequently used candidates move up; up to three get circled numbers. Every other candidate remains accessible, and records stay on your machine.

Type gi: even if the first history row is git checkout master, ordinary completions still use only gi. Colors follow your terminal’s ANSI palette, with an arrow and text color marking the selection.

KNOW WHAT WORKS

Choose your familiar shell.

v0.3.1 supports these shells. Enable each one as needed.

Shell support in the current source.
FeatureszshBash 4.4+Fish 3.6+
Automatic menus & nested candidates✅ Supported✅ Supported✅ Supported
Directory-scoped autosuggestions✅ Supported✅ Supported✅ Supported
Usage ranking & category colors✅ Supported✅ Supported✅ Supported

macOS and Linux

Linux x86_64 and ARM64 are supported. Help probing uses Landlock + seccomp and requires Landlock ABI 3+ (typically Linux 6.2+). Existing completions and history remain available without it. Download packages for either architecture from Releases.

Enable the shells you use

Run rfig setup --shell zsh for zsh, or replace the shell name with bash or fish. Open a new session afterward. Your default shell stays the same.

HOW IT WORKS

Install. Set up.
Make yourself at home.

Setup scans executables in your current PATH and common completion directories. On macOS/Linux, eligible commands without rules are analyzed sequentially in an available sandbox. Dynamic candidates are still queried as needed.

01Install rfig

Choose Homebrew, a prebuilt package, or a source installation.

02Run setup

Enable integration for $SHELL or your --shell choice. Enrichment continues in the background when a sandbox is available; setup can be repeated.

03Open a new session

Available candidates appear below your input. History is recorded by directory as you use rfig.

GET STARTED

Ready for your terminal.

Build from source on macOS or Linux. Linux packages are available for x86_64 and ARM64 and require glibc 2.36+. Homebrew and downloaded packages follow published releases. The Bash 3.2 bundled with macOS is not supported.

Run in your terminal
brew install tamia6/tap/rfig
"$(brew --prefix rfig)/bin/rfig" setup

Install the Tap release. Setup uses $SHELL by default; open a new session of that shell afterward.

A FEW DETAILS

A few things before you start.

Do I still need zsh-autosuggestions?

No. rfig includes history-based autosuggestions that replace its history suggestion functionality. Remove the old plugin from .zshrc or your plugin manager, then open a new session. Fish integration also disables native autosuggestions in favor of rfig’s directory-scoped history.

Is rfig a Fig alternative?

rfig is an independent, open-source terminal autocomplete project inspired by Fig. It is not affiliated with Fig and does not claim compatibility with every Fig feature or specification.

Does rfig complete every command?

No. Candidate coverage depends on completion definitions, scripts, generators, and cached help available on your system. Some commands may have no candidates or only basic help-derived candidates.

Does rfig use AI?

No. Completion, history suggestions, and usage ranking run locally; no AI service or cloud account is required.

Does rfig import old history or scan my whole computer?

Old shell history without directory information is not imported automatically. Scanning covers your current PATH and common completion directories, not the whole disk. History, selection records, and caches live in ~/.config/rfig/.

Does Enter accept the selected history suggestion?

No. Enter executes only your actual input. Use Right at the end of the line to insert the selected history or completion row, then press Enter to execute. Ctrl+E only moves to the end of the line.

Does help analysis support nested commands?

Yes. rfig analyze walks declared subcommands breadth first with --help / -h until leaf commands, with no fixed depth limit. zsh, Bash, and Fish read the same per-path cache. Probes run sequentially in the sandbox with existing limits; repeated parent help stops a branch, and failed probes preserve previous cache data and report the failure. Typing does not trigger new help scans. Dynamic resource names still require a completion provider. Filesystem fallback at known command groups and empty native results can use the help cache; native dynamic leaf arguments stay available.

Why do some commands have no candidates?

A command may have no usable definition, or background analysis may be pending, skipped, or unsuccessful. Check ~/.config/rfig/enrich.status: done means processing ended, not that every command succeeded. Refresh one with rfig analyze <command>. If Landlock is unavailable or restricted on Linux, probing is refused rather than run without isolation.

How do Homebrew upgrades update shell integration?

Run setup once per shell using the updated Homebrew version. It links zsh, Bash, and Fish integration to the package’s stable opt path. After brew upgrade rfig, open a new shell session; setup does not need to run again. Older copied scripts need this one-time migration. Keep one installation method: an old ~/.local/bin/rfig can shadow Homebrew. Back up and remove that duplicate, leaving history and usage data intact.

How do I enable another shell?

Run rfig setup --shell zsh, rfig setup --shell bash, or rfig setup --shell fish, then open a new session of that shell. Setup does not change your default shell, and candidates may differ between shells.