|
1 |
| -# ShellOracle |
| 1 | +# ShellOracle |
2 | 2 |
|
3 |
| -More exciting stuff coming soon so ⭐ and 👀️ to stay in the loop. |
| 3 | +ShellOracle is an innovative terminal utility designed for intelligent shell command generation, bringing a new level of |
| 4 | +efficiency to your command-line interactions. |
4 | 5 |
|
5 | 6 | 
|
6 | 7 |
|
7 |
| -# Installation |
| 8 | +Explore our dynamic features and look forward to more exciting updates by giving us a ⭐ and a 👀 |
8 | 9 |
|
9 |
| -1. Install [Ollama](https://ollama.ai/) |
10 |
| -2. Install shelloracle |
11 |
| - ```zsh |
12 |
| - curl -sSL https://raw.githubusercontent.com/djcopley/ShellOracle/master/installer.pyz -o /tmp/installer.pyz && python3 /tmp/installer.pyz |
13 |
| - ``` |
14 |
| -3. Use ctrl+f to open the prompt |
| 10 | +## Table of Contents |
15 | 11 |
|
| 12 | +- [Introduction](#introduction) |
| 13 | +- [Features](#features) |
| 14 | +- [Installation](#installation) |
| 15 | +- [Usage](#usage) |
| 16 | +- [Configuration](#configuration) |
| 17 | +- [System Requirements](#system-requirements) |
| 18 | +- [Feedback](#feedback) |
| 19 | + |
| 20 | +## Introduction |
| 21 | + |
| 22 | +In the ever-evolving landscape of command-line interfaces, ShellOracle emerges as a game-changer. This terminal utility |
| 23 | +empowers users to effortlessly generate shell commands by simply describing their intentions. Whether you're a seasoned |
| 24 | +developer or a command-line enthusiast, ShellOracle streamlines your workflow, making complex command creation an |
| 25 | +intuitive and accessible process. |
| 26 | + |
| 27 | +**Why ShellOracle?** |
| 28 | + |
| 29 | +- **Intelligence at Your Fingertips:** No need to memorize intricate shell commands. Describe your task, and let |
| 30 | + ShellOracle intelligently generate the command for you. |
| 31 | + |
| 32 | +- **Enhanced Productivity:** Say goodbye to manual command crafting. With ShellOracle, you can save time and focus on |
| 33 | + what matters by leveraging the power of natural language descriptions. |
| 34 | + |
| 35 | +- **Versatile Integration:** Whether you're working on a quick one-liner or chaining multiple commands, ShellOracle |
| 36 | + adapts to your needs. Enjoy the flexibility of Unix pipe support and command history. |
| 37 | + |
| 38 | +- **Self-hosted Control:** Take charge of your environment by running ShellOracle as a self-hosted utility. Full control |
| 39 | + means you tailor it to your preferences. |
| 40 | + |
| 41 | +This is more than just a utility; it's a tool that transforms how you interact with the command line. With ShellOracle, |
| 42 | +the language of the shell becomes more accessible, intuitive, and efficient. |
| 43 | + |
| 44 | +## Features |
| 45 | + |
| 46 | +Key features of ShellOracle include: |
| 47 | + |
| 48 | +* Seamless shell command generation from written descriptions |
| 49 | +* Command history for easy reference |
| 50 | +* Unix pipe support for advanced command chaining |
| 51 | +* Self-hosted for full control over your environment |
| 52 | +* Highly configurable to adapt to your preferences |
| 53 | + |
| 54 | +## Installation |
| 55 | + |
| 56 | +To experience the power of ShellOracle, use the following one-liner to download and run the installer Python zip |
| 57 | +application: |
| 58 | + |
| 59 | +```zsh |
| 60 | +curl -sSL https://raw.githubusercontent.com/djcopley/ShellOracle/master/installer.pyz -o /tmp/installer.pyz && python3 /tmp/installer.pyz |
| 61 | +``` |
| 62 | + |
| 63 | +> [!NOTE] |
| 64 | +> ShellOracle uses Ollama as its default Language Model (LLM) provider. If you are going to use it, follow the |
| 65 | +> installation instructions [here](https://ollama.ai/). |
| 66 | +
|
| 67 | +## Usage |
| 68 | + |
| 69 | +ShellOracle is designed to be used as a ZSH Line Editor widget activated by the CTRL+F keyboard shortcut. |
| 70 | + |
| 71 | +1. Press CTRL+F |
| 72 | +2. Describe your command or goal |
| 73 | +3. Press Enter |
| 74 | + |
| 75 | +The generated command will be inserted into your shell prompt after a brief processing period. |
| 76 | + |
| 77 | +### Ollama |
| 78 | + |
| 79 | +Before using ShellOracle with Ollama, pull the model you want to use. The default model is `codellama:13b`. To pull the |
| 80 | +default model, run: |
| 81 | + |
| 82 | +```zsh |
| 83 | +ollama pull codellama:13b |
| 84 | +``` |
| 85 | + |
| 86 | +### OpenAI |
| 87 | + |
| 88 | +To use ShellOracle with the OpenAI provider, create an [API key](https://platform.openai.com/account/api-keys). Edit |
| 89 | +your `~/.shelloracle/config.toml` to change your provider and enter your API key. |
| 90 | + |
| 91 | +### Other ways to run ShellOracle |
| 92 | + |
| 93 | +ShellOracle can be run as a Python module with `python3 -m shelloracle` or using its entrypoint `shor`; however, |
| 94 | +there are a few caveats with this method: |
| 95 | +- Ensure your `~/.local/bin` directory is added to your PATH variable for the entrypoint to work. |
| 96 | +- Running ShellOracle with this method will not automatically insert the result into your shell prompt. |
| 97 | + |
| 98 | +### Tips |
| 99 | + |
| 100 | +1. If you press CTRL+F with text in your ZLE buffer, all text left of your cursor will carry over to your ShellOracle |
| 101 | + prompt. |
| 102 | +2. UP_ARROW and DOWN_ARROW cycle through your prompt history. |
| 103 | +3. ShellOracle can be chained with other commands; try: `echo "find all the python files in my cwd" | shor` |
| 104 | + |
| 105 | +## Configuration |
| 106 | + |
| 107 | +ShellOracle's configuration is your gateway to tailoring the utility to match your preferences and requirements. |
| 108 | +The `~/.shelloracle/config.toml` file serves as the control center for customizing various aspects of ShellOracle's |
| 109 | +behavior. |
| 110 | + |
| 111 | +### ShellOracle Settings |
| 112 | + |
| 113 | +The `[shelloracle]` section in the configuration file lets you define global settings for ShellOracle: |
| 114 | + |
| 115 | +```toml |
| 116 | +[shelloracle] |
| 117 | +provider = "Ollama" |
| 118 | +``` |
| 119 | + |
| 120 | +Set the `provider` key to specify the Language Model (LLM) backend, with options currently including "Ollama" and |
| 121 | +"OpenAI." |
| 122 | + |
| 123 | +### Provider Settings |
| 124 | + |
| 125 | +Provider-specific configurations are handled through tags such as `[provider.Ollama]` or `[provider.OpenAI]`. Here's an |
| 126 | +example for the Ollama provider: |
| 127 | + |
| 128 | +```toml |
| 129 | +[provider.Ollama] |
| 130 | +host = "localhost" |
| 131 | +port = 11434 |
| 132 | +model = "codellama:13b" |
| 133 | +system_prompt = "..." |
| 134 | +``` |
| 135 | + |
| 136 | +Change these options to match your desired configuration. |
| 137 | + |
| 138 | +For OpenAI, if you opt for this provider, you'll need to provide your API key and specify the desired model: |
| 139 | + |
| 140 | +```toml |
| 141 | +[provider.OpenAI] |
| 142 | +api_key = "your-api-key-here" |
| 143 | +model = "gpt-3.5-turbo" |
| 144 | +system_prompt = "..." |
| 145 | +``` |
| 146 | + |
| 147 | +*The provided configuration options are not exhaustive, and your default configuration may vary slightly. |
| 148 | +Nevertheless, the fundamental concept remains the same.* |
| 149 | + |
| 150 | + |
| 151 | +## System Requirements |
| 152 | + |
| 153 | +For cloud providers like OpenAI, there are no specific system requirements. |
| 154 | + |
| 155 | +If self-hosting, system requirements vary based on the model used. Refer to the Ollama model registry for more |
| 156 | +information. |
| 157 | + |
| 158 | +## Feedback |
| 159 | + |
| 160 | +Encountered problems? [File an issue](https://github.com/djcopley/ShellOracle/issues/new). Feature requests are welcome, |
| 161 | +and contributions can be made by opening a pull request. |
0 commit comments