- /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>
89 lines
3.0 KiB
Bash
89 lines
3.0 KiB
Bash
#!/bin/bash
|
|
# Bash completions for Claude Code automation scripts
|
|
# Source this file: source ~/.claude/automation/completions.bash
|
|
|
|
_claude_automation() {
|
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
|
local scripts="validate-setup quick-status backup restore clean memory-add memory-list search history install test maintenance"
|
|
|
|
COMPREPLY=($(compgen -W "${scripts}" -- "${cur}"))
|
|
}
|
|
|
|
_claude_search() {
|
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
|
|
|
COMPREPLY=($(compgen -W "--memory --history --config --recent" -- "${cur}"))
|
|
}
|
|
|
|
_claude_history() {
|
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
|
|
|
COMPREPLY=($(compgen -W "--list --show --stats --unsummarized --all --limit" -- "${cur}"))
|
|
}
|
|
|
|
_claude_log() {
|
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
|
|
|
COMPREPLY=($(compgen -W "--list --tail --grep --since --type" -- "${cur}"))
|
|
}
|
|
|
|
_claude_debug() {
|
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
|
|
|
COMPREPLY=($(compgen -W "--full --json --paths" -- "${cur}"))
|
|
}
|
|
|
|
_claude_memory_add() {
|
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
|
local prev="${COMP_WORDS[COMP_CWORD-1]}"
|
|
|
|
if [[ ${COMP_CWORD} -eq 1 ]]; then
|
|
COMPREPLY=($(compgen -W "preference decision project fact auto" -- "${cur}"))
|
|
fi
|
|
}
|
|
|
|
_claude_memory_list() {
|
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
|
|
|
COMPREPLY=($(compgen -W "preferences decisions projects facts --all" -- "${cur}"))
|
|
}
|
|
|
|
_claude_restore() {
|
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
|
local backup_dir="${HOME}/.claude/backups"
|
|
|
|
if [[ -d "${backup_dir}" ]]; then
|
|
local backups=$(ls -1 "${backup_dir}"/*.tar.gz 2>/dev/null | xargs -n1 basename)
|
|
COMPREPLY=($(compgen -W "${backups}" -- "${cur}"))
|
|
fi
|
|
}
|
|
|
|
# Register completions
|
|
complete -F _claude_memory_add memory-add.py
|
|
complete -F _claude_memory_list memory-list.py
|
|
complete -F _claude_restore restore.sh
|
|
complete -F _claude_search search.py
|
|
complete -F _claude_history history-browser.py
|
|
complete -F _claude_log log-viewer.py
|
|
complete -F _claude_debug debug.sh
|
|
|
|
# Alias completions for convenience
|
|
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. Available aliases:"
|
|
echo " claude-{validate,status,backup,restore,clean,memory-add,memory-list}"
|
|
echo " claude-{search,history,install,test,maintenance,log,debug}"
|