Metadata-Version: 2.4
Name: ask-log
Version: 1.0.0a1
Summary: An AI log analyzer with chat interface
Author-email: Vandan Savla <vsavla21@gmail.com>
Project-URL: Homepage, https://github.com/vandan-savla/ask-log
Project-URL: Repository, https://github.com/vandan-savla/ask-log
Project-URL: Issues, https://github.com/vandan-savla/ask-log/issues
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: System :: Logging
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: click
Requires-Dist: rich
Requires-Dist: prompt-toolkit
Requires-Dist: questionary
Requires-Dist: pyyaml
Requires-Dist: numpy
Requires-Dist: tiktoken
Requires-Dist: chromadb
Requires-Dist: litellm
Requires-Dist: fastembed
Requires-Dist: langchain
Requires-Dist: langchain-core
Requires-Dist: langchain-community
Requires-Dist: langchain-text-splitters
Requires-Dist: langchain-classic
Requires-Dist: langchain-huggingface
Provides-Extra: openai
Requires-Dist: langchain-openai; extra == "openai"
Provides-Extra: anthropic
Requires-Dist: langchain-anthropic; extra == "anthropic"
Provides-Extra: google
Requires-Dist: langchain-google-genai; extra == "google"
Requires-Dist: langchain-google-vertexai; extra == "google"
Dynamic: license-file

## Ask Log

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
[![Python](https://img.shields.io/badge/Python-3.10%20|%203.11%20|%203.12%20|%203.13-blue)](https://www.python.org/downloads/)
[![OS](https://img.shields.io/badge/OS-Windows%20|%20macOS%20|%20Linux-555)](#)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md)

Ask Log is a CLI-first assistant that helps you explore, summarize, and reason about application logs through a conversational interface. Point it at a log file, ask questions, and iterate quickly.

This project uses LangChain under the hood and supports multiple LLM providers (OpenAI, Anthropic, Google), configurable via a simple guided setup. Conversations are optionally saved so you can resume later.

---

### Quick links

[![Configure](https://img.shields.io/badge/Step%201-Configure-blue?logo=terminal)](#-configuration) [![Start Chat](https://img.shields.io/badge/Step%202-Start%20Chat-green?logo=gnu-bash)](#-quickstart) [![Status](https://img.shields.io/badge/Status-Check-informational?logo=gnometerminal)](#-commands)

---

### Features

- Conversational log analysis over any text log
- Local vector index (FAISS) for retrieval-augmented answers
- Provider-agnostic via LangChain: OpenAI, Anthropic, Google Gemini
- Persistent conversation history per-log for continuity
- Colorful, ergonomic CLI using `rich` and `click`

---

## Installation (local, editable)

No PyPI release yet. Install locally in editable mode for fast iteration.

#### 1) Clone

```bash
git clone https://github.com/vandan-savla/ask-log.git
cd ask-log
```

#### 2) Create and activate a virtual environment

- Windows (PowerShell)

```powershell
py -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install -U pip setuptools wheel
```

- macOS/Linux (bash)

```bash
python3 -m venv .venv
source .venv/bin/activate
python -m pip install -U pip setuptools wheel
```

#### 3) Install the project in editable mode

Core installation:

```bash
pip install -e .
```

---

## Quickstart

Once installed, the `ask-log` command is available.

```bash
# 1) Configure your preferred provider and model
ask-log configure

# 2) Check configuration
ask-log status

# 3) Analyze a log file interactively; optionally save the conversation
ask-log chat --log-file /path/to/app.log --save ~/.ask-log/last-session.json
```

During configuration, you’ll be prompted for provider credentials and model. Supported providers are:

- OpenAI: `OPENAI_API_KEY`
- Anthropic: `ANTHROPIC_API_KEY`
- Google: `GOOGLE_API_KEY`

---

## Commands

```bash
# Guided config flow (choose provider, model, and options)
ask-log configure

# Show current provider configuration
ask-log status

# Start an interactive session on a specific log file
ask-log chat --log-file /path/to/logfile.log --save path/to/convo.json

# Reset configuration (removes ~/.ask-log/config.yaml)
ask-log reset
```

Configuration is stored at `~/.ask-log/config.yaml`.

---

## Tips

- Use natural language questions like “What errors do you see?”, “Summarize main events”, “Any anomalies around 10:32?”
- Use `--save` to capture the conversation so you can resume context later.
- The first run on a large log may build a local vector index; subsequent runs will be faster.

---

## Contributing

Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines, a suggested workflow, and development tips.

---

## License

## This project is licensed under the [MIT License](LICENSE).
