Chat with LLM for anything you like, be it shell generator, story teller, linux-terminal, etc. All without leaving your terminal!
Project description
ShellGPT
Chat with LLM for anything you like, be it shell generator, story teller, linux-terminal, etc. All without leaving your terminal!
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 configs.
TUI
There are some key bindings to use in TUI: option
ctrl+j
, Infer answerctrl+r
, Run commandctrl+y
, Yank command
Role
There are some built-in roles 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 roles 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.
Source Distribution
Built Distribution
File details
Details for the file shgpt-0.3.0.tar.gz
.
File metadata
- Download URL: shgpt-0.3.0.tar.gz
- Upload date:
- Size: 33.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.27.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd236e598c148a30baceea3596cb7fda15bd12858a385d77148b746a704eefa8 |
|
MD5 | e16c7d789a7e6444108e944cf557a2cf |
|
BLAKE2b-256 | e95b6ccafa300a4ed38807a699acf5a91a84ed8d8aa3f72b504ad974bafe0776 |
File details
Details for the file shgpt-0.3.0-py2.py3-none-any.whl
.
File metadata
- Download URL: shgpt-0.3.0-py2.py3-none-any.whl
- Upload date:
- Size: 9.0 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.27.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a9589bc73ada0dcbff4e722b8b80d890cd345092872d5fa839df4f4250bb954 |
|
MD5 | ae686ba3b0ec44c1e356ba32f665e0d3 |
|
BLAKE2b-256 | f06b0d8a01792fae338ace8e6411802a04fbf762cb026bb0e1a7e3546a43d6e5 |