Projects / frick

frick

Sub-5ms terminal autocorrect in Go. Uses LLM context and directory awareness, with a safety tier that stops it from suggesting destructive commands.

Demo

Two real runs recorded with gemini-3.5-flash-lite: gti status becomes git status (safe, green), and git comit becomes git commit (warning, yellow).

Overview

frick is a command-line autocorrect for the terminal, in the spirit of thefuck, written in Go. When a command fails because of a typo, you type frick and it suggests the fix.

It starts in under 5 ms and asks an LLM (Gemini or Groq) with real context: the directory listing and the active virtualenv, so suggestions use filenames and module paths that exist.

Because it fixes commands that you then run, safety was the main design constraint. The binary never executes anything itself: it prints the chosen command and your own shell runs it, and every suggestion is labelled safe, warning or danger.

What it does

How it works

Interactive diagram · 9 steps
you run frick --cmd --exit gather seen before? miss suggestions hit, no API call The command you mistyped fails with exit code 127 (command not found). Nothing special has happened yet.$ gti statuscommand not found (127)1 A small function installed with eval "$(frick init)". It remembers your last command and its exit code, and calls the binary when you type frick.ƒShell functioneval "$(frick init)"2 The Go binary that coordinates everything. It starts in under 5 ms. It never executes commands itself; it only prints the one you choose.frick runGo binary, under 5 ms3 Previous corrections are stored locally. A repeated typo is answered from here with no API call, even offline.Offline cache~/.config/frick/5 Builds the prompt context: the directory listing, the active virtualenv and your previous suggestion, so corrections use files that really exist.Contextdir, venv, last try4 On a cache miss, Gemini or Groq returns structured JSON: a few corrected commands, each with a safety level. A custom endpoint can be set too.LLM APIGemini or Groq6 The chosen command is printed to stdout. Your own shell evaluates it in your session, and the failed command in history is replaced with the fix.stdout + evalyour shell runs it9 An interactive menu on the terminal: arrow keys to choose, Enter to run, Ctrl+C to cancel. DANGER suggestions ask you to type y or yes first.Picker on /dev/ttyEnter to run8 Every suggestion is labelled SAFE, WARNING or DANGER. Local keyword overrides, such as deploy or rm, can force DANGER.Safety tierSAFE / WARN / DANGER7
Pick a stepHover, focus or tap any shape to see what it does.
From a failed command to a corrected one. The dashed path is the offline cache, which skips the API call. Editable source (.excalidraw)
  1. You type a command that fails. The shell function from eval "$(frick init)" remembers the last command and its exit code.
  2. You run frick, which calls the Go binary with --cmd and --exit.
  3. The binary checks its local cache. On a miss it adds directory and virtualenv context and asks Gemini or Groq for corrections as structured JSON, each with a safety level.
  4. Local safety overrides are applied, then a picker opens on /dev/tty. Danger commands need y or yes.
  5. The chosen command goes to stdout and your shell runs it. The binary itself has no permission to execute anything, so every command runs visibly in your own session.

Install and try it

You need a Gemini or Groq API key. A key from Google AI Studio works.

  1. Install it

    If Homebrew refuses the tap as untrusted, run brew trust BriskAM/frick first. Without Homebrew, use curl -fsSL https://raw.githubusercontent.com/BriskAM/frick/main/install.sh | bash, or build from source with Go.

    brew tap BriskAM/frick
    brew install frick
  2. Add your API key
    frick configure
  3. Turn on shell integration

    Use ~/.bashrc instead for Bash.

    echo 'eval "$(frick init)"' >> ~/.zshrc
    source ~/.zshrc
  4. Try it

    Pick a suggestion with the arrow keys and press Enter.

    gti status
    frick

Notes

All projects · Home