A clean, modern command-line interface that interprets natural language commands using a local LLM and executes real system operations. The application operates completely offline after initial setup and prioritizes user safety through confirmation prompts for destructive operations.
โโโ โโโ โโโโโโ โโโ โโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโ โโโโโโโโโโโโโโ โโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโ โโโ โโโ โโโโโโ โโโ โโโ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโ โโโ โโโโโโ โโโ โโโ
โโโ โโโโโโ โโโโโโโโโโโโโโโ โโโโโโ โโโ โโโโโโโโโโโโโโโโ
โโโ โโโโโโ โโโ โโโโโโโ โโโ โโโโโ โโโ โโโโโโโโโโโโโโโ
status: ready ยท model: llama3.2 ยท v0.1.0
- ๐ฃ๏ธ Natural Language Commands: Type what you want in plain English
- ๐ค Local LLM Processing: Uses Ollama with llama3.2 for command interpretation
- ๐ Safety First: Warns and confirms before destructive operations
- ๐จ Clean, Modern Design: Minimal interface inspired by Gemini CLI with teal and purple accents
- ๐ Command History: Remembers your commands across sessions with SQLite
- ๐ Completely Offline: No external API calls, all processing happens locally
- โจ Subtle Animations: Clean loading indicators and well-spaced output
- Python: 3.10 or higher
- Operating System: macOS, Linux, or Windows with WSL
- Ollama: Local LLM service (installation instructions below)
All Python dependencies are listed in requirements.txt:
typer>=0.9.0- CLI frameworkrich>=13.0.0- Terminal styling and formattingrequests>=2.31.0- HTTP client for Ollama APIhypothesis>=6.92.0- Property-based testing (development)pytest>=7.4.0- Testing framework (development)
Ollama is required to run the local LLM that interprets your natural language commands.
brew install ollamacurl -fsSL https://ollama.com/install.sh | shDownload the installer from ollama.com
After installing Ollama, download the llama3.2 model:
ollama pull llama3.2Start the Ollama service (it will run in the background):
ollama serveNote: On macOS and Windows, Ollama typically starts automatically. On Linux, you may need to start it manually or set it up as a systemd service.
Clone the repository:
# Clone the repository
git clone <repository-url>
cd haunted-terminal-cliThis is the professional way to install CLI tools (like pip, black, pytest):
pip install -e .This will:
- Install all dependencies automatically
- Create a
hauntedcommand available system-wide - Allow you to edit the code and see changes immediately
- Follow Python packaging best practices
If you prefer to install dependencies manually:
pip install -r requirements.txtNote: With manual installation, you'll need to run python haunted.py instead of just haunted.
If you installed with pip install -e . (recommended):
hauntedThis works from anywhere on your system! ๐
Alternatively, if you installed manually:
python haunted.pyOnce the application starts, you'll see a clean welcome header. Simply type what you want to do in natural language:
โบ list all python files in this directory
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
you: list all python files in this directory
ghost: find . -name "*.py"
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
execute? (y/n)
โบ show me the current directory
โบ create a new folder called test
โบ find all files modified in the last 24 hours
โบ show disk usage for this folder
โบ count lines in all python files
The Haunted Terminal protects you from destructive operations:
โบ delete all temporary files
โ warning: destructive operation detected
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
you: delete all temporary files
ghost: rm -rf /tmp/*
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
Type 'CONFIRM' to proceed, or anything else to cancel:
Type exit or quit to leave the Haunted Terminal:
โบ exit
goodbye
2 commands executed this session
Problem: The application can't reach the Ollama service.
Solutions:
-
Check if Ollama is running:
curl http://localhost:11434/api/tags
-
Start Ollama if it's not running:
ollama serve
-
Verify the llama3.2 model is installed:
ollama list
-
If llama3.2 is missing, pull it:
ollama pull llama3.2
Problem: Ollama is taking too long to respond (>10 seconds).
Solutions:
- The llama3.2 model might be loading for the first time (this is normal)
- Try the command again - subsequent requests are usually faster
- Check system resources - Ollama requires adequate RAM
- Consider using a smaller model if your system is resource-constrained
Problem: Commands fail with permission errors.
Solutions:
- Some operations require sudo privileges
- Run the specific command with sudo manually, or
- Rephrase your request to avoid privileged operations
Problem: SQLite database errors when saving history.
Solutions:
- Check write permissions in the application directory
- Delete the database file to reset:
rm haunted_history.db - The application will create a new database on next run
Problem: The interpreted command doesn't match your intent.
Solutions:
- Be more specific in your natural language request
- Review the command preview before confirming
- Type 'n' to cancel and rephrase your request
- You can always type the exact shell command if needed
To verify everything is working correctly:
python --version
# Should show Python 3.10 or highercurl http://localhost:11434/api/tags
# Should return JSON with available modelsollama list | grep llama3.2
# Should show llama3.2 in the listhauntedOr if you didn't use pip install -e .:
python haunted.pyYou should see:
- A clean, minimal header:
haunted โธ terminal - System status showing "ready" with model info
- A prompt waiting for input (โบ)
Try a harmless command:
โบ show current date and time
The application should:
- Display the interpreted shell command in a clean box
- Ask for confirmation
- Execute and show the result with minimal, modern formatting
If you want to run the test suite:
# Run all tests
pytest
# Run with verbose output
pytest -v
# Run specific test file
pytest tests/test_cli.py
# Run property-based tests
pytest tests/ -k "property"haunted-terminal-cli/
โโโ haunted.py # Main entry point
โโโ setup.py # Professional packaging configuration
โโโ src/
โ โโโ cli.py # CLI interface and main loop
โ โโโ theme.py # Spooky theme and styling
โ โโโ ollama_client.py # Ollama LLM integration
โ โโโ executor.py # Command execution
โ โโโ safety.py # Destructive command detection
โ โโโ history.py # SQLite command history
โโโ tests/ # Test suite
โโโ requirements.txt # Python dependencies
โโโ README.md # This file
The professional installation method (pip install -e .) offers several advantages:
- System-wide Command: Run
hauntedfrom any directory - Automatic Dependencies: All requirements installed automatically
- Development Mode: Edit code and see changes immediately (no reinstall needed)
- Standard Practice: Same approach used by pip, pytest, black, and other professional tools
- Easy Uninstall: Simply run
pip uninstall haunted-terminal-cli - Virtual Environment Friendly: Works perfectly with venv, conda, etc.
This is the recommended approach for both development and daily use!
- Offline Operation: All processing happens locally on your machine
- No External Calls: The application only communicates with localhost Ollama
- Command History: Stored locally in SQLite database
- Safety Checks: Destructive operations require explicit confirmation
- Open Source: Review the code to verify privacy claims
The theme and styling can be customized by editing src/theme.py:
- Color palette (teal accent, soft purple secondary, muted gray-green for status)
- Prompt symbols and prefixes
- Message templates
- Loading animations and spinners
- Quiet mode for minimal output
[Add your license information here]
[Add contribution guidelines here]
- First command may be slow as Ollama loads the model into memory
- Very complex commands might not interpret correctly
- Some shell-specific features (pipes, redirects) may need careful phrasing
Built with:
- Ollama - Local LLM runtime
- Typer - CLI framework
- Rich - Terminal formatting
- Hypothesis - Property-based testing
๐ป Clean, minimal, and modern - your terminal, reimagined.