Skip to content

Commit e476146

Browse files
AnnatarHeclaude
andcommitted
docs(cli): polish CLAUDE.md and condense README.md
Improve CLAUDE.md with more accurate architecture details including Watermill pub/sub messaging, dependency injection patterns, and local config file support. Condense README.md from 550 to 80 lines while preserving essential information. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 4c85b8b commit e476146

2 files changed

Lines changed: 54 additions & 522 deletions

File tree

CLAUDE.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ go test -run TestHandlerName ./daemon/
4141
# Install mockery if not already installed
4242
go install github.com/vektra/mockery/v2@v2.42.0
4343

44-
# Generate mocks
45-
go generate ./...
44+
# Generate mocks (uses .mockery.yml configuration)
45+
mockery
4646
```
4747

4848
### Linting
@@ -67,8 +67,8 @@ go fmt ./...
6767
- Hook management for shell integrations (bash, zsh, fish)
6868

6969
- **daemon/**: Daemon service implementation
70-
- Socket-based IPC communication with CLI
71-
- Async command processing and batch synchronization
70+
- Unix domain socket-based IPC communication with CLI
71+
- Watermill pub/sub messaging for async command processing
7272
- Channel-based architecture for concurrent operations
7373

7474
- **model/**: Core business logic and data models
@@ -80,10 +80,11 @@ go fmt ./...
8080
### Key Architectural Patterns
8181

8282
1. **Command Pattern**: Each CLI command implements the `urfave/cli/v2` command interface
83-
2. **Service Pattern**: ConfigService interface for configuration management
83+
2. **Service Pattern**: Interfaces (ConfigService, AIService, CommandService) with dependency injection via `commands.InjectVar()` and `commands.InjectAIService()`
8484
3. **IPC Communication**: Unix domain sockets for CLI-daemon communication
85-
4. **Batch Processing**: Commands are buffered locally and synced in batches
86-
5. **Encryption**: Hybrid RSA/AES-GCM encryption for secure command transmission
85+
4. **Pub/Sub Messaging**: Watermill GoChannel for internal daemon message routing
86+
5. **Batch Processing**: Commands are buffered locally and synced in batches
87+
6. **Encryption**: Hybrid RSA/AES-GCM encryption for secure command transmission
8788

8889
### Data Flow
8990
1. Shell hooks capture commands →
@@ -93,6 +94,7 @@ go fmt ./...
9394

9495
### Configuration
9596
- Config file location: `$HOME/.shelltime/config.toml`
97+
- Local overrides: `$HOME/.shelltime/config.local.toml` (merged with main config, not committed to version control)
9698
- Database location: `$HOME/.shelltime/shelltime.db`
9799
- Daemon socket: `/tmp/shelltime-daemon.sock` (Unix) or named pipe (Windows)
98100

0 commit comments

Comments
 (0)