- /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>
114 lines
3.3 KiB
Bash
114 lines
3.3 KiB
Bash
#!/bin/zsh
|
|
# Zsh completions for Claude Code automation scripts
|
|
# Source this file: source ~/.claude/automation/completions.zsh
|
|
|
|
# Memory add completion
|
|
_memory_add() {
|
|
local -a categories
|
|
categories=('preference:Save as preference' 'decision:Save as decision' 'project:Save as project context' 'fact:Save as fact' 'auto:Auto-categorize')
|
|
|
|
_arguments \
|
|
'1:category:->category' \
|
|
'*:content:' && return 0
|
|
|
|
case $state in
|
|
category)
|
|
_describe 'category' categories
|
|
;;
|
|
esac
|
|
}
|
|
|
|
# Memory list completion
|
|
_memory_list() {
|
|
local -a categories
|
|
categories=('preferences' 'decisions' 'projects' 'facts')
|
|
|
|
_arguments \
|
|
'1:category:->category' \
|
|
'--all[Include deprecated items]' && return 0
|
|
|
|
case $state in
|
|
category)
|
|
_describe 'category' categories
|
|
;;
|
|
esac
|
|
}
|
|
|
|
# Restore completion
|
|
_claude_restore() {
|
|
local backup_dir="${HOME}/.claude/backups"
|
|
|
|
if [[ -d "${backup_dir}" ]]; then
|
|
_files -g "${backup_dir}/*.tar.gz"
|
|
fi
|
|
}
|
|
|
|
# Search completion
|
|
_claude_search() {
|
|
_arguments \
|
|
'--memory[Search only memory]' \
|
|
'--history[Search only history]' \
|
|
'--config[Search only config]' \
|
|
'--recent[Show recent items]:days:' \
|
|
'*:query:'
|
|
}
|
|
|
|
# History browser completion
|
|
_claude_history() {
|
|
_arguments \
|
|
'--list[List recent sessions]' \
|
|
'--all[Show all sessions]' \
|
|
'--show[Show session details]:session_id:' \
|
|
'--stats[Show statistics]' \
|
|
'--unsummarized[List unsummarized sessions]' \
|
|
'--limit[Limit results]:count:'
|
|
}
|
|
|
|
# Log viewer completion
|
|
_claude_log() {
|
|
_arguments \
|
|
'--list[List log files]' \
|
|
'--tail[Number of lines]:count:' \
|
|
'--grep[Filter pattern]:pattern:' \
|
|
'--since[Since date]:date:' \
|
|
'--type[Log type]:type:' \
|
|
'*:file:'
|
|
}
|
|
|
|
# Debug completion
|
|
_claude_debug() {
|
|
_arguments \
|
|
'--full[Full debug report]' \
|
|
'--json[JSON output]' \
|
|
'--paths[Show paths only]'
|
|
}
|
|
|
|
# Register completions
|
|
compdef _memory_add memory-add.py
|
|
compdef _memory_list memory-list.py
|
|
compdef _claude_restore restore.sh
|
|
compdef _claude_search search.py
|
|
compdef _claude_history history-browser.py
|
|
compdef _claude_log log-viewer.py
|
|
compdef _claude_debug debug.sh
|
|
|
|
# Aliases
|
|
alias claude-validate='~/.claude/automation/validate-setup.sh'
|
|
alias claude-status='~/.claude/automation/quick-status.sh'
|
|
alias claude-backup='~/.claude/automation/backup.sh'
|
|
alias claude-restore='~/.claude/automation/restore.sh'
|
|
alias claude-clean='~/.claude/automation/clean.sh'
|
|
alias claude-memory-add='python3 ~/.claude/automation/memory-add.py'
|
|
alias claude-memory-list='python3 ~/.claude/automation/memory-list.py'
|
|
alias claude-search='python3 ~/.claude/automation/search.py'
|
|
alias claude-history='python3 ~/.claude/automation/history-browser.py'
|
|
alias claude-install='~/.claude/automation/install.sh'
|
|
alias claude-test='~/.claude/automation/test-scripts.sh'
|
|
alias claude-maintenance='~/.claude/automation/daily-maintenance.sh'
|
|
alias claude-log='python3 ~/.claude/automation/log-viewer.py'
|
|
alias claude-debug='~/.claude/automation/debug.sh'
|
|
|
|
echo "Claude Code completions loaded (zsh)"
|
|
echo " Aliases: claude-{validate,status,backup,restore,clean,memory-add,memory-list}"
|
|
echo " claude-{search,history,install,test,maintenance,log,debug}"
|