AI-powered DevOps health checker for your project infrastructure.
DevDoctor scans your project folder, finds issues in your Dockerfile and docker-compose.yml, and uses Gemini AI to suggest specific fixes — all from a single terminal command.
devdoctor scan .🔍 DevDoctor scanning /your/project ...
╔══════════════════════════════════════╗
║ 🩺 DevDoctor Report ║
╚══════════════════════════════════════╝
📄 Dockerfile (Dockerfile)
Score: 60/100
──────────────────────────────────────────────────
❌ ERROR
Rule : HARDCODED_SECRET
Issue : Possible secret hardcoded in ENV — use runtime env vars
Fix : Remove API_KEY from Dockerfile. Pass it at runtime using -e API_KEY=your_key
⚠️ WARNING
Rule : NO_USER
Issue : No USER instruction found — container will run as root
Fix : Add RUN useradd -r appuser && USER appuser before CMD
⚠️ WARNING
Rule : NO_DOCKERIGNORE
Issue : No .dockerignore file found — build context may include sensitive files
Fix : Create .dockerignore and exclude .env, target/, .git, .idea/
ℹ️ INFO
Rule : PARTIAL_VERSION_PIN
Issue : Image uses a partial version tag — pin to full digest for reproducibility
Fix : Use image@sha256:DIGEST for guaranteed reproducibility
🤖 AI Summary: Critical security issues found. Hardcoded secrets and running
as root are the highest risk items. Fix these before deploying to production.
══════════════════════════════════════════════════
📊 Overall Summary
══════════════════════════════════════════════════
Files scanned : 2
Total issues : 5
Overall score : 60/100
⚠️ Some issues need attention.
- Dockerfile Analyzer — detects 8 common issues including hardcoded secrets, latest tags, missing USER, no HEALTHCHECK, COPY abuse, and layer bloat
- docker-compose Analyzer — detects unpinned images, missing healthchecks, hardcoded secrets in environment, and open port bindings
- AI-powered fixes — every issue comes with a specific, actionable fix generated by Gemini 2.5 Flash
- Health score — every file gets a score out of 100, plus an overall project score
- Auto file detection — drop it in any project folder, DevDoctor finds the right files automatically
- Color-coded output — red for errors, yellow for warnings, cyan for info
| Rule | Severity | Description |
|---|---|---|
NO_LATEST_TAG |
❌ Error | Base image uses :latest — not reproducible |
HARDCODED_SECRET |
❌ Error | Password or API key in ENV/ARG |
UNPINNED_BASE_IMAGE |
No version tag on base image | |
COPY_ALL |
COPY . . copies sensitive files |
|
MULTIPLE_RUN_COMMANDS |
Too many RUN layers — bloats image | |
NO_USER |
Container runs as root | |
NO_DOCKERIGNORE |
No .dockerignore file found | |
NO_HEALTHCHECK |
ℹ️ Info | Docker can't detect unhealthy container |
PARTIAL_VERSION_PIN |
ℹ️ Info | Version tag not fully pinned |
| Rule | Severity | Description |
|---|---|---|
LATEST_TAG |
❌ Error | Service image uses :latest |
HARDCODED_SECRET |
❌ Error | Secret in environment variables |
UNPINNED_IMAGE |
No version tag on service image | |
NO_HEALTHCHECK |
Service has no healthcheck | |
OPEN_PORT_BINDING |
Port bound to 0.0.0.0 |
- Go 1.22+
- Gemini API key — get one free at Google AI Studio
git clone https://github.com/aryans1319/devdoctor.git
cd devdoctor
go mod tidy
go build -o devdoctor .echo "GEMINI_API_KEY=your_key_here" > .env# Scan current directory
./devdoctor scan .
# Scan a specific project
./devdoctor scan /path/to/your/project
# Get help
./devdoctor --help- Language — Go 1.23
- CLI framework — Cobra
- AI — Gemini 2.5 Flash API
- YAML parsing — gopkg.in/yaml.v3
- Terminal colors — fatih/color
devdoctor/
├── cmd/
│ ├── root.go → CLI root command
│ └── scan.go → scan command handler
├── analyzer/
│ ├── dockerfile.go → Dockerfile rules engine
│ ├── compose.go → docker-compose rules engine
│ ├── gemini.go → Gemini AI integration
│ └── scanner.go → project folder walker
├── formatter/
│ └── output.go → colored terminal output
├── models/
│ └── types.go → shared data structs
└── main.go
- Dockerfile analyzer
- docker-compose analyzer
- Gemini AI fix suggestions
- Health score per file + overall
- Kubernetes YAML checker
- GitHub Actions workflow checker
-
--reportflag — export HTML report -
--ciflag — exit code 1 for CI/CD pipeline integration - Web interface — upload and analyze via browser
- README badge generator
Aryan Shaw — Backend Engineer
LinkedIn · GitHub · X
MIT