This is a minimalistic but robust terminal UI for Perplexica, which is a self-hosted take on Perplexity. It uses Ollama and SearXNG to achieve ChatGPT or Gemini-style 'deep research' in your homelab.

mitch donaberger c718a9e7d5 Updated README 4 ay önce
README.md c718a9e7d5 Updated README 4 ay önce
perplexica-search-tui.py eabe4072ae hehe 4 ay önce
requirements.txt eabe4072ae hehe 4 ay önce
search.sh eabe4072ae hehe 4 ay önce

README.md

🔮 Perplexica Search TUI


image


Beautiful terminal interface for the Perplexica API – AI-powered search in your terminal.

Installation

  1. Clone the repository:

    git clone <your-repo-url>
    cd main
    
  2. Set up a Python virtual environment:

    python3 -m venv ~/venv/perplexica
    source ~/venv/perplexica/bin/activate
    
  3. Install dependencies:

    pip install -r requirements.txt
    
  4. Install to system PATH (optional but recommended):

    # 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

./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)

./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 - Set up your own Perplexica server with docker and docker-compose! Use other cloud hosts, or just locally-hosted Ollama!