pub const BASH_TEMPLATE: &str = "# cstats Bash Hook\n# Generated automatically - do not edit manually\n# Shell: {{shell_type}}\n# Default source: {{default_source}}\n\n# Environment variables\n{{env_vars}}\n\n# Core cstats wrapper function\ncstats_wrap() {\n local cmd=\"$*\"\n {{cstats_path}} collect --source \"{{default_source}}\" --command \"$cmd\"\n}\n\n# Convenient alias for manual usage\nalias cs=\'cstats_wrap\'\n\n# Auto-wrapped commands\n{{auto_commands}}\n\n# Utility functions\ncstats_recent() {\n local hours=${1:-1}\n local start_time=$(date -d \"${hours} hours ago\" -Iseconds)\n {{cstats_path}} analyze --source \"{{default_source}}\" --start-time \"$start_time\"\n}\n\ncstats_today() {\n local start_time=$(date -d \"today 00:00\" -Iseconds)\n {{cstats_path}} analyze --source \"{{default_source}}\" --start-time \"$start_time\"\n}\n\ncstats_clear_cache() {\n {{cstats_path}} cache clear\n}\n\ncstats_status() {\n {{cstats_path}} cache stats\n}\n\n# Advanced: Auto-collect all commands (if enabled)\n{{#if auto_collect_all}}\n# CAUTION: This will collect statistics for ALL commands\n# Uncomment the following line to enable:\n# trap \'cstats collect --source \"{{default_source}}\" --command \"$BASH_COMMAND\" &\' DEBUG\n{{/if}}\n\necho \"\u{2713} cstats {{shell_type}} hook loaded. Use \'cs <command>\' to collect statistics.\"";Expand description
Bash shell hook template