|
| 1 | +# Eyelet Usage Guide for Local Development |
| 2 | + |
| 3 | +## What is Eyelet? |
| 4 | + |
| 5 | +Eyelet is a hook orchestration system for Claude Code that captures and logs ALL AI agent interactions. It provides comprehensive monitoring, templating, and analytics for AI development workflows. |
| 6 | + |
| 7 | +## Installation & Setup |
| 8 | + |
| 9 | +### Quick Install (Recommended) |
| 10 | +```bash |
| 11 | +# Install and configure everything with auto-updates |
| 12 | +uvx eyelet@latest configure install-all --autoupdate |
| 13 | + |
| 14 | +# Enable SQLite logging for better performance |
| 15 | +uvx eyelet@latest configure logging --format sqlite |
| 16 | + |
| 17 | +# Verify installation |
| 18 | +uvx eyelet@latest doctor |
| 19 | +``` |
| 20 | + |
| 21 | +### Global Installation (Alternative) |
| 22 | +```bash |
| 23 | +# Install globally with pipx |
| 24 | +pipx install eyelet |
| 25 | + |
| 26 | +# Then use without uvx prefix |
| 27 | +eyelet doctor |
| 28 | +eyelet configure install-all --autoupdate |
| 29 | +``` |
| 30 | + |
| 31 | +## Core Commands |
| 32 | + |
| 33 | +### 1. Configuration & Setup |
| 34 | +```bash |
| 35 | +# Install all hooks with auto-updates |
| 36 | +uvx eyelet@latest configure install-all --autoupdate |
| 37 | + |
| 38 | +# Configure logging format (json, sqlite, or both) |
| 39 | +uvx eyelet@latest configure logging --format sqlite,json |
| 40 | + |
| 41 | +# Check configuration health |
| 42 | +uvx eyelet@latest doctor |
| 43 | + |
| 44 | +# Validate Claude settings |
| 45 | +uvx eyelet@latest validate settings |
| 46 | +``` |
| 47 | + |
| 48 | +### 2. Monitoring & Logs |
| 49 | +```bash |
| 50 | +# View recent logs |
| 51 | +uvx eyelet@latest logs --tail 20 |
| 52 | + |
| 53 | +# Follow logs in real-time |
| 54 | +uvx eyelet@latest logs --follow |
| 55 | + |
| 56 | +# Query SQLite database |
| 57 | +uvx eyelet@latest query search --text "error" |
| 58 | +uvx eyelet@latest query summary --last 24h |
| 59 | +uvx eyelet@latest query errors --last 1h |
| 60 | +``` |
| 61 | + |
| 62 | +### 3. Recall Feature (Search Conversations) |
| 63 | +```bash |
| 64 | +# Search Claude Code conversations |
| 65 | +uvx eyelet@latest recall "search term" |
| 66 | + |
| 67 | +# Filter by tool usage |
| 68 | +uvx eyelet@latest recall --tool Bash "command" |
| 69 | + |
| 70 | +# Filter by time |
| 71 | +uvx eyelet@latest recall --since 24h "error" |
| 72 | + |
| 73 | +# Limit results |
| 74 | +uvx eyelet@latest recall --limit 10 "function" |
| 75 | +``` |
| 76 | + |
| 77 | +### 4. Template Management |
| 78 | +```bash |
| 79 | +# List available templates |
| 80 | +uvx eyelet@latest template list |
| 81 | + |
| 82 | +# Install a template |
| 83 | +uvx eyelet@latest template install universal-logger |
| 84 | + |
| 85 | +# Show template details |
| 86 | +uvx eyelet@latest template show universal-logger |
| 87 | +``` |
| 88 | + |
| 89 | +### 5. Discovery |
| 90 | +```bash |
| 91 | +# Discover available hooks and tools |
| 92 | +uvx eyelet@latest discover |
| 93 | + |
| 94 | +# Show specific hook types |
| 95 | +uvx eyelet@latest discover --type PreToolUse |
| 96 | +``` |
| 97 | + |
| 98 | +## Integration with mise |
| 99 | + |
| 100 | +Add to your project's `.mise.toml`: |
| 101 | + |
| 102 | +```toml |
| 103 | +[tools] |
| 104 | +python = "3.11" |
| 105 | + |
| 106 | +[tasks.hooks-install] |
| 107 | +description = "Install eyelet hooks" |
| 108 | +run = "uvx eyelet@latest configure install-all --autoupdate" |
| 109 | + |
| 110 | +[tasks.hooks-doctor] |
| 111 | +description = "Check eyelet configuration" |
| 112 | +run = """ |
| 113 | +uvx eyelet@latest doctor |
| 114 | +echo "📌 Version: $(uvx eyelet@latest --version)" |
| 115 | +""" |
| 116 | + |
| 117 | +[tasks.hooks-logs] |
| 118 | +run = "uvx eyelet@latest logs --tail 20" |
| 119 | + |
| 120 | +# Shortcuts |
| 121 | +[tasks.hd] |
| 122 | +alias = "hooks-doctor" |
| 123 | +``` |
| 124 | + |
| 125 | +Then use: |
| 126 | +```bash |
| 127 | +mise run hooks-install |
| 128 | +mise run hd # Check configuration |
| 129 | +``` |
| 130 | + |
| 131 | +## Understanding Hook Logs |
| 132 | + |
| 133 | +Eyelet captures these hook types: |
| 134 | +- **PreToolUse/PostToolUse**: Tool execution monitoring |
| 135 | +- **UserPromptSubmit**: User input validation |
| 136 | +- **Stop/SubagentStop**: Session completion |
| 137 | +- **PreCompact**: Context management |
| 138 | +- **Notification**: User interactions |
| 139 | + |
| 140 | +Logs are stored in: |
| 141 | +``` |
| 142 | +./eyelet-hooks/ # Project-specific logs |
| 143 | +~/.eyelet-logging/ # Global logs |
| 144 | +~/.eyelet-logging/eyelet.db # SQLite database |
| 145 | +``` |
| 146 | + |
| 147 | +## Updating Eyelet |
| 148 | + |
| 149 | +```bash |
| 150 | +# Always use @latest for newest version |
| 151 | +uvx eyelet@latest [command] |
| 152 | + |
| 153 | +# Or force reinstall with uv tool |
| 154 | +uv tool install --reinstall eyelet@latest |
| 155 | + |
| 156 | +# Check current version |
| 157 | +uvx eyelet@latest --version |
| 158 | +``` |
| 159 | + |
| 160 | +## Common Use Cases |
| 161 | + |
| 162 | +### 1. Debug AI Agent Behavior |
| 163 | +```bash |
| 164 | +# Search for specific tool usage |
| 165 | +uvx eyelet@latest query search --tool Bash --text "git" |
| 166 | + |
| 167 | +# View error patterns |
| 168 | +uvx eyelet@latest query errors --last 24h |
| 169 | +``` |
| 170 | + |
| 171 | +### 2. Analyze Session Activity |
| 172 | +```bash |
| 173 | +# Get session summary |
| 174 | +uvx eyelet@latest query summary |
| 175 | + |
| 176 | +# View specific session |
| 177 | +uvx eyelet@latest query session <session-id> |
| 178 | +``` |
| 179 | + |
| 180 | +### 3. Monitor Real-Time Activity |
| 181 | +```bash |
| 182 | +# Watch hooks as they execute |
| 183 | +uvx eyelet@latest logs --follow |
| 184 | + |
| 185 | +# Filter by hook type |
| 186 | +uvx eyelet@latest logs --type PreToolUse --follow |
| 187 | +``` |
| 188 | + |
| 189 | +### 4. Search Historical Conversations |
| 190 | +```bash |
| 191 | +# Find conversations about specific topics |
| 192 | +uvx eyelet@latest recall "database migration" |
| 193 | + |
| 194 | +# Find when specific commands were used |
| 195 | +uvx eyelet@latest recall --tool Bash "docker" |
| 196 | +``` |
| 197 | + |
| 198 | +## Troubleshooting |
| 199 | + |
| 200 | +### If hooks aren't logging: |
| 201 | +1. Run `uvx eyelet@latest doctor` |
| 202 | +2. Check for unpinned versions warning |
| 203 | +3. Reinstall with: `uvx eyelet@latest configure install-all --autoupdate` |
| 204 | + |
| 205 | +### If SQLite isn't working: |
| 206 | +1. Enable it: `uvx eyelet@latest configure logging --format sqlite` |
| 207 | +2. Check database: `ls -la ~/.eyelet-logging/eyelet.db` |
| 208 | + |
| 209 | +### If updates aren't working: |
| 210 | +1. Always use `@latest`: `uvx eyelet@latest` |
| 211 | +2. Or force reinstall: `uv tool install --reinstall eyelet@latest` |
| 212 | + |
| 213 | +## Important Notes |
| 214 | + |
| 215 | +- **Designed for uvx**: Eyelet works best with `uvx eyelet@latest` |
| 216 | +- **Auto-updates**: Use `--autoupdate` flag when installing hooks |
| 217 | +- **Performance**: SQLite logging is faster than JSON for queries |
| 218 | +- **Privacy**: All logs are local - nothing is sent externally |
| 219 | + |
| 220 | +## Environment Variables |
| 221 | + |
| 222 | +```bash |
| 223 | +# Optional configuration |
| 224 | +export EYELET_LOG_LEVEL=INFO |
| 225 | +export EYELET_HOOKS_DIR=./eyelet-hooks |
| 226 | +``` |
| 227 | + |
| 228 | +## Quick Reference Card |
| 229 | + |
| 230 | +```bash |
| 231 | +# Essential Commands |
| 232 | +uvx eyelet@latest configure install-all --autoupdate # Setup |
| 233 | +uvx eyelet@latest doctor # Health check |
| 234 | +uvx eyelet@latest logs --tail 20 # View logs |
| 235 | +uvx eyelet@latest query summary # Statistics |
| 236 | +uvx eyelet@latest recall "search" # Search conversations |
| 237 | +uvx eyelet@latest --version # Check version |
| 238 | +``` |
| 239 | + |
| 240 | +## Support |
| 241 | + |
| 242 | +- GitHub: https://github.com/bdmorin/eyelet |
| 243 | +- Issues: https://github.com/bdmorin/eyelet/issues |
| 244 | +- PyPI: https://pypi.org/project/eyelet/ |
0 commit comments