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 cidoc

Or with pip:

pip install cidoc

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.0.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.0-py3-none-any.whl (21.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ci_doctor-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 7077a4a622c4e9138fe30f15521aac0ffa8a5c3f339526ebb2314d4779256c5a
MD5 6e22ea58558022decbb47966a316ae55
BLAKE2b-256 5c53269143df3dcfbbc4817bbb03124c50ed8ef439dcd8152a5365880e9304b1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ci_doctor-0.1.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b118cb8aabb19de83fa86d3c0495949733c73f70e63119da817afe744f00dcd8
MD5 7d8382f7acec3de05698fe9e372148d5
BLAKE2b-256 c4993e31e8a3b5d155233806afdb313a18688891f541885ee7575a4a91bfb308

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