bashstats 0.1.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/NUL ADDED
@@ -0,0 +1,10 @@
1
+ Traceback (most recent call last):
2
+ File "<string>", line 4, in <module>
3
+ for line in f:
4
+ ^
5
+ File "C:\Program Files\Python314\Lib\encodings\cp1252.py", line 23, in decode
6
+ return codecs.charmap_decode(input,self.errors,decoding_table)[0]
7
+ ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8
+ UnicodeDecodeError: 'charmap' codec can't decode byte 0x8f in position 3569: character maps to <undefined>
9
+ Exception ignored while flushing sys.stdout:
10
+ OSError: [Errno 22] Invalid argument
package/README.md ADDED
@@ -0,0 +1,186 @@
1
+ # bashstats
2
+ <img width="1727" height="916" alt="bashstats2" src="https://github.com/user-attachments/assets/4029e711-f559-4771-9490-dedd4aeec1ee" />
3
+
4
+ Track every prompt, tool call, and late-night coding session. Earn badges. Build streaks. Watch your rank climb from Bronze to Obsidian.
5
+ bashstats hooks into Claude Code and quietly records everything — sessions, prompts, tool usage, errors, and streaks. It then turns it all into stats,
6
+ achievements, and a dashboard you'll check way too often.
7
+
8
+ ## Install
9
+
10
+ ```bash
11
+ npm install -g bashstats
12
+ bashstats init
13
+ ```
14
+
15
+ `bashstats init` installs Claude Code hooks and creates the local database at `~/.bashstats/bashstats.db`. Stats begin recording immediately.
16
+
17
+ ## CLI Commands
18
+
19
+ | Command | Description |
20
+ |---|---|
21
+ | `bashstats init` | Install hooks and set up database |
22
+ | `bashstats stats` | Quick stat summary in your terminal |
23
+ | `bashstats achievements` | List all badges with progress bars |
24
+ | `bashstats streak` | Show current and longest daily streak |
25
+ | `bashstats web` | Launch the browser dashboard |
26
+ | `bashstats export` | Export all data as JSON |
27
+ | `bashstats reset` | Wipe all data |
28
+ | `bashstats uninstall` | Remove hooks and data |
29
+
30
+ ### Options
31
+
32
+ ```bash
33
+ bashstats web --port 8080 # Custom port (default: 17900)
34
+ bashstats web --no-open # Don't auto-open browser
35
+ ```
36
+
37
+ ## Dashboard
38
+
39
+ The browser dashboard at `http://localhost:17900` includes:
40
+
41
+ - **Overview** - Recent badges, rank progress, stat cards, activity heatmap, and recent sessions at a glance
42
+ - **Stats** - Lifetime totals, tool breakdowns, time analysis, session records, and project stats in a 2x2 grid
43
+ - **Achievements** - All 53 badges with tier progress, organized by category
44
+ - **Timeline** - Activity heatmap and session history with sparkline charts
45
+
46
+ ## What Gets Tracked
47
+
48
+ bashstats hooks into 12 Claude Code events:
49
+
50
+ | Event | What it records |
51
+ |---|---|
52
+ | SessionStart | Session creation, project, agent type |
53
+ | UserPromptSubmit | Prompt content, character/word counts |
54
+ | PreToolUse | Tool invocations (Bash, Read, Edit, etc.) |
55
+ | PostToolUse | Tool results and exit codes |
56
+ | PostToolUseFailure | Failed tool calls |
57
+ | Stop | Session end time and duration |
58
+ | Notification | Errors and rate limits |
59
+ | SubagentStart | Subagent spawns |
60
+ | SubagentStop | Subagent completions |
61
+ | PreCompact | Context compactions |
62
+ | PermissionRequest | Permission prompts |
63
+ | Setup | Initialization events |
64
+
65
+ ## Achievements
66
+ <img width="1732" height="917" alt="bashstats" src="https://github.com/user-attachments/assets/63591b76-54ff-4659-b81a-e6310810e364" />
67
+
68
+ 53 badges across 10 categories, each with 5 tiers: Bronze, Silver, Gold, Diamond, Obsidian.
69
+
70
+ ### Volume
71
+ - **First Prompt** - Submit prompts to Claude
72
+ - **Tool Time** - Make tool calls
73
+ - **Marathon** - Spend hours in sessions
74
+ - **Wordsmith** - Type characters in prompts
75
+ - **Session Vet** - Complete sessions
76
+
77
+ ### Tool Mastery
78
+ - **Shell Lord** - Execute Bash commands
79
+ - **Bookworm** - Read files
80
+ - **Editor-in-Chief** - Edit files
81
+ - **Architect** - Create files
82
+ - **Detective** - Search with Grep and Glob
83
+ - **Web Crawler** - Fetch web pages
84
+ - **Delegator** - Spawn subagents
85
+
86
+ ### Time & Streaks
87
+ - **Iron Streak** - Maintain a daily streak
88
+ - **Night Owl** - Prompts between midnight and 5am
89
+ - **Early Bird** - Prompts between 5am and 8am
90
+ - **Weekend Warrior** - Weekend sessions
91
+
92
+ ### Behavioral
93
+ - **Creature of Habit** - Repeat your most-used prompt
94
+ - **Explorer** - Use unique tool types
95
+ - **Planner** - Use plan mode
96
+ - **Novelist** - Write prompts over 1000 characters
97
+ - **Speed Demon** - Complete sessions in under 5 minutes
98
+
99
+ ### Resilience
100
+ - **Clean Hands** - Longest error-free tool streak
101
+ - **Resilient** - Survive errors
102
+ - **Rate Limited** - Hit rate limits
103
+
104
+ ### Shipping & Projects
105
+ - **Shipper** - Make commits via Claude
106
+ - **PR Machine** - Create pull requests
107
+ - **Empire** - Work on unique projects
108
+ - **Polyglot** - Use different programming languages
109
+
110
+ ### Multi-Agent
111
+ - **Buddy System** - Use concurrent agents
112
+ - **Hive Mind** - Spawn subagents total
113
+
114
+ ### Humor
115
+ - **Please and Thank You** - "You're polite to the AI. When they take over, you'll be spared."
116
+ - **Wall of Text** - "Claude read your entire novel and didn't even complain."
117
+ - **The Fixer** - "At this point just rewrite the whole thing."
118
+ - **What Day Is It?** - "Your chair is now a part of you."
119
+ - **Copy Pasta** - "Maybe if I ask again it'll work differently."
120
+ - **Error Magnet** - "At this point, the errors are a feature."
121
+
122
+ ### Aspirational (Obsidian-only)
123
+ - **The Machine** - "You are no longer using the tool. You are the tool."
124
+ - **Year of Code** - "365 days. No breaks. Absolute unit."
125
+ - **Million Words** - "You've written more to Claude than most people write in a lifetime."
126
+ - **Lifer** - "At this point, Claude is your cofounder."
127
+ - **Transcendent** - "You've reached the peak. The view is nice up here."
128
+ - **Omniscient** - "You've mastered every tool. There is nothing left to teach you."
129
+
130
+ ### Secret
131
+ 10 hidden badges unlocked by specific behaviors. Discover them yourself.
132
+
133
+ ## Rank System
134
+
135
+ XP is earned from badge tiers. Your rank progresses through:
136
+
137
+ | Rank | XP Required |
138
+ |---|---|
139
+ | Bronze | 0 |
140
+ | Silver | 1,000 |
141
+ | Gold | 5,000 |
142
+ | Diamond | 25,000 |
143
+ | Obsidian | 100,000 |
144
+
145
+ ## Agent Support
146
+
147
+ bashstats detects which CLI agent is running:
148
+
149
+ - Claude Code (default)
150
+ - Gemini CLI
151
+ - Copilot CLI
152
+ - OpenCode
153
+
154
+ ## Data Storage
155
+
156
+ All data is stored locally in `~/.bashstats/bashstats.db` (SQLite with WAL mode). Nothing is sent anywhere. Tables:
157
+
158
+ - `events` - Every hook event with full context
159
+ - `sessions` - Session lifecycle (start, end, duration, counts)
160
+ - `prompts` - Prompt content and word/char counts
161
+ - `daily_activity` - Aggregated daily stats
162
+ - `achievement_unlocks` - Badge tier unlock timestamps
163
+
164
+ ## Tech Stack
165
+
166
+ - TypeScript + Node.js 18+
167
+ - SQLite via `better-sqlite3`
168
+ - Express for the dashboard server
169
+ - Commander for the CLI
170
+ - tsup for bundling
171
+ - vitest for tests
172
+
173
+ ## Development
174
+
175
+ ```bash
176
+ git clone https://github.com/GhostPeony/bashstats.git
177
+ cd bashstats
178
+ npm install
179
+ npm run build
180
+ npm link
181
+ bashstats init
182
+ ```
183
+
184
+ ## License
185
+
186
+ MIT