{
  "report_info": {
    "version": "9.0.1",
    "generated_at": "2026-05-19T08:52:43Z",
    "binary_name": "logs-hook"
  },
  "binary": {
    "name": "logs-hook",
    "path": "/home/kodachi/k900/dashboard/hooks/logs-hook",
    "timestamp": "2026-05-19T08:52:43Z",
    "file_info": {
      "size": 1450656,
      "sha256": "906ed5f40ff81f69dea7856a1dad1a8892cd81c0cc27023a93798e0c4e5a3156"
    },
    "flag_n": {
      "command": "info",
      "data": {
        "author": "Warith Al Maawali",
        "copyright": "© 2026 Linux Kodachi",
        "description": "A robust, secure, and configurable logging system for Kodachi OS",
        "features": [
          "Centralized logging system",
          "Log rotation with configurable limits",
          "Secure log wiping",
          "Multiple log levels support",
          "JSON output format",
          "Embedded configuration system"
        ],
        "license": "Proprietary",
        "name": "logs-hook",
        "securityFeatures": {
          "authentication": "Not implemented in this crate (online-auth is a separate binary)",
          "encryption": "Not implemented in this crate (log files are stored as plain text)",
          "inputValidation": "Sanitizes script names and messages",
          "rateLimiting": "Not implemented in this crate (handled externally if required)"
        },
        "systemRequirements": {
          "dependencies": [
            "tokio runtime",
            "filesystem access"
          ],
          "os": "Linux (Debian-based)",
          "privileges": "root/sudo for system logs"
        },
        "version": "9.0.1",
        "website": "https://digi77.com"
      },
      "errors": [],
      "metadata": {
        "executionTime": 0,
        "hostname": "iMac-27inch",
        "user": "kodachi"
      },
      "status": "success",
      "timestamp": "2026-05-19T08:52:43.151243203Z",
      "version": "9.0.1",
      "warnings": []
    },
    "flag_v": {
      "command": "version",
      "data": {
        "buildDate": "2026-05-19T08:52:43.190761484Z",
        "gitCommit": "unknown",
        "name": "logs-hook",
        "rustVersion": "1.88.0",
        "version": "9.0.1"
      },
      "errors": [],
      "metadata": {
        "executionTime": 0,
        "hostname": "iMac-27inch",
        "user": "kodachi"
      },
      "status": "success",
      "timestamp": "2026-05-19T08:52:43.190762753Z",
      "version": "9.0.1",
      "warnings": []
    },
    "flag_h": {
      "command": "help",
      "data": {
        "commandCategories": [
          {
            "category": "Logging Commands",
            "commands": [
              {
                "description": "Log a message",
                "examples": [
                  "logs-hook log --script 'my-script' --level info 'Script started'",
                  "logs-hook log -s 'backup' -l warn 'Low disk space'",
                  "logs-hook log --script 'app' --level error 'Connection failed' --json"
                ],
                "name": "log",
                "options": [
                  {
                    "description": "Script name for the log entry",
                    "flag": "--script, -s <SCRIPT>",
                    "required": true
                  },
                  {
                    "default": "info",
                    "description": "Log level (info, warn, error, debug, fatal)",
                    "flag": "--level, -l <LEVEL>",
                    "required": false
                  }
                ],
                "requires_sudo": false,
                "usage": "logs-hook log --script <SCRIPT> --level <LEVEL> <MESSAGE>"
              }
            ]
          },
          {
            "category": "Maintenance Commands",
            "commands": [
              {
                "description": "Rotate a specific log file (--file is required)",
                "examples": [
                  "logs-hook maintenance rotate --file /path/to/log.txt",
                  "logs-hook maintenance rotate --file /path/to/log.txt --json"
                ],
                "name": "maintenance rotate",
                "options": [
                  {
                    "description": "Log file to rotate (required; rotate-all is not supported)",
                    "flag": "--file, -f <FILE>",
                    "required": true
                  }
                ],
                "requires_sudo": false,
                "usage": "logs-hook maintenance rotate --file <FILE>"
              },
              {
                "description": "Wipe log files (--all, --file, or --confirm is required)",
                "examples": [
                  "logs-hook maintenance wipe --all",
                  "logs-hook maintenance wipe --file /path/to/log.txt",
                  "logs-hook maintenance wipe --all --json",
                  "logs-hook maintenance wipe --confirm"
                ],
                "name": "maintenance wipe",
                "options": [
                  {
                    "description": "Wipe all logs",
                    "flag": "--all, -a",
                    "required": false
                  },
                  {
                    "description": "Specific log file to wipe",
                    "flag": "--file, -f <FILE>",
                    "required": false
                  },
                  {
                    "description": "Explicitly confirm wipe using the default policy (required when neither --all nor --file is given)",
                    "flag": "--confirm",
                    "required": false
                  }
                ],
                "requires_sudo": false,
                "usage": "logs-hook maintenance wipe (--all | --file <FILE> | --confirm)"
              }
            ]
          }
        ],
        "description": "A robust, secure, and configurable logging system for Kodachi OS",
        "environmentVariables": [
          {
            "default": "info",
            "description": "Set logging level",
            "name": "RUST_LOG",
            "values": "error|warn|info|debug|trace"
          },
          {
            "default": "unset",
            "description": "Disable all colored output when set",
            "name": "NO_COLOR",
            "values": "1|true|yes (any value disables color)"
          },
          {
            "default": "auto-detected",
            "description": "Base directory for logs",
            "name": "KODACHI_BASE_DIR",
            "values": "/path/to/base/dir"
          },
          {
            "default": "current directory",
            "description": "Working directory for logging operations",
            "name": "LOGS_HOOK_WORK_DIR",
            "values": "/path/to/work/dir"
          }
        ],
        "exitCodes": {
          "0": "Success",
          "1": "General error",
          "2": "Invalid arguments",
          "3": "Permission denied",
          "4": "Network error",
          "5": "File not found"
        },
        "globalOptions": [
          {
            "description": "Print help information",
            "flag": "-h, --help"
          },
          {
            "description": "Print version information",
            "flag": "-v, --version"
          },
          {
            "description": "Display detailed information",
            "flag": "-n, --info"
          },
          {
            "description": "Show usage examples",
            "flag": "-e, --examples"
          },
          {
            "description": "Output in JSON format",
            "flag": "--json"
          },
          {
            "description": "Pretty-print JSON output",
            "flag": "--json-pretty"
          },
          {
            "description": "Filter JSON output fields (parsed globally; not applied by logs-hook)",
            "flag": "--json-filter <FIELDS>"
          },
          {
            "description": "Enable verbose output (parsed globally; not applied by logs-hook)",
            "flag": "--verbose"
          },
          {
            "description": "Suppress non-essential output (parsed globally; not applied by logs-hook)",
            "flag": "--quiet"
          },
          {
            "description": "Disable colored output",
            "flag": "--no-color"
          },
          {
            "description": "Set timeout (parsed globally; not applied by logs-hook)",
            "flag": "-t, --timeout <SECS>"
          },
          {
            "description": "Retry attempts (parsed globally; not applied by logs-hook)",
            "flag": "--retry <COUNT>"
          },
          {
            "description": "Working directory (defaults to auto-detected base directory)",
            "flag": "-d, --work-dir <PATH>"
          },
          {
            "description": "Force output format (default: text)",
            "flag": "-o, --output-format <FORMAT>"
          },
          {
            "description": "Configuration file path (parsed globally; logs-hook uses embedded config only)",
            "flag": "--config <FILE>"
          },
          {
            "description": "Select specific fields to include in output (parsed globally; not applied by logs-hook)",
            "flag": "--fields <FIELD_LIST>"
          },
          {
            "description": "Limit number of results returned (parsed globally; not applied by logs-hook)",
            "flag": "--limit <NUMBER>"
          },
          {
            "description": "Skip first N results for pagination (parsed globally; not applied by logs-hook)",
            "flag": "--offset <NUMBER>"
          }
        ],
        "name": "logs-hook",
        "usage": "logs-hook [OPTIONS] [COMMAND] [ARGS]"
      },
      "errors": [],
      "metadata": {
        "executionTime": 0,
        "hostname": "iMac-27inch",
        "user": "kodachi"
      },
      "status": "success",
      "timestamp": "2026-05-19T08:52:43.228377727Z",
      "version": "9.0.1",
      "warnings": []
    },
    "flag_e": {
      "command": "examples",
      "data": {
        "categories": [
          {
            "description": "Common logging operations",
            "examples": [
              {
                "command": "sudo logs-hook log --script 'my-script' --level info 'Script started'",
                "description": "Log an info message",
                "expectedOutput": "Message logged successfully"
              },
              {
                "command": "sudo logs-hook log -s 'backup' -l warn 'Low disk space'",
                "description": "Log a warning with short flags",
                "expectedOutput": "Message logged successfully"
              },
              {
                "command": "sudo logs-hook --json log --script 'app' --level error 'Failed'",
                "description": "Log with JSON output",
                "expectedOutput": "JSON response with envelope"
              },
              {
                "command": "sudo logs-hook log --script 'app' --level debug 'Verbose trace'",
                "description": "Log a debug message",
                "expectedOutput": "Message logged successfully"
              },
              {
                "command": "sudo logs-hook log --script 'app' --level fatal 'Unrecoverable failure'",
                "description": "Log a fatal message",
                "expectedOutput": "Message logged successfully",
                "notes": "Fatal level is the highest severity; reserve for unrecoverable conditions"
              }
            ],
            "id": "1_basic_usage",
            "title": "Basic Usage"
          },
          {
            "description": "Log rotation and cleanup",
            "examples": [
              {
                "command": "sudo logs-hook maintenance rotate --file /path/to/log.txt",
                "description": "Rotate a specific log file (--file is required)",
                "expectedOutput": "Log rotation completed for the specified file",
                "notes": "--file is required; rotate-all is not supported"
              },
              {
                "command": "sudo logs-hook maintenance wipe --all",
                "description": "Wipe all logs",
                "expectedOutput": "All logs wiped successfully",
                "notes": "Use with caution"
              },
              {
                "command": "sudo logs-hook maintenance wipe --file /path/to/log.txt",
                "description": "Wipe specific log file",
                "expectedOutput": "Specified log file wiped successfully",
                "notes": "File must exist and be writable"
              }
            ],
            "id": "2_maintenance",
            "title": "Maintenance Operations"
          },
          {
            "description": "Complex operations and configurations",
            "examples": [
              {
                "command": "sudo logs-hook --timeout 60 log --script 'slow-task' --level info 'Starting'",
                "description": "Custom timeout for long operations",
                "expectedOutput": "Message logged successfully"
              },
              {
                "command": "sudo logs-hook --json-pretty log -s 'test' -l info 'Test'",
                "description": "Pretty JSON output",
                "expectedOutput": "Pretty-printed JSON response"
              }
            ],
            "id": "3_advanced_usage",
            "title": "Advanced Usage"
          },
          {
            "description": "Working with JSON formatted output",
            "examples": [
              {
                "command": "sudo logs-hook -v --json",
                "description": "Version in JSON format",
                "expectedOutput": "JSON envelope with version data"
              },
              {
                "command": "sudo logs-hook -n --json",
                "description": "Program info in JSON format",
                "expectedOutput": "JSON envelope with program details"
              },
              {
                "command": "sudo logs-hook --json log --script 'test' --level info 'message'",
                "description": "Log with JSON output",
                "expectedOutput": "JSON response with status and metadata"
              },
              {
                "command": "sudo logs-hook maintenance rotate --file /path/to/log.txt --json",
                "description": "Rotate a specific log file with JSON output",
                "expectedOutput": "JSON response with rotation results",
                "notes": "--file is required"
              },
              {
                "command": "sudo logs-hook maintenance wipe --all --json",
                "description": "Wipe all logs with JSON output",
                "expectedOutput": "JSON response with wipe results",
                "notes": "Returns structured JSON with operation status"
              }
            ],
            "id": "4_json_output",
            "title": "JSON Output"
          },
          {
            "description": "Debug and error handling",
            "examples": [
              {
                "command": "sudo logs-hook --verbose log --script 'debug' --level debug 'Debug info'",
                "description": "Enable verbose output",
                "expectedOutput": "Detailed debug information",
                "notes": "Use for debugging issues"
              },
              {
                "command": "sudo logs-hook --work-dir /custom/path log --script 'debug' --level info 'Custom directory test'",
                "description": "Test with custom working directory",
                "expectedOutput": "Message logged to custom path",
                "notes": "Useful for debugging path issues"
              }
            ],
            "id": "5_troubleshooting",
            "title": "Troubleshooting"
          }
        ],
        "description": "Usage examples for logs-hook",
        "name": "logs-hook",
        "quickReference": [
          "logs-hook --help",
          "logs-hook --version",
          "logs-hook --info --json",
          "logs-hook --examples --json",
          "sudo logs-hook log -s 'test' -l info 'message'",
          "sudo logs-hook maintenance rotate --file /path/to/log.txt",
          "sudo logs-hook maintenance wipe --all",
          "sudo logs-hook maintenance wipe --file /path/to/log.txt",
          "sudo logs-hook --work-dir /custom/path log -s 'test' -l info 'msg'"
        ]
      },
      "errors": [],
      "metadata": {
        "executionTime": 0,
        "hostname": "iMac-27inch",
        "user": "kodachi"
      },
      "status": "success",
      "timestamp": "2026-05-19T08:52:43.300283422Z",
      "version": "9.0.1",
      "warnings": []
    }
  }
}
