Skip to content

Commit 1a604b6

Browse files
GeneAIclaude
authored andcommitted
feat: Add unified Typer CLI and Dev Container setup
## Unified CLI (cli_unified.py) - Single `empathy` command with nested subcommands - Uses Typer + Rich for beautiful CLI output - Delegates to existing CLIs for robust compatibility - Command structure: - empathy memory (status, start, stop, stats, patterns) - empathy provider (config, registry, costs, telemetry) - empathy scan/inspect (code analysis) - empathy morning/ship/health/fix-all (workflows) - empathy wizard/workflow (domain wizards) - Includes cheatsheet command for quick reference ## Dev Container (.devcontainer/) - One-click dev environment with VS Code - Python 3.11 + Redis 7 pre-configured - Extensions: Python, Ruff, Black, MyPy, Pylance - Auto-installs dependencies on container create - Redis available at redis://redis:6379 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent de5664a commit 1a604b6

File tree

5 files changed

+571
-1
lines changed

5 files changed

+571
-1
lines changed

.devcontainer/Dockerfile

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Empathy Framework Development Container
2+
# Python 3.11 with dev tools pre-installed
3+
4+
FROM mcr.microsoft.com/devcontainers/python:1-3.11-bullseye
5+
6+
# Install system dependencies
7+
RUN apt-get update && apt-get install -y --no-install-recommends \
8+
git \
9+
curl \
10+
redis-tools \
11+
&& apt-get clean \
12+
&& rm -rf /var/lib/apt/lists/*
13+
14+
# Install Python tools
15+
RUN pip install --no-cache-dir \
16+
pip --upgrade \
17+
wheel \
18+
setuptools
19+
20+
# Set working directory
21+
WORKDIR /workspace
22+
23+
# Create non-root user (already exists in base image as 'vscode')
24+
USER vscode
25+
26+
# Install pre-commit globally for the user
27+
RUN pip install --user pre-commit
28+
29+
# Add local bin to PATH
30+
ENV PATH="/home/vscode/.local/bin:${PATH}"
31+
32+
# Default command
33+
CMD ["sleep", "infinity"]

.devcontainer/devcontainer.json

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{
2+
"name": "Empathy Framework Dev",
3+
"dockerComposeFile": "docker-compose.yml",
4+
"service": "empathy-dev",
5+
"workspaceFolder": "/workspace",
6+
7+
"features": {
8+
"ghcr.io/devcontainers/features/git:1": {},
9+
"ghcr.io/devcontainers/features/github-cli:1": {}
10+
},
11+
12+
"customizations": {
13+
"vscode": {
14+
"extensions": [
15+
"ms-python.python",
16+
"ms-python.vscode-pylance",
17+
"charliermarsh.ruff",
18+
"ms-python.black-formatter",
19+
"ms-python.mypy-type-checker",
20+
"tamasfe.even-better-toml",
21+
"redhat.vscode-yaml",
22+
"GitHub.copilot"
23+
],
24+
"settings": {
25+
"python.defaultInterpreterPath": "/usr/local/bin/python",
26+
"python.analysis.typeCheckingMode": "basic",
27+
"editor.formatOnSave": true,
28+
"editor.codeActionsOnSave": {
29+
"source.organizeImports": "explicit"
30+
},
31+
"[python]": {
32+
"editor.defaultFormatter": "charliermarsh.ruff"
33+
}
34+
}
35+
}
36+
},
37+
38+
"forwardPorts": [6379, 8000, 3000],
39+
40+
"postCreateCommand": "pip install -e '.[dev,full]' && pre-commit install",
41+
42+
"remoteEnv": {
43+
"REDIS_URL": "redis://redis:6379",
44+
"PYTHONPATH": "/workspace/src:/workspace"
45+
},
46+
47+
"containerEnv": {
48+
"PYTHONDONTWRITEBYTECODE": "1",
49+
"PYTHONUNBUFFERED": "1"
50+
}
51+
}

.devcontainer/docker-compose.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
version: '3.8'
2+
3+
services:
4+
empathy-dev:
5+
build:
6+
context: .
7+
dockerfile: Dockerfile
8+
volumes:
9+
- ..:/workspace:cached
10+
- ~/.gitconfig:/home/vscode/.gitconfig:ro
11+
command: sleep infinity
12+
environment:
13+
- REDIS_URL=redis://redis:6379
14+
- PYTHONPATH=/workspace/src:/workspace
15+
depends_on:
16+
- redis
17+
18+
redis:
19+
image: redis:7-alpine
20+
ports:
21+
- "6379:6379"
22+
volumes:
23+
- redis-data:/data
24+
command: redis-server --appendonly yes
25+
healthcheck:
26+
test: ["CMD", "redis-cli", "ping"]
27+
interval: 10s
28+
timeout: 5s
29+
retries: 5
30+
31+
volumes:
32+
redis-data:

pyproject.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,11 @@ all = [
198198
]
199199

200200
[project.scripts]
201-
empathy = "empathy_os.cli:main"
201+
# Primary unified CLI (Typer-based)
202+
empathy = "empathy_os.cli_unified:main"
203+
204+
# Legacy entry points (for backwards compatibility)
205+
empathy-legacy = "empathy_os.cli:main"
202206
empathy-scan = "empathy_software_plugin.cli:scan_command"
203207
empathy-memory = "empathy_os.memory.control_panel:main"
204208
empathy-inspect = "empathy_software_plugin.cli.inspect:main"

0 commit comments

Comments
 (0)