fixcmd is a command-line tool that helps you correct mistyped or uncertain shell commands, explains terminal errors, and provides usage examples — all using OpenAI's GPT models.
- ✅ Auto-correct mistyped terminal commands
- 🧠 Suggest correct commands for vague or unsure inputs
- ❌ Explain terminal errors and how to fix them
- 🔹 Show usage and real-world examples for shell commands
- 🔐 Secure OpenAI API key configuration
- Python 3.7+
- An OpenAI API key (starts with
sk-...)
pip install fixcmdfixcmd -setupThis will prompt you to enter your OpenAI API key and save it securely in ~/.fixcmd.env.
fixcmd gti statusOutput:
Invalid command:
gti status
Suggested:
git status
fixcmd -fix "remove all jpgs"Output:
Corrected Command:
rm *.jpg
Usage & Example:
Removes all JPG files in the current directory.
Example: $ rm *.jpg
fixcmd -ask "rm -rf"Output:
Suggested Command:
rm -rf
Usage & Example:
Recursively and forcefully deletes files and directories.
Example: $ rm -rf myfolder/
fixcmd -explain "fatal: not a git repository"Output:
Explanation:
You're trying to run a Git command in a directory that is not a Git repository.
Fix:
$ git init # to initialize a new repo
Or navigate to a valid repo directory
fixcmd -versionfixcmd -helpThe OpenAI API key is stored in this file:
~/.fixcmd.env
with this content:
OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxxxxx
Feel free to fork, improve, and submit PRs. Suggestions and issues welcome!
Developed by Parishith Ragumar