Infra Metrics Insight Renderer
IMIR is a Rust CLI tool for automated GitHub metrics generation and repository discovery. It provides commands for:
- GitHub CLI operations: Create PRs, manage issues via
gh
integration - Git automation: Commit, push, branch management
- Metrics generation: Render repository and profile dashboards using lowlighter/metrics
- Discovery: Automatically detect repositories using IMIR badges
- Badge generation: Create lightweight SVG badges for discovered targets
- README updates: Maintain user tables with
imir readme
command
Add IMIR badge to your repository README:
<!-- For public repositories --> [](https://github.com/RAprogramm/infra-metrics-insight-renderer)
<!-- For private repositories --> [](https://github.com/RAprogramm/infra-metrics-insight-renderer)
<!-- For GitHub profiles --> [](https://github.com/RAprogramm/infra-metrics-insight-renderer)
Add metrics placeholder:

Star this repository and wait for automatic discovery (runs daily at 02:00 UTC).
See WORKFLOW.md for detailed discovery and metrics generation flow.
IMIR automatically discovers and tracks users who add badges to their repositories.
Open-source repositories
Repository | Badge |
---|---|
RAprogramm/RAprogramm |
|
RAprogramm/infra-metrics-insight-renderer |
|
RAprogramm/masterror |
|
RAprogramm/telegram-webapp-sdk |
Private repositories
Private dashboards follow the same embedding rules. Publish badges from this section once private projects are registered.
# Load and normalize targets from YAML
imir --config targets/targets.yaml --pretty
# Validate open-source repository inputs
imir open-source --input '[{"repository": "masterror"}]'
# Discover repositories using IMIR badges
imir discover --token $GITHUB_TOKEN --source all --format json
# Sync discovered repositories to targets.yaml
imir sync --config targets/targets.yaml --token $GITHUB_TOKEN --source all
# Generate badge assets for specific target
imir badge generate --config targets/targets.yaml --target profile --output metrics
# Generate all badge assets in parallel
imir badge generate-all --config targets/targets.yaml --output metrics
# Update README.md with current user tables
imir readme --readme README.md --config targets/targets.yaml
# Commit and push changes
imir git commit-push --branch ci/update --path metrics/profile.svg --message "Update metrics"
# Create or update pull request
imir gh pr-create --repo owner/repo --head feature --base main --title "Title" --body "Body" --labels ci --token $GITHUB_TOKEN
# Normalize profile render inputs
imir render normalize-profile --target-user RAprogramm --display-name "Profile"
# Normalize repository render inputs
imir render normalize-repository --target-repo masterror --target-owner RAprogramm --github-repo owner/repo
See imir/README.md for complete CLI documentation.
Run individual CI checks locally before pushing:
# Format check
cargo +nightly fmt --check --manifest-path imir/Cargo.toml
# Linting
cargo clippy --all-targets --all-features --manifest-path imir/Cargo.toml
# Tests
cargo nextest run --all-features --manifest-path imir/Cargo.toml
# Documentation
cargo doc --no-deps --all-features --manifest-path imir/Cargo.toml
# Security audit
cargo audit --file imir/Cargo.lock
# License compliance
reuse lint
# Benchmarks
cargo bench --no-fail-fast --manifest-path imir/Cargo.toml
# Coverage
cargo llvm-cov nextest --all-features --manifest-path imir/Cargo.toml --html
All checks run automatically in CI via GitHub Actions with matrix parallelization.
metrics-renderer/
├── imir/ # Rust CLI crate
│ ├── src/
│ │ ├── main.rs # CLI entry point
│ │ ├── config.rs # YAML configuration parsing
│ │ ├── normalizer.rs # Target normalization logic
│ │ ├── discover.rs # Repository discovery
│ │ ├── badge.rs # Badge SVG generation
│ │ ├── readme.rs # README table updates
│ │ ├── gh.rs # GitHub CLI operations
│ │ └── git.rs # Git operations
│ └── Cargo.toml
├── targets/
│ └── targets.yaml # Metrics targets configuration
├── .github/workflows/ # CI/CD and automation workflows
├── assets/badges/ # Static badge SVG files
├── metrics/ # Generated metrics dashboards
└── WORKFLOW.md # Discovery flow documentation
Current: SVG artifacts committed directly to metrics/
directory. GitHub Actions render updated metrics on schedule, commit to main branch, and serve via raw.githubusercontent.com
.
Trade-offs:
- ✅ Zero infrastructure, immediate availability
⚠️ Git history noise (mitigated withchore(metrics):
prefix)⚠️ Repository size growth (negligible for typical refresh rates)
Future: Migrate to database backend (PostgreSQL/SQLite) for historical queries and reduced git noise. Migration path straightforward since rendering logic isolated in CLI.
- Ensure all CI checks pass on main branch
- Bump version in
imir/Cargo.toml
- Create annotated tag:
git tag -a v0.1.0 -m "Release v0.1.0"
- Push tag:
git push origin v0.1.0
- Create GitHub release (triggers automated build workflow)
- Workflow builds and uploads
imir-x86_64-unknown-linux-gnu.tar.gz
binary - Binary is automatically downloaded by downstream workflows
MIT