Sharing my ShellGPT Aliases/Functions for Bash and Zsh #409
WolframRavenwolf
started this conversation in
Show and tell
Replies: 2 comments 1 reply
-
Very intuitive and clever! I would have never thought alias ..='cd ../..'
alias ...='cd ../../..'
alias ....='cd ../../../..'
alias .....='cd ../../../../..' |
Beta Was this translation helpful? Give feedback.
0 replies
-
@WolframRavenwolf Your GIST's are dead line. 💀 Can you please repost? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I use ShellGPT daily but it could be more user-friendly (can't remember all the options), so I've created some ShellGPT Aliases/Functions for Bash and Zsh to make it much easier (i. e. intuitive) to use. I'm sharing them here with other users, and if you'd like to integrate or adapt them into ShellGPT itself, @TheR1D, I'd be happy to contribute this.
Setup
Just put the contents of this gist into your
~/.bash_aliases
or~/.oh-my-zsh/custom/aliases.zsh
or any other location where you keep your shell aliases/functions. Log out and back in orsource
the aliases file to load them, as usual.Features
The most important features are the shortcut functions - they're just a letter and a colon (so super easy to type, and no conflict with existing commands):
q:
chat ("query")s:
shelld:
describe-shellc:
codeUse uppercase letters for a bigger and better (and more expensive) model, switching from GPT-3.5 (pre-v1.0) or GPT-4-Turbo (v1.0) to GPT-4. Double uppercase letters are supposed to expand context by switching to GPT-4-32K (although that model isn't available to me right now?).
If you don't append your input to the shortcut, it will open REPL mode, so you see the chat history and get an interactive session.
It keeps a chat cache for each letter individually, so you can do follow-up questions and freely switch between command and REPL modes.
When you follow the shortcut with a minus/dash, it clears the chat cache of only that function (chat/shell/describe/code). Double minuses/dashes clear the request cache. Triple minuses/dashes clear both caches (the chat cache of only that function and the shared request cache).
Besides these main functions, there are also a bunch of aliases like
sgpt-chat
forsgpt --repl chat
, but I rarely use those as the letter shortcut functions explained above are so much more useful. There are also clear commands, andsgpt-clear-chats
could be useful when you want to clear all chat histories at once, as the letter shortcuts only clear their own chat history.Also of note is that the cache paths are taken from the
.sgptrc
config file, so it works with custom paths as well. I prefer my caches to be inside my own home directory's.cache
folder instead of the system-wide/tmp
folder (and actually think that should be the standard, following the XDG Base Directory Specification and would be more organized and secure that way – but that's just a suggestion).Examples
Here are the same examples from the Usage section of the README, using my shell aliases/functions instead:
Hope this is helpful to any of you!
Beta Was this translation helpful? Give feedback.
All reactions