You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CLAUDE.md
+35-2Lines changed: 35 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,8 @@ ShellTime CLI is a Go-based command-line tool for tracking DevOps work. It consi
10
10
11
11
## Development Commands
12
12
13
+
**Requires Go 1.25+**
14
+
13
15
### Building
14
16
```bash
15
17
# Build the CLI binary
@@ -36,12 +38,19 @@ go test ./model/...
36
38
go test -run TestHandlerName ./daemon/
37
39
```
38
40
41
+
Tests use **testify** (assertions + suites). Suite-based tests use `suite.Suite` with `SetupTest`/`TearDownTest` lifecycle hooks (see `daemon/cc_info_handler_test.go` for example). Simple functions use table-driven tests.
# Generate PromptPal types (requires pp CLI and API token)
49
+
pp g
43
50
```
44
51
52
+
CI runs both `mockery` and `pp g` before tests. Generated files: `model/pp.types.g.go` (PromptPal types), `model/mock_*.go` (testify mocks for service interfaces).
53
+
45
54
### Linting
46
55
```bash
47
56
go vet ./...
@@ -69,7 +78,16 @@ Injection happens in `cmd/*/main.go` via `commands.InjectVar()` and `commands.In
69
78
1.**SocketHandler**: Unix domain socket server accepting JSON messages from CLI
70
79
2.**GoChannel**: Watermill pub/sub for decoupled message processing
71
80
3.**SocketTopicProcessor**: Consumes messages and routes to appropriate handlers
72
-
4.**AICodeOtelServer** (optional): gRPC server implementing OTEL collector for AI coding CLI metrics/logs passthrough (Claude Code, Codex, etc.)
81
+
82
+
Optional daemon services (feature-gated via config):
83
+
-**CCInfoTimerService**: Lazy-fetch background timer for Claude Code statusline data (cost, quota, git info)
84
+
-**SyncCircuitBreakerService**: Retry failed syncs with file-based persistence (`sync_pending.log`) and hourly recovery timer
85
+
-**AICodeOtelServer**: gRPC OTEL collector for AI coding CLI metrics/logs (Claude Code, Codex)
86
+
-**HeartbeatResyncService**: Periodic resync of failed heartbeats (30-min interval)
Services initialize in `cmd/daemon/main.go`: check enabled flag → create → start → defer stop. All run concurrently with graceful shutdown on SIGINT/SIGTERM.
-**Message Queue**: `ThreeDotsLabs/watermill` (in-process pub/sub for daemon)
112
+
-**AI Integration**: `PromptPal/go-sdk` with generated types from `promptpal.yml`
113
+
-**Telemetry**: `uptrace-go` for OTEL
114
+
-**Config**: `pelletier/go-toml/v2`
115
+
-**Git**: `go-git/v5` for branch/dirty detection
116
+
-**gRPC**: OTEL collector protos for AICodeOtel server
117
+
118
+
## Release
119
+
120
+
Releases use Release-Please (always-bump-patch) + Goreleaser. macOS builds include code signing/notarization via Quill when credentials are present. CI config in `.github/workflows/`.
121
+
90
122
## Important Notes
91
123
92
124
- Daemon is optional but recommended (<8ms latency vs ~100ms+ direct)
93
125
- Encryption requires daemon mode and a token with encryption capability
94
126
- Shell hooks are platform-specific (bash, zsh, fish) - test on target shells
127
+
- CC statusline quota display is macOS-only (requires Keychain access to Claude Code OAuth token)
95
128
- AICodeOtel feature enables AI coding CLI metrics/logs passthrough via gRPC (port 54027) - supports Claude Code, Codex, and other OTEL-compatible CLIs
0 commit comments