{"id":13564082,"url":"https://github.com/jiacai2050/shellgpt","last_synced_at":"2025-04-06T06:07:12.024Z","repository":{"id":242011610,"uuid":"808451724","full_name":"jiacai2050/shellgpt","owner":"jiacai2050","description":"Chat with LLM in your terminal, be it shell generator, story teller, linux-terminal, etc.","archived":false,"fork":false,"pushed_at":"2025-02-03T11:42:19.000Z","size":414,"stargazers_count":68,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-30T05:08:24.701Z","etag":null,"topics":["chatbot","chatgpt","devops","gpt","llm","shell","terminal"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jiacai2050.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"custom":["https://liujiacai.net/donate/"]}},"created_at":"2024-05-31T05:20:44.000Z","updated_at":"2025-03-24T05:56:15.000Z","dependencies_parsed_at":"2024-06-15T15:33:41.951Z","dependency_job_id":"2c7dcdda-cefa-4925-935e-826152f54992","html_url":"https://github.com/jiacai2050/shellgpt","commit_stats":null,"previous_names":["jiacai2050/shellgpt"],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiacai2050%2Fshellgpt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiacai2050%2Fshellgpt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiacai2050%2Fshellgpt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiacai2050%2Fshellgpt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jiacai2050","download_url":"https://codeload.github.com/jiacai2050/shellgpt/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247441046,"owners_count":20939239,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chatbot","chatgpt","devops","gpt","llm","shell","terminal"],"created_at":"2024-08-01T13:01:26.366Z","updated_at":"2025-04-06T06:07:11.970Z","avatar_url":"https://github.com/jiacai2050.png","language":"Python","funding_links":["https://liujiacai.net/donate/"],"categories":["Python"],"sub_categories":[],"readme":"# 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=\u003ctoken\u003e\nexport SHELLGPT_MODEL='gpt-3.5-turbo'\n\n# or Cloudflare Worker AI\nexport SHELLGPT_API_URL=https://api.cloudflare.com/client/v4/accounts/\u003caccount-id\u003e/ai\nexport SHELLGPT_API_KEY=\u003ctoken\u003e\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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjiacai2050%2Fshellgpt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjiacai2050%2Fshellgpt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjiacai2050%2Fshellgpt/lists"}