MCPcopy Index your code
hub / github.com/LionyxML/magit-stats

github.com/LionyxML/magit-stats @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
19 symbols 51 edges 6 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

magit-stats

img IMG

img

What is this package?

A git statistics report generator that can be use both as an individual CLI Tool or called from inside Emacs.

Here's a demo of the report: img

Requirements

You need to have node@latest installed in your system and the npx tool.

Just check if you have it issuing the command: npx --version.

Basic Usage

Navigate to your git folder and issue:

npx magit-stats

And that's it! A new git-stats.html file is generated with your repository statistics and will be automatically opened.

Advanced Usage

You can get all options of this cli tool by issuing npx magit-stats --help.

[magit-stats] - Your git repository statistics

Usage: npx magit-stats  [options]

Opções:
      --html      Saves report to HTML file (default: git-stats.html)  [boolean]
      --json      Saves report to JSON file (default: git-stats.json)  [boolean]
      --stdout    Outputs to stdout                                    [boolean]
      --minify    Minifies the JSON output                             [boolean]
      --file      Output file name                                      [string]
      --repo      Repository name to show on report                     [string]
      --no-open   Does not auto-open the generate HTML file            [boolean]
      --no-icons  Does not use icons on HTML                           [boolean]
      --heap      Node memory heap size                 [string] [default: 4096]
  -h, --help      Show help                                            [boolean]
  -v, --version   Show app version                                     [boolean]

Examples:
  npx magit-stats                          saves report to git-stats.html an ope
                                           ns the file with default app
  npx magit-stats  --html                  same as above
  npx magit-stats  --html --file out.html  saves report to out.html and open it
  npx magit-stats  --html --no-open        saves report to git-stats.html
  npx magit-stats  --json                  saves report to git-stats.json
  npx magit-stats  --json --file out.json  saves report to out.json
  npx magit-stats  --json --stdout         prints JSON report to stdout

Emacs Usage

NOTE: Requires you to be able to execute `npx` (see above) and have it set to your emacs path.

Install it from MELPA and add to your `.emacs` file:

(require 'magit-stats)

Then open a file that is inside a git repository and call magit-stats, like M-x magit-stats RET.

Choose an option generate your report!

Demo: img

Extension points exported contracts — how you extend this code

chartProps (Interface)
(no doc)
src/chartGenerator/index.ts

Core symbols most depended-on inside this repo

getFileName
called by 3
src/index.ts
renderChart
called by 3
src/chartGenerator/index.ts
logError
called by 3
src/utils/index.ts
logMsg
called by 2
src/utils/index.ts
generateHTMLReport
called by 2
src/htmlReport/index.ts
checkOptionsAreValid
called by 1
src/index.ts
getGitLogStats
called by 1
src/index.ts
processOutput
called by 1
src/index.ts

Shape

Function 18
Interface 1

Languages

TypeScript100%

Modules by API surface

src/utils/index.ts10 symbols
src/index.ts6 symbols
src/chartGenerator/index.ts2 symbols
src/htmlReport/index.ts1 symbols

For agents

$ claude mcp add magit-stats \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact