GPT-OS is a revolutionary Linux shell that understands natural language and translates it into precise Linux commands. It makes Linux accessible to users of any age, skill level, or technical background by allowing them to interact with their system using plain, conversational language.
- Speak naturally: Type commands in plain English or your local language
- Multi-accent support: Works with different dialects and accents
- Context-aware: Understands your current directory and system state
- Conversational: Get explanations in easy-to-understand language
- Command preview: Always shows what will be executed before running
- Danger detection: Identifies potentially destructive commands
- Confirmation required: Asks for approval before executing dangerous operations
- Timeout protection: Commands automatically timeout after 30 seconds
- Chat-style interface: Responses formatted like a conversation
- Clear explanations: Every command comes with a human-readable explanation
- Command history: Track what you've done
- Built-in help: Comprehensive help system
- Operating System: Linux (Ubuntu, Debian, Fedora, Arch, etc.)
- Python: Version 3.8 or higher
- OpenAI API Key: Get one from OpenAI Platform
-
Clone the repository:
git clone https://github.com/hunix/gpt-os.git cd gpt-os -
Run the installation script:
./install.sh
-
Set your OpenAI API key:
export OPENAI_API_KEY='your-api-key-here'
To make it permanent, add it to your
~/.bashrc:echo 'export OPENAI_API_KEY="your-api-key-here"' >> ~/.bashrc source ~/.bashrc
-
Launch GPT-OS:
./gpt-os
To use GPT-OS from anywhere on your system:
sudo ln -s $(pwd)/gpt-os /usr/local/bin/gpt-osThen simply run:
gpt-osInstead of remembering complex syntax, just describe what you want:
| Natural Language | Traditional Command |
|---|---|
| "update my software" | sudo apt update && sudo apt upgrade -y |
| "show me all PDF files" | find . -name "*.pdf" |
| "check disk space" | df -h |
| "find large files" | du -ah . | sort -rh | head -20 |
| "compress this folder" | tar -czf folder.tar.gz folder/ |
| "show running processes" | ps aux |
| "check my IP address" | curl ifconfig.me |
| "install python packages" | pip3 install package-name |
Direct command execution: Prefix with ! to execute commands directly without AI translation:
🤖 user@host:~$ !ls -la
Command history: View your previous commands:
🤖 user@host:~$ history
Built-in help: Get assistance anytime:
🤖 user@host:~$ help
GPT-OS is built as a userspace application that sits on top of the standard Linux kernel. This means:
- ✅ No kernel modification required - Works with any Linux distribution
- ✅ Easy to install and uninstall - Just a Python application
- ✅ Safe and isolated - Doesn't affect your system's core functionality
- ✅ Compatible - Works alongside your existing shell (bash, zsh, etc.)
┌─────────────────────────────────────────────────────────────┐
│ User Input │
│ (Natural Language Command) │
└────────────────────────┬────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ GPT-OS Shell │
│ • Context gathering (current dir, OS info) │
│ • Safety checks │
└────────────────────────┬────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ OpenAI API (GPT-4) │
│ • Natural language understanding │
│ • Command generation │
│ • Explanation generation │
└────────────────────────┬────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Command Preview │
│ • Show generated command │
│ • Display explanation │
│ • Request user confirmation │
└────────────────────────┬────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Execution │
│ • Run approved command │
│ • Capture output │
│ • Format results │
└─────────────────────────────────────────────────────────────┘
GPT-OS takes security seriously:
-
Dangerous Command Detection: Automatically identifies commands that could harm your system:
- File deletion (
rm -rf) - Disk formatting (
mkfs,fdisk) - System shutdown/reboot
- Process termination (
kill -9) - And more...
- File deletion (
-
Mandatory Confirmation: All commands require explicit user approval before execution
-
Command Preview: You always see exactly what will be executed
-
Timeout Protection: Commands automatically terminate after 30 seconds to prevent runaway processes
-
No Automatic Execution: Unlike some AI assistants, GPT-OS never executes commands without your permission
GPT-OS is designed to work with multiple languages and accents. The underlying GPT model understands:
- English (all dialects: US, UK, Australian, etc.)
- Spanish
- French
- German
- Chinese
- Arabic
- And many more...
Simply type your commands in your preferred language!
By default, GPT-OS uses gpt-4.1-mini for fast, cost-effective responses. You can modify the model in gpt_shell.py:
response = self.client.chat.completions.create(
model="gpt-4.1-mini", # Change this to gpt-4, gpt-4.1-nano, etc.
...
)The system prompt in gpt_shell.py can be customized to change how the AI interprets commands. This is useful for:
- Adding domain-specific knowledge
- Changing the response format
- Adding custom safety rules
| Feature | GPT-OS | Traditional Shell | Other AI Shells |
|---|---|---|---|
| Natural Language | ✅ Full support | ❌ No | ✅ Limited |
| Command Explanation | ✅ Always | ❌ No | |
| Safety Confirmation | ✅ Required | ❌ No | |
| Multi-language | ✅ Yes | ❌ No | |
| Offline Mode | ❌ No (requires API) | ✅ Yes | |
| Learning Curve | ✅ None | ❌ Steep | |
| Full Shell Replacement | ✅ Yes | N/A | ❌ No (CLI tools) |
We welcome contributions! Here's how you can help:
- Report Bugs: Open an issue describing the problem
- Suggest Features: Share your ideas for improvements
- Submit Pull Requests: Fix bugs or add features
- Improve Documentation: Help make the docs better
- Share Examples: Add more natural language command examples
git clone https://github.com/hunix/gpt-os.git
cd gpt-os
pip3 install --user openai
python3 gpt_shell.py- ✅ Natural language command translation
- ✅ Safety features and confirmations
- ✅ Command history
- ✅ Multi-language support
- 🔄 Voice input support (speech-to-text)
- 🔄 Voice output (text-to-speech responses)
- 🔄 Offline mode with local LLM (Ollama integration)
- 🔄 Learning from user corrections
- 🔄 Custom command aliases
- 🔮 GUI interface option
- 🔮 System troubleshooting assistant
- 🔮 Complex workflow automation
- 🔮 Plugin system for extensions
- 🔮 Custom Linux distribution (GPT-OS ISO)
Make sure you've set the environment variable:
export OPENAI_API_KEY='your-api-key-here'Some commands take longer than 30 seconds. You can modify the timeout in gpt_shell.py:
result = subprocess.run(
command,
shell=True,
capture_output=True,
text=True,
timeout=30 # Change this value
)Try rephrasing your request or being more specific. You can also use ! to execute direct commands:
🤖 user@host:~$ !your-command-here
GPT-OS is released under the MIT License. See LICENSE for details.
- OpenAI for providing the GPT models that power natural language understanding
- BuilderIO/ai-shell for inspiration on CLI design
- The Linux community for creating an amazing open-source operating system
- All contributors and users who help improve GPT-OS
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Website: gptos.ai
If you find GPT-OS useful, please consider giving us a star on GitHub! It helps others discover the project.
Made with ❤️ for the Linux community
Making Linux accessible to everyone, one natural language command at a time.