ShellOracle

Jan 17, 2022 | Educational

Tests PyPI version PyPI Supported Python Versions Downloads

ShellOracle is an innovative terminal utility designed for intelligent shell command generation, bringing a new level of efficiency to your command-line interactions. ShellOracle currently supports Ollama, LocalAI, and OpenAI.

ShellOracle GIF

Table of Contents

Features

Key features of ShellOracle include:

  • Seamless shell command generation from written descriptions
  • Command history for easy reference
  • Unix pipe support for advanced command chaining
  • Self-hosted for full control over your environment
  • Highly configurable to adapt to your preferences

Installation

Installing ShellOracle is easy!

  1. Use pipx to install the shelloracle package:
  2. pipx install shelloracle
  3. Configure ShellOracle and follow the prompts:
  4. shor configure
  5. Refer to the providers section for specific details regarding your chosen provider.

Upgrading to the latest version of ShellOracle is just as simple:

pipx upgrade shelloracle

Note: Installation with pip is supported, however, pipx is preferred for its automatic environment isolation.

Usage

ShellOracle is designed to be used as a BASH/ZSH widget activated by the CTRL+F keyboard shortcut.

  1. Press CTRL+F
  2. Describe your command
  3. Press Enter

The generated command will be inserted into your shell prompt after a brief processing period.

Other ways to run ShellOracle

ShellOracle can also be run as a Python module with:

python3 -m shelloracle

Alternatively, use its entrypoint shor, but note this will not automatically insert the result into your shell prompt.

Tips

  • If you press CTRL+F with text in your ZLE buffer, all text left of your cursor will carry over to your ShellOracle prompt.
  • Use and to cycle through your prompt history.
  • ShellOracle can be chained with other commands; for example: echo "find all the python files in my cwd" | shor

Providers

Ollama

Before using ShellOracle with Ollama, pull the model you chose in the configure step.

For example, if you chose dolphin-mistral, run:

shell ollama pull dolphin-mistral

Refer to the Ollama docs for installation, available models, and usage.

OpenAI

To use ShellOracle with the OpenAI provider, create an API key. Edit your ~/.shelloracle/config.toml file to change your provider and enter your API key.

LocalAI

Refer to the LocalAI docs for installation, available models, and usage.

Configuration

ShellOracle’s configuration file, located at ~/.shelloracle/config.toml, serves as the control center for customizing various aspects of ShellOracle’s behavior.

System Requirements

Software

ShellOracle supports BASH and ZSH on macOS and Linux.

Hardware

For cloud providers like OpenAI, there are no hardware requirements. If running locally, refer to your model for hardware specifications.

Feedback

Encountered problems? File an issue. Feature requests are welcome, and contributions can be made by opening a pull request.

Troubleshooting

If you run into issues while using ShellOracle, here are some troubleshooting tips:

  • Ensure you have the necessary permissions to install the package.
  • Check your internet connection if you’re having trouble pulling models from Ollama or OpenAI.
  • Verify that your configuration files are correctly set up, especially for the API keys.
  • Look for any error messages outputted in the terminal for guidance on what may be wrong.

For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.

At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.

Stay Informed with the Newest F(x) Insights and Blogs

Tech News and Blog Highlights, Straight to Your Inbox