Command reference
ed code-stats
ed code-stats drives the Code Stats ability, the same one the Code Stats settings and page use. Edith mirrors every GitHub repository you can reach into a folder you choose, counts the commits that are yours across all of them, and keeps a report of commits, lines, streaks, languages and habits. The background agent owns the mirror and the report, so the status, run, cancel, report, export, authors and audit commands need Edith or Edith's background services running. The folder, schedule and identity commands write the shared settings directly.
| Command | What it does |
|---|---|
ed code-stats status |
Shows the folder, schedule, last refresh and live progress. |
ed code-stats run |
Refreshes the mirror and recounts your commits. |
ed code-stats cancel |
Cancels the refresh in progress. |
ed code-stats report |
Prints the report for 30 days, 90 days, a year or all time. |
ed code-stats folder |
Chooses the folder that holds the mirror. |
ed code-stats schedule |
Chooses a manual, hourly, daily or weekly refresh. |
ed code-stats identity |
Lists, adds and removes the identities counted as you. |
ed code-stats authors |
Lists the commit authors found in the mirror. |
ed code-stats audit |
Explains what was counted and what was excluded, and why. |
ed code-stats export |
Renders the totals as PNG cards you can share, with no repository names. |
status is the default, so a bare ed code-stats shows the status. identity defaults to identity list.
How it works
- Repositories are listed with the GitHub CLI (
gh), so rungh auth loginonce for each account. Every account signed in toghis counted, not just the active one, except the logins listed incodeStatsExcludedAccounts(the account checkboxes in Code Stats settings). Withoutghthe agent still analyses whatever is already in the folder. - New repositories are cloned bare into
<folder>/<owner>/<repo>.gitand existing ones are fetched. Clones made by other tools as<folder>/<owner>/<repo>/.gitare read as they are. Nothing in the folder is ever deleted. - Results and the per-repository cache live in Edith's own data folder, not in the mirror, so the last report stays readable while an external drive is unplugged.
- A folder on an external drive under
/Volumesis remembered while the drive is away. A scheduled refresh that comes due then waits for the drive, and runs once when it returns. The schedule counts from the first refresh you start, even one that the drive cut short. - Forks are skipped and archived repositories are included unless you change
codeStatsIncludeForksorcodeStatsIncludeArchivedwithed config set.
Exit codes
| Code | When |
|---|---|
| 0 | the command completed |
| 2 | a range, schedule, interval, hour or weekday was not valid |
| 3 | the folder does not exist, an identity to remove is not listed, or no report exists yet |
| 4 | the background agent is not running |