llm-shell


Namellm-shell JSON
Version 0.3.0 PyPI version JSON
download
home_pagehttps://github.com/mirror12k/llm-shell
SummaryA Language Model Enhanced Command Line Interface
upload_time2024-02-02 19:53:11
maintainer
docs_urlNone
authorMirror12k
requires_python
licenseMIT
keywords shell with integrated access to chatgpt or other llms
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # LLM-Shell: Language Model Enhanced Command Line Interface

## Overview
LLM-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.

## Features
- Execute 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.

## Prerequisites
- Python 3
- `requests` library for making HTTP requests to the LLM API.
- `pygments` library for syntax highlighting.
- An API key from OpenAI for accessing their language models.

## Installation

There are two ways to install LLM-Shell:

### Using pip (Recommended)

1. Ensure you have Python 3 installed on your system.
2. Install the `llm-shell` package from PyPI:
   ```
   pip install llm-shell
   ```
3. Set your OpenAI API key as an environment variable `CHATGPT_API_KEY` or within a `.env` file that the script can read.

### Using Git Clone (For Developers)

1. Clone the repository to your local machine.
2. Navigate to the cloned directory.
3. Install the required Python packages:
   ```
   pip install -r requirements.txt
   ```
4. Make sure the script is executable:
   ```sh
   chmod +x llm-shell.py
   ```

## Usage

### If Installed Through pip

To start the LLM-Shell, run the following command:

```sh
llm-shell
```
### If Installed By Git Cloning the Repository

To start the LLM-Shell, navigate to the `bin` directory and run the `llm_shell` script:

```sh
./bin/llm_shell
```
### Executing Commands

- Standard 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 Commands

- `help` - 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. Use `context none` to clear the context files.
- `summary [filename1] [filename2] ...` - Sets one or multiple summary files. Similar to `context`, 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.

### Autocompletion

- The LLM-Shell supports autocompletion for file paths and custom commands. Press `Tab` to autocomplete the current input.

## Customization

Modify the `llm-shell.py` script to add new features or change existing behavior to better suit your needs.

## License

LLM-Shell is released under the MIT License. See the LICENSE file for more information.

## Disclaimer

