|
| 1 | +# CodeMe |
| 2 | + |
| 3 | +> Zero-config coding activity tracker written in Go |
| 4 | +
|
| 5 | +Track your coding activity with automatic detection of projects, languages, and branches. Designed to work seamlessly with editor integrations. |
| 6 | + |
| 7 | +## Installation |
| 8 | + |
| 9 | +```bash |
| 10 | +# Using go install |
| 11 | +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 | +``` |
| 18 | + |
| 19 | +## Usage |
| 20 | + |
| 21 | +### Quick Start |
| 22 | + |
| 23 | +```bash |
| 24 | +# Show help |
| 25 | +codeme help |
| 26 | + |
| 27 | +# Show version |
| 28 | +codeme version |
| 29 | + |
| 30 | +# View your stats |
| 31 | +codeme stats |
| 32 | + |
| 33 | +# Today's activity only |
| 34 | +codeme today |
| 35 | + |
| 36 | +# List projects |
| 37 | +codeme projects |
| 38 | + |
| 39 | +# JSON output (for integrations) |
| 40 | +codeme stats --json |
| 41 | +``` |
| 42 | + |
| 43 | +### Automatic Tracking (Recommended) |
| 44 | + |
| 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 |
| 49 | +- Switch back to Neovim |
| 50 | + |
| 51 | +See "Integration with Editors" section below for setup. |
| 52 | + |
| 53 | +### Track Activity Manually (Advanced) |
| 54 | + |
| 55 | +The track command is mainly used by editor integrations. You rarely need to call it manually. |
| 56 | + |
| 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) |
| 74 | + |
| 75 | +## Data Storage |
| 76 | + |
| 77 | +All data is stored locally and persists across versions: |
| 78 | + |
| 79 | +``` |
| 80 | +~/.local/share/codeme/codeme.db |
| 81 | +``` |
| 82 | + |
| 83 | +## Architecture |
| 84 | + |
| 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 | +``` |
| 95 | + |
| 96 | +## Development |
| 97 | + |
| 98 | +### Build and Install |
| 99 | + |
| 100 | +```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 | +### Integration with Editors |
| 112 | + |
| 113 | +#### Neovim |
| 114 | + |
| 115 | +Install [codeme.nvim](https://github.com/tduyng/codeme.nvim) for a beautiful dashboard: |
| 116 | + |
| 117 | +```lua |
| 118 | +{ |
| 119 | + "tduyng/codeme.nvim", |
| 120 | + dependencies = { "nvzone/volt" }, |
| 121 | + config = function() |
| 122 | + require("codeme").setup() |
| 123 | + end, |
| 124 | +} |
| 125 | +``` |
| 126 | + |
| 127 | +The plugin automatically tracks files and provides: |
| 128 | + |
| 129 | +- 3-tab dashboard - Overview, Languages, Activity |
| 130 | +- GitHub-style activity heatmap - 7 months of coding history |
| 131 | +- Language breakdown - with visual bar graphs |
| 132 | +- Streak tracking - maintain momentum |
| 133 | +- Auto-tracking - on file open, save, and focus |
| 134 | + |
| 135 | +Commands: |
| 136 | + |
| 137 | +- `:CodeMe` - Open dashboard |
| 138 | +- `:CodeMeTrack` - Manually track current file |
| 139 | +- `:CodeMeToday` - Show today's stats |
| 140 | +- `:CodeMeProjects` - Show project breakdown |
| 141 | + |
| 142 | +#### Other Editors |
| 143 | + |
| 144 | +The CLI is designed to be editor-agnostic. Integrate by calling: |
| 145 | + |
| 146 | +```bash |
| 147 | +# On file save |
| 148 | +codeme track --file "$FILE_PATH" --lang "$LANGUAGE" --lines "$LINE_COUNT" |
| 149 | + |
| 150 | +# Get stats (JSON format) |
| 151 | +codeme stats --json |
| 152 | +``` |
| 153 | + |
| 154 | +## License |
| 155 | + |
| 156 | +MIT |
0 commit comments