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.
- Go
- Shell integration
- Gemini / Groq
- Homebrew
Demo
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
- Fast start. A Go binary that starts in under 5 ms, so it never slows the shell down.
- Context aware. Sends the directory listing and virtualenv state, so corrections use real filenames and module paths.
- Safety tiers. Each suggestion is labelled SAFE, WARNING or DANGER. Danger commands, like
rm -rf, need you to typeyoryesbefore they run. - Local overrides. Force chosen keywords, for example
deployorrm, to DANGER in~/.config/frick/config.json. - Double-frick. If a correction also fails and you run
frickagain, it knows and tries a different approach. - Offline cache. Repeated typos are answered from a local cache without calling the API.
- Clean history. The failed command and the
frickcall are replaced in your shell history by the corrected one. - Bring your own model. Works with Gemini or Groq, and a custom endpoint such as a proxy or a local gateway can be set in the config.
How it works
- You type a command that fails. The shell function from
eval "$(frick init)"remembers the last command and its exit code. - You run
frick, which calls the Go binary with--cmdand--exit. - 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.
- Local safety overrides are applied, then a picker opens on
/dev/tty. Danger commands needyoryes. - 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.
- Install it
If Homebrew refuses the tap as untrusted, run
brew trust BriskAM/frickfirst. Without Homebrew, usecurl -fsSL https://raw.githubusercontent.com/BriskAM/frick/main/install.sh | bash, or build from source with Go.brew tap BriskAM/frick brew install frick - Add your API key
frick configure - Turn on shell integration
Use
~/.bashrcinstead for Bash.echo 'eval "$(frick init)"' >> ~/.zshrc source ~/.zshrc - Try it
Pick a suggestion with the arrow keys and press Enter.
gti status frick
Notes
- frick sends the failed command, its exit code and the directory context to the model provider you configure. Don't use it where that would be a problem.
- The demo was recorded in a throwaway directory with an isolated config, so it never touched a real shell setup.