- /diff command to compare config with backups - Shows added/removed/changed files - JSON-aware comparison for config files - List available backups - /template command for session templates - Built-in templates: daily-standup, code-review, troubleshoot, deploy - Each template includes checklist, initial commands, prompt - Create custom templates interactively or non-interactively - Updated shell completions with 21 aliases total - Test suite now covers 29 tests 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
154 lines
5.0 KiB
Bash
154 lines
5.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_export() {
|
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
|
|
|
COMPREPLY=($(compgen -W "--list --format --output" -- "${cur}"))
|
|
}
|
|
|
|
_claude_mcp_status() {
|
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
|
|
|
COMPREPLY=($(compgen -W "--json" -- "${cur}"))
|
|
}
|
|
|
|
_claude_upgrade() {
|
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
|
|
|
COMPREPLY=($(compgen -W "--check --backup --apply --help" -- "${cur}"))
|
|
}
|
|
|
|
_claude_workflow() {
|
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
|
|
|
COMPREPLY=($(compgen -W "--category --list" -- "${cur}"))
|
|
}
|
|
|
|
_claude_skill_info() {
|
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
|
|
|
COMPREPLY=($(compgen -W "--scripts --list" -- "${cur}"))
|
|
}
|
|
|
|
_claude_agent_info() {
|
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
|
|
|
COMPREPLY=($(compgen -W "--tree --list" -- "${cur}"))
|
|
}
|
|
|
|
_claude_diff() {
|
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
|
|
|
COMPREPLY=($(compgen -W "--backup --list --json" -- "${cur}"))
|
|
}
|
|
|
|
_claude_template() {
|
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
|
|
|
COMPREPLY=($(compgen -W "--list --create --use --delete" -- "${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
|
|
complete -F _claude_export session-export.py
|
|
complete -F _claude_mcp_status mcp-status.sh
|
|
complete -F _claude_upgrade upgrade.sh
|
|
complete -F _claude_workflow workflow-info.py
|
|
complete -F _claude_skill_info skill-info.py
|
|
complete -F _claude_agent_info agent-info.py
|
|
complete -F _claude_diff config-diff.py
|
|
complete -F _claude_template session-template.py
|
|
|
|
# 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'
|
|
alias claude-export='python3 ~/.claude/automation/session-export.py'
|
|
alias claude-mcp='~/.claude/automation/mcp-status.sh'
|
|
alias claude-upgrade='~/.claude/automation/upgrade.sh'
|
|
alias claude-workflow='python3 ~/.claude/automation/workflow-info.py'
|
|
alias claude-skill='python3 ~/.claude/automation/skill-info.py'
|
|
alias claude-agent='python3 ~/.claude/automation/agent-info.py'
|
|
alias claude-diff='python3 ~/.claude/automation/config-diff.py'
|
|
alias claude-template='python3 ~/.claude/automation/session-template.py'
|
|
|
|
echo "Claude Code completions loaded. Available aliases:"
|
|
echo " claude-{validate,status,backup,restore,clean,memory-add,memory-list,search}"
|
|
echo " claude-{history,install,test,maintenance,log,debug,export,mcp,upgrade}"
|
|
echo " claude-{workflow,skill,agent,diff,template}"
|