Skip to main content

A CLI chat app with web search and session management

Project description

PyPI version Python version License

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

pip install geegle

Configuration

Geegle requires API keys for OpenAI, Tavily, and Exa. You can configure them in three ways:

  1. First-Time Setup Wizard

When you first run Geegle, it will prompt you to enter your API keys if they aren't found:

geegle

You'll be prompted to enter your API keys, which will be saved in ~/.geegle/config.json

  1. Environment Variables You can set the following environment variables:
export OPENAI_API_KEY=your_openai_api_key
export TAVILY_API_KEY=your_tavily_api_key
export EXA_API_KEY=your_exa_api_key

You can get these API keys from:

https://platform.openai.com/docs/overview https://tavily.com/ https://exa.ai/

Usage

Start the application:

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

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

Session Management

/session: Opens the session management menu.
/session [name]: Switches directly to the specified session.

Model Selection

/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

/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

/session
# Select "n" to create a new session
# Enter "product-research"
# Now you're in a new conversation session

Switching models

/model
# View available models and select one
# Or use direct command: /model gpt-4o

Customizing prompts

/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:

/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:

/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:

/model
# Select "a" to add a custom model
# Enter the model identifier

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

geegle-0.0.3.tar.gz (19.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

geegle-0.0.3-py3-none-any.whl (20.3 kB view details)

Uploaded Python 3

File details

Details for the file geegle-0.0.3.tar.gz.

File metadata

  • Download URL: geegle-0.0.3.tar.gz
  • Upload date:
  • Size: 19.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for geegle-0.0.3.tar.gz
Algorithm Hash digest
SHA256 3d4386a1fa620b4bc2ed61df6a8d174ebc53742ebbb32d6208c2f7c7f6b54615
MD5 b04b3d1a88bc4b59db34522cdffcaf57
BLAKE2b-256 f95363181c4a831d16983aed5cdbcec0e1098353cd9169b5ff005d1254f92d17

See more details on using hashes here.

File details

Details for the file geegle-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: geegle-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 20.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for geegle-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f14e34c4a77d246e2c569eec97d4c94a12ef2de53c30dbc5df2f363634894c09
MD5 ab7646a727bbdfb9c1637259f8bf99f9
BLAKE2b-256 9d943c5f0cb598b48db2f24ffd306e1e1298223c75c7b2b974a7068ddb4d8d8f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page