# 🔮 Perplexica Search TUI --- ![image](https://images.mitch.science/i/d855d1eb-38d2-4603-8882-65b5b669dfea.jpg) --- Beautiful terminal interface for the [Perplexica](https://github.com/ItzCrazyKns/Perplexica) API – AI-powered search in your terminal. ## Installation 1. **Clone the repository:** ```sh git clone cd main ``` 2. **Set up a Python virtual environment:** ```sh python3 -m venv ~/venv/perplexica source ~/venv/perplexica/bin/activate ``` 3. **Install dependencies:** ```sh pip install -r requirements.txt ``` 4. **Install to system PATH (optional but recommended):** ```sh # Move files to a permanent location sudo mkdir -p /usr/local/bin/perplexica sudo cp search.sh perplexica-search-tui.py /usr/local/bin/perplexica/ # Set execute permissions sudo chmod +x /usr/local/bin/perplexica/search.sh sudo chmod +x /usr/local/bin/perplexica/perplexica-search-tui.py # Add to PATH (add this line to your shell profile like ~/.bashrc or ~/.zshrc) export PATH="/usr/local/bin/perplexica:$PATH" ``` 5. **Configure your API endpoint:** - Edit `perplexica-search-tui.py` and set `API_URL` to your own Perplexica API endpoint. - Edit `search.sh` and set `VENV_PATH` to your Python virtual environment path if different from the default. ## Usage ### Interactive Mode ```sh ./search.sh ``` - Use `/mode` to switch focus modes (web, academic, writing, etc.). - Use `/speed` to change optimization mode (speed/balanced). - Use `/clear` to clear history. - Use `/help` for help. - Use `/exit` to quit. ### Direct Query (Non-interactive) ```sh ./search.sh --query "What is quantum computing?" ``` ### Command-line Options - `--mode MODE` - Set focus mode (e.g., webSearch, academicSearch) - `--query QUERY` - Run a direct query - `--speed MODE` - Set optimization mode (speed/balanced) - `--version` - Show version ## FAQ **Q: How do I set my API endpoint?** A: Edit `perplexica-search-tui.py` and set `API_URL` to your Perplexica API server. **Q: How do I set my Python virtual environment path?** A: Edit `search.sh` and set `VENV_PATH` to the path where your venv is located. **Q: I get 'Python interpreter not found' errors.** A: Make sure your virtual environment exists and `VENV_PATH` is correct. **Q: How do I pass system instructions?** A: In interactive mode, use `|` to separate your query and instructions, e.g. `translate this to French | write in formal tone` **Q: What Python version is required?** A: Python 3.8 or newer. **Q: How do I install dependencies?** A: Run `pip install -r requirements.txt` inside your virtual environment. **Q: How do I exit?** A: Use `/exit` in interactive mode or press `Ctrl+C`. --- For more details, see comments in the scripts. If you encounter issues, check your API endpoint and venv configuration. # Links * [Perplexica on GitHub](https://github.com/ItzCrazyKns/Perplexica) - Set up your own Perplexica server with `docker` and `docker-compose`! Use other cloud hosts, or just locally-hosted Ollama!