Skip to content

Commit 4fccc59

Browse files
GeneAIclaude
authored andcommitted
docs: Add CLI cheatsheet and power-user configuration
- Add CLI_CHEATSHEET.md with quick reference for all commands - Update CLI_GUIDE.md with v2.3 Claude Code integration section - Update empathy.config.example.yml with v2.3 features: - Model routing configuration - Claude sync settings - Code inspection options - Code health settings - Add CLI docs to mkdocs.yml navigation (Getting Started + Book appendix) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent 24e8a5f commit 4fccc59

File tree

4 files changed

+517
-16
lines changed

4 files changed

+517
-16
lines changed

docs/CLI_CHEATSHEET.md

Lines changed: 239 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,239 @@
1+
# Empathy Framework CLI Cheatsheet
2+
3+
Quick reference for power users. Full docs at [smartaimemory.com/docs](https://www.smartaimemory.com/docs).
4+
5+
---
6+
7+
## Installation
8+
9+
```bash
10+
pip install empathy-framework
11+
```
12+
13+
---
14+
15+
## Core Commands
16+
17+
### Code Health
18+
19+
```bash
20+
empathy health # Quick health check
21+
empathy health --deep # Comprehensive analysis
22+
empathy health --fix # Auto-fix safe issues
23+
empathy health --dry-run # Preview fixes without applying
24+
empathy health --check lint # Run specific check (lint/format/types/tests/security/deps)
25+
empathy health --trends 30 # Show health trends over 30 days
26+
empathy health --json # JSON output for CI/CD
27+
```
28+
29+
### Code Review (Pattern-Based)
30+
31+
```bash
32+
empathy review # Review recent changes
33+
empathy review --staged # Review staged changes only
34+
empathy review src/ # Review specific files/dirs
35+
empathy review --severity error # Only show errors (skip warnings/info)
36+
empathy review --json # JSON output
37+
```
38+
39+
### Code Inspection
40+
41+
```bash
42+
empathy-inspect . # Inspect current directory
43+
empathy-inspect . --fix # Auto-fix formatting/imports
44+
empathy-inspect . --staged # Staged changes only
45+
empathy-inspect . --quick # Skip slow checks
46+
empathy-inspect . --format sarif # SARIF output for GitHub Actions
47+
empathy-inspect . --format html # HTML dashboard report
48+
empathy-inspect . -o report.json # Write to file
49+
empathy-inspect . --no-baseline # Show all findings (ignore suppressions)
50+
empathy-inspect . --baseline-init # Create .empathy-baseline.json
51+
```
52+
53+
---
54+
55+
## Memory & Patterns
56+
57+
### Memory Control Panel
58+
59+
```bash
60+
empathy-memory serve # Start Redis + API server (recommended)
61+
empathy-memory status # Show memory system status
62+
empathy-memory start # Start Redis if not running
63+
empathy-memory stop # Stop Redis
64+
empathy-memory stats # Detailed statistics
65+
empathy-memory health # Run health check
66+
empathy-memory patterns # List stored patterns
67+
empathy-memory patterns -c SENSITIVE # Filter by classification
68+
empathy-memory export patterns.json # Export patterns to file
69+
empathy-memory api --api-port 8765 # Start REST API only
70+
```
71+
72+
### Pattern Management
73+
74+
```bash
75+
empathy patterns list # List patterns in library
76+
empathy patterns export # Export patterns
77+
empathy patterns resolve <bug_id> # Mark investigating bug as resolved
78+
```
79+
80+
---
81+
82+
## Claude Code Integration
83+
84+
```bash
85+
empathy-sync-claude # One-time sync to .claude/rules/empathy/
86+
empathy-sync-claude --watch # Auto-sync on pattern changes
87+
empathy-sync-claude --dry-run # Preview without writing
88+
empathy-sync-claude --verbose # Detailed output
89+
```
90+
91+
**Output structure:**
92+
```
93+
.claude/rules/empathy/
94+
├── bug-patterns.md # From patterns/debugging/
95+
├── security-decisions.md # From patterns/security/
96+
├── tech-debt-hotspots.md # From patterns/tech_debt/
97+
└── coding-patterns.md # From patterns/inspection/
98+
```
99+
100+
---
101+
102+
## Project Setup
103+
104+
```bash
105+
empathy init # Initialize new project
106+
empathy init --format yaml # Create empathy.config.yaml
107+
empathy init --format json # Create empathy.config.json
108+
empathy validate config.yaml # Validate configuration file
109+
empathy info # Display framework info
110+
empathy info --config my.yaml # Info with specific config
111+
empathy version # Show version
112+
```
113+
114+
### Interactive Tools
115+
116+
```bash
117+
empathy wizard # Interactive setup wizard
118+
empathy run # Interactive REPL mode
119+
```
120+
121+
---
122+
123+
## State & Metrics
124+
125+
```bash
126+
empathy state list # List saved states
127+
empathy state load <id> # Load specific state
128+
empathy metrics show # Show metrics
129+
empathy metrics export # Export metrics
130+
empathy status # Session status report
131+
```
132+
133+
---
134+
135+
## CI/CD Integration
136+
137+
### GitHub Actions (SARIF)
138+
139+
```yaml
140+
- name: Run Empathy Inspect
141+
run: empathy-inspect . --format sarif -o results.sarif
142+
143+
- name: Upload SARIF
144+
uses: github/codeql-action/upload-sarif@v2
145+
with:
146+
sarif_file: results.sarif
147+
```
148+
149+
### Pre-commit Hook
150+
151+
```yaml
152+
# .pre-commit-config.yaml
153+
repos:
154+
- repo: local
155+
hooks:
156+
- id: empathy-review
157+
name: Pattern-based code review
158+
entry: empathy review --staged --severity error
159+
language: system
160+
pass_filenames: false
161+
162+
- id: empathy-sync
163+
name: Sync patterns to Claude
164+
entry: empathy-sync-claude
165+
language: system
166+
pass_filenames: false
167+
```
168+
169+
---
170+
171+
## Inline Suppressions
172+
173+
```python
174+
# Suppress for current line
175+
data = user_input # empathy:disable injection reason="sanitized upstream"
176+
177+
# Suppress for next line
178+
# empathy:disable-next-line null_reference
179+
result = obj.value
180+
181+
# Suppress for entire file (at top)
182+
# empathy:disable-file deprecated reason="legacy module"
183+
```
184+
185+
---
186+
187+
## Environment Variables
188+
189+
```bash
190+
ANTHROPIC_API_KEY=sk-... # Claude API key
191+
OPENAI_API_KEY=sk-... # OpenAI API key (optional)
192+
EMPATHY_CONFIG=./config.yaml # Custom config path
193+
EMPATHY_LOG_LEVEL=DEBUG # Logging level
194+
REDIS_URL=redis://localhost:6379 # Redis connection
195+
```
196+
197+
---
198+
199+
## Quick Workflows
200+
201+
### Morning Check
202+
203+
```bash
204+
empathy health --deep && empathy status
205+
```
206+
207+
### Before Commit
208+
209+
```bash
210+
empathy review --staged && empathy-inspect . --staged --quick
211+
```
212+
213+
### Fix Everything
214+
215+
```bash
216+
empathy health --fix && empathy-inspect . --fix
217+
```
218+
219+
### Sync to Claude Code
220+
221+
```bash
222+
empathy-sync-claude --verbose
223+
```
224+
225+
---
226+
227+
## Getting Help
228+
229+
```bash
230+
empathy --help # Main help
231+
empathy <command> --help # Command-specific help
232+
empathy-inspect --help # Inspect help
233+
empathy-memory --help # Memory control help
234+
empathy-sync-claude --help # Claude sync help
235+
```
236+
237+
---
238+
239+
*Empathy Framework v2.3.0 | [GitHub](https://github.com/Smart-AI-Memory/empathy-framework) | [Docs](https://www.smartaimemory.com/docs)*

docs/CLI_GUIDE.md

Lines changed: 131 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -878,15 +878,142 @@ The code review automatically detects file languages and applies appropriate pat
878878

879879
---
880880

881+
---
882+
883+
### Claude Code Integration (New in v2.3.0)
884+
885+
Sync learned patterns to Claude Code's native rules directory:
886+
887+
```bash
888+
# One-time sync
889+
empathy-sync-claude
890+
891+
# Watch for changes and auto-sync
892+
empathy-sync-claude --watch
893+
894+
# Preview without writing
895+
empathy-sync-claude --dry-run
896+
897+
# Verbose output
898+
empathy-sync-claude --verbose
899+
```
900+
901+
**Output structure:**
902+
903+
```
904+
.claude/rules/empathy/
905+
├── bug-patterns.md # From patterns/debugging/
906+
├── security-decisions.md # From patterns/security/
907+
├── tech-debt-hotspots.md # From patterns/tech_debt/
908+
└── coding-patterns.md # From patterns/inspection/
909+
```
910+
911+
Claude Code automatically loads these rules at session start, giving it access to your team's bug history, security decisions, and coding patterns.
912+
913+
---
914+
915+
## Quick Reference (Cheatsheet)
916+
917+
### Core Commands
918+
919+
```bash
920+
# Code Health
921+
empathy health # Quick health check
922+
empathy health --deep # Comprehensive analysis
923+
empathy health --fix # Auto-fix safe issues
924+
empathy health --check lint # Run specific check
925+
926+
# Code Review
927+
empathy review # Review recent changes
928+
empathy review --staged # Staged changes only
929+
930+
# Code Inspection
931+
empathy-inspect . # Inspect current directory
932+
empathy-inspect . --fix # Auto-fix formatting/imports
933+
empathy-inspect . --format sarif # SARIF for GitHub Actions
934+
empathy-inspect . --format html # HTML dashboard
935+
```
936+
937+
### Memory & Patterns
938+
939+
```bash
940+
# Memory Control Panel
941+
empathy-memory serve # Start Redis + API (recommended)
942+
empathy-memory status # Show memory status
943+
empathy-memory patterns # List stored patterns
944+
945+
# Pattern Management
946+
empathy patterns list # List patterns
947+
empathy patterns resolve <id> # Mark bug as resolved
948+
949+
# Claude Code Sync
950+
empathy-sync-claude # Sync to .claude/rules/empathy/
951+
empathy-sync-claude --watch # Auto-sync on changes
952+
```
953+
954+
### Quick Workflows
955+
956+
```bash
957+
# Morning check
958+
empathy health --deep && empathy status
959+
960+
# Before commit
961+
empathy review --staged && empathy-inspect . --staged --quick
962+
963+
# Fix everything
964+
empathy health --fix && empathy-inspect . --fix
965+
966+
# Sync to Claude Code
967+
empathy-sync-claude --verbose
968+
```
969+
970+
### CI/CD Integration
971+
972+
**GitHub Actions (SARIF):**
973+
```yaml
974+
- name: Run Empathy Inspect
975+
run: empathy-inspect . --format sarif -o results.sarif
976+
977+
- name: Upload SARIF
978+
uses: github/codeql-action/upload-sarif@v2
979+
with:
980+
sarif_file: results.sarif
981+
```
982+
983+
**Pre-commit Hook:**
984+
```yaml
985+
repos:
986+
- repo: local
987+
hooks:
988+
- id: empathy-review
989+
name: Pattern-based review
990+
entry: empathy review --staged --severity error
991+
language: system
992+
pass_filenames: false
993+
```
994+
995+
### Environment Variables
996+
997+
```bash
998+
ANTHROPIC_API_KEY=sk-... # Claude API key
999+
EMPATHY_CONFIG=./config.yaml # Custom config path
1000+
EMPATHY_LOG_LEVEL=DEBUG # Logging level
1001+
REDIS_URL=redis://localhost:6379 # Redis connection
1002+
```
1003+
1004+
---
1005+
8811006
## Getting Help
8821007

8831008
For more information on any command:
8841009

8851010
```bash
886-
empathy-framework --help
887-
empathy-framework patterns --help
888-
empathy-framework metrics --help
1011+
empathy --help
1012+
empathy <command> --help
1013+
empathy-inspect --help
1014+
empathy-memory --help
1015+
empathy-sync-claude --help
8891016
```
8901017

8911018
For bugs and feature requests, visit:
892-
https://github.com/Deep-Study-AI/Empathy/issues
1019+
https://github.com/Smart-AI-Memory/empathy-framework/issues

0 commit comments

Comments
 (0)