Add /log and /debug commands for troubleshooting

- /log command to view and analyze automation logs
  - Filter by pattern, date, or log type
  - List available log files
- /debug command generates comprehensive debug report
  - Version, core files, state, memory, scripts status
  - Environment info (Python, kubectl)
  - Disk usage by directory
  - JSON output mode for scripting
- Updated shell completions with 13 aliases total
- Test suite now covers 21 tests

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
OpenCode Test
2026-01-01 18:44:40 -08:00
parent 125bb4904b
commit c1a3c1812c
9 changed files with 596 additions and 6 deletions

39
commands/log.md Normal file
View File

@@ -0,0 +1,39 @@
---
name: log
description: View and analyze Claude Code logs
aliases: [logs, logview]
invokes: skill:log-viewer
---
# Log Command
View and analyze automation logs.
## Usage
```
/log # Show most recent log
/log --list # List all log files
/log <filename> # View specific log
/log --tail 100 # Show last 100 lines
/log --grep "error" # Filter by pattern
/log --since 1d # Show entries from last day
```
## Implementation
Run the log viewer script:
```bash
python3 ~/.claude/automation/log-viewer.py [options]
```
## Options
| Option | Description |
|--------|-------------|
| `--list` | List available log files |
| `--tail N` | Number of lines to show (default: 50) |
| `--grep PATTERN` | Filter by regex pattern |
| `--since DATE` | Filter by date (YYYY-MM-DD or 1d/7d/1h) |
| `--type TYPE` | Filter log files by type |