A powerful shell environment enhanced with Large Language Model capabilities for natural language command processing.
IMPORTANT SECURITY AND SAFETY NOTICE:
- This shell can execute arbitrary commands on your system based on natural language input.
- LLMs can hallucinate or misinterpret your intent, potentially leading to destructive commands.
- Always review translated commands before confirming execution, especially for destructive operations.
- Never run this shell with elevated privileges (root/sudo) unless absolutely necessary.
- Use in production environments at your own risk - this is primarily a development tool.
- The shell may transmit command context to external LLM services.
By using LLM Shell, you accept full responsibility for any consequences resulting from commands executed through this interface.
- Natural language command processing
- Command explanations and suggestions
- Environment variable support
- Built-in shell commands
- Command history and completion
- Job control
- LLM-powered assistance
-
Natural Language Commands
find all python files modified in the last week
LLM Shell translates this to the appropriate
find
command with the correct syntax. -
Ask Questions Directly
? how do I check disk usage in Linux
Get answers to technical questions without leaving your terminal.
-
Command Suggestions
git ??
Append
??
to any command to get contextually relevant suggestions. -
Complex Command Generation
create a backup of my home directory excluding node_modules folders
Generate complex commands with exclude patterns without memorizing syntax.
-
Command Explanations
awk '{print $1}' file.txt ??
Get explanations of what complex commands actually do.
-
Data Processing Tasks
extract all email addresses from log.txt
Let the LLM generate the appropriate regex and command.
-
System Administration
show me all processes using more than 1GB of memory
Generate and execute system monitoring commands easily.
-
File Operations
find and delete all empty directories under the current path
Perform complex file operations with simple language.
-
Network Diagnostics
check if port 8080 is open and what process is using it
Simplify network troubleshooting with natural language.
-
Learning Tool
? what's the difference between grep and egrep
Use the shell as a learning platform to understand command-line tools better.
# Clone the repository
git clone https://github.com/phildougherty/llmsh.git
# Build the project
cd llmsh
cargo build --release
# Install the binary
sudo cp target/release/llm-shell /usr/local/bin/llmsh
# Run the shell
llmsh
LLM Shell uses the following environment variables:
RUST_LOG
: Set log level (info, warn, error, debug)LLM_HOST
: URL of the LLM service (default: http://localhost:11434)LLM_MODEL
: Model to use (default: qwen2.5:14b)
- Regular shell commands work as expected
- Start with
?
to ask a question - Type natural language for command translation
- Append
??
to any command for suggestions - Use
help
to see built-in commands
cd [dir]
: Change directorypwd
: Print working directoryexport VAR=VALUE
: Set environment variableecho [text]
: Display textalias [name[=value]]
: Manage aliaseshistory
: View command historyhelp
: Show help information- And many more standard shell built-ins
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with Rust
- Powered by Ollama or other LLM providers
- Inspired by traditional Unix shells and modern AI assistants