Package: llm-shell
LLM-Shell: Language Model Enhanced Command Line InterfaceOverviewLLM-Shell is a command-line interface (CLI) tool that enhances your shell experience with the power of large language models (LLMs) such as GPT-4 and GPT-3.5 Turbo. It acts as a wrapper around your standard shell, allowing you to execute regular shell commands while also providing the capability to consult an LLM for programming assistance, code examples, and executing commands with natural language understanding.FeaturesExecute standard shell commands with real-time output.Use language models to process commands described in natural language.Syntax highlighting for code blocks returned by the language model.Set one or multiple context/summary files to provide additional information to the LLM.Change the underlying LLM backend (e.g., GPT-4 Turbo, GPT-4, GPT-3.5 Turbo).Set or update the instruction for the LLM to change how it assists you.Autocompletion for custom commands and file paths.History tracking of commands and LLM responses.PrerequisitesPython 3requestslibrary for making HTTP requests to the LLM API.pygmentslibrary for syntax highlighting.An API key from OpenAI for accessing their language models.InstallationThere are two ways to install LLM-Shell:Using pip (Recommended)Ensure you have Python 3 installed on your system.Install thellm-shellpackage from PyPI:pip install llm-shellSet your OpenAI API key as an environment variableCHATGPT_API_KEYor within a.envfile that the script can read.Using Git Clone (For Developers)Clone the repository to your local machine.Navigate to the cloned directory.Install the required Python packages:pip install -r requirements.txtMake sure the script is executable:chmod+xllm-shell.pyUsageIf Installed Through pipTo start the LLM-Shell, run the following command:llm-shellIf Installed By Git Cloning the RepositoryTo start the LLM-Shell, navigate to thebindirectory and run thellm_shellscript:./bin/llm_shellExecuting CommandsStandard shell commands are executed as normal, e.g.,ls -la.To use the LLM, prefix your command with a hash#, followed by the natural language instruction, e.g.,# How do I list all files in the current directory?.Special Commandshelp- Displays a list of available custom commands within the LLM-Shell.llm-backend [backend]- Changes the LLM backend. Replace[backend]with one of the supported backends (e.g.,gpt-4-turbo,gpt-4,gpt-3.5-turbo,claude-instant-v1,claude-v2.1).llm-instruction [instruction]- Sets or updates the instruction for the LLM. Use this command to change how the LLM assists you.llm-reindent-with-tabs [true/false]- Controls auto-reindent with tabs, to help when the LLM doesn't auto-detect it properly.llm-chatgpt-apikey [apikey]- Set API key for OpenAI's models.context [filename1] [filename2] ...- Sets one or multiple context files that will be used to provide additional information to the LLM. Usecontext noneto clear the context files.summary [filename1] [filename2] ...- Sets one or multiple summary files. Similar tocontext, but it will summarize the file before sending it to the LLM. Useful if you just want to send an outline of a class instead of the entire code.exit- Exits LLM-Shell.AutocompletionThe LLM-Shell supports autocompletion for file paths and custom commands. PressTabto autocomplete the current input.CustomizationModify thellm-shell.pyscript to add new features or change existing behavior to better suit your needs.LicenseLLM-Shell is released under the MIT License. See the LICENSE file for more information.DisclaimerLLM-Shell is not an official product and is not affiliated with OpenAI.
It's just an open-source tool developed to showcase the integration of LLMs into a command-line environment.
Use it at your own risk.