cura 0.2.0
cura: ^0.2.0 copied to clipboard
Flutter/Dart package health audit CLI tool.
π©Ί Cura - Flutter/Dart Package Health Audit #
[Cura Logo]
Replace "Vibe Code" with data-driven decisions
π Table of Contents #
- What is Cura?
- Features
- Quick Start
- Installation
- Usage
- Scoring Algorithm
- Configuration
- CI/CD Integration
- Advanced Features
- Contributing
- License
π― What is Cura? #
Cura is a CLI tool that provides objective health scores (0-100) for Flutter and Dart packages, helping you make informed decisions about your dependencies instead of relying on intuition ("Vibe Code").
The Problem #
When choosing packages, developers often rely on:
- β Gut feeling - "This looks good"
- β Popularity alone - High downloads β quality
- β Outdated information - Last checked 6 months ago
The Solution #
Cura analyzes packages across 4 key dimensions:
| Dimension | Weight | What it measures |
|---|---|---|
| Vitality | 40pts | Update frequency, release freshness |
| Technical Health | 30pts | Pana score, null safety, platform support |
| Trust | 20pts | Popularity, community engagement |
| Maintenance | 10pts | Verified publisher, Flutter Favorite |
Score: 0-100 β Grade: F to A+
β¨ Features #
Core Features #
- π Package Analysis - Deep health check for any pub.dev package
- π Project Scanning - Analyze all dependencies in your
pubspec.yaml - π― Objective Scoring - Data-driven scores (0-100) with detailed breakdown
- π‘ Smart Suggestions - Recommendations for better alternatives
- β‘ Fast & Cached - Local SQLite cache for instant results
Developer Experience #
- π¨ Beautiful CLI - Color-coded output with progress bars
- π Theme Support - Dark, Light, Minimal, Dracula themes
- π§ Highly Configurable - Global + project-level configs
- π CI/CD Ready - Exit codes, JSON output, quiet mode
Advanced #
- π Multi-API - Aggregates data from pub.dev, GitHub, OSV.dev
- π Auto-update - Background cache refresh every 24h
- π GitHub Metrics - Stars, issues, commit activity (optional)
- π Security Checks - CVE detection via OSV.dev
β‘ Quick Start #
# Install globally
dart pub global activate cura
# Analyze your Flutter project
cd my_flutter_app
cura scan
# View detailed score for a specific package
cura view riverpod
# CI/CD health check
cura check --min-score 70
Output:
π¦ Scanning pubspec.yaml...
Found 15 dependencies
β Analyzing packages... [ββββββββββββββββββββ] 15/15 (3.2s)
ββββββββββββββββββββββββββ¬ββββββββ¬βββββββββ¬βββββββββββββββ
β Package β Score β Status β Last Update β
ββββββββββββββββββββββββββΌββββββββΌβββββββββΌβββββββββββββββ€
β riverpod β 92 β β
β 1 month β
β dio β 88 β β
β 15 days β
β provider β 68 β β οΈ β 8 months β
β old_package β 25 β β β 32 months β
ββββββββββββββββββββββββββ΄ββββββββ΄βββββββββ΄βββββββββββββββ
π Summary
Average Score: 75.3/100
β
Healthy: 12/15 (80%)
π‘ Alternatives Available: 2
π₯ Installation #
Method 1: Global Installation (Recommended) #
dart pub global activate cura
Verify installation:
cura --version
Method 2: Local Installation #
# Clone the repository
git clone https://github.com/meragix/cura.git
cd cura
# Install dependencies
dart pub get
# Activate locally
dart pub global activate --source path .
Requirements #
- Dart SDK β₯ 3.0.0
- Internet connection (for initial package analysis)
π Usage #
Scan Command #
Analyze all dependencies in your project.
cura scan [options]
Options:
-p, --path <path>- Project directory (default: current directory)--min-score <score>- Fail if average score below threshold--json- Output results as JSON--no-github- Skip GitHub metrics (faster, offline mode)--theme <theme>- Override theme (dark, light, minimal, dracula)
Examples:
# Basic scan
cura scan
# Scan specific directory
cura scan --path /path/to/project
# CI/CD mode with threshold
cura scan --min-score 80 --json > report.json
# Offline mode (cached data only)
cura scan --no-github
See also: docs/scan.md for advanced usage
View Command #
Get detailed analysis for a specific package.
cura view <package> [options]
Options:
-v, --verbose- Show detailed debug information--json- Output as JSON
Examples:
# View package score
cura view dio
# Verbose mode (cache status, API calls, timing)
cura view dio --verbose
# JSON output for scripts
cura view dio --json | jq '.score.total'
Output (Normal):
β¨ dio v5.4.0
β Score: 92/100 (A+)
β Vitality β Tech β Trust β Maint
Key Metrics
Publisher: dart.dev β
Pub Score: 135/140 β
Popularity: 98% βββ
GitHub: β 12.0K
Last Update: 1 month ago π’
β Recommended - High-quality, actively maintained package
Output (Verbose):
π dio v5.4.0
[CACHE] β
Hit (2h old, valid)
[DATA]
Last update: 45 days ago
Publisher: dart.dev (trusted β
)
Pub points: 135/140 (96%)
Popularity: 0.98
Repository: β
github.com/cfug/dio
[SCORE: 92/100 β
]
Vitality 38/40 β
(Updated recently)
Tech Health 28/30 β
(Excellent Pana score)
Trust 19/20 β
(High popularity)
Maintenance 7/10 β
(Verified publisher)
π‘ Recommended for production
β±οΈ 315ms (1 API call, now cached)
See also: docs/view.md for output customization
Check Command #
Quick health check with exit codes (perfect for CI/CD).
cura check [options]
Options:
--min-score <score>- Minimum acceptable score (default: 70)--fail-on-vulnerable- Exit 1 if vulnerabilities found--fail-on-discontinued- Exit 1 if discontinued packages found-q, --quiet- Minimal output
Examples:
# Basic check
cura check
# Strict check for CI/CD
cura check --min-score 80 --fail-on-vulnerable
# Quiet mode (only errors)
cura check --quiet
echo $? # 0 = pass, 1 = fail
GitHub Actions Integration:
- name: Cura Health Check
run: cura check --min-score 75
See also: docs/ci-cd.md for CI/CD best practices
Config Command #
Manage global and project-level configuration.
cura config <subcommand> [options]
Subcommands:
show- Display current configurationinit- Create project config (./.cura/config.yaml)edit- Open config in editorset <key> <value>- Set a configuration valueget <key>- Get a configuration valuereset- Reset to defaultsvalidate- Validate config file
Examples:
# Show config hierarchy
cura config show
# Initialize project config
cura config init
# Set global preference
cura config set theme dracula --global
# Set project-specific min score
cura config set min_score 85 --project
# Edit config
cura config edit --global
See also: docs/configuration.md for all options
π Scoring Algorithm #
Cura calculates a score from 0 to 100 based on weighted criteria:
Score Breakdown #
Total Score = Vitality (40) + Technical Health (30) + Trust (20) + Maintenance (10)
1. Vitality (40 points)
Measures how actively maintained the package is.
| Last Update | Score |
|---|---|
| < 1 month | 40 |
| 1-3 months | 35 |
| 3-6 months | 28 |
| 6-12 months | 20 |
| 1-2 years | 10 |
| > 2 years | 0 |
Exceptions: Packages with high Pana scores (>130) and proven stability receive bonus points even if older.
2. Technical Health (30 points)
Evaluates code quality and platform support.
- Pana Score (15pts): Normalized from pub.dev's 0-140 scale
- Null Safety (10pts): Supports null safety
- Platform Support (5pts): Number of supported platforms (iOS, Android, Web, etc.)
3. Trust (20 points)
Measures community confidence.
- Likes (10pts): Normalized from pub.dev likes
- Popularity (10pts): Based on download metrics
4. Maintenance (10 points)
Indicates official support and reliability.
- Verified Publisher (5pts): Has verified publisher
- Flutter Favorite (5pts): Official Flutter Favorite badge
Grade Mapping #
| Score | Grade | Meaning |
|---|---|---|
| 90-100 | A+ | Excellent - Production ready |
| 80-89 | A | Very good - Highly recommended |
| 70-79 | B | Good - Safe to use |
| 60-69 | C | Fair - Use with caution |
| 50-59 | D | Poor - Consider alternatives |
| 0-49 | F | Critical - Avoid |
Penalties #
Automatic score of 0 if:
- Package is marked as discontinued
- Critical security vulnerabilities detected (via OSV.dev)
See also: docs/scoring.md for detailed algorithm explanation
βοΈ Configuration #
Cura supports hierarchical configuration: Project > Global > Defaults
Config Locations #
~/.cura/config.yaml # Global config (user preferences)
./.cura/config.yaml # Project config (team standards)
Config Hierarchy #
CLI Flags (highest priority)
β
Project Config (./.cura/config.yaml)
β
Global Config (~/.cura/config.yaml)
β
Defaults (lowest priority)
Example Configuration #
Global Config (~/.cura/config.yaml):
# Appearance
theme: dracula
use_emojis: true
use_colors: true
# Cache
cache_max_age: 24 # hours
auto_update: true
# Scoring
min_score: 70
# API
timeout_seconds: 10
github_token: ghp_your_token_here
# Suggestions
show_suggestions: true
max_suggestions_per_package: 3
Project Config (./.cura/config.yaml):
# Override for this project
min_score: 85
# Ignore internal packages
ignore_packages:
- internal_test_package
# Trust company packages
trusted_publishers:
- my-company.dev
Common Settings #
| Setting | Type | Default | Description |
|---|---|---|---|
theme |
string | dark |
UI theme (dark, light, minimal, dracula) |
min_score |
int | 70 |
Minimum acceptable score |
cache_max_age |
int | 24 |
Cache TTL in hours |
github_token |
string | null |
GitHub PAT for higher rate limits |
ignore_packages |
list | [] |
Packages to skip during analysis |
trusted_publishers |
list | [] |
Auto-approve publishers |
See also: docs/configuration.md for full reference
π CI/CD Integration #
GitHub Actions #
name: Cura Health Check
on: [push, pull_request]
jobs:
health:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dart-lang/setup-dart@v1
- name: Install Cura
run: dart pub global activate cura
- name: Health Check
run: cura check --min-score 75 --fail-on-vulnerable
GitLab CI #
cura_check:
image: dart:stable
script:
- dart pub global activate cura
- cura check --min-score 80 --quiet
allow_failure: false
Exit Codes #
0- All checks passed1- Failed (score below threshold, vulnerabilities, etc.)
See also: docs/ci-cd.md for advanced workflows
π¨ Advanced Features #
Themes #
Switch between 4 built-in themes:
# Via CLI flag
cura scan --theme=dracula
# Via config
cura config set theme light
# Via environment variable
export CURA_THEME=minimal
cura scan
Available Themes:
dark- Default, vibrant colorslight- For light terminalsminimal- Monochrome, CI/CD friendlydracula- Popular Dracula color scheme
See also: docs/themes.md for theme customization
Caching #
Cura uses local SQLite cache to minimize API calls.
Cache locations:
~/.cura/cache/cura_cache.db # Package scores
~/.cura/suggestions_cache.yaml # Alternative suggestions
Cache management:
# Clear cache
cura clean
# View cache stats
cura config show
# Disable cache
cura scan --no-cache
Cache TTL:
- Popular packages (>1000 likes): 1 hour
- Normal packages: 24 hours
- Failed requests: Not cached
See also: docs/caching.md for cache strategies
Suggestions Engine #
Cura suggests better alternatives for low-scoring packages.
How it works:
- Maintains a community-driven database of alternatives
- Validates each suggestion's health score (must be >70)
- Auto-updates from GitHub every 24h
Example:
β οΈ provider (68/100)
π‘ Better Alternatives:
β riverpod (92/100) - Modern, compile-safe state management
Migration: https://riverpod.dev/docs/from_provider
Contributing suggestions:
- Fork cura-data
- Edit
alternatives.yaml - Submit PR (auto-validated)
See also: docs/suggestions.md for details
Multi-API Aggregation #
Cura aggregates data from multiple sources:
| Source | Data Retrieved |
|---|---|
| pub.dev | Pana score, likes, popularity, publisher |
| GitHub | Stars, issues, commits, contributors |
| OSV.dev | Security vulnerabilities (CVEs) |
GitHub integration:
# Set GitHub token for higher rate limits
cura config set github_token ghp_xxxxx
# Disable GitHub (faster, offline)
cura scan --no-github
Rate limits:
- pub.dev: ~10 req/s (built-in retry)
- GitHub: 60 req/h (5000/h with token)
- OSV.dev: No limit
See also: docs/api-integration.md
π€ Contributing #
We welcome contributions! Here's how you can help:
Bug Reports & Feature Requests #
Open an issue with:
- Clear description
- Steps to reproduce (for bugs)
- Expected vs actual behavior
Code Contributions #
- Fork the repository
- Create a feature branch (
git checkout -b feat/amazing-feature) - Commit your changes (
git commit -m 'feat: add amazing feature') - Push to the branch (
git push origin feat/amazing-feature) - Open a Pull Request
Development setup:
git clone https://github.com/your-org/cura.git
cd cura
dart pub get
dart run bin/cura.dart --help
Run tests:
dart test
Suggesting Package Alternatives #
Contribute to cura-data:
- Fork the repo
- Edit
alternatives.yaml - Submit PR (auto-validated by CI)
See also: CONTRIBUTING.md for guidelines
π Documentation #
- Scoring Algorithm - Detailed score calculation
- Configuration - All config options
- CI/CD Integration - GitHub Actions, GitLab CI examples
- Themes - Theme customization
- API Integration - Multi-API architecture
- Caching - Cache strategies
- Suggestions - Alternatives engine
πΊοΈ Roadmap #
v1.x (Current) #
- β Core scoring algorithm
- β CLI with scan/view/check commands
- β Multi-API aggregation
- β Config system (global + project)
- β Themes
v2.0 (Planned) #
- π Backend service (optional)
- π Web dashboard
- π Badge service (shields.io style)
- π VS Code extension
- π GitHub Action (pre-built)
Future #
- π Trend analysis (score over time)
- π Dependency tree visualization
- π Package comparison tool
- π Custom scoring weights
Vote on features: GitHub Discussions
π¬ Community #
- Discord: Join our server
- Twitter: @CuraCLI
- Discussions: GitHub Discussions
π License #
Cura is MIT licensed. See LICENSE for details.
π Acknowledgments #
- Inspired by Pana and npm's Snyk
- Built with mason_logger for beautiful CLI output
- Data provided by pub.dev, GitHub, and OSV.dev
Made with β€οΈ for the Flutter/Dart community
β Star us on GitHub β’ π Report Bug β’ π¬ Discussions