Crates.io | shellchat |
lib.rs | shellchat |
version | 1.0.39 |
source | src |
created_at | 2024-08-20 08:46:30.523605 |
updated_at | 2024-09-26 12:08:44.012199 |
description | Transforms natural language into shell commands for execution or explanation. |
homepage | https://github.com/eugeis/shellchat |
repository | https://github.com/eugeis/shellchat |
max_upload_size | |
id | 1345048 |
size | 149,933 |
Welcome to ShellChat, your intelligent command-line assistant that transforms natural language requests into precise shell commands. Say goodbye to memorizing complex command syntax—simply describe what you need, and let ShellChat handle the rest.
ShellChat is designed to be contextually aware of your operating system and shell environment, offering both automatic detection and manual configuration options. By default, ShellChat automatically detects your OS and shell, adapting the commands it generates to ensure they run seamlessly within your environment.
Alternatively, you can manually specify the operating system and shell by passing them as command-line parameters (-o, --os for the OS, and -s, --shell for the shell), or through environment variables (SHC_OS, SHC_SHELL). This dual approach provides maximum flexibility, ensuring that ShellChat is compatible with any setup, whether running locally, in containers, or on remote systems, enhancing the overall efficiency and reducing errors in command execution.
One of ShellChat's most powerful features is its ability to understand and process commands given in any natural language. Whether you prefer to work in English, German, or any other language, ShellChat can interpret your requests and generate the corresponding shell commands. The examples below demonstrate commands in both English and German, showcasing the tool's versatility.
When you initiate a request via ShellChat's TUI, you will be presented with three options:
To navigate through the options, use the arrow keys:
Once you've made your selection, press Enter
to confirm.
Note: In addition to these options, ShellChat offers a reverse mode, where you can provide an existing command to be analyzed and explained. To enable this mode, use the -e or --explain flag.
ShellChat will break down the provided command and explain its purpose, syntax, and potential side effects, helping you better understand what the command will do before execution.
ShellChat is built on a robust architecture consisting of two primary components:
Server (shc-serve or Docker Image): The server handles the sensitive configuration related to the AI provider, including access keys and other critical credentials. It acts as the central processing unit, interpreting user commands and securely managing interactions with the AI provider. The server is developed in Rust, making it exceptionally fast and performant.
Client (shc): The client is a lightweight interface that communicates with the server without needing direct access to the server's deployment. This separation ensures that sensitive data remains secure and inaccessible from the client side. The communication protocol is designed to support unlimited clients operating concurrently, allowing for scalable, parallel processing of commands. The client is also developed in Rust, contributing to its speed and reliability.
Here are some examples of how ShellChat can help you translate your everyday tasks into efficient shell commands, in both English and German:
Input:
shc list how many pods are deployed in all namespaces
Output:
kubectl get pods --all-namespaces | grep -v NAME | wc -l
Input:
shc zeige pods in dem ollama namespace
Output:
kubectl get pods -n ollama
Input:
shc show history of last 3 commits
Output:
git log -3
Input:
shc zeige diff des letzten commit
Output:
git log -1 --pretty=%H | xargs git diff
Input:
shc show git user and email of the current git repo
Output:
git config --get user.name && git config --get user.email
Input:
shc list 10 larges files recursive
Output:
find . -type f -exec du -h {} + | sort -rh | head -n 10
Input:
shc list csv files
Output:
ls *.csv
Input:
shc list csv files recursive
Output:
find . -type f -name "*.csv"
Input:
shc show Gitlab last pipeline status of gitlab host https://some_host and some_project
Output:
curl -s --header "PRIVATE-TOKEN: <your_access_token>" "https://some_host/api/v4/projects/some_project/pipelines/latest" | jq '.status'
ShellChat is the perfect tool for anyone who wants to streamline their command-line interactions across different languages. By converting natural language—whether it's English, German, or any other—into shell commands, it makes complex operations simple and accessible. Whether you're managing Kubernetes pods, checking Git histories, or exploring file systems, ShellChat is here to enhance your productivity.