Skip to main content

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 like echo 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 answer
  • ctrl+r, Run command
  • ctrl+y, Yank command

TUI screenshot

Role

There are some built-in roles in shellgpt:

  • default, used for ask general questions
  • code, used for ask programming questions
  • shell, used for infer shell command
  • cm, used for generate git commit message, like git 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

GPL-3.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

shgpt-0.3.1.tar.gz (33.5 kB view details)

Uploaded Source

Built Distribution

shgpt-0.3.1-py2.py3-none-any.whl (9.2 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file shgpt-0.3.1.tar.gz.

File metadata

  • Download URL: shgpt-0.3.1.tar.gz
  • Upload date:
  • Size: 33.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.27.0

File hashes

Hashes for shgpt-0.3.1.tar.gz
Algorithm Hash digest
SHA256 df904d1b17e93fdf644a29cdaa386ad5a08860acb76088830ba76e4f89cfc2e0
MD5 980eefb5060343170509317f91c22e4e
BLAKE2b-256 50d57fe09f718c63f683bd4ac740b60db916300e95ed4f23ee7a89e5c3f98617

See more details on using hashes here.

File details

Details for the file shgpt-0.3.1-py2.py3-none-any.whl.

File metadata

  • Download URL: shgpt-0.3.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 9.2 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.27.0

File hashes

Hashes for shgpt-0.3.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 08964f5bf9c728a92ce9344b1f125f3af28bb79a13af652e8a84d34aaed99731
MD5 d61d25f10bbb41b713ff8d6f1d97dc33
BLAKE2b-256 a8f55a9b008a48a20a0fcb28b4e28c8f80def1ec74fd3c320ba979267b116456

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page