Skip to main content

Pangu RCA CLI - AI-powered log analysis tool

Project description

Pangu RCA CLI

PyPI version Python Versions License

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

Installation

pip install pangu-rca

Quick Start

# 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

$ pangu-rca analyze java_error.log

English version:

============================================================
🔍 Pangu RCA Agent - Analysis Result
============================================================

📋 Problem Type: Application Error
🎯 Confidence: 90.0%

📝 Detailed Reason:
   NullPointerException occurred during profile update request processing

🔑 Key Evidence:
   1. 2026-04-05 15:10:27 ERROR [http-nio-8080-exec-1] java.lang.NullPointerException: null
   2. 2026-04-05 15:10:27 ERROR [http-nio-8080-exec-1]     at com.example.UserService.updateProfile(UserService.java:145)
   3. 2026-04-05 15:10:27 WARN [http-nio-8080-exec-1] Request processing failed; nested exception is java.lang.NullPointerException

💡 Fix Suggestions:
   Review the UserService.updateProfile method at line 145 to identify potential null references. Add null checks and proper error handling to prevent similar issues.

Chinese version:

============================================================
🔍 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

# 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

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

pangu_rca-0.1.1.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

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

pangu_rca-0.1.1-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file pangu_rca-0.1.1.tar.gz.

File metadata

  • Download URL: pangu_rca-0.1.1.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.18

File hashes

Hashes for pangu_rca-0.1.1.tar.gz
Algorithm Hash digest
SHA256 1228b84c51da998b76422cee67d53a8ddadd2caf34cc029943ff3dcbf96e1911
MD5 81656022ffd291a9b3b565bd04c7504f
BLAKE2b-256 927d58c7acb3783df9863262b2afe291e40e09e5ef7ef18b5dac31a6c2dcfe14

See more details on using hashes here.

File details

Details for the file pangu_rca-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pangu_rca-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.18

File hashes

Hashes for pangu_rca-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f476a132c862462842c86d72b13e6e2a310f57e16e281f18c247ea8000d3b2e4
MD5 9af958ee6aba59b699a192d083bf3233
BLAKE2b-256 89a7b4e059bfc87838ffb83ed0573aa989eef87f1795e1895e94873425aed342

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