Skip to main content

CLI to diagnose CI pipeline runs

Project description

CI Doctor

A CLI that analyzes a GitHub Actions run URL and prints a compact diagnosis.

Install

Using pipx (recommended for CLI tools):

pipx install ci-doctor

Or with pip:

pip install ci-doctor

Install (editable for dev)

pip install -e .

Auth

Set up a GitHub Personal Access Token. See GITHUB_TOKEN_SETUP.md for detailed instructions.

Quick start:

export GITHUB_TOKEN=ghp_...

AI Analysis (Optional)

For AI-powered failure analysis, install the AI extras and set your OpenAI API key:

pip install -e ".[ai]"
export OPENAI_API_KEY=sk-...

Creating an OpenAI API Key:

  1. Go to https://platform.openai.com/api-keys
  2. Sign in or create an OpenAI account
  3. Click "Create new secret key"
  4. Give it a name (e.g., "CI Doctor")
  5. Copy the key immediately (you won't be able to see it again)
  6. Add it to your environment: export OPENAI_API_KEY=sk-...

Note: AI analysis uses OpenAI's API, which may incur costs. The tool uses gpt-4o-mini for cost efficiency.

Usage

# Use 'ci-doctor' or shorter alias 'cidoc'
ci-doctor analyze https://github.com/owner/repo/actions/runs/123456789
cidoc analyze <url>

# With AI-powered analysis
ci-doctor analyze <url> --ai

# JSON output
ci-doctor analyze <url> --format json > report.json

# Save logs to disk
ci-doctor analyze <url> --save-logs

Note: Logs from failing steps are automatically extracted and displayed. Use --save-logs to also save the full log ZIP to ./artifacts. Use --ai for intelligent failure analysis (requires OpenAI API key).

Security

🔒 This tool is 100% READ-ONLY

CI Doctor only performs GET requests to the GitHub API. It cannot:

  • Modify repositories, workflows, or files
  • Create, update, or delete anything
  • Trigger workflow runs
  • Change repository settings or permissions

The tool only reads:

  • Workflow run status and metadata
  • Job and step information
  • Repository commit comparisons
  • Logs (download only, no modification)

Use tokens with read-only scopes (actions:read, contents:read) only.

Notes

  • GitHub provider only in v0; provider abstraction enables Jenkins/Azure later.
  • Stateless; uses live API with optional ETag cache.

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

ci_doctor-0.1.1.tar.gz (19.7 kB view details)

Uploaded Source

Built Distribution

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

ci_doctor-0.1.1-py3-none-any.whl (21.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ci_doctor-0.1.1.tar.gz
  • Upload date:
  • Size: 19.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ci_doctor-0.1.1.tar.gz
Algorithm Hash digest
SHA256 b67aa7d5fc753d3daa57e0f2851b4a78824dd32c36334a7fbcf2b063f1e617e5
MD5 34c02440fd8327140caf99dd27fac318
BLAKE2b-256 d3750d089dceba0481d500735646e018a4b97378e7cdfe55322a1aae8d4dc131

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ci_doctor-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 21.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ci_doctor-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 281acd3968cae77b7b1d34076d7ca895f8126e6af576c1e9fc9c6d8ac3cdabe1
MD5 cb150e141f3103a3139bd0e92206a949
BLAKE2b-256 811b891b6ae81d754aaed49e80fe398ff8a4116dca595279ecd61a0b483e2df4

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