@paynegh/terminal-gpt
v0.1.0
Published
nlsh (Natural Language Shell) — talk to your terminal in plain English.
Downloads
48
Readme
nlsh - Natural Language Shell
Talk to your terminal in plain English.
Requirements: macOS or Linux (Windows not currently supported)
Install
Option 0: npm (global)
# from the repo (until published on npm)
cd TerminalGPT
npm install
npm link
# now you can run:
nlshNotes:
- Requires Python 3 (
python3) and pip.- Postinstall will run
python3 -m pip install --user -r requirements.txt.- To skip pip install:
NLSH_SKIP_PIP=1 npm install.
Option 1: One-liner (curl)
bash <(curl -s https://raw.githubusercontent.com/PushDream/TerminalGPT/main/install.sh)Option 2: Clone and setup
git clone https://github.com/PushDream/TerminalGPT.git
cd TerminalGPT
./setup.shOption 3: Download ZIP (no git needed)
wget https://github.com/PushDream/TerminalGPT/archive/refs/heads/main.zip
unzip main.zip
cd TerminalGPT-main
./setup.shOption 4: Manual (minimal)
git clone https://github.com/PushDream/TerminalGPT.git
cd TerminalGPT
pip install google-generativeai
python nlsh.pyUninstall
curl -fsSL https://raw.githubusercontent.com/PushDream/TerminalGPT/main/uninstall.sh | bashUsage
nlshType naturally:
list all python files→find . -name "*.py"git commit with message fixed bug→git commit -m "fixed bug"show me disk usage→df -h
Or use shell commands directly - nlsh automatically detects when you're typing a command vs. natural language.
Features
Core Features
- Natural language to shell commands - Powered by Google Gemini AI
- Smart command detection - Automatically distinguishes between natural language and direct shell commands
- Command history context - AI remembers recent commands for context-aware suggestions
- Editable AI suggestions - Modify suggested commands before execution
Enhanced Features (v2.0.0+)
- Persistent command history - History saved across sessions (
~/.nlsh_history) - Tab completion - Autocomplete file paths and commands
- Environment variable expansion - Support for
$HOME,$USER, etc. - Built-in commands -
exit,quit,clearwork as expected - Improved command detection - 40+ additional shell commands recognized
- Interactive program support (v2.1.0) - Run
nano,vim,htop, and other interactive programs directly - Smart OS/shell detection (v2.2.0) - AI automatically adapts to your OS (Linux/macOS) and shell (bash/zsh/fish)
Commands
!api- Change API key!version- Show version!history- Show command history!help- Show help!<cmd>- Run any command directly (e.g.,!git status)exitorquit- Exit nlshclear- Clear screenCtrl+D- ExitCtrl+C- Cancel current operation
Credits
Original author: Junaid Mahmood
Enhanced by: PushDream - v2.0.0+ improvements including:
- Persistent readline history with file storage
- Tab completion for paths and commands
- Exit/quit/clear built-in commands
- Environment variable expansion
- Editable AI command suggestions
- Version tracking
- Expanded shell command detection (40+ additional commands)
- Synchronized history between readline and AI context
- Interactive program support (v2.1.0) - nano, vim, htop, etc.
- Smart OS/shell detection (v2.2.0) - AI adapts to Linux/macOS and bash/zsh/fish
