Skip to content

Commit 83ce75d

Browse files
committed
feat: simplify architectures
1 parent c613cdd commit 83ce75d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+5698
-2842
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,24 +22,31 @@ jobs:
2222

2323
test:
2424
name: Test
25-
runs-on: macos-latest
25+
runs-on: ${{ matrix.os }}
26+
strategy:
27+
matrix:
28+
os: [ubuntu-latest, macos-latest] # Linux + macOS coverage
2629
steps:
2730
- uses: actions/checkout@v4
2831
- uses: actions/setup-go@v6
2932
with:
3033
go-version: '1.25'
31-
- run: go test -v -race ./...
34+
- run: go test -v -race ./... # -race catches data races
3235

3336
build:
3437
name: Build
35-
runs-on: macos-latest
38+
runs-on: ${{ matrix.os }}
3639
needs: [lint, test]
3740
strategy:
3841
matrix:
42+
os: [ubuntu-latest, macos-latest] # Match test platforms
3943
arch: [amd64, arm64]
44+
exclude:
45+
- os: ubuntu-latest
46+
arch: arm64 # Skip Linux arm64 if slow
4047
steps:
4148
- uses: actions/checkout@v4
4249
- uses: actions/setup-go@v6
4350
with:
4451
go-version: '1.25'
45-
- run: GOARCH=${{ matrix.arch }} go build -o codeme .
52+
- run: GOOS=${{ matrix.os == 'ubuntu-latest' && 'linux' || 'darwin' }} GOARCH=${{ matrix.arch }} CGO_ENABLED=0 go build -ldflags="-s -w" -o codeme .

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
codeme
2-
*_test.go

.goreleaser.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ builds:
55
- CGO_ENABLED=0
66
goos:
77
- darwin
8+
- linux
89
goarch:
910
- amd64
1011
- arm64

README.md

Lines changed: 39 additions & 126 deletions
Original file line numberDiff line numberDiff line change
@@ -1,167 +1,80 @@
11
# CodeMe
22

3-
> Zero-config coding activity tracker written in Go
3+
> Private coding activity tracker that just works
44
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.
66

7-
## Installation
7+
## Install
88

99
```bash
10-
# Using go install
1110
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
1711
```
1812

19-
## Usage
20-
21-
### Quick Start
13+
Or build from source:
2214

2315
```bash
24-
# Show help
25-
codeme help
16+
git clone https://github.com/tduyng/codeme
17+
cd codeme && just install
18+
```
2619

27-
# Show version
28-
codeme version
20+
## Quick Start
2921

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+
```
3228

33-
# Today's activity only
34-
codeme today
29+
## Neovim Plugin
3530

36-
# List projects
37-
codeme projects
31+
Install [codeme.nvim](https://github.com/tduyng/codeme.nvim) for automatic tracking and a beautiful dashboard:
3832

39-
# JSON output (for integrations)
40-
codeme stats --json
33+
```lua
34+
{ "tduyng/codeme.nvim" }
4135
```
4236

43-
### Automatic Tracking (Recommended)
37+
The plugin tracks automatically when you:
4438

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
4940
- Switch back to Neovim
41+
- Work across different projects
5042

51-
See "Integration with Editors" section below for setup.
52-
53-
### Track Activity Manually (Advanced)
43+
No manual tracking needed.
5444

55-
The track command is mainly used by editor integrations. You rarely need to call it manually.
45+
This tracks:
5646

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
7452

75-
## Data Storage
53+
## Your Data
7654

77-
All data is stored locally and persists across versions:
55+
Everything stays on your machine:
7856

7957
```
8058
~/.local/share/codeme/codeme.db
8159
```
8260

83-
## Architecture
61+
No telemetry. No accounts. No cloud sync. Just you and your code.
8462

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
9564

96-
## Development
97-
98-
### Build and Install
65+
Mostly used by editor integrations, but you can track manually:
9966

10067
```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
12270
```
12371

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
15873

15974
```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
16578
```
16679

16780
## License

0 commit comments

Comments
 (0)