Skip to content

Releases: TheR1D/shell_gpt

0.9.3

14 Jun 15:08
15b8598
Compare
Choose a tag to compare

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.

sgpt --model gpt-3.5-turbo-16k "16k context prompt"

0.9.2

04 Jun 23:49
cb9782b
Compare
Choose a tag to compare

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.

Shell_GPT_Integration.mp4

Installation

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.

List all txt files in current folder (Ctrl+l)
# -> ls *.txt

Special thanks to @chinarjoshi

0.9.1

21 May 18:54
0129e59
Compare
Choose a tag to compare

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:

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:

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:

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.

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

16 Apr 16:35
a054a90
Compare
Choose a tag to compare
  • Custom user defined roles.
  • Option to change default roles like shell, code and default.
  • Option to force use system role 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:

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": "p@ssw0rd",
  "email": "[email protected]",
  "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

14 Apr 23:31
4786191
Compare
Choose a tag to compare

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

10 Apr 15:20
3c5361b
Compare
Choose a tag to compare
  • 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:

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

10 Apr 10:26
8fe43f5
Compare
Choose a tag to compare
  • 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.

...
DEFAULT_COLOR=magenta

0.8.6

09 Apr 17:20
2b7067f
Compare
Choose a tag to compare
  • 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.

0.8.5

07 Apr 22:13
d12d72b
Compare
Choose a tag to compare
  • Native $SHELL command execution instead of default /bin/sh.
  • Better integration with Powershell and CMD on Windows.
  • Fixed a bug with pyreadline3 dependency for Windows systems.
  • Fixed a bug when sgpt couldn't recognize Powershell or CMD on Windows.

0.8.3

03 Apr 00:33
096b690
Compare
Choose a tag to compare

New awesome REPL mode for chat sessions. To start a chat session in REPL mode, use the --repl option followed by a unique session name. You can also use "temp" as a session name to start a temporary REPL session. Note that --chat and --repl are using same chat sessions, so you can use --chat to start a chat session and then use --repl to continue the conversation in REPL mode. REPL mode will also show history of your conversation in the beginning. REPL mode can work with --shell and --code options, which makes it very handy for interactive shell commands and code generation.

gif