gitpulse-cli 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/commands/analyze.d.ts +16 -0
  2. package/dist/commands/analyze.d.ts.map +1 -0
  3. package/dist/commands/compare.d.ts +11 -0
  4. package/dist/commands/compare.d.ts.map +1 -0
  5. package/dist/commands/config.d.ts +8 -0
  6. package/dist/commands/config.d.ts.map +1 -0
  7. package/dist/commands/history.d.ts +6 -0
  8. package/dist/commands/history.d.ts.map +1 -0
  9. package/dist/commands/report.d.ts +7 -0
  10. package/dist/commands/report.d.ts.map +1 -0
  11. package/dist/index.d.ts +2 -0
  12. package/dist/index.d.ts.map +1 -0
  13. package/dist/index.js +1202 -0
  14. package/dist/index.js.map +1 -0
  15. package/dist/repl/arg-parser.d.ts +33 -0
  16. package/dist/repl/arg-parser.d.ts.map +1 -0
  17. package/dist/repl/repl.d.ts +2 -0
  18. package/dist/repl/repl.d.ts.map +1 -0
  19. package/dist/ui/logo.d.ts +2 -0
  20. package/dist/ui/logo.d.ts.map +1 -0
  21. package/dist/ui/progress.d.ts +3 -0
  22. package/dist/ui/progress.d.ts.map +1 -0
  23. package/dist/ui/spinner.d.ts +4 -0
  24. package/dist/ui/spinner.d.ts.map +1 -0
  25. package/dist/ui/table.d.ts +4 -0
  26. package/dist/ui/table.d.ts.map +1 -0
  27. package/dist/ui/theme.d.ts +15 -0
  28. package/dist/ui/theme.d.ts.map +1 -0
  29. package/dist/utils/error-handler.d.ts +3 -0
  30. package/dist/utils/error-handler.d.ts.map +1 -0
  31. package/dist/utils/remote-repo.d.ts +5 -0
  32. package/dist/utils/remote-repo.d.ts.map +1 -0
  33. package/dist/utils/version.d.ts +2 -0
  34. package/dist/utils/version.d.ts.map +1 -0
  35. package/dist/wizard/onboarding.d.ts +3 -0
  36. package/dist/wizard/onboarding.d.ts.map +1 -0
  37. package/dist/wizard/setup.d.ts +9 -0
  38. package/dist/wizard/setup.d.ts.map +1 -0
  39. package/package.json +45 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts","../src/ui/logo.ts","../src/utils/version.ts","../src/commands/analyze.ts","../src/ui/theme.ts","../src/ui/spinner.ts","../src/ui/table.ts","../src/ui/progress.ts","../src/utils/error-handler.ts","../src/utils/remote-repo.ts","../src/commands/report.ts","../src/commands/config.ts","../src/wizard/setup.ts","../src/commands/compare.ts","../src/repl/repl.ts","../src/wizard/onboarding.ts","../src/commands/history.ts","../src/repl/arg-parser.ts"],"sourcesContent":["import { Command } from 'commander';\nimport { printLogo } from './ui/logo.js';\nimport { getVersion } from './utils/version.js';\nimport { analyzeCommand } from './commands/analyze.js';\nimport { reportCommand } from './commands/report.js';\nimport { configCommand } from './commands/config.js';\nimport { compareCommand } from './commands/compare.js';\nimport { handleError } from './utils/error-handler.js';\nimport { startRepl } from './repl/repl.js';\n\nconst args = process.argv.slice(2);\n\nif (args.length === 0) {\n // No arguments → interactive REPL mode\n startRepl().catch(handleError);\n} else {\n // Has arguments → one-shot Commander.js mode\n const program = new Command();\n\n program\n .name('gitpulse')\n .description('AI-powered Git contribution analyzer')\n .version(getVersion())\n .hook('preAction', () => {\n printLogo();\n });\n\n program\n .command('analyze')\n .description('Analyze repository contributions')\n .argument('[path]', 'Path or URL to git repository', '.')\n .option('-b, --branch <branch>', 'Branch to analyze')\n .option('--since <date>', 'Start date (e.g., 2025-01-01)')\n .option('--until <date>', 'End date')\n .option('--author <names...>', 'Filter by author name(s)')\n .option('--max-commits <n>', 'Maximum number of commits', parseInt)\n .option('--format <type>', 'Output format: terminal, json, markdown, html')\n .option('-o, --output <path>', 'Output file path')\n .option('--no-cache', 'Ignore cache, force re-scoring')\n .option('-y, --yes', 'Skip confirmation prompt')\n .option('--provider <type>', 'LLM provider override')\n .option('--model <name>', 'LLM model override')\n .action(async (repoPath: string, options) => {\n await analyzeCommand(repoPath, options);\n });\n\n program\n .command('report')\n .description('Generate report from cached scores')\n .argument('[path]', 'Path or URL to git repository', '.')\n .option('--format <type>', 'Output format: terminal, json, markdown, html')\n .option('-o, --output <path>', 'Output file path')\n .action(async (repoPath: string, options) => {\n await reportCommand(repoPath, options);\n });\n\n program\n .command('config')\n .description('Manage configuration')\n .option('--init', 'Run interactive setup wizard')\n .option('--show', 'Show current configuration')\n .option('--set <key>', 'Set a config value')\n .argument('[value]', 'Value to set')\n .action(async (value: string | undefined, options) => {\n await configCommand(options, value);\n });\n\n program\n .command('compare')\n .description('Compare two developers')\n .argument('<author1>', 'First author name or email')\n .argument('<author2>', 'Second author name or email')\n .option('-p, --path <path>', 'Path or URL to git repository', '.')\n .option('--since <date>', 'Start date')\n .option('--until <date>', 'End date')\n .action(async (author1: string, author2: string, options) => {\n await compareCommand(author1, author2, options);\n });\n\n program.parseAsync(process.argv).catch(handleError);\n}\n","import chalk from 'chalk';\n\nconst LOGO = `\n _____ _ _ _____ _\n / ____(_) | | __ \\\\ | |\n | | __ _| |_| |__) | _| |___ ___\n | | |_ | | __| ___/ | | | / __|/ _ \\\\\n | |__| | | |_| | | |_| | \\\\__ \\\\ __/\n \\\\_____|_|\\\\__|_| \\\\__,_|_|___/\\\\___|\n`;\n\nexport function printLogo(): void {\n console.log(chalk.hex('#6366f1')(LOGO));\n console.log(chalk.dim(' AI-Powered Git Contribution Analyzer\\n'));\n}\n","import * as fs from 'node:fs';\nimport * as path from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nexport function getVersion(): string {\n const __filename = fileURLToPath(import.meta.url);\n let dir = path.dirname(__filename);\n\n for (let i = 0; i < 10; i++) {\n const pkgPath = path.join(dir, 'package.json');\n if (fs.existsSync(pkgPath)) {\n const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'));\n return pkg.version ?? '0.0.0';\n }\n const parent = path.dirname(dir);\n if (parent === dir) break;\n dir = parent;\n }\n\n return '0.0.0';\n}\n","import * as path from 'node:path';\nimport * as fs from 'node:fs';\nimport { confirm, select, input } from '@inquirer/prompts';\nimport {\n Analyzer,\n createProvider,\n generateReport,\n loadConfig,\n HomeManager,\n type AnalysisScope,\n type ReportFormat,\n type AnalysisProgress,\n} from '@gitpulse/core';\nimport { theme } from '../ui/theme.js';\nimport { phaseSpinner } from '../ui/spinner.js';\nimport { renderScoreTable, renderSummaryTable } from '../ui/table.js';\nimport cliProgress from 'cli-progress';\nimport { createProgressBar } from '../ui/progress.js';\nimport { handleError } from '../utils/error-handler.js';\nimport { resolveRepoPath } from '../utils/remote-repo.js';\n\nexport interface AnalyzeOptions {\n branch?: string;\n since?: string;\n until?: string;\n author?: string[];\n maxCommits?: number;\n format?: string;\n output?: string;\n noCache?: boolean;\n yes?: boolean;\n provider?: string;\n model?: string;\n}\n\nexport async function analyzeCommandInner(repoPath: string, options: AnalyzeOptions): Promise<void> {\n const { localPath } = await resolveRepoPath(repoPath);\n const absolutePath = path.resolve(localPath);\n\n // Initialize home directory silently\n const home = new HomeManager();\n home.ensureInitialized();\n\n // Load config with CLI overrides\n const overrides: Record<string, unknown> = {};\n if (options.provider) overrides.provider = options.provider;\n if (options.model) overrides.model = options.model;\n\n const config = await loadConfig(absolutePath, overrides);\n const format = (options.format ?? config.output.format) as ReportFormat;\n\n // Create LLM provider\n const model = await createProvider({\n type: config.provider,\n model: config.model,\n apiKey: config.apiKey,\n baseURL: config.baseURL,\n });\n\n const analyzer = await Analyzer.create(absolutePath, {\n config,\n model,\n noCache: options.noCache,\n });\n\n const scope: AnalysisScope = {\n branch: options.branch,\n since: options.since,\n until: options.until,\n authors: options.author,\n maxCommits: options.maxCommits,\n path: absolutePath,\n };\n\n // Interactive time range selection (only when no CLI date filters and not in -y mode)\n if (!options.since && !options.until && !options.yes) {\n const fmt = (d: Date) => d.toISOString().slice(0, 10);\n const ago = (months: number) => {\n const d = new Date();\n d.setMonth(d.getMonth() - months);\n return fmt(d);\n };\n\n const range = await select({\n message: 'Select time range for analysis:',\n choices: [\n { name: 'Last month', value: 'last-1' },\n { name: 'Last 3 months', value: 'last-3' },\n { name: 'Last 6 months', value: 'last-6' },\n { name: 'Last year', value: 'last-12' },\n { name: 'All time (no filter)', value: 'all' },\n { name: 'Custom range...', value: 'custom' },\n ],\n });\n\n if (range === 'custom') {\n const customSince = await input({ message: 'Since (YYYY-MM-DD, leave empty for none):' });\n const customUntil = await input({ message: 'Until (YYYY-MM-DD, leave empty for none):' });\n if (customSince) scope.since = customSince;\n if (customUntil) scope.until = customUntil;\n } else if (range !== 'all') {\n const months = parseInt(range.split('-')[1], 10);\n scope.since = ago(months);\n }\n }\n\n // Cost estimation\n const estimate = await analyzer.estimate(scope);\n\n console.log(theme.heading('\\nAnalysis Summary:'));\n console.log(` Total commits: ${estimate.totalCommits}`);\n console.log(` Cached (skip): ${estimate.cachedCommits}`);\n console.log(` To analyze: ${estimate.toAnalyze}`);\n console.log(` Est. LLM calls: ~${estimate.estimatedLlmCalls}`);\n console.log(` Est. tokens: ~${(estimate.estimatedTokens / 1000).toFixed(0)}K`);\n console.log(` Est. cost: ~$${estimate.estimatedCost.toFixed(2)}`);\n console.log('');\n\n if (estimate.toAnalyze === 0) {\n console.log(theme.success('All commits are cached. Generating report from cache.\\n'));\n } else if (!options.yes) {\n const proceed = await confirm({ message: 'Proceed with analysis?', default: true });\n if (!proceed) {\n console.log(theme.dim('Analysis cancelled.'));\n return;\n }\n }\n\n // Run analysis with progress tracking\n const startTime = Date.now();\n let currentSpinner = phaseSpinner(1, 3, 'Extracting commits');\n currentSpinner.start();\n const state: { progressBar: cliProgress.SingleBar | null } = { progressBar: null };\n\n const onProgress = (progress: AnalysisProgress) => {\n if (progress.phase === 'extracting') {\n currentSpinner.text = theme.dim(\n `[Phase 1/3] ${progress.message}`,\n );\n } else if (progress.phase === 'scoring') {\n if (currentSpinner.isSpinning) {\n currentSpinner.succeed(theme.dim('Commits extracted'));\n }\n if (!state.progressBar && progress.total > 0) {\n console.log(theme.dim(`\\n Scoring commits [Phase 2/3]:`));\n state.progressBar = createProgressBar(progress.total);\n }\n if (state.progressBar) {\n state.progressBar.update(progress.current, { message: progress.message });\n }\n } else if (progress.phase === 'aggregating') {\n if (state.progressBar) {\n state.progressBar.stop();\n state.progressBar = null;\n }\n if (currentSpinner.isSpinning) {\n currentSpinner.succeed(theme.dim('Scoring complete'));\n }\n currentSpinner = phaseSpinner(3, 3, 'Aggregating results');\n currentSpinner.start();\n }\n };\n\n const report = await analyzer.analyze(scope, onProgress);\n\n if (state.progressBar) state.progressBar.stop();\n if (currentSpinner.isSpinning) {\n currentSpinner.succeed(theme.dim('Report generated'));\n }\n\n // Record analysis history and update agent memory\n const durationMs = Date.now() - startTime;\n try {\n home.recordAnalysis(report, scope, durationMs, estimate);\n home.updateMemory(report);\n } catch {\n // Non-critical — don't fail the command if home recording fails\n }\n\n // Output\n if (format === 'terminal') {\n console.log(theme.heading('\\nResults:\\n'));\n renderSummaryTable(report);\n console.log('');\n renderScoreTable(report);\n\n // Show author details\n for (const author of report.authors) {\n console.log(`\\n${theme.bold(author.score.authorName)}`);\n console.log(` Score: ${theme.score(author.score.overallScore)}/100 | Trend: ${theme.trend(author.score.trend.direction)}`);\n if (author.highlights.length > 0) {\n console.log(` Highlights: ${author.highlights.join(', ')}`);\n }\n if (author.recommendations.length > 0) {\n console.log(` Recommendations: ${author.recommendations.join(', ')}`);\n }\n }\n } else {\n const output = generateReport(report, format);\n\n if (options.output) {\n const outputPath = path.resolve(options.output);\n fs.writeFileSync(outputPath, output, 'utf-8');\n console.log(theme.success(`\\nReport saved to ${outputPath}`));\n } else {\n console.log(output);\n }\n }\n\n console.log('');\n}\n\nexport async function analyzeCommand(repoPath: string, options: AnalyzeOptions): Promise<void> {\n try {\n await analyzeCommandInner(repoPath, options);\n } catch (error) {\n handleError(error);\n }\n}\n","import chalk from 'chalk';\n\nexport const theme = {\n primary: chalk.hex('#6366f1'),\n secondary: chalk.hex('#8b5cf6'),\n success: chalk.hex('#22c55e'),\n warning: chalk.hex('#f59e0b'),\n error: chalk.hex('#ef4444'),\n info: chalk.hex('#3b82f6'),\n dim: chalk.dim,\n bold: chalk.bold,\n heading: chalk.bold.hex('#6366f1'),\n prompt: chalk.hex('#6366f1').bold,\n\n score: (score: number): string => {\n if (score >= 80) return chalk.hex('#22c55e')(score.toFixed(1));\n if (score >= 60) return chalk.hex('#3b82f6')(score.toFixed(1));\n if (score >= 40) return chalk.hex('#f59e0b')(score.toFixed(1));\n return chalk.hex('#ef4444')(score.toFixed(1));\n },\n\n trend: (direction: 'improving' | 'stable' | 'declining'): string => {\n switch (direction) {\n case 'improving':\n return chalk.hex('#22c55e')('▲ improving');\n case 'declining':\n return chalk.hex('#ef4444')('▼ declining');\n case 'stable':\n return chalk.hex('#94a3b8')('► stable');\n }\n },\n};\n","import ora, { type Ora } from 'ora';\nimport { theme } from './theme.js';\n\nexport function createSpinner(text: string): Ora {\n return ora({\n text: theme.dim(text),\n color: 'cyan',\n });\n}\n\nexport function phaseSpinner(phase: number, totalPhases: number, text: string): Ora {\n return createSpinner(`[Phase ${phase}/${totalPhases}] ${text}`);\n}\n","import Table from 'cli-table3';\nimport type { AnalysisReport } from '@gitpulse/core';\nimport { theme } from './theme.js';\n\nexport function renderScoreTable(report: AnalysisReport): void {\n const table = new Table({\n head: [\n theme.bold('Author'),\n theme.bold('Overall'),\n theme.bold('Code Quality'),\n theme.bold('Complexity'),\n theme.bold('Discipline'),\n theme.bold('Collab'),\n theme.bold('Trend'),\n theme.bold('Commits'),\n ],\n style: {\n head: [],\n border: ['dim'],\n },\n });\n\n for (const author of report.authors) {\n const s = author.score;\n table.push([\n s.authorName,\n theme.score(s.overallScore),\n theme.score(s.dimensionScores.codeQuality.score),\n theme.score(s.dimensionScores.complexityImpact.score),\n theme.score(s.dimensionScores.commitDiscipline.score),\n theme.score(s.dimensionScores.collaboration.score),\n theme.trend(s.trend.direction),\n String(s.scoredCommitCount),\n ]);\n }\n\n console.log(table.toString());\n}\n\nexport function renderSummaryTable(report: AnalysisReport): void {\n const table = new Table({\n style: { head: [], border: ['dim'] },\n });\n\n table.push(\n { [theme.bold('Total Commits')]: String(report.metadata.totalCommits) },\n { [theme.bold('Analyzed')]: String(report.metadata.analyzedCommits) },\n { [theme.bold('Cached')]: String(report.metadata.cachedCommits) },\n { [theme.bold('Skipped')]: String(report.metadata.skippedCommits) },\n { [theme.bold('Authors')]: String(report.summary.totalAuthors) },\n { [theme.bold('Average Score')]: theme.score(report.summary.averageScore) },\n { [theme.bold('Top Performer')]: report.summary.topPerformer },\n );\n\n console.log(table.toString());\n}\n","import cliProgress from 'cli-progress';\nimport { theme } from './theme.js';\n\nexport function createProgressBar(total: number): cliProgress.SingleBar {\n const bar = new cliProgress.SingleBar({\n format: ` ${theme.primary('{bar}')} {value}/{total} ({percentage}%) | {message}`,\n barCompleteChar: '\\u2588',\n barIncompleteChar: '\\u2591',\n hideCursor: true,\n });\n\n bar.start(total, 0, { message: '' });\n return bar;\n}\n","import { theme } from '../ui/theme.js';\n\nexport function handleError(error: unknown): never {\n if (error instanceof Error) {\n console.error(`\\n${theme.error('Error:')} ${error.message}`);\n if (process.env.DEBUG) {\n console.error(theme.dim(error.stack ?? ''));\n }\n } else {\n console.error(`\\n${theme.error('Error:')} An unexpected error occurred`);\n }\n process.exit(1);\n}\n\nexport function handleReplError(error: unknown): void {\n if (error instanceof Error) {\n console.error(`\\n${theme.error('Error:')} ${error.message}`);\n if (process.env.DEBUG) {\n console.error(theme.dim(error.stack ?? ''));\n }\n } else {\n console.error(`\\n${theme.error('Error:')} An unexpected error occurred`);\n }\n}\n","import * as path from 'node:path';\nimport * as fs from 'node:fs';\nimport * as os from 'node:os';\nimport * as crypto from 'node:crypto';\nimport simpleGit from 'simple-git';\nimport { theme } from '../ui/theme.js';\n\nconst REMOTE_URL_RE = /^(?:https?:\\/\\/|git@|ssh:\\/\\/|git:\\/\\/)/;\n\nexport function isRemoteUrl(input: string): boolean {\n return REMOTE_URL_RE.test(input);\n}\n\nfunction repoSlug(url: string): string {\n // Strip protocol, .git suffix, trailing slashes; convert non-alphanum to dashes\n const cleaned = url\n .replace(/^(?:https?:\\/\\/|git@|ssh:\\/\\/|git:\\/\\/)/, '')\n .replace(/\\.git\\/?$/, '')\n .replace(/:/g, '/')\n .replace(/\\/+$/, '');\n const slug = cleaned.replace(/[^a-zA-Z0-9_.-]/g, '-').replace(/-+/g, '-');\n const hash = crypto.createHash('sha256').update(url).digest('hex').slice(0, 8);\n return `${slug}-${hash}`;\n}\n\nfunction getCacheDir(): string {\n return path.join(os.homedir(), '.gitpulse', 'repos');\n}\n\nexport async function resolveRepoPath(input: string): Promise<{ localPath: string }> {\n if (!isRemoteUrl(input)) {\n return { localPath: input };\n }\n\n const slug = repoSlug(input);\n const cacheDir = getCacheDir();\n const localPath = path.join(cacheDir, slug);\n\n fs.mkdirSync(cacheDir, { recursive: true });\n\n if (fs.existsSync(path.join(localPath, '.git'))) {\n console.log(theme.dim(`Using cached clone at ${localPath}`));\n console.log(theme.dim('Fetching latest changes...'));\n\n try {\n const git = simpleGit(localPath);\n await git.fetch(['--all']);\n console.log(theme.success('Fetch complete.\\n'));\n } catch (err) {\n const msg = err instanceof Error ? err.message : String(err);\n console.log(theme.warning(`Fetch failed (using cached clone): ${msg}\\n`));\n }\n } else {\n console.log(theme.dim(`Cloning ${input}...`));\n const git = simpleGit();\n await git.clone(input, localPath);\n console.log(theme.success('Clone complete.\\n'));\n }\n\n return { localPath };\n}\n","import * as path from 'node:path';\nimport * as fs from 'node:fs';\nimport {\n CacheManager,\n loadConfig,\n generateReport,\n loadAllRubrics,\n computeRubricHash,\n type ReportFormat,\n type AnalysisReport,\n type CommitScore,\n} from '@gitpulse/core';\nimport { theme } from '../ui/theme.js';\nimport { renderScoreTable, renderSummaryTable } from '../ui/table.js';\nimport { handleError } from '../utils/error-handler.js';\nimport { resolveRepoPath } from '../utils/remote-repo.js';\n\nexport interface ReportOptions {\n format?: string;\n output?: string;\n}\n\nexport async function reportCommandInner(repoPath: string, options: ReportOptions): Promise<void> {\n const { localPath } = await resolveRepoPath(repoPath);\n const absolutePath = path.resolve(localPath);\n const config = await loadConfig(absolutePath);\n const format = (options.format ?? config.output.format) as ReportFormat;\n\n const rubrics = loadAllRubrics(absolutePath);\n const rubricHash = computeRubricHash(rubrics);\n const cache = new CacheManager(absolutePath);\n const cached = cache.getAllCached(rubricHash);\n\n if (cached.size === 0) {\n console.log(theme.warning('No cached scores found. Run `gitpulse analyze` first.'));\n return;\n }\n\n console.log(theme.dim(`Found ${cached.size} cached commit scores.\\n`));\n\n // Build a minimal report from cache\n const commitScores = Array.from(cached.values());\n const report = buildReportFromCache(commitScores, absolutePath, config.provider, config.model, config.scoring.weights);\n\n if (format === 'terminal') {\n renderSummaryTable(report);\n console.log('');\n renderScoreTable(report);\n } else {\n const output = generateReport(report, format);\n if (options.output) {\n const outputPath = path.resolve(options.output);\n fs.writeFileSync(outputPath, output, 'utf-8');\n console.log(theme.success(`Report saved to ${outputPath}`));\n } else {\n console.log(output);\n }\n }\n}\n\nexport async function reportCommand(repoPath: string, options: ReportOptions): Promise<void> {\n try {\n await reportCommandInner(repoPath, options);\n } catch (error) {\n handleError(error);\n }\n}\n\nfunction buildReportFromCache(\n scores: CommitScore[],\n repoPath: string,\n provider: string,\n model: string,\n weights: { codeQuality: number; complexityImpact: number; commitDiscipline: number; collaboration: number },\n): AnalysisReport {\n return {\n metadata: {\n generatedAt: new Date(),\n repositoryPath: repoPath,\n scope: {},\n dimensionWeights: weights,\n totalCommits: scores.length,\n analyzedCommits: scores.length,\n cachedCommits: scores.length,\n skippedCommits: 0,\n llmProvider: provider,\n llmModel: model,\n },\n summary: {\n averageScore: scores.reduce((s, c) => s + c.overallScore, 0) / scores.length,\n medianScore: [...scores].sort((a, b) => a.overallScore - b.overallScore)[Math.floor(scores.length / 2)]?.overallScore ?? 0,\n topPerformer: 'N/A (from cache)',\n totalAuthors: 0,\n dateRange: { start: new Date(), end: new Date() },\n },\n authors: [],\n commitScores: scores,\n };\n}\n","import { loadConfig, HomeManager } from '@gitpulse/core';\nimport { theme } from '../ui/theme.js';\nimport { runSetupWizard } from '../wizard/setup.js';\nimport { handleError } from '../utils/error-handler.js';\n\nexport interface ConfigOptions {\n init?: boolean;\n show?: boolean;\n set?: string;\n}\n\nexport async function configCommandInner(options: ConfigOptions, setValue?: string): Promise<void> {\n if (options.init) {\n // Initialize ~/.gitpulse/ home directory\n const home = new HomeManager();\n const result = home.initialize();\n\n if (result.created) {\n console.log(theme.success(`Created ${result.homePath}/`));\n } else {\n console.log(theme.dim(`Home directory already exists: ${result.homePath}/`));\n }\n\n if (result.copiedRubrics.length > 0) {\n console.log(theme.success(`Copied rubrics: ${result.copiedRubrics.join(', ')}`));\n }\n if (result.skippedRubrics.length > 0) {\n console.log(theme.dim(`Skipped existing rubrics: ${result.skippedRubrics.join(', ')}`));\n }\n\n // Run project-level setup wizard\n await runSetupWizard(process.cwd());\n return;\n }\n\n if (options.show || (!options.set && !options.init)) {\n const config = await loadConfig(process.cwd());\n console.log(theme.heading('\\nCurrent Configuration:\\n'));\n console.log(JSON.stringify(config, null, 2));\n return;\n }\n\n if (options.set && setValue) {\n console.log(theme.dim(`Setting ${options.set} = ${setValue}`));\n console.log(theme.warning('Direct config setting via CLI not yet implemented. Edit .gitpulse.yml directly.'));\n }\n}\n\nexport async function configCommand(options: ConfigOptions, setValue?: string): Promise<void> {\n try {\n await configCommandInner(options, setValue);\n } catch (error) {\n handleError(error);\n }\n}\n","import * as fs from 'node:fs';\nimport * as path from 'node:path';\nimport { select, input, confirm } from '@inquirer/prompts';\nimport { theme } from '../ui/theme.js';\nimport type { LLMProviderType } from '@gitpulse/core';\n\nexport interface SetupResult {\n provider: LLMProviderType;\n model: string;\n apiKey?: string;\n baseURL?: string;\n}\n\nexport async function runSetupWizard(targetDir: string): Promise<void> {\n console.log(theme.heading('\\nGitPulse Configuration Wizard\\n'));\n\n const provider = (await select({\n message: 'Select your LLM provider:',\n choices: [\n { value: 'openai', name: 'OpenAI (GPT-4o, GPT-4o-mini)' },\n { value: 'anthropic', name: 'Anthropic (Claude)' },\n { value: 'google', name: 'Google (Gemini)' },\n { value: 'vertex', name: 'Google Vertex AI (Gemini via Vertex)' },\n { value: 'custom', name: 'Custom (OpenAI-compatible endpoint)' },\n ],\n })) as LLMProviderType;\n\n const defaultModels: Record<string, string> = {\n openai: 'gpt-4o',\n anthropic: 'claude-sonnet-4-20250514',\n google: 'gemini-1.5-pro',\n vertex: 'gemini-1.5-pro',\n custom: 'default',\n };\n\n const model = await input({\n message: 'Model name:',\n default: defaultModels[provider] ?? 'gpt-4o',\n });\n\n let baseURL: string | undefined;\n if (provider === 'custom') {\n baseURL = await input({\n message: 'Base URL for the API:',\n validate: (v) => {\n try {\n new URL(v);\n return true;\n } catch {\n return 'Please enter a valid URL';\n }\n },\n });\n }\n\n const envVarNames: Record<string, string> = {\n openai: 'OPENAI_API_KEY',\n anthropic: 'ANTHROPIC_API_KEY',\n google: 'GOOGLE_GENERATIVE_AI_API_KEY',\n vertex: 'GOOGLE_VERTEX_API_KEY',\n custom: 'API_KEY',\n };\n\n const envVar = envVarNames[provider] ?? 'API_KEY';\n console.log(\n theme.dim(\n `\\nTip: Set your API key via the ${theme.info(envVar)} environment variable.\\n`,\n ),\n );\n\n const customize = await confirm({\n message: 'Customize scoring weights?',\n default: false,\n });\n\n let weights = {\n codeQuality: 0.3,\n complexityImpact: 0.25,\n commitDiscipline: 0.25,\n collaboration: 0.2,\n };\n\n if (customize) {\n console.log(theme.dim('Enter weights (must sum to 1.0):'));\n const cq = await input({ message: 'Code Quality weight:', default: '0.30' });\n const ci = await input({ message: 'Complexity & Impact weight:', default: '0.25' });\n const cd = await input({ message: 'Commit Discipline weight:', default: '0.25' });\n const co = await input({ message: 'Collaboration weight:', default: '0.20' });\n weights = {\n codeQuality: parseFloat(cq),\n complexityImpact: parseFloat(ci),\n commitDiscipline: parseFloat(cd),\n collaboration: parseFloat(co),\n };\n }\n\n const config = buildConfigYaml(provider, model, baseURL, weights);\n const configPath = path.join(targetDir, '.gitpulse.yml');\n\n fs.writeFileSync(configPath, config, 'utf-8');\n console.log(theme.success(`\\nConfiguration saved to ${configPath}`));\n}\n\nfunction buildConfigYaml(\n provider: string,\n model: string,\n baseURL: string | undefined,\n weights: Record<string, number>,\n): string {\n let yaml = `# GitPulse Configuration\nprovider: ${provider}\nmodel: ${model}\n`;\n\n if (baseURL) {\n yaml += `baseURL: ${baseURL}\\n`;\n }\n\n yaml += `\nscoring:\n weights:\n codeQuality: ${weights.codeQuality}\n complexityImpact: ${weights.complexityImpact}\n commitDiscipline: ${weights.commitDiscipline}\n collaboration: ${weights.collaboration}\n timeDecay: false\n maxTokensPerDiff: 8000\n\nanalysis:\n maxConcurrency: 3\n skipMergeCommits: true\n skipLockFiles: true\n skipAutoGenerated: true\n\noutput:\n format: terminal\n anonymize: false\n\nprivacy:\n excludeFileContents: false\n anonymize: false\n`;\n\n return yaml;\n}\n","import * as path from 'node:path';\nimport {\n Analyzer,\n createProvider,\n loadConfig,\n type AnalysisScope,\n} from '@gitpulse/core';\nimport { theme } from '../ui/theme.js';\nimport { handleError } from '../utils/error-handler.js';\nimport { resolveRepoPath } from '../utils/remote-repo.js';\n\nexport async function compareCommandInner(author1: string, author2: string, options: { path?: string; since?: string; until?: string }): Promise<void> {\n const { localPath } = await resolveRepoPath(options.path ?? '.');\n const repoPath = path.resolve(localPath);\n const config = await loadConfig(repoPath);\n\n const model = await createProvider({\n type: config.provider,\n model: config.model,\n apiKey: config.apiKey,\n baseURL: config.baseURL,\n });\n\n const analyzer = await Analyzer.create(repoPath, { config, model });\n\n const scope: AnalysisScope = {\n since: options.since,\n until: options.until,\n path: repoPath,\n };\n\n console.log(theme.heading(`\\nComparing: ${author1} vs ${author2}\\n`));\n console.log(theme.dim('Running analysis...\\n'));\n\n const report = await analyzer.analyze(scope);\n\n const a1 = report.authors.find(\n (a) => a.score.authorName.toLowerCase().includes(author1.toLowerCase()) ||\n a.score.authorEmail.toLowerCase().includes(author1.toLowerCase()),\n );\n const a2 = report.authors.find(\n (a) => a.score.authorName.toLowerCase().includes(author2.toLowerCase()) ||\n a.score.authorEmail.toLowerCase().includes(author2.toLowerCase()),\n );\n\n if (!a1) {\n console.log(theme.error(`Author not found: ${author1}`));\n return;\n }\n if (!a2) {\n console.log(theme.error(`Author not found: ${author2}`));\n return;\n }\n\n const dims = [\n { label: 'Overall', get: (a: typeof a1) => a.score.overallScore },\n { label: 'Code Quality', get: (a: typeof a1) => a.score.dimensionScores.codeQuality.score },\n { label: 'Complexity', get: (a: typeof a1) => a.score.dimensionScores.complexityImpact.score },\n { label: 'Discipline', get: (a: typeof a1) => a.score.dimensionScores.commitDiscipline.score },\n { label: 'Collaboration', get: (a: typeof a1) => a.score.dimensionScores.collaboration.score },\n ];\n\n const nameWidth = Math.max(a1.score.authorName.length, a2.score.authorName.length, 15);\n\n console.log(\n `${'Dimension'.padEnd(20)} ${a1.score.authorName.padEnd(nameWidth)} ${a2.score.authorName.padEnd(nameWidth)} ${'Winner'}`,\n );\n console.log('-'.repeat(20 + nameWidth * 2 + 15));\n\n for (const dim of dims) {\n const v1 = dim.get(a1);\n const v2 = dim.get(a2);\n const winner = v1 > v2 ? a1.score.authorName : v2 > v1 ? a2.score.authorName : 'Tie';\n\n console.log(\n `${dim.label.padEnd(20)} ${theme.score(v1).padEnd(nameWidth + 10)} ${theme.score(v2).padEnd(nameWidth + 10)} ${winner}`,\n );\n }\n\n console.log(`\\n${'Commits'.padEnd(20)} ${String(a1.score.scoredCommitCount).padEnd(nameWidth)} ${String(a2.score.scoredCommitCount).padEnd(nameWidth)}`);\n console.log(`${'Trend'.padEnd(20)} ${theme.trend(a1.score.trend.direction).padEnd(nameWidth + 10)} ${theme.trend(a2.score.trend.direction)}`);\n console.log('');\n}\n\nexport async function compareCommand(author1: string, author2: string, options: { path?: string; since?: string; until?: string }): Promise<void> {\n try {\n await compareCommandInner(author1, author2, options);\n } catch (error) {\n handleError(error);\n }\n}\n","import * as readline from 'node:readline';\nimport { select, confirm, input as inputPrompt } from '@inquirer/prompts';\nimport { HomeManager } from '@gitpulse/core';\nimport { printLogo } from '../ui/logo.js';\nimport { theme } from '../ui/theme.js';\nimport { isOnboardingNeeded, runOnboarding } from '../wizard/onboarding.js';\nimport { analyzeCommandInner } from '../commands/analyze.js';\nimport { reportCommandInner } from '../commands/report.js';\nimport { configCommandInner } from '../commands/config.js';\nimport { compareCommandInner } from '../commands/compare.js';\nimport { historyCommandInner } from '../commands/history.js';\nimport { handleReplError } from '../utils/error-handler.js';\nimport {\n parseArgs,\n parseAnalyzeArgs,\n parseReportArgs,\n parseConfigArgs,\n parseCompareArgs,\n parseHistoryArgs,\n} from './arg-parser.js';\n\nexport async function startRepl(): Promise<void> {\n printLogo();\n\n if (isOnboardingNeeded()) {\n await runOnboarding();\n } else {\n await showWelcomeBack();\n }\n\n await replLoop();\n}\n\nasync function showWelcomeBack(): Promise<void> {\n const home = new HomeManager();\n const memory = home.getMemory();\n\n if (memory.lastRun) {\n const date = new Date(memory.lastRun.timestamp);\n const dateStr = date.toLocaleDateString('en-US', {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n hour: '2-digit',\n minute: '2-digit',\n });\n\n console.log(theme.heading(' Welcome back!\\n'));\n console.log(` Last analysis: ${theme.bold(memory.lastRun.repoName)} on ${dateStr}`);\n console.log(` Commits: ${memory.lastRun.totalCommits} | Avg Score: ${theme.score(memory.lastRun.averageScore)}`);\n\n if (memory.preferences.preferredProvider) {\n console.log(` Provider: ${memory.preferences.preferredProvider}/${memory.preferences.preferredModel ?? 'default'}`);\n }\n\n console.log(` Total analyses: ${memory.totalAnalysisCount}\\n`);\n\n const continueSettings = await confirm({\n message: 'Continue with current settings?',\n default: true,\n });\n\n if (!continueSettings) {\n await runOnboarding();\n }\n } else {\n console.log(theme.heading(' Welcome back!\\n'));\n console.log(theme.dim(' No previous analysis found. Run `analyze <path>` to get started.\\n'));\n }\n}\n\n/**\n * Read one line from stdin using a fresh readline interface.\n * The interface is closed immediately after, so it never conflicts with inquirer.\n * Returns null on Ctrl+C / stream close (signals exit).\n */\nfunction promptLine(): Promise<string | null> {\n return new Promise((resolve) => {\n const rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: true,\n });\n\n rl.on('SIGINT', () => {\n rl.close();\n resolve(null);\n });\n\n rl.on('close', () => {\n // If resolved already this is a no-op (promises settle once)\n resolve(null);\n });\n\n rl.question(theme.prompt('gitpulse> '), (answer) => {\n resolve(answer);\n rl.close();\n });\n });\n}\n\nasync function replLoop(): Promise<void> {\n console.log(theme.dim(' Type a command, press Enter for quick menu, or type `help` for usage.\\n'));\n\n while (true) {\n const line = await promptLine();\n\n if (line === null) {\n // Ctrl+C or stdin closed\n console.log(theme.dim('\\n Goodbye!'));\n return;\n }\n\n const trimmed = line.trim();\n\n if (trimmed === '') {\n // readline is already closed — safe to use inquirer\n try {\n const shouldExit = await showQuickMenu();\n if (shouldExit) return;\n } catch (error) {\n // Only silently swallow prompt-cancellation errors (Ctrl+C during inquirer)\n if (error instanceof Error && error.name === 'AbortPromptError') {\n // User cancelled — just re-prompt\n } else {\n handleReplError(error);\n }\n }\n continue;\n }\n\n if (trimmed === 'exit' || trimmed === 'quit') {\n console.log(theme.dim('\\n Goodbye!'));\n return;\n }\n\n if (trimmed === 'help') {\n printHelp();\n continue;\n }\n\n // readline is already closed — safe to dispatch (which may use inquirer)\n try {\n await dispatchCommand(trimmed);\n } catch (error) {\n handleReplError(error);\n }\n }\n}\n\nasync function dispatchCommand(input: string): Promise<void> {\n const argv = parseArgs(input);\n if (argv.length === 0) return;\n\n const command = argv[0].toLowerCase();\n const args = argv.slice(1);\n\n switch (command) {\n case 'analyze': {\n const { repoPath, options } = parseAnalyzeArgs(args);\n await analyzeCommandInner(repoPath, options);\n break;\n }\n case 'report': {\n const { repoPath, options } = parseReportArgs(args);\n await reportCommandInner(repoPath, options);\n break;\n }\n case 'config': {\n const { options, value } = parseConfigArgs(args);\n await configCommandInner(options, value);\n break;\n }\n case 'compare': {\n const parsed = parseCompareArgs(args);\n if (!parsed) {\n console.log(theme.error('Usage: compare <author1> <author2> [--path <path>] [--since <date>] [--until <date>]'));\n break;\n }\n await compareCommandInner(parsed.author1, parsed.author2, parsed.options);\n break;\n }\n case 'history': {\n const { options } = parseHistoryArgs(args);\n await historyCommandInner(options);\n break;\n }\n case 'help': {\n printHelp();\n break;\n }\n default: {\n console.log(theme.warning(`Unknown command: ${command}`));\n console.log(theme.dim('Type `help` for available commands.\\n'));\n }\n }\n}\n\n/**\n * Returns true if the user chose to exit.\n */\nasync function showQuickMenu(): Promise<boolean> {\n const action = await select({\n message: 'What would you like to do?',\n choices: [\n { value: 'analyze', name: 'Analyze a repository' },\n { value: 'report', name: 'Generate a report from cache' },\n { value: 'compare', name: 'Compare two developers' },\n { value: 'history', name: 'View analysis history' },\n { value: 'config', name: 'Manage configuration' },\n { value: 'help', name: 'Show help' },\n { value: 'exit', name: 'Exit' },\n ],\n });\n\n switch (action) {\n case 'analyze': {\n const repoPath = await inputPrompt({\n message: 'Repository path or URL:',\n default: '.',\n });\n await analyzeCommandInner(repoPath, {});\n break;\n }\n case 'report': {\n const repoPath = await inputPrompt({\n message: 'Repository path or URL:',\n default: '.',\n });\n await reportCommandInner(repoPath, {});\n break;\n }\n case 'compare': {\n const author1 = await inputPrompt({ message: 'First author name or email:' });\n const author2 = await inputPrompt({ message: 'Second author name or email:' });\n await compareCommandInner(author1, author2, {});\n break;\n }\n case 'history': {\n await historyCommandInner();\n break;\n }\n case 'config': {\n await configCommandInner({ show: true });\n break;\n }\n case 'help': {\n printHelp();\n break;\n }\n case 'exit': {\n console.log(theme.dim('\\n Goodbye!'));\n return true;\n }\n }\n\n return false;\n}\n\nfunction printHelp(): void {\n console.log(theme.heading('\\n Available Commands:\\n'));\n console.log(' analyze [path] Analyze a repository');\n console.log(' --branch, -b <name> Branch to analyze');\n console.log(' --since <date> Start date');\n console.log(' --until <date> End date');\n console.log(' --author <names...> Filter by author');\n console.log(' --max-commits <n> Max commits to analyze');\n console.log(' --format <type> Output: terminal, json, markdown, html');\n console.log(' -o, --output <path> Output file path');\n console.log(' --no-cache Force re-scoring');\n console.log(' -y, --yes Skip confirmation');\n console.log(' --provider <type> LLM provider override');\n console.log(' --model <name> LLM model override');\n console.log('');\n console.log(' report [path] Generate report from cached scores');\n console.log(' --format <type> Output format');\n console.log(' -o, --output <path> Output file path');\n console.log('');\n console.log(' compare <a1> <a2> Compare two developers');\n console.log(' -p, --path <path> Repository path');\n console.log(' --since <date> Start date');\n console.log(' --until <date> End date');\n console.log('');\n console.log(' history View analysis history');\n console.log(' --repo <path> Filter by repository');\n console.log(' -n, --limit <n> Limit entries');\n console.log('');\n console.log(' config Show current configuration');\n console.log(' --init Run setup wizard');\n console.log(' --show Show configuration');\n console.log('');\n console.log(' help Show this help');\n console.log(' exit / quit Exit REPL');\n console.log('');\n console.log(theme.dim(' Press Enter (empty input) for quick menu.'));\n console.log('');\n}\n","import * as fs from 'node:fs';\nimport * as path from 'node:path';\nimport * as os from 'node:os';\nimport { select, input, password } from '@inquirer/prompts';\nimport { theme } from '../ui/theme.js';\nimport type { LLMProviderType } from '@gitpulse/core';\n\nconst HOME_DIR = path.join(os.homedir(), '.gitpulse');\nconst CONFIG_FILE = path.join(HOME_DIR, 'config.yml');\n\nexport function isOnboardingNeeded(): boolean {\n return !fs.existsSync(CONFIG_FILE);\n}\n\nexport async function runOnboarding(): Promise<void> {\n console.log(theme.heading('\\n Welcome to GitPulse!\\n'));\n console.log(theme.dim(' Let\\'s set up your global configuration.\\n'));\n\n const provider = (await select({\n message: 'Select your LLM provider:',\n choices: [\n { value: 'openai', name: 'OpenAI (GPT-4o, GPT-4o-mini)' },\n { value: 'anthropic', name: 'Anthropic (Claude)' },\n { value: 'google', name: 'Google (Gemini)' },\n { value: 'vertex', name: 'Google Vertex AI (Gemini via Vertex)' },\n { value: 'custom', name: 'Custom (OpenAI-compatible endpoint)' },\n ],\n })) as LLMProviderType;\n\n const defaultModels: Record<string, string> = {\n openai: 'gpt-4o',\n anthropic: 'claude-sonnet-4-20250514',\n google: 'gemini-1.5-pro',\n vertex: 'gemini-1.5-pro',\n custom: 'default',\n };\n\n const model = await input({\n message: 'Model name:',\n default: defaultModels[provider] ?? 'gpt-4o',\n });\n\n let baseURL: string | undefined;\n if (provider === 'custom') {\n baseURL = await input({\n message: 'Base URL for the API:',\n validate: (v) => {\n try {\n new URL(v);\n return true;\n } catch {\n return 'Please enter a valid URL';\n }\n },\n });\n }\n\n const apiKey = await password({\n message: `API Key for ${provider}:`,\n mask: '*',\n });\n\n // Ensure home directory exists\n fs.mkdirSync(HOME_DIR, { recursive: true });\n\n // Build and write config\n let yaml = `# GitPulse Global Configuration\nprovider: ${provider}\nmodel: ${model}\n`;\n\n if (baseURL) {\n yaml += `baseURL: ${baseURL}\\n`;\n }\n\n if (apiKey) {\n yaml += `apiKey: ${apiKey}\\n`;\n }\n\n fs.writeFileSync(CONFIG_FILE, yaml, 'utf-8');\n\n console.log(theme.success(`\\n Configuration saved to ${CONFIG_FILE}`));\n console.log('');\n}\n","import Table from 'cli-table3';\nimport { HomeManager } from '@gitpulse/core';\nimport { theme } from '../ui/theme.js';\n\nexport interface HistoryOptions {\n repo?: string;\n limit?: number;\n}\n\nexport async function historyCommandInner(options?: HistoryOptions): Promise<void> {\n const home = new HomeManager();\n const entries = home.getHistory(options?.repo);\n\n if (entries.length === 0) {\n console.log(theme.dim('\\n No analysis history found. Run `analyze` to get started.\\n'));\n return;\n }\n\n const limit = options?.limit ?? 20;\n const shown = entries.slice(0, limit);\n\n const table = new Table({\n head: [\n theme.bold('Date'),\n theme.bold('Repository'),\n theme.bold('Commits'),\n theme.bold('Avg Score'),\n theme.bold('Provider'),\n theme.bold('Cost'),\n ],\n style: {\n head: [],\n border: ['dim'],\n },\n });\n\n for (const entry of shown) {\n const date = new Date(entry.timestamp);\n const dateStr = `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, '0')}-${String(date.getDate()).padStart(2, '0')} ${String(date.getHours()).padStart(2, '0')}:${String(date.getMinutes()).padStart(2, '0')}`;\n\n table.push([\n dateStr,\n entry.repoName,\n String(entry.summary.analyzedCommits),\n theme.score(entry.summary.averageScore),\n `${entry.cost.llmProvider}/${entry.cost.llmModel}`,\n `$${entry.cost.estimatedCost.toFixed(2)}`,\n ]);\n }\n\n console.log(theme.heading('\\n Analysis History\\n'));\n console.log(table.toString());\n\n if (entries.length > limit) {\n console.log(theme.dim(`\\n Showing ${limit} of ${entries.length} entries.`));\n }\n console.log('');\n}\n","import type { AnalyzeOptions } from '../commands/analyze.js';\nimport type { ReportOptions } from '../commands/report.js';\nimport type { ConfigOptions } from '../commands/config.js';\nimport type { HistoryOptions } from '../commands/history.js';\n\n/**\n * Split a raw input string into an argv-like array, respecting quoted strings.\n */\nexport function parseArgs(input: string): string[] {\n const args: string[] = [];\n let current = '';\n let inSingle = false;\n let inDouble = false;\n\n for (let i = 0; i < input.length; i++) {\n const ch = input[i];\n\n if (ch === \"'\" && !inDouble) {\n inSingle = !inSingle;\n continue;\n }\n if (ch === '\"' && !inSingle) {\n inDouble = !inDouble;\n continue;\n }\n if (ch === ' ' && !inSingle && !inDouble) {\n if (current.length > 0) {\n args.push(current);\n current = '';\n }\n continue;\n }\n current += ch;\n }\n\n if (current.length > 0) {\n args.push(current);\n }\n\n return args;\n}\n\nfunction consumeFlag(args: string[], flag: string, alias?: string): boolean {\n const idx = args.findIndex((a) => a === flag || (alias && a === alias));\n if (idx === -1) return false;\n args.splice(idx, 1);\n return true;\n}\n\nfunction consumeOption(args: string[], flag: string, alias?: string): string | undefined {\n const idx = args.findIndex((a) => a === flag || (alias && a === alias));\n if (idx === -1) return undefined;\n const value = args[idx + 1];\n args.splice(idx, value !== undefined ? 2 : 1);\n return value;\n}\n\nfunction consumeMultiOption(args: string[], flag: string, alias?: string): string[] | undefined {\n const values: string[] = [];\n let found = false;\n while (true) {\n const idx = args.findIndex((a) => a === flag || (alias && a === alias));\n if (idx === -1) break;\n found = true;\n const value = args[idx + 1];\n if (value !== undefined && !value.startsWith('-')) {\n args.splice(idx, 2);\n values.push(value);\n } else {\n args.splice(idx, 1);\n }\n }\n return found ? values : undefined;\n}\n\nexport function parseAnalyzeArgs(args: string[]): { repoPath: string; options: AnalyzeOptions } {\n // Work on a copy so we don't mutate the original\n const rest = [...args];\n\n const options: AnalyzeOptions = {};\n\n options.branch = consumeOption(rest, '--branch', '-b');\n options.since = consumeOption(rest, '--since');\n options.until = consumeOption(rest, '--until');\n options.author = consumeMultiOption(rest, '--author');\n const maxCommits = consumeOption(rest, '--max-commits');\n if (maxCommits) options.maxCommits = parseInt(maxCommits, 10);\n options.format = consumeOption(rest, '--format');\n options.output = consumeOption(rest, '--output', '-o');\n if (consumeFlag(rest, '--no-cache')) options.noCache = true;\n if (consumeFlag(rest, '-y') || consumeFlag(rest, '--yes')) options.yes = true;\n options.provider = consumeOption(rest, '--provider');\n options.model = consumeOption(rest, '--model');\n\n // Remaining positional is repoPath\n const repoPath = rest.find((a) => !a.startsWith('-')) ?? '.';\n\n return { repoPath, options };\n}\n\nexport function parseReportArgs(args: string[]): { repoPath: string; options: ReportOptions } {\n const rest = [...args];\n\n const options: ReportOptions = {};\n options.format = consumeOption(rest, '--format');\n options.output = consumeOption(rest, '--output', '-o');\n\n const repoPath = rest.find((a) => !a.startsWith('-')) ?? '.';\n return { repoPath, options };\n}\n\nexport function parseConfigArgs(args: string[]): { options: ConfigOptions; value?: string } {\n const rest = [...args];\n\n const options: ConfigOptions = {};\n if (consumeFlag(rest, '--init')) options.init = true;\n if (consumeFlag(rest, '--show')) options.show = true;\n options.set = consumeOption(rest, '--set');\n\n const value = rest.find((a) => !a.startsWith('-'));\n return { options, value };\n}\n\nexport function parseCompareArgs(args: string[]): { author1: string; author2: string; options: { path?: string; since?: string; until?: string } } | null {\n const rest = [...args];\n\n const options: { path?: string; since?: string; until?: string } = {};\n options.path = consumeOption(rest, '--path', '-p');\n options.since = consumeOption(rest, '--since');\n options.until = consumeOption(rest, '--until');\n\n // Remaining positional args should be author1 and author2\n const positional = rest.filter((a) => !a.startsWith('-'));\n\n if (positional.length < 2) {\n return null;\n }\n\n return { author1: positional[0], author2: positional[1], options };\n}\n\nexport function parseHistoryArgs(args: string[]): { options: HistoryOptions } {\n const rest = [...args];\n\n const options: HistoryOptions = {};\n options.repo = consumeOption(rest, '--repo');\n const limit = consumeOption(rest, '--limit', '-n');\n if (limit) options.limit = parseInt(limit, 10);\n\n return { options };\n}\n"],"mappings":";;;AAAA,SAAS,eAAe;;;ACAxB,OAAO,WAAW;AAElB,IAAM,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASN,SAAS,YAAkB;AAChC,UAAQ,IAAI,MAAM,IAAI,SAAS,EAAE,IAAI,CAAC;AACtC,UAAQ,IAAI,MAAM,IAAI,0CAA0C,CAAC;AACnE;;;ACdA,YAAY,QAAQ;AACpB,YAAY,UAAU;AACtB,SAAS,qBAAqB;AAEvB,SAAS,aAAqB;AACnC,QAAM,aAAa,cAAc,YAAY,GAAG;AAChD,MAAI,MAAW,aAAQ,UAAU;AAEjC,WAAS,IAAI,GAAG,IAAI,IAAI,KAAK;AAC3B,UAAM,UAAe,UAAK,KAAK,cAAc;AAC7C,QAAO,cAAW,OAAO,GAAG;AAC1B,YAAM,MAAM,KAAK,MAAS,gBAAa,SAAS,OAAO,CAAC;AACxD,aAAO,IAAI,WAAW;AAAA,IACxB;AACA,UAAM,SAAc,aAAQ,GAAG;AAC/B,QAAI,WAAW,IAAK;AACpB,UAAM;AAAA,EACR;AAEA,SAAO;AACT;;;ACpBA,YAAYA,WAAU;AACtB,YAAYC,SAAQ;AACpB,SAAS,SAAS,QAAQ,aAAa;AACvC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAIK;;;ACZP,OAAOC,YAAW;AAEX,IAAM,QAAQ;AAAA,EACnB,SAASA,OAAM,IAAI,SAAS;AAAA,EAC5B,WAAWA,OAAM,IAAI,SAAS;AAAA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,OAAO,uBAAuB,0BAA0B,EACxD,OAAO,qBAAqB,6BAA6B,QAAQ,EACjE,OAAO,mBAAmB,+CAA+C,EACzE,OAAO,uBAAuB,kBAAkB,EAChD,OAAO,cAAc,gCAAgC,EACrD,OAAO,aAAa,0BAA0B,EAC9C,OAAO,qBAAqB,uBAAuB,EACnD,OAAO,kBAAkB,oBAAoB,EAC7C,OAAO,OAAO,UAAkB,YAAY;AAC3C,UAAM,eAAe,UAAU,OAAO;AAAA,EACxC,CAAC;AAEH,UACG,QAAQ,QAAQ,EAChB,YAAY,oCAAoC,EAChD,SAAS,UAAU,iCAAiC,GAAG,EACvD,OAAO,mBAAmB,+CAA+C,EACzE,OAAO,uBAAuB,kBAAkB,EAChD,OAAO,OAAO,UAAkB,YAAY;AAC3C,UAAM,cAAc,UAAU,OAAO;AAAA,EACvC,CAAC;AAEH,UACG,QAAQ,QAAQ,EAChB,YAAY,sBAAsB,EAClC,OAAO,UAAU,8BAA8B,EAC/C,OAAO,UAAU,4BAA4B,EAC7C,OAAO,eAAe,oBAAoB,EAC1C,SAAS,WAAW,cAAc,EAClC,OAAO,OAAO,OAA2B,YAAY;AACpD,UAAM,cAAc,SAAS,KAAK;AAAA,EACpC,CAAC;AAEH,UACG,QAAQ,SAAS,EACjB,YAAY,wBAAwB,EACpC,SAAS,aAAa,4BAA4B,EAClD,SAAS,aAAa,6BAA6B,EACnD,OAAO,qBAAqB,iCAAiC,GAAG,EAChE,OAAO,kBAAkB,YAAY,EACrC,OAAO,kBAAkB,UAAU,EACnC,OAAO,OAAO,SAAiB,SAAiB,YAAY;AAC3D,UAAM,eAAe,SAAS,SAAS,OAAO;AAAA,EAChD,CAAC;AAEH,UAAQ,WAAW,QAAQ,IAAI,EAAE,MAAM,WAAW;AACpD;","names":["path","fs","chalk","path","fs","input","path","fs","loadConfig","generateReport","loadConfig","generateReport","loadConfig","HomeManager","fs","path","select","input","confirm","select","input","confirm","HomeManager","loadConfig","path","Analyzer","createProvider","loadConfig","loadConfig","createProvider","Analyzer","select","confirm","HomeManager","fs","path","os","select","input","select","input","Table","HomeManager","HomeManager","Table","input","args","HomeManager","confirm","resolve","input","args","select"]}
@@ -0,0 +1,33 @@
1
+ import type { AnalyzeOptions } from '../commands/analyze.js';
2
+ import type { ReportOptions } from '../commands/report.js';
3
+ import type { ConfigOptions } from '../commands/config.js';
4
+ import type { HistoryOptions } from '../commands/history.js';
5
+ /**
6
+ * Split a raw input string into an argv-like array, respecting quoted strings.
7
+ */
8
+ export declare function parseArgs(input: string): string[];
9
+ export declare function parseAnalyzeArgs(args: string[]): {
10
+ repoPath: string;
11
+ options: AnalyzeOptions;
12
+ };
13
+ export declare function parseReportArgs(args: string[]): {
14
+ repoPath: string;
15
+ options: ReportOptions;
16
+ };
17
+ export declare function parseConfigArgs(args: string[]): {
18
+ options: ConfigOptions;
19
+ value?: string;
20
+ };
21
+ export declare function parseCompareArgs(args: string[]): {
22
+ author1: string;
23
+ author2: string;
24
+ options: {
25
+ path?: string;
26
+ since?: string;
27
+ until?: string;
28
+ };
29
+ } | null;
30
+ export declare function parseHistoryArgs(args: string[]): {
31
+ options: HistoryOptions;
32
+ };
33
+ //# sourceMappingURL=arg-parser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arg-parser.d.ts","sourceRoot":"","sources":["../../src/repl/arg-parser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE7D;;GAEG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAgCjD;AAmCD,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,cAAc,CAAA;CAAE,CAuB9F;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,aAAa,CAAA;CAAE,CAS5F;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG;IAAE,OAAO,EAAE,aAAa,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAU1F;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,GAAG,IAAI,CAgBxJ;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG;IAAE,OAAO,EAAE,cAAc,CAAA;CAAE,CAS5E"}
@@ -0,0 +1,2 @@
1
+ export declare function startRepl(): Promise<void>;
2
+ //# sourceMappingURL=repl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repl.d.ts","sourceRoot":"","sources":["../../src/repl/repl.ts"],"names":[],"mappings":"AAqBA,wBAAsB,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,CAU/C"}
@@ -0,0 +1,2 @@
1
+ export declare function printLogo(): void;
2
+ //# sourceMappingURL=logo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logo.d.ts","sourceRoot":"","sources":["../../src/ui/logo.ts"],"names":[],"mappings":"AAWA,wBAAgB,SAAS,IAAI,IAAI,CAGhC"}
@@ -0,0 +1,3 @@
1
+ import cliProgress from 'cli-progress';
2
+ export declare function createProgressBar(total: number): cliProgress.SingleBar;
3
+ //# sourceMappingURL=progress.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../src/ui/progress.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,cAAc,CAAC;AAGvC,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW,CAAC,SAAS,CAUtE"}
@@ -0,0 +1,4 @@
1
+ import { type Ora } from 'ora';
2
+ export declare function createSpinner(text: string): Ora;
3
+ export declare function phaseSpinner(phase: number, totalPhases: number, text: string): Ora;
4
+ //# sourceMappingURL=spinner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spinner.d.ts","sourceRoot":"","sources":["../../src/ui/spinner.ts"],"names":[],"mappings":"AAAA,OAAY,EAAE,KAAK,GAAG,EAAE,MAAM,KAAK,CAAC;AAGpC,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAK/C;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,GAAG,CAElF"}
@@ -0,0 +1,4 @@
1
+ import type { AnalysisReport } from '@gitpulse/core';
2
+ export declare function renderScoreTable(report: AnalysisReport): void;
3
+ export declare function renderSummaryTable(report: AnalysisReport): void;
4
+ //# sourceMappingURL=table.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../src/ui/table.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGrD,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI,CAiC7D;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI,CAgB/D"}
@@ -0,0 +1,15 @@
1
+ export declare const theme: {
2
+ primary: import("chalk").ChalkInstance;
3
+ secondary: import("chalk").ChalkInstance;
4
+ success: import("chalk").ChalkInstance;
5
+ warning: import("chalk").ChalkInstance;
6
+ error: import("chalk").ChalkInstance;
7
+ info: import("chalk").ChalkInstance;
8
+ dim: import("chalk").ChalkInstance;
9
+ bold: import("chalk").ChalkInstance;
10
+ heading: import("chalk").ChalkInstance;
11
+ prompt: import("chalk").ChalkInstance;
12
+ score: (score: number) => string;
13
+ trend: (direction: "improving" | "stable" | "declining") => string;
14
+ };
15
+ //# sourceMappingURL=theme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/ui/theme.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,KAAK;;;;;;;;;;;mBAYD,MAAM,KAAG,MAAM;uBAOX,WAAW,GAAG,QAAQ,GAAG,WAAW,KAAG,MAAM;CAUjE,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare function handleError(error: unknown): never;
2
+ export declare function handleReplError(error: unknown): void;
3
+ //# sourceMappingURL=error-handler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-handler.d.ts","sourceRoot":"","sources":["../../src/utils/error-handler.ts"],"names":[],"mappings":"AAEA,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,CAUjD;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CASpD"}
@@ -0,0 +1,5 @@
1
+ export declare function isRemoteUrl(input: string): boolean;
2
+ export declare function resolveRepoPath(input: string): Promise<{
3
+ localPath: string;
4
+ }>;
5
+ //# sourceMappingURL=remote-repo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remote-repo.d.ts","sourceRoot":"","sources":["../../src/utils/remote-repo.ts"],"names":[],"mappings":"AASA,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAElD;AAkBD,wBAAsB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,CA+BnF"}
@@ -0,0 +1,2 @@
1
+ export declare function getVersion(): string;
2
+ //# sourceMappingURL=version.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/utils/version.ts"],"names":[],"mappings":"AAIA,wBAAgB,UAAU,IAAI,MAAM,CAgBnC"}
@@ -0,0 +1,3 @@
1
+ export declare function isOnboardingNeeded(): boolean;
2
+ export declare function runOnboarding(): Promise<void>;
3
+ //# sourceMappingURL=onboarding.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"onboarding.d.ts","sourceRoot":"","sources":["../../src/wizard/onboarding.ts"],"names":[],"mappings":"AAUA,wBAAgB,kBAAkB,IAAI,OAAO,CAE5C;AAED,wBAAsB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAqEnD"}
@@ -0,0 +1,9 @@
1
+ import type { LLMProviderType } from '@gitpulse/core';
2
+ export interface SetupResult {
3
+ provider: LLMProviderType;
4
+ model: string;
5
+ apiKey?: string;
6
+ baseURL?: string;
7
+ }
8
+ export declare function runSetupWizard(targetDir: string): Promise<void>;
9
+ //# sourceMappingURL=setup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../src/wizard/setup.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,eAAe,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,wBAAsB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAwFrE"}
package/package.json ADDED
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "gitpulse-cli",
3
+ "version": "0.1.0",
4
+ "description": "AI-powered Git contribution analyzer CLI",
5
+ "type": "module",
6
+ "bin": {
7
+ "gitpulse": "./dist/index.js"
8
+ },
9
+ "main": "./dist/index.js",
10
+ "types": "./dist/index.d.ts",
11
+ "files": [
12
+ "dist"
13
+ ],
14
+ "scripts": {
15
+ "build": "tsup && tsc --emitDeclarationOnly --declaration --declarationDir dist",
16
+ "dev": "tsup --watch",
17
+ "test": "vitest run",
18
+ "test:watch": "vitest",
19
+ "lint": "eslint src/",
20
+ "lint:fix": "eslint src/ --fix",
21
+ "typecheck": "tsc --noEmit",
22
+ "clean": "rm -rf dist"
23
+ },
24
+ "dependencies": {
25
+ "@ai-sdk/anthropic": "^3.0.40",
26
+ "@ai-sdk/google": "^3.0.23",
27
+ "@ai-sdk/openai": "^3.0.26",
28
+ "@gitpulse/core": "workspace:*",
29
+ "@inquirer/prompts": "^7.2.0",
30
+ "chalk": "^5.4.0",
31
+ "cli-progress": "^3.12.0",
32
+ "cli-table3": "^0.6.5",
33
+ "commander": "^12.1.0",
34
+ "ora": "^8.1.0",
35
+ "simple-git": "^3.27.0"
36
+ },
37
+ "devDependencies": {
38
+ "@types/cli-progress": "^3.11.6",
39
+ "@types/node": "^25.2.2",
40
+ "tsup": "^8.3.0",
41
+ "typescript": "^5.7.0",
42
+ "vitest": "^2.1.0"
43
+ },
44
+ "license": "Apache-2.0"
45
+ }