Shell-gpt

Latest version: v1.4.4

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

Scan your dependencies

Page 3 of 5

0.9.1

This release includes several new features, optimizations and bug fixes:
* New input option to describe command when executing using `--shell`.
* New CLI option `--describe-shell` or `-d` to generate explanation for commands.
* Configuration parameter to execute shell commands by default.
* Comment lines (a line starting with ) excluded when parsing `.sgptrc` file.
* Max limit of `--temperature` was change to 2.
* Hiding API key from tracebacks when `sgpt` crashes.
* Fixing a bug when typing `exit()` in REPL mode.

Describe shell commands
When executing a shell command suggestion using `--shell` the prompt has be changed. There are 3 new options:
shell
sgpt -s "show all txt files in current folder"
-> ls *.txt
-> [E]xecute, [D]escribe, [A]bort: d
-> List all files with .txt extension in current directory
-> [E]xecute, [D]escribe, [A]bort: e
...


Same logic works in `--repl` mode:
shell
sgpt -s --repl temp
Entering shell REPL mode, type [e] to execute commands or [d] to describe the commands, press Ctrl+C to exit.
>>> install docker
brew install docker
>>> d
Installs Docker using the Homebrew package manager.
>>> e
...


Added new option `--describe-shell` or `-d`. It allows you to generate explanation for shell commands:
shell
sgpt -d "ls -la"
-> List all files and directories, including hidden files, with permissions and ownership information.


Execute commands by default
New configuration parameter `DEFAULT_EXECUTE_SHELL_CMD` (`false` by default), if `true` will executing commands when calling `sgpt --shell` if no input was passed (enter). So we don't have to type "y" or "e" to execute command.
shell
sgpt -s "say hi"
-> echo hi
-> [E]xecute, [D]escribe, [A]bort: (enter)
hi

Shoutout to all contributors: chinarjoshi, konstantin-goldman, Daeinar, eitamal, cosmojg.

0.9.0

* Custom user defined roles.
* Option to change default roles like **shell**, **code** and **default**.
* Option to force use [system role](https://help.openai.com/en/articles/7042661-chatgpt-api-transition-guide) messages (not recommended).
* Improvements when passing stdin and prompt `echo hello | sgpt "another hello"`.
* Fixed typo in `--list-chat` option renamed as `--list-chats`

Roles
ShellGPT allows you to create custom roles, which can be utilized to generate code, shell commands, or to fulfill your specific needs. To create a new role, use the `--create-role` option followed by the role name. You will be prompted to provide a description for the role, along with other details. This will create a JSON file in `~/.config/shell_gpt/roles` with the role name. Inside this directory, you can also edit default `sgpt` roles, such as **shell**, **code**, and **default**. Use the `--list-roles` option to list all available roles, and the `--show-role` option to display the details of a specific role. Here's an example of a custom role:
shell
sgpt --create-role json
Enter role description: You are JSON generator, provide only valid json as response.
Enter expecting result, e.g. answer, code, shell command, etc.: json
sgpt --role json "random: user, password, email, address"
{
"user": "JohnDoe",
"password": "pssw0rd",
"email": "johndoeexample.com",
"address": {
"street": "123 Main St",
"city": "Anytown",
"state": "CA",
"zip": "12345"
}
}

Note that all previous chats which were created in previous version of ShellGPT will not work with this new version.

0.8.9

This release includes several backend optimizations:
* Migrating to TOML.
* Mypy stricted types.
* New code linting tools.
* Dependencies optimization.
* sdist and bdist package optimizations.

0.8.8

* Accept prompt from both stdin and command line argument.

This versatile feature is particularly useful when you need to pass file content or pipe output from other commands to the GPT models for summarization or analysis. For example, you can easily generate a git commit message based on a diff:
shell
git diff | sgpt "Generate git commit message, for my changes"
-> Commit message: Implement Model enum and get_edited_prompt()

This powerful feature simplifies the process of managing and understanding data from different sources, making it easier for you to focus on what really matters: improving your projects and applications.

0.8.7

* Config option to change OpenAI completion color in terminal.
* Minor config logic optimization.

You can change color of OpenAI completion by changing `DEFAULT_COLOR` in `~/.config/shell_gpt/.sgptrc` or `$DEFAULT_COLOR` env, possible options: black, red, green, yellow, blue, magenta, cyan, white, bright_black, bright_red, bright_green, bright_yellow, bright_blue, bright_magenta, bright_cyan, bright_white.
text
...
DEFAULT_COLOR=magenta

0.8.6

* Model choice option to support GPT-4.
* Added default model to config file.

Note that GPT-4 currently in private beta, if you don't have access, you will get 404 error.

Page 3 of 5

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.