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 detailed configs.

TUI

There are 3 key bindings to use in TUI:

  • ctrl+j, Infer answer
  • ctrl+r, Run command
  • ctrl+y, Yank command

TUI screenshot

Role

There are 4 built-in system role contents 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 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

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.4.1.tar.gz (34.9 kB view details)

Uploaded Source

Built Distribution

shgpt-0.4.1-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for shgpt-0.4.1.tar.gz
Algorithm Hash digest
SHA256 3caabde4994040fa105c46a66593345b3e193016155510156cc35b73ef380306
MD5 6c97fff7a63089c11b130241a088452f
BLAKE2b-256 53e8e2f4bd9e4e34f64afb61bcbe0b9ace8b5d4eec51c34010256cea66026d39

See more details on using hashes here.

File details

Details for the file shgpt-0.4.1-py3-none-any.whl.

File metadata

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

File hashes

Hashes for shgpt-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 741aeafd794dc5cac2d9bd196761880212dfff230affc3344d84adbf808b5d85
MD5 2ad29db2c6c1ff243f18258ef69ef01e
BLAKE2b-256 57d709d3ef750f99545834bb6d8adc259a7125e5499c597ed8e81e39c254aa96

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