Getting Started
Unentropy helps you track code metrics directly in your CI pipeline—without external servers, cloud dependencies, or vendor lock-in. Get started in under 2 minutes.
What You’ll Learn
Section titled “What You’ll Learn”This guide shows you how to:
- Generate a configuration file
- Verify metrics collection locally
- Add GitHub Actions workflows
- View your first metrics report
1. Generate Configuration
Section titled “1. Generate Configuration”Tip: Unentropy supports both npx and bunx
Run this command in your project directory:
Unentropy auto-detects your project type (JavaScript, PHP, Go, or Python) and creates unentropy.json with sensible defaults for tracking lines of code and test coverage.
Example configuration:
This configuration tracks two metrics:
- Lines of Code: Measures the size of your codebase by counting lines in the
src/directory - Test Coverage: Measures test coverage percentage from your coverage report
It also includes a quality gate that fails if test coverage drops below 80%, helping prevent coverage regressions in pull requests. Your metrics history will be stored in GitHub Actions workflow artifacts - this will get you up and running quickly, but may not be suitable for long-term tracking. See Storage Guide for more options.
Since no metrics are collected yet, the preview will show example, random-generated data.
Override Auto-Detection
Section titled “Override Auto-Detection”If auto-detection picks the wrong type, specify it explicitly:
Supported types: javascript, php, go, python
2. Preview Your Report
Section titled “2. Preview Your Report”See what your metrics report will look like:
This generates an HTML report with your configured metrics (showing empty data) and opens it in your browser. Use this to verify your setup before collecting real data.
3. Add GitHub Workflows
Section titled “3. Add GitHub Workflows”Copy the workflow examples from your init output into your repository:
Main Branch Tracking
Section titled “Main Branch Tracking”Create .github/workflows/metrics.yml:
Enable GitHub Pages in your repository settings to view reports at https://<username>.github.io/<repo>/.
Pull Request Quality Gate
Section titled “Pull Request Quality Gate”Create .github/workflows/quality-gate.yml:
Commit and push these files to start tracking metrics.
That’s it! Metrics are now tracked automatically on every commit to main. Your metrics report will be published to your repository’s GitHub Pages, and quality gate feedback will be automatically posted as comments on pull requests.
What’s Next?
Section titled “What’s Next?”- Configure custom metrics specific to your domain
- Set up quality gate thresholds to prevent regressions
- Publish reports to GitHub Pages for easy access
- Use S3 storage for multi-repo tracking
Common Questions
Section titled “Common Questions”Where is my data stored?
Section titled “Where is my data stored?”By default, metrics are stored in GitHub Actions workflow artifacts (90-day retention). You can switch to S3-compatible storage for long-term history. See Storage Guide.
Do I need to run tests before collecting metrics?
Section titled “Do I need to run tests before collecting metrics?”For coverage metrics, yes. Run your test suite with coverage reporting enabled (e.g., bun test --coverage --coverage-reporter=lcov) before collecting metrics. Other metrics like lines of code work without additional setup.
What if my project type isn’t detected?
Section titled “What if my project type isn’t detected?”Use --type to specify it explicitly, or create unentropy.json manually following the Configuration Reference.
Related Resources
Section titled “Related Resources”- CLI Commands Reference - Complete command documentation
- Metrics Guide - Built-in and custom metrics
- Configuration Reference - All configuration options