Skip to content

laris-co/origin-indexer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Origin Indexer

Index git commits, issues, and file changes for any repository. Outputs CSV files that can be queried with DuckDB.

Installation

# Run directly with bunx
bunx @laris/origin-indexer

# Or install globally
bun install -g @laris/origin-indexer

Usage

# Index current repository
origin-indexer .

# Index with CSV output (DuckDB-friendly)
origin-indexer /path/to/repo --csv

# Include GitHub issues
origin-indexer . --issues --csv

# JSON output
origin-indexer . --json

Output Files

When using --csv, the following files are created:

File Description
commits.csv All commits with stats
daily.csv Aggregated daily stats
files.csv File changes per commit
issues.csv GitHub issues (if --issues)

DuckDB Queries

-- Top 10 largest commits
SELECT shortHash, date, message, insertions
FROM 'commits.csv'
ORDER BY insertions DESC
LIMIT 10;

-- Daily activity chart
SELECT date, commits, insertions, deletions
FROM 'daily.csv'
ORDER BY date;

-- Most frequently changed files
SELECT fileName, COUNT(*) as changes
FROM 'files.csv'
GROUP BY fileName
ORDER BY changes DESC
LIMIT 20;

-- Find CLAUDE.md evolution
SELECT date, shortHash, message
FROM 'files.csv'
WHERE fileName LIKE '%CLAUDE.md%'
ORDER BY date;

-- File type breakdown
SELECT fileExtension, COUNT(*) as count
FROM 'files.csv'
GROUP BY fileExtension
ORDER BY count DESC;

As a Library

import { indexRepo } from "@laris/origin-indexer";

const result = await indexRepo("/path/to/repo", {
  fetchIssues: true,
});

console.log(result.stats);
// {
//   totalCommits: 467,
//   totalIssues: 91,
//   totalFiles: 1955,
//   totalInsertions: 388707,
//   totalDeletions: 70602,
//   netChange: 318105,
// }

Origin Story

This tool was created to index the Oracle origin projects:

  • uniserv-nft-erc721 (Project 001) - NFT smart contracts
  • liff-carbon-offset-app (Project 002) - LINE LIFF app

Together these projects represent 467 commits, 91 issues, and 318,105 net lines of code - the birthplace of the Oracle Philosophy.

License

MIT

About

Index git commits and pipe to DuckDB

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors