Skip to content

rezerov/sorry

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sorry

A tiny Rust CLI that sends your terminal/git mistakes to an LLM and prints helpful advice.

It automatically includes your last 10 terminal commands for context.

sorry I messed up

Installation

cargo install --path .

Setup

0. Add shell function (recommended)

To get the most accurate command history, add the shell function to your shell config:

For Bash (~/.bashrc or ~/.bash_profile):

# Set path to sorry binary (adjust if installed elsewhere)
export SORRY_BIN="$HOME/.cargo/bin/sorry"

# Source the shell function
source /path/to/sorry/shell/sorry.bash

For Zsh (~/.zshrc):

# Set path to sorry binary (adjust if installed elsewhere)
export SORRY_BIN="$HOME/.cargo/bin/sorry"

# Source the shell function
source /path/to/sorry/shell/sorry.zsh

The shell function ensures history is captured from your current session. Without it, sorry will try to read from history files (which may not be up-to-date).

Optional: You can override the default count of 10 commands:

sorry 5 I need help  # Uses last 5 commands instead of 10

1. Configure a provider

# OpenAI
sorry --config-openai

# Groq (free tier available!)
sorry --config-groq

You'll be prompted for your API key and model:

🔧 Configuring groq

Enter API key: gsk-xxxxx
Enter model name (openai/gpt-oss-20b): 

✓ Configured groq with model 'openai/gpt-oss-20b'

2. Choose your mood

sorry --behaviour
🎭 Configure sorry's behaviour

Choose a mood:

  1. Treat me like a princess
  2. Treat me like a bro
  3. Treat me like a bitch

Select mood [1-3]: 

Moods:

  • Princess 👸 - Gentle, supportive, encouraging
  • Bro 🤙 - Casual, chill, brief
  • Bitch 💅 - Roasts you mercilessly, but still helps

Usage

sorry I made a mistake
sorry what did I just do
sorry help

It automatically includes your last 10 terminal commands for context. If you've set up the shell function (recommended), it reads from your current session's history. Otherwise, it falls back to reading from history files.

Commands

Command Description
sorry <message> Get help (includes last 10 commands as context)
sorry --config-openai Configure OpenAI
sorry --config-groq Configure Groq
sorry --behaviour Choose your mood
sorry --show-config Show current settings

Project Structure

src/
├── main.rs     # CLI entry point
├── config.rs   # Config types, moods, file I/O
├── cli.rs      # Interactive configuration
├── api.rs      # LLM API calls
└── history.rs  # Shell history reading

License

MIT

About

The shameful way to get answers in the terminal

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors