https://github.com/duriantaco/geegle-py
Access web search engine via a CLI using wrappers
https://github.com/duriantaco/geegle-py
cli llm python python3
Last synced: about 1 year ago
JSON representation
Access web search engine via a CLI using wrappers
- Host: GitHub
- URL: https://github.com/duriantaco/geegle-py
- Owner: duriantaco
- License: other
- Created: 2025-04-11T02:58:22.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-14T09:14:20.000Z (about 1 year ago)
- Last Synced: 2025-04-15T01:18:10.316Z (about 1 year ago)
- Topics: cli, llm, python, python3
- Language: Python
- Homepage: https://geegle-py.readthedocs.io/en/latest/
- Size: 349 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: License
- Security: SECURITY.md
Awesome Lists containing this project
README
[](https://badge.fury.io/py/geegle)
[](https://www.python.org/downloads/)
[](https://www.apache.org/licenses/LICENSE-2.0)
# Geegle
Geegle is a CLI chat app that combines web search, academic research, and session management using SQLite for local data storage. It uses APIs from OpenAI, Tavily, and Exa to provide answers with web sources, for users seeking information directly from their terminal.
# Features
* Real-Time Web Search: Integrates Tavily for up-to-date web information
* Academic Research: Uses Exa to fetch research papers and scholarly content
* Session Management: Store and switch between multiple conversation sessions using SQLite
* Model Selection: Choose between different AI models (GPT-3.5, GPT-4, Claude, etc.)
* Prompt Customization: Create and manage custom system prompts to tailor responses
* Command Autocomplete: Tab completion for commands and arguments
* Interactive Menus: User-friendly navigation for all features
* Data Export: Export session data to JSON files for backup or sharing
# Installation
Follow these steps to set up Geegle on your system.
## Prerequisites
Python: Version 3.7 or higher
pip: Latest version recommended
# Install the package
```bash
pip install geegle
```
# Configuration
Geegle requires API keys for OpenAI, Tavily, and Exa.
You can get these API keys from:
https://platform.openai.com/docs/overview
https://tavily.com/
https://exa.ai/
* API keys are stored securely in your system's keychain using the `keyring` library
* You can update your API keys anytime using the `/model` command and selecting the key management option
* For security reasons, API keys are not included in exported session data
# Usage
Start the application:
```bash
geegle
```
# Quick Start:
1. Type a question (e.g., "What's the capital of France?") and press `Enter`.
2. Use commands (starting with /) to manage sessions or data.
3. Press `Tab` to autocomplete commands and arguments.
4. Type `exit` to quit.
# Commands
## Basic Commands
```bash
/clear: Clears the current session's conversation history.
/clear all: Deletes all session data (requires confirmation).
/export [filename]: Exports all sessions to a JSON file (default: sessions_export.json).
/help: Shows a list of commands and usage instructions.
/rerank
```
## Session Management
```bash
/session: Opens the session management menu.
/session [name]: Switches directly to the specified session.
```
## Model Selection
```bash
/model: Opens the model selection menu.
/model [name]: Switches directly to the specified model.
```
Available models:
* gpt-3.5-turbo
* gpt-4-turbo-preview
* gpt-4o
* claude-3-opus-20240229
* claude-3-sonnet-20240229
* claude-3-haiku-20240307
## Prompt Customization
```bash
/prompt: Opens the prompt customization menu.
/prompt [template_name]: Uses the specified prompt template.
/prompt [text]: Sets a custom system prompt.
```
Default templates:
* default: General assistant
* concise: Brief, factual responses
* detailed: In-depth analysis
* coding: Code-focused assistance
## Keyboard Shortcuts
Tab: Autocomplete commands and arguments
↑/↓: Navigate command history
exit: Exits the application
# Examples
## Creating a new session
```bash
/session
# Select "n" to create a new session
# Enter "product-research"
# Now you're in a new conversation session
```
## Switching models
```bash
/model
# View available models and select one
# Or use direct command: /model gpt-4o
```
## Customizing prompts
```bash
/prompt
# Create a custom prompt or use a template
# Or use direct command: /prompt coding
```
# Advanced Usage
## Autocomplete
Press Tab to complete commands and arguments:
```bash
/m[Tab] # Completes to "/model"
/model g[Tab] # Shows available models starting with "g"
/session p[Tab] # Completes to existing sessions starting with "p"
```
## Multi-line Prompts
When creating custom prompts, you can enter multiple lines:
```bash
/prompt
# Select "c" to create custom prompt
# Enter your prompt, press Enter twice when done
```
## Adding Custom Models
You can add custom models through the model menu:
```bash
/model
# Select "a" to add a custom model
# Enter the model identifier
```
## Geegle vs Perplexity?
Geegle offers several advantages over web-based search tools like Perplexity:
* **Command-Line Efficiency**: Works directly in your terminal without having to switch to a browser
* **Local-First Architecture**: Stores all conversation data in a local SQLite database, giving you complete data ownership
* **Comprehensive Session Management**: Create, switch between, and manage multiple conversation sessions seamlessly
* **Academic Research Integration**: Connects with Exa API specifically for academic research papers and scholarly content
* **Model Flexibility**: Supports multiple AI models from both OpenAI and Anthropic, giving you freedom of choice
* **Privacy-Focused Design**: Uses secure system keychain storage for API keys rather than plain text configuration
* **Open-Source Flexibility**: Apache 2.0 licensed, allowing modification and customization to meet specific requirements
* **Advanced Caching**: Intelligently caches previous search results and web content for reduced API usage and offline access
* **Customizable Prompts**: Create and manage custom system prompts with different templates for various use cases
* **Seamless Web Content Analysis**: Can scrape and analyze specific URLs for deeper insights beyond search snippets
* **Command Autocompletion**: Tab completion for commands and arguments makes the tool efficient and intuitive
# Contributing
See CONTRIBUTING.md for details on how to contribute to this project.
# License
This project is licensed under the Apache License 2.0 - see the License file for details.