{
  "report_info": {
    "version": "9.0.1",
    "generated_at": "2026-06-28T11:16:29Z",
    "binary_name": "ai-scheduler"
  },
  "binary": {
    "name": "ai-scheduler",
    "path": "/opt/kodachi/dashboard/hooks/ai-scheduler",
    "timestamp": "2026-06-28T11:16:29Z",
    "file_info": {
      "size": 5779024,
      "sha256": "312320c071286aa2f120d0e3ad358d9ffd3459c7e2e8d9b75b4caa9b146343f5"
    },
    "flag_n": {
      "status": "success",
      "timestamp": "2026-06-28T11:16:29.776852575Z",
      "command": "info",
      "version": "9.8.4",
      "data": {
        "name": "ai-scheduler",
        "version": "9.8.4",
        "author": "Warith Al Maawali",
        "description": "Kodachi Scheduler Daemon - Cron-based command scheduling with security whitelist",
        "copyright": "© 2026 Linux Kodachi",
        "website": "https://www.digi77.com",
        "license": "Proprietary",
        "features": [
          "Cron expression parsing (\"0 * * * *\")",
          "Event-driven triggers",
          "Command whitelist validation",
          "Execution history tracking"
        ],
        "securityFeatures": {
          "inputValidation": "Argument parsing via clap; per-command validation is the consumer's responsibility",
          "rateLimiting": "Not provided by cli-core",
          "authentication": "Not provided by cli-core (see online-auth)",
          "encryption": "Not provided by cli-core"
        },
        "systemRequirements": {
          "os": "Linux (Debian-based)",
          "privileges": "root/sudo for system operations",
          "dependencies": [
            "OpenSSL",
            "libcurl"
          ]
        }
      },
      "errors": [],
      "warnings": [],
      "metadata": {
        "executionTime": 0,
        "hostname": "REDACTED-BUILD-HOST",
        "user": "REDACTED-BUILD-USER"
      }
    },
    "flag_v": {
      "status": "success",
      "timestamp": "2026-06-28T11:16:29.877860724Z",
      "command": "version",
      "version": "9.8.4",
      "data": {
        "name": "ai-scheduler",
        "version": "9.8.4",
        "buildDate": "REDACTED-BUILD-TIME",
        "gitCommit": "unknown",
        "rustVersion": "1.82.0"
      },
      "errors": [],
      "warnings": [],
      "metadata": {
        "executionTime": 0,
        "hostname": "REDACTED-BUILD-HOST",
        "user": "REDACTED-BUILD-USER"
      }
    },
    "flag_h": {
      "status": "success",
      "timestamp": "2026-06-28T11:16:29.985759868Z",
      "command": "help",
      "version": "9.8.4",
      "data": {
        "name": "ai-scheduler",
        "description": "Kodachi Scheduler Daemon - Cron-based command scheduling with security whitelist",
        "usage": "ai-scheduler [OPTIONS] [COMMAND] [ARGS]",
        "commandCategories": [
          {
            "category": "Daemon Control",
            "commands": [
              {
                "name": "start",
                "description": "Start the scheduler daemon",
                "usage": "ai-scheduler start [OPTIONS]",
                "options": [],
                "requires_sudo": false
              }
            ]
          },
          {
            "category": "Schedule Management",
            "commands": [
              {
                "name": "add",
                "description": "Add a new scheduled task",
                "usage": "ai-scheduler add [OPTIONS]",
                "options": [],
                "requires_sudo": false
              },
              {
                "name": "list",
                "description": "List all scheduled tasks",
                "usage": "ai-scheduler list [OPTIONS]",
                "options": [],
                "requires_sudo": false
              },
              {
                "name": "remove",
                "description": "Remove a scheduled task",
                "usage": "ai-scheduler remove [OPTIONS]",
                "options": [],
                "requires_sudo": false
              }
            ]
          }
        ],
        "globalOptions": [
          {
            "flag": "-h, --help",
            "description": "Print help information"
          },
          {
            "flag": "-v, --version",
            "description": "Print version information"
          },
          {
            "flag": "-n, --info",
            "description": "Display detailed information"
          },
          {
            "flag": "-e, --examples",
            "description": "Show usage examples"
          },
          {
            "flag": "--json",
            "description": "Output in JSON format"
          },
          {
            "flag": "-o, --output-format <FORMAT>",
            "description": "Force output format (text|json)"
          },
          {
            "flag": "--json-pretty",
            "description": "Pretty-print JSON output with indentation"
          },
          {
            "flag": "--json-human",
            "description": "Enhanced JSON output with improved formatting (like jq)"
          },
          {
            "flag": "--fields <FIELD_LIST>",
            "description": "Select specific fields to include in output (comma-separated)"
          },
          {
            "flag": "--limit <NUMBER>",
            "description": "Limit number of results returned"
          },
          {
            "flag": "--offset <NUMBER>",
            "description": "Skip first N results (for pagination)"
          },
          {
            "flag": "-d, --work-dir <PATH>",
            "description": "Working directory (defaults to auto-detected base directory)"
          },
          {
            "flag": "--port <PORT>",
            "description": "Set custom port number (1024-65535)"
          },
          {
            "flag": "--log-level <LEVEL>",
            "description": "Set log level (error|warn|info|debug)"
          },
          {
            "flag": "--verbose",
            "description": "Enable verbose output"
          },
          {
            "flag": "--quiet",
            "description": "Suppress non-essential output"
          },
          {
            "flag": "--no-color",
            "description": "Disable colored output"
          },
          {
            "flag": "--config <FILE>",
            "description": "Use custom configuration file"
          },
          {
            "flag": "--timeout <SECS>",
            "description": "Set operation timeout in seconds (optional; no default applied)"
          },
          {
            "flag": "--retry <COUNT>",
            "description": "Retry attempts (optional; no default applied)"
          }
        ],
        "environmentVariables": [
          {
            "name": "RUST_LOG",
            "description": "Set logging level",
            "default": "info",
            "values": "error|warn|info|debug|trace"
          },
          {
            "name": "NO_COLOR",
            "description": "Disable all colored output when set",
            "default": "unset",
            "values": "1|true|yes (any value disables color)"
          }
        ],
        "exitCodes": {
          "1": "General error",
          "0": "Success",
          "4": "Network error",
          "3": "Permission denied",
          "2": "Invalid arguments",
          "5": "File not found"
        }
      },
      "errors": [],
      "warnings": [],
      "metadata": {
        "executionTime": 0,
        "hostname": "REDACTED-BUILD-HOST",
        "user": "REDACTED-BUILD-USER"
      }
    },
    "flag_e": {
      "status": "success",
      "timestamp": "2026-06-28T11:16:30.191911085Z",
      "command": "examples",
      "version": "9.8.4",
      "data": {
        "name": "ai-scheduler",
        "description": "Usage examples for ai-scheduler",
        "categories": [
          {
            "id": "1_daemon_control",
            "title": "Daemon Control",
            "description": "Start and manage the scheduler daemon",
            "examples": [
              {
                "command": "sudo ai-scheduler start",
                "description": "Start scheduler daemon",
                "expectedOutput": "Scheduler daemon started successfully",
                "notes": "Runs as background service"
              },
              {
                "command": "sudo ai-scheduler start --foreground",
                "description": "Start in foreground mode for debugging",
                "expectedOutput": "Scheduler running in foreground with live output",
                "notes": "Useful for debugging and testing scheduled tasks"
              },
              {
                "command": "sudo ai-scheduler start --foreground --json",
                "description": "Foreground mode with JSON status output",
                "expectedOutput": "JSON events as tasks are scheduled and executed",
                "notes": "Combines debug visibility with structured output"
              },
              {
                "command": "sudo ai-scheduler start --json",
                "description": "Start daemon with JSON status output",
                "expectedOutput": "JSON response with daemon process info",
                "notes": "Useful for automated monitoring"
              }
            ]
          },
          {
            "id": "2_schedule_management",
            "title": "Schedule Management",
            "description": "Add, list, and remove scheduled tasks",
            "examples": [
              {
                "command": "ai-scheduler add --name \"daily-check\" --command \"health-control net-check\" --cron \"0 8 * * *\"",
                "description": "Schedule a daily network check at 8 AM",
                "expectedOutput": "Task scheduled successfully with ID",
                "notes": "Cron syntax: minute hour day month weekday"
              },
              {
                "command": "ai-scheduler add --name \"hourly-tor\" --command \"tor-switch tor-status\" --cron \"0 * * * *\"",
                "description": "Check Tor status every hour",
                "expectedOutput": "Hourly task created successfully",
                "notes": "Executes at the start of each hour"
              },
              {
                "command": "ai-scheduler add --name \"dns-check\" --command \"dns-leak test\" --cron \"*/30 * * * *\" --json",
                "description": "Schedule DNS leak check every 30 minutes with JSON output",
                "expectedOutput": "JSON with task ID and schedule details",
                "notes": "Full add command with all parameters and structured output"
              },
              {
                "command": "ai-scheduler add --name \"weekly-cleanup\" --command \"health-control cleanup\" --cron \"0 2 * * 0\" --json",
                "description": "Schedule weekly cleanup every Sunday at 2 AM",
                "expectedOutput": "Task details in JSON format",
                "notes": "Weekday 0 = Sunday, 1 = Monday, etc."
              },
              {
                "command": "ai-scheduler list",
                "description": "List all scheduled tasks",
                "expectedOutput": "Table of scheduled tasks with IDs and status",
                "notes": "Shows task name, command, schedule, and next run"
              },
              {
                "command": "ai-scheduler list --json",
                "description": "List scheduled tasks as JSON",
                "expectedOutput": "Task list in JSON format",
                "notes": "Structured output for automation"
              },
              {
                "command": "ai-scheduler remove 1",
                "description": "Remove scheduled task by ID",
                "expectedOutput": "Task removed successfully",
                "notes": "Use 'list' command to find task IDs"
              },
              {
                "command": "ai-scheduler remove 2 --json",
                "description": "Remove task with JSON confirmation",
                "expectedOutput": "JSON response confirming task removal"
              }
            ]
          },
          {
            "id": "3_gateway_core_policy",
            "title": "Gateway Core Policy Validation",
            "description": "Scheduler command validation is aligned with shared ai-gateway core policy and sanitization rules",
            "examples": [
              {
                "command": "ai-scheduler add --name \"tor-health\" --command \"tor-switch tor-status\" --cron \"*/15 * * * *\" --json",
                "description": "Valid passive command accepted by shared gateway-core validator",
                "expectedOutput": "Task created successfully"
              },
              {
                "command": "ai-scheduler add --name \"blocked-test\" --command \"malicious-binary run\" --cron \"0 * * * *\" --json",
                "description": "Unknown service is rejected by shared validator before scheduling",
                "expectedOutput": "Validation error indicating service is blocked"
              }
            ]
          }
        ],
        "quickReference": [
          "sudo ai-scheduler --help",
          "sudo ai-scheduler --version",
          "sudo ai-scheduler --info --json",
          "sudo ai-scheduler --examples --json"
        ]
      },
      "errors": [],
      "warnings": [],
      "metadata": {
        "executionTime": 0,
        "hostname": "REDACTED-BUILD-HOST",
        "user": "REDACTED-BUILD-USER"
      }
    }
  }
}
