ohshit
Version, currently master branch1 version
- master branchlatestMay 18, 2019
github.com/watzon/ohshit
Oh Shit! is the command fixer you didn't know you needed. Inspired by thefuck.
Installation
# Add this to your shard.yml
dependencies:
ohshit:
github: watzon/ohshit
branch: mastermaster is a branch, not a release, so this tracks it rather than pinning a version.
Then run:
shards installshard.yml
- Crystal
0.28.0- License
- MIT
- Author
- Chris Watson
- Target
ohshitfrom src/ohshit.cr
- Executable
ohshit
Dependencies
This version declares no dependencies.
README
Oh Shit!
This app was heavily inspired by nvbn/thefuck, so credit where credit is due. That being said, Oh Shit! aims to be an even more powerful, fast, and gratifying way to correct your shell mistakes. Since Oh Shit! is written in Crystal you should see a significant speed increse, and you don't need to worry about any Python!
Note: This is still in development. The below instructions do not work yet.
Installation
For now, installation will require cloning this repo and building yourself. Binaries will be available in the future.
cd /opt
git clone https://github.com/watzon/ohshit
cd ohshit
crystal build --release
sudo ln -ls /opt/ohshit/bin/ohshit /usr/local/bin/ohshit
ohshit set-aliases
The set-aliases command will set an alias in your .bashrc and .zshrc files, allowing you to run Oh Shit! with the shit command instead of ohshit. To do this manually add the following to your shell configuration files.
alias shit='ohshit'
Don't forget to reload your configuration any time you make a change.
source ~/.zshrc
Usage
Whenever you run an incorrect command on your terminal just follow it up with shit to have your mistake instantly corrected.
Examples
➜ pacman -S vim
error: you cannot perform this operation unless you are root.
➜ shit
sudo pacman -S vim [enter/↑/↓/ctrl+c]
[sudo] password for watzon:
resolving dependencies...
...
➜ git push
fatal: The current branch master has no upstream branch.
To push the current branch and set the remote as upstream, use
git push --set-upstream origin master
➜ shit
git push --set-upstream origin master [enter/↑/↓/ctrl+c]
Counting objects: 2, done.
...
➜ git brnch
git: 'brnch' is not a git command. See 'git --help'.
The most similar command is
branch
➜ shit
git branch [enter/↑/↓/ctrl+c]
* master
Development
Feel free to help with issue tracking by submitting an issue if you run into one. Do remember that this is alpha software and comes with no assurances that it will work correctly.
Alternatively you can always fork this repo and do some coding yourself. I open all contributions and appreciate the effort.
Contributing
- Fork it (https://github.com/watzon/ohshit/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- Chris Watson - creator and maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This branch
- Branch
master- Seen
- May 18, 2019
- Crystal
0.28.0- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/watzon/ohshit
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 14, 2026
- Synced
- Aug 14, 2026
- Versions
- 1