-
Background Job Manager
- Press key in emdx GUI → spawns background process
- Each job gets a unique ID (maybe tied to doc ID)
- Logs stream to files or database
-
TUI Log Viewer (new mode in emdx)
- Press
lfor "logs" view - Shows active/recent jobs
- Live tail of outputs
- Filter by document, tag, status
- Press
def action_git_operation(self):
job_id = f"git-{self.current_doc_id}-{timestamp}"
subprocess.Popen([
'bash', '-c', f'''
exec > >(tee -a ~/.emdx/logs/{job_id}.log)
exec 2>&1
echo "=== Git Operation for: {doc['title']} ==="
git checkout -b gameplan-{doc_id}
git add .
git commit -m "WIP: {doc['title']}"
echo "=== Complete ==="
'''
])
status.update(f"Git operation started → Press 'l' to view logs")def action_claude_execute(self):
job = {
'id': f"claude-{doc_id}-{timestamp}",
'doc_id': doc_id,
'type': 'claude-execution',
'status': 'running',
'log_file': f"~/.emdx/logs/claude-{doc_id}.log"
}
subprocess.Popen([
'claude-code',
'--file', temp_path,
'--output-format', 'json', # For structured parsing
'--log-file', job['log_file']
])Using something like Textual (which you already use), you could build:
┌─ EMDX Logs ──────────────────────────────────────────┐
│ Jobs (j/k to navigate, Enter to view) │
├──────────────────────────────────────────────────────┤
│ ● [RUNNING] Claude: Implement Auth System 2m ago│
│ ✓ [DONE] Git: Create feature branch 5m ago│
│ ✗ [FAILED] Claude: Database Migration 10m ago│
│ ● [RUNNING] Monitor: API Health Check Active │
└──────────────────────────────────────────────────────┘
┌─ Log Output ─────────────────────────────────────────┐
│ [13:45:02] Starting Claude execution... │
│ [13:45:03] Analyzing document: Auth System Gameplan │
│ [13:45:04] Found 5 implementation tasks │
│ [13:45:05] Task 1/5: Create user model │
│ [13:45:06] > Running: poetry add bcrypt │
│ [13:45:08] > Success: bcrypt==4.0.1 installed │
│ [13:45:09] > Creating: models/user.py │
│ ▌ │
└──────────────────────────────────────────────────────┘
- Non-blocking - Can trigger multiple operations
- Persistent logs - Review what happened later
- Pattern matching - Search across all executions
- Status tracking - See what's running/failed/completed
- Less tmux clutter - Clean workspace
- stern - Multi-pod Kubernetes log tailing
- lnav - Advanced log file navigator
- multitail - Multiple log monitoring
- glogg - Fast log explorer
But building it into emdx means:
-
Integrated with your documents
-
Custom formatting for Claude/Git output
-
Smart filtering by tags/projects
-
Direct jump from log → document
-
Press
cin emdx GUI → Claude runs in background -
Press
g→ Git operations in background -
Press
l→ See all running/completed jobs -
Select a job → View live streaming logs
-
Press
din log view → Jump back to source document
This creates a complete async workflow where you can trigger multiple operations and monitor them all from within emdx!