|
1 | 1 | # CodeMe |
2 | 2 |
|
3 | | -> Zero-config coding activity tracker written in Go |
| 3 | +> Private coding activity tracker that just works |
4 | 4 |
|
5 | | -Track your coding activity with automatic detection of projects, languages, and branches. Designed to work seamlessly with editor integrations. |
| 5 | +Track your coding sessions automatically. No account, no cloud, no config—just insights. |
6 | 6 |
|
7 | | -## Installation |
| 7 | +## Install |
8 | 8 |
|
9 | 9 | ```bash |
10 | | -# Using go install |
11 | 10 | go install github.com/tduyng/codeme@latest |
12 | | - |
13 | | -# Or build from source |
14 | | -git clone https://github.com/tduyng/codeme |
15 | | -cd codeme |
16 | | -just install |
17 | 11 | ``` |
18 | 12 |
|
19 | | -## Usage |
20 | | - |
21 | | -### Quick Start |
| 13 | +Or build from source: |
22 | 14 |
|
23 | 15 | ```bash |
24 | | -# Show help |
25 | | -codeme help |
| 16 | +git clone https://github.com/tduyng/codeme |
| 17 | +cd codeme && just install |
| 18 | +``` |
26 | 19 |
|
27 | | -# Show version |
28 | | -codeme version |
| 20 | +## Quick Start |
29 | 21 |
|
30 | | -# View your stats |
31 | | -codeme stats |
| 22 | +```bash |
| 23 | +codeme stats # View your coding stats |
| 24 | +codeme today # Today's activity |
| 25 | +codeme projects # Project breakdown |
| 26 | +codeme api # JSON output for integrations |
| 27 | +``` |
32 | 28 |
|
33 | | -# Today's activity only |
34 | | -codeme today |
| 29 | +## Neovim Plugin |
35 | 30 |
|
36 | | -# List projects |
37 | | -codeme projects |
| 31 | +Install [codeme.nvim](https://github.com/tduyng/codeme.nvim) for automatic tracking and a beautiful dashboard: |
38 | 32 |
|
39 | | -# JSON output (for integrations) |
40 | | -codeme stats --json |
| 33 | +```lua |
| 34 | +{ "tduyng/codeme.nvim" } |
41 | 35 | ``` |
42 | 36 |
|
43 | | -### Automatic Tracking (Recommended) |
| 37 | +The plugin tracks automatically when you: |
44 | 38 |
|
45 | | -Use the [codeme.nvim](https://github.com/tduyng/codeme.nvim) plugin for automatic tracking in Neovim. It tracks when you: |
46 | | - |
47 | | -- Open files |
48 | | -- Save files |
| 39 | +- Open and save files |
49 | 40 | - Switch back to Neovim |
| 41 | +- Work across different projects |
50 | 42 |
|
51 | | -See "Integration with Editors" section below for setup. |
52 | | - |
53 | | -### Track Activity Manually (Advanced) |
| 43 | +No manual tracking needed. |
54 | 44 |
|
55 | | -The track command is mainly used by editor integrations. You rarely need to call it manually. |
| 45 | +This tracks: |
56 | 46 |
|
57 | | -```bash |
58 | | -# Track a file (called by codeme.nvim automatically) |
59 | | -codeme track --file /path/to/file.go --lines 100 |
60 | | - |
61 | | -# Specify language manually |
62 | | -codeme track --file /path/to/file.txt --lang plaintext --lines 50 |
63 | | -``` |
64 | | - |
65 | | -## Features |
66 | | - |
67 | | -- Zero configuration - works out of the box |
68 | | -- Auto-detection - project, language, and git branch |
69 | | -- Session tracking - 15-minute idle timeout |
70 | | -- Streak calculation - maintain your coding momentum |
71 | | -- SQLite storage - all data stored locally |
72 | | -- JSON API - easy integration with editors and tools |
73 | | -- Neovim plugin - beautiful dashboard with [codeme.nvim](https://github.com/tduyng/codeme.nvim) |
| 47 | +- Sessions - 15min idle timeout groups your work |
| 48 | +- Projects - Auto-detected from git repos |
| 49 | +- Languages - Detected from file extensions |
| 50 | +- Streaks - Keep your momentum going |
| 51 | +- Branches - Know what you worked on |
74 | 52 |
|
75 | | -## Data Storage |
| 53 | +## Your Data |
76 | 54 |
|
77 | | -All data is stored locally and persists across versions: |
| 55 | +Everything stays on your machine: |
78 | 56 |
|
79 | 57 | ``` |
80 | 58 | ~/.local/share/codeme/codeme.db |
81 | 59 | ``` |
82 | 60 |
|
83 | | -## Architecture |
| 61 | +No telemetry. No accounts. No cloud sync. Just you and your code. |
84 | 62 |
|
85 | | -``` |
86 | | -codeme/ |
87 | | -├── main.go # CLI entry point |
88 | | -├── core/ |
89 | | -│ ├── storage.go # SQLite operations |
90 | | -│ ├── tracker.go # Activity tracking |
91 | | -│ ├── detector.go # Auto-detection logic |
92 | | -│ └── stats.go # Statistics calculation |
93 | | -└── go.mod |
94 | | -``` |
| 63 | +## Manual Tracking |
95 | 64 |
|
96 | | -## Development |
97 | | - |
98 | | -### Build and Install |
| 65 | +Mostly used by editor integrations, but you can track manually: |
99 | 66 |
|
100 | 67 | ```bash |
101 | | -# Install development version |
102 | | -just install |
103 | | - |
104 | | -# Run tests |
105 | | -just test |
106 | | - |
107 | | -# Run locally |
108 | | -go run . stats |
109 | | -``` |
110 | | - |
111 | | -### Debug from database |
112 | | -```bash |
113 | | -# Check if activities exist |
114 | | -sqlite3 ~/.local/share/codeme/codeme.db "SELECT COUNT(*) FROM activities;" |
115 | | - |
116 | | -# If > 0, check API output |
117 | | -codeme api | jq '.this_week.total_time' |
118 | | - |
119 | | -# If 0, use debug version |
120 | | -# Replace bridge.go with debug_bridge artifact |
121 | | -go build && ./codeme api 2>&1 | grep DEBUG |
| 68 | +codeme track --file main.go --lines 50 |
| 69 | +codeme track --file script.py --lang python --lines 100 |
122 | 70 | ``` |
123 | 71 |
|
124 | | -### Integration with Editors |
125 | | - |
126 | | -#### Neovim |
127 | | - |
128 | | -Install [codeme.nvim](https://github.com/tduyng/codeme.nvim) for a beautiful dashboard: |
129 | | - |
130 | | -```lua |
131 | | -{ |
132 | | - "tduyng/codeme.nvim", |
133 | | - dependencies = { "nvzone/volt" }, |
134 | | - config = function() |
135 | | - require("codeme").setup() |
136 | | - end, |
137 | | -} |
138 | | -``` |
139 | | - |
140 | | -The plugin automatically tracks files and provides: |
141 | | - |
142 | | -- 3-tab dashboard - Overview, Languages, Activity |
143 | | -- GitHub-style activity heatmap - 7 months of coding history |
144 | | -- Language breakdown - with visual bar graphs |
145 | | -- Streak tracking - maintain momentum |
146 | | -- Auto-tracking - on file open, save, and focus |
147 | | - |
148 | | -Commands: |
149 | | - |
150 | | -- `:CodeMe` - Open dashboard |
151 | | -- `:CodeMeTrack` - Manually track current file |
152 | | -- `:CodeMeToday` - Show today's stats |
153 | | -- `:CodeMeProjects` - Show project breakdown |
154 | | - |
155 | | -#### Other Editors |
156 | | - |
157 | | -The CLI is designed to be editor-agnostic. Integrate by calling: |
| 72 | +## Development |
158 | 73 |
|
159 | 74 | ```bash |
160 | | -# On file save |
161 | | -codeme track --file "$FILE_PATH" --lang "$LANGUAGE" --lines "$LINE_COUNT" |
162 | | - |
163 | | -# Get stats (JSON format) |
164 | | -codeme stats --json |
| 75 | +just test # Run tests |
| 76 | +just install # Build and install |
| 77 | +go run . stats # Run locally |
165 | 78 | ``` |
166 | 79 |
|
167 | 80 | ## License |
|
0 commit comments