Skip to content

Commit 3ff064b

Browse files
committed
Add the AI usage badge and pinned agent-badge tooling
Display aggregate token usage through the repository's public gist and make the badge CLI available in each Nix development shell. Keep refresh manual and local state out of Git.
1 parent 99c8999 commit 3ff064b

5 files changed

Lines changed: 136 additions & 1 deletion

File tree

.github/agent-badge/config.json

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"version": 1,
3+
"providers": {
4+
"codex": {
5+
"enabled": true
6+
},
7+
"claude": {
8+
"enabled": true
9+
},
10+
"grok": {
11+
"enabled": true
12+
}
13+
},
14+
"repo": {
15+
"aliases": {
16+
"remotes": [],
17+
"slugs": []
18+
}
19+
},
20+
"badge": {
21+
"label": "AI burn",
22+
"mode": "tokens",
23+
"style": "flat",
24+
"color": "#E8A515",
25+
"colorZero": "lightgrey",
26+
"cacheSeconds": 300
27+
},
28+
"publish": {
29+
"provider": "github-gist",
30+
"gistId": "8e84087d2b366ca46922d83c53177eb7",
31+
"badgeUrl": "https://img.shields.io/endpoint?url=https%3A%2F%2Fgist.githubusercontent.com%2Fjbboehr%2F8e84087d2b366ca46922d83c53177eb7%2Fraw%2Fagent-badge.json&cacheSeconds=300"
32+
},
33+
"refresh": {
34+
"prePush": {
35+
"enabled": false,
36+
"mode": "fail-soft"
37+
}
38+
},
39+
"privacy": {
40+
"aggregateOnly": true,
41+
"output": "standard"
42+
}
43+
}

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,9 @@ result*
99
/.pre-commit-config.yaml
1010
/coverage/
1111
/vendor/
12+
13+
# agent-badge:gitignore:start
14+
.github/agent-badge/state.json
15+
.github/agent-badge/cache/
16+
.github/agent-badge/logs/
17+
# agent-badge:gitignore:end

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
[![ci](https://github.com/jbboehr/phpstan-array-merge/actions/workflows/ci.yml/badge.svg)](https://github.com/jbboehr/phpstan-array-merge/actions/workflows/ci.yml)
55
[![License: AGPL v3 with Romic Exception](https://img.shields.io/badge/License-AGPL_v3_with_Romic_Exception-blue.svg)](#license)
66
![stability-experimental](https://img.shields.io/badge/stability-experimental-orange.svg)
7+
[![AI burn](https://img.shields.io/endpoint?url=https%3A%2F%2Fgist.githubusercontent.com%2Fjbboehr%2F8e84087d2b366ca46922d83c53177eb7%2Fraw%2Fagent-badge.json&cacheSeconds=300)](https://github.com/arlegotin/agent-badge)
78

89
## Installation
910

flake.lock

Lines changed: 79 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@
2323
nixpkgs-php81.url = "github:nixos/nixpkgs/nixos-25.05";
2424
systems.url = "github:nix-systems/default";
2525

26+
agent-badge = {
27+
url = "github:jbboehr/agent-badge.ts/master";
28+
inputs.nixpkgs.follows = "nixpkgs";
29+
};
30+
2631
git-hooks = {
2732
url = "github:cachix/git-hooks.nix";
2833
inputs.nixpkgs.follows = "nixpkgs";
@@ -35,6 +40,7 @@
3540
nixpkgs,
3641
nixpkgs-php81,
3742
systems,
43+
agent-badge,
3844
git-hooks,
3945
}:
4046
let
@@ -84,6 +90,7 @@
8490
in
8591
pkgs.mkShell {
8692
packages = pre-commit-check.enabledPackages ++ [
93+
agent-badge.packages.${system}.default
8794
pkgs.mdl
8895
php'
8996
php'.packages.composer

0 commit comments

Comments
 (0)