Shell-gpt

Latest version: v1.4.4

Safety actively analyzes 681881 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 5

1.1.0

https://github.com/TheR1D/shell_gpt/assets/16740832/721ddb19-97e7-428f-a0ee-107d027ddd59

OpenAI Library
ShellGPT has now integrated the OpenAI Python library for handling API requests. This integration simplifies the development and maintenance of the ShellGPT code base. Additionally, it enhances user experience by providing more user-friendly error messages, complete with descriptions and potential solutions.

Function Calling
[Function calls](https://platform.openai.com/docs/guides/function-calling) is a powerful feature OpenAI provides. It allows LLM to execute functions in your system, which can be used to accomplish a variety of tasks. ShellGPT has a convenient [way to define functions](https://github.com/TheR1D/shell_gpt#function-calling) and use them. To install [default functions](https://github.com/TheR1D/shell_gpt/tree/main/sgpt/default_functions/) run:
shell
sgpt --install-functions

This will add a function for LLM to execute shell commands and to execute Apple Scripts (on macOS). More details in demo video and README.md.

Options
* Shortcut option `-c` for `—code`.
* Shortcut option `-lc` for `--list-chats`
* Shortcut option `-lr` for `--list-roles`
* New `—functions` option, enables/disable function calling.
* New `—install-functions` option, installs default functions.

Config
* New config variable `OPENAI_FUNCTIONS_PATH`
* New config variable `OPENAI_USE_FUNCTIONS`
* New config variable `SHOW_FUNCTIONS_OUTPUT`

Minor Changes
* Code optimisation
* Cache optimisations for function calls

1.0.1

* Fixed a bug in REPL mode which was not working properly since last release.
* Minor optimisation and bug fixes in default roles.
* Minor code optimisations.

1.0.0

* Default model has been changed to `gpt-4-1106-preview` (a.k.a. GPT-4 Turbo).
* ShellGPT roles (prompts) optimised for OpenAI GPT-4 models.
* Using system roles when calling OpenAI API with [messages](https://platform.openai.com/docs/api-reference/chat/create#chat-create-messages).
* Rendering markdown for default and describe shell command outputs.
* New config variable `CODE_THEME` which sets theme for markdown (default is `dracula`).
* Multiline input in REPL mode possible with `"""` triple quotes.
* New `--version` options that prints installed ShellGPT version.
* Fixed issue with home direcotry in Dockerfile which leading to container crash.
* Code optimisations, minor bug fixes.

https://github-production-user-asset-6210df.s3.amazonaws.com/16740832/291779848-66392282-474e-4a84-8482-d20c53c8727d.mp4

For users which will be upgrading from previous versions it is recommended to change `DEFAULT_MODEL` to `gpt-4-1106-preview` in config file `~/.config/shell_gpt/.sgptrc` since older models might not perform well with system roles. Because of significant changes in roles, unfortunately previously created custom roles and chats will not work with ShellGPT v1.0.0 and you will need to re-create them using new version.

Shoutout to all contributors: jaycenhorton arafatsyed th3happybit Navidur1 moritz-t-w Ismail-Ben

0.9.4

By default, ShellGPT leverages OpenAI's large language models. However, this release provides the flexibility to use locally hosted models, which can be a cost-effective alternative. To use local models, you will need to run your own API server. You can accomplish this by using [LocalAI](https://github.com/go-skynet/LocalAI), a self-hosted, OpenAI-compatible API. Setting up LocalAI allows you to run language models on your own hardware, potentially without the need for an internet connection, depending on your usage. To set up your LocalAI, please follow this comprehensive [guide](https://github.com/TheR1D/shell_gpt/wiki/LocalAI). Remember that the performance of your local models may depend on the specifications of your hardware and the specific language model you choose to deploy.

* `--model` parameter is now string (was enum before).
* Added LocalAI information to README.md.
* Created a [guide](https://github.com/TheR1D/shell_gpt/wiki/LocalAI) on wiki page.

0.9.3

This release incorporates support for the newly announced gpt-3.5-turbo-16k model which has same capabilities as the standard gpt-3.5-turbo model but with 4 times the context.
shell
sgpt --model gpt-3.5-turbo-16k "16k context prompt"

0.9.2

This release includes shell integrations for ZSH and Bash.
* Added simple shell integration for ZSH.
* Added simple shell integration for Bash.
* New hidden option `--install-integration` which will update user shell profile.

Shell Integration
Shell integration allows you to use Shell-GPT in your terminal with hotkeys. It is currently available for Bash and ZSH. It will allow you to have `sgpt` completions in your shell history, and also edit suggested commands right away.

https://github.com/TheR1D/shell_gpt/assets/16740832/bead0dab-0dd9-436d-88b7-6abfb2c556c1

Installation
shell
pip install --upgrade shell-gpt
sgpt --install-integration
Restart your terminal to apply changes.


Usage
In your terminal enter natural language request, and press `Ctrl+l` to get shell command suggestion. It will replace your current input line (buffer) with the GPT suggested command.
text
List all txt files in current folder (Ctrl+l)
-> ls *.txt

Special thanks to chinarjoshi

Page 2 of 5

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.