LogCoz CLI is a TypeScript command-line tool for diagnosing application, container, and host-level failures from logs.
The primary binary is logcozcli. logcoz remains a supported compatibility alias.
LogCoz is early-stage, actively evolving, and usable today for local log explanation, runtime correlation, grouped analysis, and self-contained HTML reporting.
The project is intentionally local-first in the current release. Remote runtimes, direct Kubernetes collection, cloud log backends, and broader security tooling are still out of scope for now.
Good fit:
- engineers debugging application, container, and host-level failures from local logs
- users who want fast CLI-first incident summaries and HTML reports
- contributors interested in detectors, runtime analysis, correlation quality, reporting, packaging, and docs
Not a fit:
- full observability platform replacement
- cloud log aggregation backend
- vulnerability scanner, compliance tool, or fleet-management system
logcozcli explain <file>for file-based analysislogcozcli explain dockerfor Docker log analysislogcozcli pastefor stdin-based analysislogcozcli correlate <files...>for multi-file incident groupinglogcozcli correlate dockerfor Docker correlationlogcozcli analyzefor grouped local Docker and system-log analysislogcozcli analyze --reconfor timeline-first reconnaissance HTML reports- self-contained HTML report export for
correlate,correlate docker, andanalyze - stable JSON envelopes for
explain,paste,correlate, andanalyze - structured context hints from
.env, Docker Compose, Kubernetes manifests, and JSON config files - evidence-based security findings for auth, TLS, SSH, and posture-style risks
- Redis connection refused and auth errors
- PostgreSQL connection/auth errors
- MySQL connection/auth errors
- MongoDB connection/auth errors
- DNS resolution failures
- network timeout failures
- TLS and certificate errors
- port conflicts
- Nginx upstream failures
- Docker health-check, restart-loop, and generic container failures
- Kubernetes workload failures when those patterns appear in collected logs
- missing file/path failures
- out-of-memory failures
- Kafka broker/connectivity failures
- RabbitMQ/AMQP connection failures
See docs/detectors.md for details.
pnpm add -g @hkgdevx/logcozOr:
npm install -g @hkgdevx/logcozAfter installation, both commands work:
logcozclilogcoz
logcozcli --help and each command-level --help page now include concrete examples directly in the terminal, so common workflows are discoverable without opening the docs.
- contribution guide: CONTRIBUTING.md
- security policy: SECURITY.md
- code of conduct: CODE_OF_CONDUCT.md
- roadmap: docs/roadmap.md
Issues and pull requests are reviewed on a best-effort basis. There is no guaranteed support or review SLA.
Explain a log file:
logcozcli explain ./app.log --context .env,docker-compose.yml --include-reasoningExplain Docker container logs:
logcozcli explain docker --container api --tail 200 --jsonCorrelate multiple files:
logcozcli correlate ./api.log ./worker.log ./nginx.log --html-out ./reports/correlation.htmlCorrelate Docker containers:
logcozcli correlate docker --container api --container nginx --include-system --system-source ssh --html-out ./reports/runtime-correlation.htmlRun grouped local analysis:
logcozcli analyze --include-docker --include-system --html-out ./reports/system-scan.html --reconUse the OpenAI provider:
OPENAI_API_KEY=YOUR_API_KEY logcozcli explain ./app.log --llm --llm-provider openai --llm-model gpt-5-miniRuntime collection in the current release is local-only:
- Docker collection uses the local
dockerCLI - system collection uses local journal/file access
- remote Docker contexts, cloud log backends, and direct Kubernetes collection are not included yet
Kubernetes patterns are still detected when they appear inside gathered logs.
- analyzes one file
- supports
--json,--context,--llm*, and--include-reasoning
- collects local Docker logs before running the normal explanation pipeline
- supports
--container,--service,--tail,--since,--json,--llm*, and--include-reasoning
- reads logs from stdin
- supports
--json,--context,--llm*, and--include-reasoning
- correlates multiple files using extracted trace/request/job identifiers
- supports
--json,--html-out, and--force
- collects multiple Docker sources and optional local system sources, then runs the correlation pipeline
- supports repeatable
--container, repeatable--service,--include-system,--system-source,--tail,--since,--json,--html-out, and--force - requires at least 2 collected runtime sources; single-source investigation belongs to
explain docker
- auto-discovers local Docker containers and common host/system services
- returns one grouped incident report with sources, incidents, correlations, security findings, and next actions
- supports
--include-docker,--include-system,--include-services,--exclude-sources,--container,--service,--tail,--since,--json,--html-out,--force,--recon,--llm*, and--include-reasoning
For grouped workflows, you can export a polished self-contained HTML report that opens offline in any browser:
logcozcli correlate ./api.log ./nginx.log --html-out ./reports/correlation.html
logcozcli correlate docker --container api --container nginx --include-system --html-out ./reports/runtime-correlation.html
logcozcli analyze --include-docker --include-system --html-out ./reports/system-scan.html
logcozcli analyze --include-docker --include-system --html-out ./reports/system-scan.html --reconNotes:
- HTML export is available for
correlate,correlate docker, andanalyze analyze --include-docker --include-system --html-out ...is the preferred system-wide scan report path--reconis an analyze-only HTML timeline mode for reconnaissance-style incident windows--jsonand--html-outcannot be used together--reconrequires--html-outand cannot be used with--json- partial timestamps are inferred conservatively and labeled in the report; untimed lines stay as supporting evidence
- existing output files are protected unless you add
--force - the generated report is a single file with inline styling and no external assets
All structured commands emit:
schemaVersioncliNamecliVersionexitCodestatusresult
analyze --json additionally returns:
sourcesincidentscorrelationssecurityFindingssummary- optional
metadata
Security findings are evidence-based and limited to the observed logs and lightweight context:
- auth failures
- TLS/certificate failures
- SSH anomalies
- repeated auth failures
- container localhost/service mismatch hints
This is not a vulnerability scanner, compliance tool, or full security audit product.
The package is intended for public npm publishing through GitHub Actions and Changesets.
Pre-publish smoke flow:
pnpm check
pnpm build
pnpm smoke:packaged-cli
pnpm publish --dry-run --no-git-checks --access public --registry https://registry.npmjs.orgpnpm smoke:packaged-cli builds, packs, installs the tarball into an isolated prefix, verifies the CLI shebang, and runs both installed binaries.