log-genius

Crates.iolog-genius
lib.rslog-genius
version0.1.0
created_at2025-07-09 15:43:56.881346+00
updated_at2025-07-09 15:43:56.881346+00
descriptionAn AI-powered CLI to instantly analyze and explain complex logs.
homepagehttps://github.com/LunaStev/log-genius
repositoryhttps://github.com/LunaStev/log-genius
max_upload_size
id1745049
size137,805
(LunaStev)

documentation

README

log-genius 🤖💡

Don't read logs. Understand them.

log-genius is a smart CLI tool that uses AI to analyze and explain complex logs. Stop deciphering cryptic error messages and get human-readable summaries, potential causes, and actionable solutions directly in your terminal.

Crates.io LICENSE

log-genius-demo


Why log-genius?

  • ⚡️ Instant Clarity: Turns hundreds of lines of confusing logs into a clear, concise explanation.
  • 🎯 Actionable Solutions: Provides concrete code snippets and configuration changes to fix the problem.
  • 🧑‍💻 For Every Developer: Whether you're in frontend, backend, or DevOps, log-genius speaks your language.
  • Seamless Workflow: Integrates perfectly with your existing workflow using standard Unix pipes. docker-compose logs | log-genius is all you need.

Features

  • AI-Powered Analysis: Leverages large language models (like GPT-4o) to understand context and provide intelligent solutions.
  • Pipe-Friendly: Works seamlessly with standard input.
  • File Input: Analyze saved log files directly: log-genius error.log.
  • Readable Output: Formatted and colorized for maximum readability.
  • Blazingly Fast: Written in Rust for performance and reliability.

Installation

Prerequisites

You must have an OpenAI API key. You can get one from the OpenAI Platform.

1. Using cargo (Recommended)

If you have the Rust toolchain installed, you can install log-genius with a single command:

cargo install log-genius

2, From Binaries

Download the pre-compiled binary for your operating system from the Releases page. Unzip it and place it in a directory within your $PATH.

3. From Source

  1. Clone the repository:
git clone https://github.com/LunaStev/log-genius.git
cd log-genius
  1. Build the project:
cargo build --release
  1. The executable will be located at target/release/log-genius.

Setup

log-genius requires your OpenAI API key to function. Set it as an environment variable:

export OPENAI_API_KEY="sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

To make this permanent, add the line above to your shell's configuration file (e.g., .zshrc, .bash_profile, or .bashrc).

Alternatively, you can create a .env file in the directory where you run log-genius (or in your project's root) with the following content:

# .env
OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Usage

log-genius is designed to be simple and intuitive.


Piping from another command (most common)

Pipe the output of any command that generates logs directly into log-genius.

# Analyze Docker Compose logs
docker-compose logs | log-genius

# Analyze Kubernetes pod logs
kubectl logs my-pod-name | log-genius

# Analyze a service's journald logs
journalctl -u my-service.service -n 50 | log-genius

Analyzing a file

You can also pass a log file path as an argument.

log-genius /path/to/your/error.log

Contributing

Contributions are welcome! Whether it's a bug report, a feature request, or a pull request, please feel free to get involved. Check out the CONTRIBUTING.md file for more details.

Commit count: 0

cargo fmt