Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
da6e8ca
send mixpanel usage analytic
mabd-dev Apr 14, 2026
807d855
read env variable, save/read telemetry.json, show notice
mabd-dev Apr 14, 2026
2b9bf46
updated first use message
mabd-dev Apr 14, 2026
c84f081
added telemetry section in readme
mabd-dev Apr 14, 2026
2fd156f
removed claude.md
mabd-dev Apr 14, 2026
1deb1f5
added file utils file
mabd-dev Apr 14, 2026
51f880f
add uuid to telemetry json file
mabd-dev Apr 14, 2026
f200924
first check if tool is disabled
mabd-dev Apr 14, 2026
e1aa1f3
removed debugging prints
mabd-dev Apr 14, 2026
66c57de
add indentation to Telemetry parsing
mabd-dev Apr 16, 2026
60fa97b
add ldflags to build script
mabd-dev Apr 16, 2026
d171ccf
handle if get configDir failed
mabd-dev Apr 16, 2026
75d89e7
updated readme
mabd-dev Apr 16, 2026
5e3b7a2
added v0.3.5 release notes
mabd-dev Apr 16, 2026
a7c90b7
fixed analytics package name. fix build script
mabd-dev Apr 16, 2026
09b5799
updated changelog
mabd-dev Apr 16, 2026
3a57704
move disable check to top of send function
mabd-dev Apr 16, 2026
515a2a5
remove debugging print
mabd-dev Apr 16, 2026
c4dfdd6
default mixpanelToken to empty string
mabd-dev Apr 16, 2026
3573c8e
updated build script for test and release github actions
mabd-dev Apr 16, 2026
eee6e54
set cache to false on setup-go. remove -race from test command
mabd-dev Apr 16, 2026
df5de42
reset tests.yml
mabd-dev Apr 17, 2026
c6757ec
docs: updated release notes
mabd-dev Apr 17, 2026
239d945
test update: keep only go veresion 1.25
mabd-dev Apr 17, 2026
6640afd
remove go version matrix
mabd-dev Apr 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ jobs:
run: |
echo "Building gh-oss-stats ..."
mkdir -p dist
GOOS=linux GOARCH=amd64 go build -o dist/gh-oss-stats-linux-amd64 ./cmd/gh-oss-stats/*.go
GOOS=linux GOARCH=arm64 go build -o dist/gh-oss-stats-linux-arm64 ./cmd/gh-oss-stats/*.go
GOOS=darwin GOARCH=arm64 go build -o dist/gh-oss-stats-darwin-arm64 ./cmd/gh-oss-stats/*.go
GOOS=linux GOARCH=amd64 go build -o dist/gh-oss-stats-linux-amd64 -ldflags="-X github.com/mabd-dev/gh-oss-stats/internal/analytics.mixpanelToken=${{ secrets.MIXPANEL_TOKEN }}" ./cmd/gh-oss-stats
GOOS=linux GOARCH=arm64 go build -o dist/gh-oss-stats-linux-arm64 -ldflags="-X github.com/mabd-dev/gh-oss-stats/internal/analytics.mixpanelToken=${{ secrets.MIXPANEL_TOKEN }}" ./cmd/gh-oss-stats
GOOS=darwin GOARCH=arm64 go build -o dist/gh-oss-stats-darwin-arm64 -ldflags="-X github.com/mabd-dev/gh-oss-stats/internal/analytics.mixpanelToken=${{ secrets.MIXPANEL_TOKEN }}" ./cmd/gh-oss-stats

- name: Trigger pkg.go.dev indexing
run: |
Expand Down
12 changes: 4 additions & 8 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,14 @@ jobs:
name: Run Tests
runs-on: ubuntu-latest

strategy:
matrix:
go-version: ['1.23', '1.24', '1.25']

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
go-version: 1.25
cache: true

- name: Download dependencies
Expand Down Expand Up @@ -59,9 +55,9 @@ jobs:
run: |
echo "Building gh-oss-stats ..."
mkdir -p dist
GOOS=linux GOARCH=amd64 go build -o dist/gh-oss-stats-linux-amd64 ./cmd/gh-oss-stats/*.go
GOOS=linux GOARCH=arm64 go build -o dist/gh-oss-stats-linux-arm64 ./cmd/gh-oss-stats/*.go
GOOS=darwin GOARCH=arm64 go build -o dist/gh-oss-stats-darwin-arm64 ./cmd/gh-oss-stats/*.go
GOOS=linux GOARCH=amd64 go build -o dist/gh-oss-stats-linux-amd64 -ldflags="-X github.com/mabd-dev/gh-oss-stats/internal/analytics.mixpanelToken=${{ secrets.MIXPANEL_TOKEN }}" ./cmd/gh-oss-stats
GOOS=linux GOARCH=arm64 go build -o dist/gh-oss-stats-linux-arm64 -ldflags="-X github.com/mabd-dev/gh-oss-stats/internal/analytics.mixpanelToken=${{ secrets.MIXPANEL_TOKEN }}" ./cmd/gh-oss-stats
GOOS=darwin GOARCH=arm64 go build -o dist/gh-oss-stats-darwin-arm64 -ldflags="-X github.com/mabd-dev/gh-oss-stats/internal/analytics.mixpanelToken=${{ secrets.MIXPANEL_TOKEN }}" ./cmd/gh-oss-stats

- name: Verify binaries
run: |
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.claude
.serena
.mcp.json
claude.local.md
commands.nu
/gh-oss-stats
scripts/
Expand Down
189 changes: 0 additions & 189 deletions CLAUDE.md

This file was deleted.

27 changes: 26 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ Customize your badge by passing inputs to the action:
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
badge-path: 'images/oss-badge.svg'
badge-style: 'detailed' # summary, compact, or detailed
badge-style: 'detailed' # summary, compact, or detailed
badge-theme: 'nord' # dark, light, nord, dracula, gruvbox-light, gruvbox-dark, etc...
badge-variant: 'text-based' # default or text-based
min-stars: '100' # Filter repos by minimum stars
Expand Down Expand Up @@ -131,6 +131,31 @@ For local development or custom integrations, see [docs/TECHNICAL.md](docs/TECHN

📖 **Full technical documentation:** [docs/TECHNICAL.md](docs/TECHNICAL.md)

***

## Telemetry

`gh-oss-stats` collects anonymous usage data to help understand how the tool
is used and improve it over time. You'll see a one-time notice about this on
first run.

**What is collected:**
- `os` — operating system (linux, windows, darwin)
- `version` — tool version being used
- `ci` — whether the tool is running in a CI environment

Nothing personal is collected — no usernames, tokens, or file paths.
Events are sent to a [mixpanel](https://mixpanel.com/home/) (a third-party analytics service) and visible only to the maintainer.

### Disable telemetry

Add this to your shell config (`~/.zshrc` or `~/.bashrc`):
```sh
export GH_OSS_STATS_TELEMETRY_DISABLED=1
```

***

## License

See [LICENSE](LICENSE) file.
Expand Down
8 changes: 7 additions & 1 deletion cmd/gh-oss-stats/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,34 @@ package main
import (
"fmt"
"os"

"github.com/mabd-dev/gh-oss-stats/internal/telemetry"
)

const version = "0.3.2"
const version = "0.3.5"

func main() {
args := os.Args[1:]

if len(args) == 0 {
telemetry.Send(version)
runMainCmd(args)
return
}

// Route to sub-commands, or fallback to main command
switch args[0] {
case "badge":
telemetry.Send(version)
runBadgeCmd(args[1:])
case "demo":
telemetry.Send(version)
runDemoCmd(args[1:])
case "version":
fmt.Printf("gh-oss-stats v%s\n", version)
os.Exit(0)
default:
telemetry.Send(version)
runMainCmd(args)
}
}
15 changes: 15 additions & 0 deletions docs/release-notes/v0.3.5.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Release Notes: v0.3.5

Release Date: April XX, 2026
Codename:


## ✨ Features

- **NEW**: add anonymous usage telemetry via Mixpanel

Collects anonymous usage data (os, version, ci) on each run.
Disable with GH_OSS_STATS_TELEMETRY_DISABLED=1.
See README for full details.


5 changes: 5 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
module github.com/mabd-dev/gh-oss-stats

go 1.25.4

require (
github.com/google/uuid v1.6.0
github.com/mixpanel/mixpanel-go v1.2.1
)
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/mixpanel/mixpanel-go v1.2.1 h1:iykbHKomTJjVoWU95Vt1sjZy4HLt8UOYacMEEEMFBok=
github.com/mixpanel/mixpanel-go v1.2.1/go.mod h1:mPGaNhBoZMJuLu8k7Y1KhU5n8Vw13rxQZZjHj+b9RLk=
39 changes: 39 additions & 0 deletions internal/analytics/analytics.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package analytics

import (
"context"

"github.com/mixpanel/mixpanel-go"
)

var mixpanelToken = ""

type Analytics struct {
userUUID string
Client *mixpanel.ApiClient
}

func CreateAnalytics(userUUID string) Analytics {
mixpanelClient := mixpanel.NewApiClient(mixpanelToken)
return Analytics{
userUUID: userUUID,
Client: mixpanelClient,
}
}

func (analytics Analytics) Track(name string, params map[string]any) error {
ctx := context.Background()
return analytics.Client.Track(ctx, []*mixpanel.Event{
analytics.Client.NewEvent(name, analytics.userUUID, params),
})
}

func (analytics Analytics) TrackToolUsage(os string, version string, ci bool) error {
params := map[string]any{
"os": os,
"tool-version": version,
"ci": ci,
"project": "gh-oss-stats",
}
return analytics.Track("usage", params)
}
Loading
Loading