Chat with LLM in your terminal, be it shell generator, story teller, linux-terminal, etc.
Project description
ShellGPT
Chat with LLM in your terminal, be it shell generator, story teller, linux-terminal, etc.
Install
pip install -U shgpt
This will install two commands: sg
and shgpt
, which are identical.
After install, use sg --init
to create required directories(mainly ~/.shellgpt
).
Usage
ShellGPT has three modes to use:
- Direct mode,
sg [question]
or pipeline likeecho question | sg
. - TUI mode,
sg
, tailored for infer shell command. - REPL mode,
sg -l
, chat with LLM.
See conf.py for detailed configs.
TUI
There are 3 key bindings to use in TUI:
ctrl+j
, Infer answerctrl+r
, Run commandctrl+y
, Yank command
Role
There are 4 built-in system role contents in shellgpt:
default
, used for ask general questionscode
, used for ask programming questionsshell
, used for infer shell commandcm
, used for generate git commit message, likegit diff | sg -r cm
Users can define their own content in ~/.shellgpt/roles.json
, it a JSON map with
- key being role name and
- value being role content
Or you can just copy roles.json to play with, it's generated from Awesome ChatGPT Prompts.
$ shgpt -r linux-terminal pwd
/home/user
$ shgpt -r javascript-console 0.1 + 0.2
0.3
Requirements
- Ollama, you need to download models before try shellgpt.
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.