LLM-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.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/mirror12k/llm-shell",
    "name": "llm-shell",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "shell with integrated access to chatgpt or other llms",
    "author": "Mirror12k",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/02/8f/be5b1f0d918e03d69ac904a1d8147468256ad39baec48b109443e4b1a5d8/llm-shell-0.3.0.tar.gz",
    "platform": null,
    "description": "# LLM-Shell: Language Model Enhanced Command Line Interface\n\n## Overview\nLLM-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.\n\n## Features\n- Execute standard shell commands with real-time output.\n- Use language models to process commands described in natural language.\n- Syntax highlighting for code blocks returned by the language model.\n- Set one or multiple context/summary files to provide additional information to the LLM.\n- Change the underlying LLM backend (e.g., GPT-4 Turbo, GPT-4, GPT-3.5 Turbo).\n- Set or update the instruction for the LLM to change how it assists you.\n- Autocompletion for custom commands and file paths.\n- History tracking of commands and LLM responses.\n\n## Prerequisites\n- Python 3\n- `requests` library for making HTTP requests to the LLM API.\n- `pygments` library for syntax highlighting.\n- An API key from OpenAI for accessing their language models.\n\n## Installation\n\nThere are two ways to install LLM-Shell:\n\n### Using pip (Recommended)\n\n1. Ensure you have Python 3 installed on your system.\n2. Install the `llm-shell` package from PyPI:\n   ```\n   pip install llm-shell\n   ```\n3. Set your OpenAI API key as an environment variable `CHATGPT_API_KEY` or within a `.env` file that the script can read.\n\n### Using Git Clone (For Developers)\n\n1. Clone the repository to your local machine.\n2. Navigate to the cloned directory.\n3. Install the required Python packages:\n   ```\n   pip install -r requirements.txt\n   ```\n4. Make sure the script is executable:\n   ```sh\n   chmod +x llm-shell.py\n   ```\n\n## Usage\n\n### If Installed Through pip\n\nTo start the LLM-Shell, run the following command:\n\n```sh\nllm-shell\n```\n### If Installed By Git Cloning the Repository\n\nTo start the LLM-Shell, navigate to the `bin` directory and run the `llm_shell` script:\n\n```sh\n./bin/llm_shell\n```\n### Executing Commands\n\n- Standard shell commands are executed as normal, e.g., `ls -la`.\n- 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?`.\n\n### Special Commands\n\n- `help` - Displays a list of available custom commands within the LLM-Shell.\n- `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`).\n- `llm-instruction [instruction]` - Sets or updates the instruction for the LLM. Use this command to change how the LLM assists you.\n- `llm-reindent-with-tabs [true/false]` - Controls auto-reindent with tabs, to help when the LLM doesn't auto-detect it properly.\n- `llm-chatgpt-apikey [apikey]` - Set API key for OpenAI's models.\n- `context [filename1] [filename2] ...` - Sets one or multiple context files that will be used to provide additional information to the LLM. Use `context none` to clear the context files.\n- `summary [filename1] [filename2] ...` - Sets one or multiple summary files. Similar to `context`, 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.\n- `exit` - Exits LLM-Shell.\n\n### Autocompletion\n\n- The LLM-Shell supports autocompletion for file paths and custom commands. Press `Tab` to autocomplete the current input.\n\n## Customization\n\nModify the `llm-shell.py` script to add new features or change existing behavior to better suit your needs.\n\n## License\n\nLLM-Shell is released under the MIT License. See the LICENSE file for more information.\n\n## Disclaimer\n\nLLM-Shell is not an official product and is not affiliated with OpenAI.\nIt's just an open-source tool developed to showcase the integration of LLMs into a command-line environment.\nUse it at your own risk.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A Language Model Enhanced Command Line Interface",
    "version": "0.3.0",
    "project_urls": {
        "Homepage": "https://github.com/mirror12k/llm-shell"
    },
    "split_keywords": [
        "shell",
        "with",
        "integrated",
        "access",
        "to",
        "chatgpt",
        "or",
        "other",
        "llms"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "97f57a929b04c6cb8499f22dbe8c7dbc9f3d2fb5dcfebb6995688426941ed984",
                "md5": "8f8d08f8940449146e64ae91e5dcf304",
                "sha256": "833e03fb445fc25272ce9b4274b7a858761506f7fa7421284b698c32d9053890"
            },
            "downloads": -1,
            "filename": "llm_shell-0.3.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "8f8d08f8940449146e64ae91e5dcf304",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 16956,
            "upload_time": "2024-02-02T19:53:10",
            "upload_time_iso_8601": "2024-02-02T19:53:10.077760Z",
            "url": "https://files.pythonhosted.org/packages/97/f5/7a929b04c6cb8499f22dbe8c7dbc9f3d2fb5dcfebb6995688426941ed984/llm_shell-0.3.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "028fbe5b1f0d918e03d69ac904a1d8147468256ad39baec48b109443e4b1a5d8",
                "md5": "818399d7ce3edd0ea9b6a094f8629d5a",
                "sha256": "ad6eb4d6377e460ea39a7cdb1852bacfc8af37f177f2f97426e80a363f31ba36"
            },
            "downloads": -1,
            "filename": "llm-shell-0.3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "818399d7ce3edd0ea9b6a094f8629d5a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 16680,
            "upload_time": "2024-02-02T19:53:11",
            "upload_time_iso_8601": "2024-02-02T19:53:11.577412Z",
            "url": "https://files.pythonhosted.org/packages/02/8f/be5b1f0d918e03d69ac904a1d8147468256ad39baec48b109443e4b1a5d8/llm-shell-0.3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-02 19:53:11",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "mirror12k",
    "github_project": "llm-shell",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "llm-shell"
}
        
Elapsed time: 0.21516s