Metadata-Version: 2.4
Name: pangu-rca
Version: 0.1.0
Summary: Pangu RCA CLI - AI-powered log analysis tool
Home-page: https://www.pangulab.com
Author: Pangulab Team
Author-email: Pangulab Team <r00txxyyzz@gmail.com>
License: MIT
Project-URL: Homepage, https://www.pangulab.com
Project-URL: Source, https://github.com/halokid/TronRabbit
Keywords: log analysis,AI,root cause analysis,debugging,devtools
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Debuggers
Classifier: Topic :: System :: Logging
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Requires-Dist: requests>=2.25.0
Dynamic: author
Dynamic: home-page
Dynamic: requires-python

# Pangu RCA CLI

[![PyPI version](https://img.shields.io/pypi/v/pangu-rca)](https://pypi.org/project/pangu-rca/)
[![Python Versions](https://img.shields.io/pypi/pyversions/pangu-rca)](https://pypi.org/project/pangu-rca/)
[![License](https://img.shields.io/pypi/l/pangu-rca)](https://github.com/halokid/TronRabbit/blob/main/LICENSE)

**AI-powered log analysis tool for developers.** Analyze error logs directly from your terminal.

## Installation

```bash
pip install pangu-rca
```

## Quick Start

```bash
# Analyze a log file
pangu-rca analyze error.log

# Analyze with English output
pangu-rca analyze error.log --lang en

# Pipe log content directly
cat error.log | pangu-rca analyze --stdin

# Get JSON output (for scripting)
pangu-rca analyze error.log --output json

# Check service health
pangu-rca health
```

## Examples

### Analyze a Java error log

```bash
$ pangu-rca analyze java_error.log
```

```
============================================================
🔍 Pangu RCA Agent - 分析结果
============================================================

📋 问题类型: 数据库连接超时
🎯 置信度: 95.0%

📝 详细原因:
   数据库连接池配置过小，导致在高并发场景下连接被耗尽...

🔑 关键证据:
   1. java.sql.SQLException: Connection timeout
   2. Caused by: java.sql.SQLTimeoutException: Timeout waiting for connection

💡 修复建议:
   增加数据库连接池的最大连接数，建议从 10 调整为 50...
```

### Pipe from another command

```bash
# Analyze Docker container logs
docker logs my-container 2>&1 | pangu-rca analyze --stdin

# Analyze system logs
journalctl -u my-service --no-pager | pangu-rca analyze --stdin --lang en
```

## Options

| Option | Description | Default |
|--------|-------------|---------|
| `--lang` | Output language: `zh` or `en` | `zh` |
| `--output` | Output format: `text` or `json` | `text` |
| `--api-url` | Custom API endpoint | `https://www.pangulab.com/api/analyze` |

## Commands

- `pangu-rca analyze <file>` — Analyze a log file
- `pangu-rca analyze --stdin` — Read logs from stdin
- `pangu-rca health` — Check API service status
- `pangu-rca --version` — Show version
- `pangu-rca --help` — Show help

## About

Pangu RCA Agent is an AI-powered log analysis tool that helps developers quickly identify root causes of errors from application logs. It supports Java, Python, Go, Rust, JavaScript, and many other programming languages.

**Web version**: https://www.pangulab.com

## License

MIT
