Name | shgpt JSON |
Version |
0.5.3
JSON |
| download |
home_page | None |
Summary | Chat with LLM in your terminal, be it shell generator, story teller, linux-terminal, etc. |
upload_time | 2024-08-11 01:31:00 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.0.0 |
license | None |
keywords |
ai
gpt
llm
shell
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# ShellGPT
[![](https://img.shields.io/pypi/v/shgpt)](https://pypi.org/project/shgpt/)
[![](https://github.com/jiacai2050/shellgpt/actions/workflows/ci.yml/badge.svg)](https://github.com/jiacai2050/shellgpt/actions/workflows/ci.yml)
[![](https://github.com/jiacai2050/shellgpt/actions/workflows/release.yml/badge.svg)](https://github.com/jiacai2050/shellgpt/actions/workflows/release.yml)
Chat with LLM in your terminal, be it shell generator, story teller, linux-terminal, etc.
# Install
```bash
pip install -U shgpt
```
Or install latest version
```bash
pip install --force-reinstall -U git+https://github.com/jiacai2050/shellgpt.git
```
This will install two commands: `sg` and `shellgpt`, 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`.
- REPL mode, `sg -r`, chat with LLM.
- TUI mode, `sg -t`, tailored for infer shell command.
## Model
By default, `shellgpt` uses [Ollama](https://ollama.com/) as its language model backend, requiring installation prior to usage.
Alternatively, one can set up `shellgpt` to utilize [OpenAI compatible](https://developers.cloudflare.com/workers-ai/configuration/open-ai-compatibility/) API endpoints:
```bash
export SHELLGPT_API_URL=https://api.openai.com
export SHELLGPT_API_KEY=<token>
export SHELLGPT_MODEL='gpt-3.5-turbo'
# or Cloudflare Worker AI
export SHELLGPT_API_URL=https://api.cloudflare.com/client/v4/accounts/<account-id>/ai
export SHELLGPT_API_KEY=<token>
export SHELLGPT_MODEL='@cf/meta/llama-3-8b-instruct'
```
See [conf.py](https://github.com/jiacai2050/shellgpt/blob/main/shellgpt/utils/conf.py) for more 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](https://github.com/jiacai2050/shellgpt/raw/main/assets/shellgpt-tui.jpg)
## System contents
There are some built-in [system contents](https://platform.openai.com/docs/guides/text-generation/chat-completions-api) in shellgpt:
- `default`, used for ask general questions
- `typo`, used for correct article typos.
- `slug`, used for generate URL slug.
- `code`, used for ask programming questions
- `shell`, used for infer shell command
- `commit`, used for generate git commit message, like `git diff | sg -s commit`
Users can define their own content in `~/.shellgpt/contents.json`, it a JSON map with
- key being content name and
- value being content body
Or you can just copy [contents.json](https://github.com/jiacai2050/shellgpt/blob/main/contents.json) to play with, it's generated from [Awesome ChatGPT Prompts](https://github.com/f/awesome-chatgpt-prompts/blob/main/prompts.csv).
```bash
$ sg -s linux-terminal pwd
/home/user
$ sg -s javascript-console 0.1 + 0.2
0.3
```
Users can share their customized contents in [discussions](https://github.com/jiacai2050/shellgpt/discussions).
# License
[GPL-3.0](https://opensource.org/license/GPL-3.0)
Raw data
{
"_id": null,
"home_page": null,
"name": "shgpt",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.0.0",
"maintainer_email": null,
"keywords": "ai, gpt, llm, shell",
"author": null,
"author_email": "Jiacai Liu <dev@liujiacai.net>",
"download_url": "https://files.pythonhosted.org/packages/dc/18/2f2ac8009cd789f3f486575f9ff0e3ca08179844e29073b9d03be60e88c5/shgpt-0.5.3.tar.gz",
"platform": null,
"description": "# ShellGPT\n\n[![](https://img.shields.io/pypi/v/shgpt)](https://pypi.org/project/shgpt/)\n[![](https://github.com/jiacai2050/shellgpt/actions/workflows/ci.yml/badge.svg)](https://github.com/jiacai2050/shellgpt/actions/workflows/ci.yml)\n[![](https://github.com/jiacai2050/shellgpt/actions/workflows/release.yml/badge.svg)](https://github.com/jiacai2050/shellgpt/actions/workflows/release.yml)\n\nChat with LLM in your terminal, be it shell generator, story teller, linux-terminal, etc.\n\n# Install\n```bash\npip install -U shgpt\n```\n\nOr install latest version\n```bash\npip install --force-reinstall -U git+https://github.com/jiacai2050/shellgpt.git\n```\n\nThis will install two commands: `sg` and `shellgpt`, which are identical.\n\nAfter install, use `sg --init` to create required directories(mainly `~/.shellgpt`).\n\n# Usage\n\nShellGPT has three modes to use:\n- Direct mode, `sg [question]` or pipeline like `echo question | sg`.\n- REPL mode, `sg -r`, chat with LLM.\n- TUI mode, `sg -t`, tailored for infer shell command.\n\n## Model\n\nBy default, `shellgpt` uses [Ollama](https://ollama.com/) as its language model backend, requiring installation prior to usage.\n\nAlternatively, one can set up `shellgpt` to utilize [OpenAI compatible](https://developers.cloudflare.com/workers-ai/configuration/open-ai-compatibility/) API endpoints:\n\n```bash\nexport SHELLGPT_API_URL=https://api.openai.com\nexport SHELLGPT_API_KEY=<token>\nexport SHELLGPT_MODEL='gpt-3.5-turbo'\n\n# or Cloudflare Worker AI\nexport SHELLGPT_API_URL=https://api.cloudflare.com/client/v4/accounts/<account-id>/ai\nexport SHELLGPT_API_KEY=<token>\nexport SHELLGPT_MODEL='@cf/meta/llama-3-8b-instruct'\n```\n\nSee [conf.py](https://github.com/jiacai2050/shellgpt/blob/main/shellgpt/utils/conf.py) for more configs.\n\n## TUI\n\nThere are 3 key bindings to use in TUI:\n- `ctrl+j`, Infer answer\n- `ctrl+r`, Run command\n- `ctrl+y`, Yank command\n\n![TUI screenshot](https://github.com/jiacai2050/shellgpt/raw/main/assets/shellgpt-tui.jpg)\n\n## System contents\n\nThere are some built-in [system contents](https://platform.openai.com/docs/guides/text-generation/chat-completions-api) in shellgpt:\n- `default`, used for ask general questions\n- `typo`, used for correct article typos.\n- `slug`, used for generate URL slug.\n- `code`, used for ask programming questions\n- `shell`, used for infer shell command\n- `commit`, used for generate git commit message, like `git diff | sg -s commit`\n\nUsers can define their own content in `~/.shellgpt/contents.json`, it a JSON map with\n- key being content name and\n- value being content body\n\nOr you can just copy [contents.json](https://github.com/jiacai2050/shellgpt/blob/main/contents.json) to play with, it's generated from [Awesome ChatGPT Prompts](https://github.com/f/awesome-chatgpt-prompts/blob/main/prompts.csv).\n\n```bash\n$ sg -s linux-terminal pwd\n/home/user\n\n$ sg -s javascript-console 0.1 + 0.2\n0.3\n\n```\n\nUsers can share their customized contents in [discussions](https://github.com/jiacai2050/shellgpt/discussions).\n\n# License\n\n[GPL-3.0](https://opensource.org/license/GPL-3.0)\n",
"bugtrack_url": null,
"license": null,
"summary": "Chat with LLM in your terminal, be it shell generator, story teller, linux-terminal, etc.",
"version": "0.5.3",
"project_urls": {
"Issues": "https://github.com/jiacai2050/shellgpt/issues",
"Repository": "https://github.com/jiacai2050/shellgpt"
},
"split_keywords": [
"ai",
" gpt",
" llm",
" shell"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "614bfcccf0f59f94c846e9ec71e9694d9dbedd65a37f1ec1618b29096c04488b",
"md5": "d5531bf02f28a45a27c8657096edbf5c",
"sha256": "869c72baa805baf75ac414db1752ee75ab35f7be6da18d6efc4ea106cdcea8ef"
},
"downloads": -1,
"filename": "shgpt-0.5.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d5531bf02f28a45a27c8657096edbf5c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.0.0",
"size": 12968,
"upload_time": "2024-08-11T01:31:01",
"upload_time_iso_8601": "2024-08-11T01:31:01.783986Z",
"url": "https://files.pythonhosted.org/packages/61/4b/fcccf0f59f94c846e9ec71e9694d9dbedd65a37f1ec1618b29096c04488b/shgpt-0.5.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "dc182f2ac8009cd789f3f486575f9ff0e3ca08179844e29073b9d03be60e88c5",
"md5": "bf8f33732f88833c02339b15c775876f",
"sha256": "50bc13ceacd38dca8dc3f8513da062b4cc7b0a1ee99ea0cfce06ce5843209f1e"
},
"downloads": -1,
"filename": "shgpt-0.5.3.tar.gz",
"has_sig": false,
"md5_digest": "bf8f33732f88833c02339b15c775876f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.0.0",
"size": 10982,
"upload_time": "2024-08-11T01:31:00",
"upload_time_iso_8601": "2024-08-11T01:31:00.639909Z",
"url": "https://files.pythonhosted.org/packages/dc/18/2f2ac8009cd789f3f486575f9ff0e3ca08179844e29073b9d03be60e88c5/shgpt-0.5.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-11 01:31:00",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "jiacai2050",
"github_project": "shellgpt",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "shgpt"
}