Skip to content

Commit 403711a

Browse files
committed
feat: rewrite commit-chronicle as a self-contained Go binary
Replace the zsh report script with a single static binary (Bubble Tea TUI). For a date window it gathers everything you did across your repos — git commits, commits on PRs you authored, authored PRs, and reviewed PRs — into one tagged, fuzzy-filterable picker, then exports a worklog (markdown/json). Highlights: - Interactive: range menu (incl. custom date selector), multi-select picker with live git-show preview, in-app editor, animated loading spinner. - Repo discovery: --repos, --root (auto-discover under a dir), and config files (~/.config/commit-chronicle/{repos,roots}); unioned + deduped. - GitHub PR/review discovery via gh, date-bounded to keep API calls sane. - Flags: --since/--from/--to/--month/--date, --author/--user, --format md|json, --all, --no-edit, --no-pr, --copy, --out. - Packages: cmd/commit-chronicle + internal/{model,config,collect,render,tui,app}. - Build/release via Makefile; CI + release GitHub Actions workflows. - README rewritten; legacy zsh scripts removed.
1 parent 85acbbd commit 403711a

23 files changed

Lines changed: 2229 additions & 1353 deletions

File tree

‎.commit-chronicle.example‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# commit-chronicle — repo list
2+
#
3+
# One git repository path per line. Lines starting with # are ignored.
4+
# A leading ~ expands to your home directory.
5+
#
6+
# Use this for an explicit list of repos. Copy it to either:
7+
# • ./.commit-chronicle (per-project, in a repo)
8+
# • ~/.config/commit-chronicle/repos (global)
9+
#
10+
# Prefer auto-discovery? Instead of listing repos, put PARENT directories in
11+
# ~/.config/commit-chronicle/roots (one dir per line, e.g. ~/work)
12+
# and every git repo beneath them is found automatically.
13+
14+
~/projects/my-app
15+
~/projects/my-api
16+
~/work/some-service

‎.github/workflows/ci.yml‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
branches: ["**"]
6+
pull_request:
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-go@v5
14+
with:
15+
go-version: "1.24"
16+
- run: gofmt -l cmd internal | tee /dev/stderr | (! read)
17+
- run: go vet ./...
18+
- run: go build ./...

‎.github/workflows/release.yml‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: release
2+
3+
# Tag a version (e.g. `git tag v0.1.0 && git push --tags`) to build
4+
# cross-platform binaries and attach them to a GitHub Release.
5+
on:
6+
push:
7+
tags:
8+
- "v*"
9+
10+
permissions:
11+
contents: write
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- uses: actions/setup-go@v5
22+
with:
23+
go-version: "1.24"
24+
25+
- name: Build cross-platform binaries
26+
run: make release
27+
28+
- name: Publish release
29+
uses: softprops/action-gh-release@v2
30+
with:
31+
files: dist/*
32+
generate_release_notes: true

‎.gitignore‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,8 @@ monthly_data_*/
1616

1717
# IDE
1818
.vscode/
19-
.idea/
19+
.idea/
20+
21+
# Go build artifacts
22+
/bin/
23+
/dist/

‎Makefile‎

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
BINARY := commit-chronicle
2+
PKG := ./cmd/commit-chronicle
3+
BINDIR := bin
4+
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo dev)
5+
LDFLAGS := -s -w -X main.version=$(VERSION)
6+
7+
.PHONY: build install run clean test release
8+
9+
## build: compile the binary for the host platform into bin/
10+
build:
11+
go build -ldflags "$(LDFLAGS)" -o $(BINDIR)/$(BINARY) $(PKG)
12+
13+
## install: install worklog into $GOBIN (or $GOPATH/bin)
14+
install:
15+
go install -ldflags "$(LDFLAGS)" $(PKG)
16+
17+
## run: build and run (pass args via ARGS=...)
18+
run: build
19+
./$(BINDIR)/$(BINARY) $(ARGS)
20+
21+
## test: vet + build all packages
22+
test:
23+
go vet ./...
24+
go build ./...
25+
26+
## clean: remove build artifacts
27+
clean:
28+
rm -rf $(BINDIR) dist
29+
30+
## release: cross-compile static binaries into dist/
31+
release:
32+
@mkdir -p dist
33+
@for target in \
34+
darwin/amd64 darwin/arm64 \
35+
linux/amd64 linux/arm64 \
36+
windows/amd64; do \
37+
os=$${target%/*}; arch=$${target#*/}; \
38+
ext=""; [ "$$os" = "windows" ] && ext=".exe"; \
39+
out=dist/$(BINARY)-$$os-$$arch$$ext; \
40+
echo "→ $$out"; \
41+
GOOS=$$os GOARCH=$$arch CGO_ENABLED=0 \
42+
go build -ldflags "$(LDFLAGS)" -o $$out $(PKG) || exit 1; \
43+
done
44+
@echo "done. binaries in dist/"

0 commit comments

Comments
 (0)