shell-ai


Nameshell-ai JSON
Version 0.4.1 PyPI version JSON
download
home_pageNone
SummaryNone
upload_time2024-12-13 13:00:09
maintainerNone
docs_urlNone
authorRick Lamers
requires_pythonNone
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Shell-AI: let AI write your shell commands

[![PyPI version](https://badge.fury.io/py/shell-ai.svg)](https://pypi.org/project/shell-ai/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Forks](https://img.shields.io/github/forks/ricklamers/shell-ai)](https://github.com/ricklamers/shell-ai/network)
[![Stars](https://img.shields.io/github/stars/ricklamers/shell-ai)](https://github.com/ricklamers/shell-ai/stargazers)


Shell-AI (`shai`) is a CLI utility that brings the power of natural language understanding to your command line. Simply input what you want to do in natural language, and `shai` will suggest single-line commands that achieve your intent. Under the hood, Shell-AI leverages the [LangChain](https://github.com/langchain-ai/langchain) for LLM use and builds on the excellent [InquirerPy](https://github.com/kazhala/InquirerPy) for the interactive CLI.

![demo-shell-ai](https://github.com/ricklamers/shell-ai/assets/1309307/b4057165-5c23-46d4-b68e-00915b738dc3)

## Installation

You can install Shell-AI directly from PyPI using pip:

```bash
pip install shell-ai
```

Note that on Linux, Python 3.10 or later is required.

After installation, you can invoke the utility using the `shai` command.

## Usage

To use Shell-AI, open your terminal and type:

```bash
shai run terraform dry run thingy
```

Shell-AI will then suggest 3 commands to fulfill your request:
- `terraform plan`
- `terraform plan -input=false`
- `terraform plan`

## Features

- **Natural Language Input**: Describe what you want to do in plain English (or other supported languages).
- **Command Suggestions**: Get single-line command suggestions that accomplish what you asked for.
- **Cross-Platform**: Works on Linux, macOS, and Windows.
- **Azure Compatibility**: Shell-AI now supports Azure OpenAI deployments.

## Configuration

Shell-AI can be configured through environment variables or a config file located at `~/.config/shell-ai/config.json` (Linux/MacOS) or `%APPDATA%\shell-ai\config.json` (Windows).

### Environment Variables

- `OPENAI_API_KEY`: (Required) Your OpenAI API key
- `GROQ_API_KEY`: (Required if using Groq) Your Groq API key
- `OPENAI_MODEL`: The OpenAI model to use (default: "gpt-3.5-turbo")
- `SHAI_SUGGESTION_COUNT`: Number of suggestions to generate (default: 3)
- `SHAI_SKIP_CONFIRM`: Skip command confirmation when set to "true"
- `SHAI_SKIP_HISTORY`: Skip writing to shell history when set to "true"
- `SHAI_API_PROVIDER`: Choose between "openai", "azure", or "groq" (default: "groq")
- `SHAI_TEMPERATURE`: Controls randomness in the output (default: 0.05). Lower values (e.g., 0.05) make output more focused and deterministic, while higher values (e.g., 0.7) make it more creative and varied.
- `CTX`: Enable context mode when set to "true" (Note: outputs will be sent to the API)

### Config File Example

```json
{
  "OPENAI_API_KEY": "your_openai_api_key_here",
  "OPENAI_MODEL": "gpt-3.5-turbo",
  "SHAI_SUGGESTION_COUNT": "3",
  "CTX": true
}
```

The application will read from this file if it exists, overriding any existing environment variables.

Run the application after setting these configurations.

### Using with Groq

To use Shell AI with Groq:

1. Get your API key from Groq
2. Set the following environment variables:
   ```bash
   export SHAI_API_PROVIDER=groq
   export GROQ_API_KEY=your_api_key_here
   export GROQ_MODEL=llama-3.3-70b-versatile
   ```

## Contributing

This implementation can be made much smarter! Contribute your ideas as Pull Requests and make AI Shell better for everyone.

Contributions are welcome! Please read the [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.

## License

Shell-AI is licensed under the MIT License. See [LICENSE](LICENSE) for details.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "shell-ai",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": null,
    "author": "Rick Lamers",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/4b/d8/a6881c411365beb5ae21103f79e2885f9815b883cd95dad133be56e3f17e/shell_ai-0.4.1.tar.gz",
    "platform": null,
    "description": "# Shell-AI: let AI write your shell commands\n\n[![PyPI version](https://badge.fury.io/py/shell-ai.svg)](https://pypi.org/project/shell-ai/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Forks](https://img.shields.io/github/forks/ricklamers/shell-ai)](https://github.com/ricklamers/shell-ai/network)\n[![Stars](https://img.shields.io/github/stars/ricklamers/shell-ai)](https://github.com/ricklamers/shell-ai/stargazers)\n\n\nShell-AI (`shai`) is a CLI utility that brings the power of natural language understanding to your command line. Simply input what you want to do in natural language, and `shai` will suggest single-line commands that achieve your intent. Under the hood, Shell-AI leverages the [LangChain](https://github.com/langchain-ai/langchain) for LLM use and builds on the excellent [InquirerPy](https://github.com/kazhala/InquirerPy) for the interactive CLI.\n\n![demo-shell-ai](https://github.com/ricklamers/shell-ai/assets/1309307/b4057165-5c23-46d4-b68e-00915b738dc3)\n\n## Installation\n\nYou can install Shell-AI directly from PyPI using pip:\n\n```bash\npip install shell-ai\n```\n\nNote that on Linux, Python 3.10 or later is required.\n\nAfter installation, you can invoke the utility using the `shai` command.\n\n## Usage\n\nTo use Shell-AI, open your terminal and type:\n\n```bash\nshai run terraform dry run thingy\n```\n\nShell-AI will then suggest 3 commands to fulfill your request:\n- `terraform plan`\n- `terraform plan -input=false`\n- `terraform plan`\n\n## Features\n\n- **Natural Language Input**: Describe what you want to do in plain English (or other supported languages).\n- **Command Suggestions**: Get single-line command suggestions that accomplish what you asked for.\n- **Cross-Platform**: Works on Linux, macOS, and Windows.\n- **Azure Compatibility**: Shell-AI now supports Azure OpenAI deployments.\n\n## Configuration\n\nShell-AI can be configured through environment variables or a config file located at `~/.config/shell-ai/config.json` (Linux/MacOS) or `%APPDATA%\\shell-ai\\config.json` (Windows).\n\n### Environment Variables\n\n- `OPENAI_API_KEY`: (Required) Your OpenAI API key\n- `GROQ_API_KEY`: (Required if using Groq) Your Groq API key\n- `OPENAI_MODEL`: The OpenAI model to use (default: \"gpt-3.5-turbo\")\n- `SHAI_SUGGESTION_COUNT`: Number of suggestions to generate (default: 3)\n- `SHAI_SKIP_CONFIRM`: Skip command confirmation when set to \"true\"\n- `SHAI_SKIP_HISTORY`: Skip writing to shell history when set to \"true\"\n- `SHAI_API_PROVIDER`: Choose between \"openai\", \"azure\", or \"groq\" (default: \"groq\")\n- `SHAI_TEMPERATURE`: Controls randomness in the output (default: 0.05). Lower values (e.g., 0.05) make output more focused and deterministic, while higher values (e.g., 0.7) make it more creative and varied.\n- `CTX`: Enable context mode when set to \"true\" (Note: outputs will be sent to the API)\n\n### Config File Example\n\n```json\n{\n  \"OPENAI_API_KEY\": \"your_openai_api_key_here\",\n  \"OPENAI_MODEL\": \"gpt-3.5-turbo\",\n  \"SHAI_SUGGESTION_COUNT\": \"3\",\n  \"CTX\": true\n}\n```\n\nThe application will read from this file if it exists, overriding any existing environment variables.\n\nRun the application after setting these configurations.\n\n### Using with Groq\n\nTo use Shell AI with Groq:\n\n1. Get your API key from Groq\n2. Set the following environment variables:\n   ```bash\n   export SHAI_API_PROVIDER=groq\n   export GROQ_API_KEY=your_api_key_here\n   export GROQ_MODEL=llama-3.3-70b-versatile\n   ```\n\n## Contributing\n\nThis implementation can be made much smarter! Contribute your ideas as Pull Requests and make AI Shell better for everyone.\n\nContributions are welcome! Please read the [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.\n\n## License\n\nShell-AI is licensed under the MIT License. See [LICENSE](LICENSE) for details.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": null,
    "version": "0.4.1",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c2dc93bf2b716fe350ce0669571dd19abc7e7ad08fa9f83ef9c570ce3b4669be",
                "md5": "da003397012ba9657c94b4733afa0140",
                "sha256": "c942d614faddb17f55a8b05fb64ab2d56134d1fd46b42ba2fd57269b3156da5d"
            },
            "downloads": -1,
            "filename": "shell_ai-0.4.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "da003397012ba9657c94b4733afa0140",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 10757,
            "upload_time": "2024-12-13T13:00:05",
            "upload_time_iso_8601": "2024-12-13T13:00:05.253359Z",
            "url": "https://files.pythonhosted.org/packages/c2/dc/93bf2b716fe350ce0669571dd19abc7e7ad08fa9f83ef9c570ce3b4669be/shell_ai-0.4.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4bd8a6881c411365beb5ae21103f79e2885f9815b883cd95dad133be56e3f17e",
                "md5": "87bdca5c124bedd4d86120a66ad3a1cf",
                "sha256": "097ed2eaed6897858483e8122c87551d324895c5dfa098430914cbc4b736d6a0"
            },
            "downloads": -1,
            "filename": "shell_ai-0.4.1.tar.gz",
            "has_sig": false,
            "md5_digest": "87bdca5c124bedd4d86120a66ad3a1cf",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 10786,
            "upload_time": "2024-12-13T13:00:09",
            "upload_time_iso_8601": "2024-12-13T13:00:09.339020Z",
            "url": "https://files.pythonhosted.org/packages/4b/d8/a6881c411365beb5ae21103f79e2885f9815b883cd95dad133be56e3f17e/shell_ai-0.4.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-13 13:00:09",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "shell-ai"
}
        
Elapsed time: 1.31043s