{
  "report_info": {
    "version": "9.0.1",
    "generated_at": "2026-04-11T17:16:26Z",
    "binary_name": "ai-cmd"
  },
  "binary": {
    "name": "ai-cmd",
    "path": "/home/kodachi/k900/dashboard/hooks/ai-cmd",
    "timestamp": "2026-04-11T17:16:26Z",
    "file_info": {
      "size": 58672632,
      "sha256": "3b064f634c6ddb200f631ade173ec28607bc6978bb1c27a1cbd794fff2900613"
    },
    "flag_n": {
      "status": "success",
      "timestamp": "2026-04-11T17:16:26.776691794Z",
      "command": "info",
      "version": "9.0.1",
      "data": {
        "name": "ai-cmd",
        "version": "9.0.1",
        "author": "Warith Al Maawali",
        "description": "AI-powered command-line interface for natural language command execution",
        "copyright": "© 2026 Linux Kodachi",
        "website": "https://www.digi77.com",
        "license": "Proprietary",
        "features": [],
        "securityFeatures": {
          "inputValidation": "All inputs are validated and sanitized",
          "rateLimiting": "Built-in rate limiting for network operations",
          "authentication": "Secure authentication with certificate pinning",
          "encryption": "TLS 1.3 for all network communications"
        },
        "systemRequirements": {
          "os": "Linux (Debian-based)",
          "privileges": "root/sudo for system operations",
          "dependencies": [
            "OpenSSL",
            "libcurl"
          ]
        }
      },
      "errors": [],
      "warnings": [],
      "metadata": {
        "executionTime": 1,
        "hostname": "Boardroom-System",
        "user": "kodachi"
      }
    },
    "flag_v": {
      "status": "success",
      "timestamp": "2026-04-11T17:16:26.904299855Z",
      "command": "version",
      "version": "9.0.1",
      "data": {
        "name": "ai-cmd",
        "version": "9.0.1",
        "buildDate": "2026-04-11T17:16:26.901556477Z",
        "gitCommit": "unknown",
        "rustVersion": "1.82.0"
      },
      "errors": [],
      "warnings": [],
      "metadata": {
        "executionTime": 2,
        "hostname": "Boardroom-System",
        "user": "kodachi"
      }
    },
    "flag_h": {
      "status": "success",
      "timestamp": "2026-04-11T17:16:26.996185311Z",
      "command": "help",
      "version": "9.0.1",
      "data": {
        "name": "ai-cmd",
        "description": "AI-powered command-line interface for natural language command execution",
        "usage": "ai-cmd [OPTIONS] [COMMAND] [ARGS]",
        "commandCategories": [
          {
            "category": "Commands",
            "commands": [
              {
                "name": "query",
                "description": "Process a natural language query and execute the matching command",
                "usage": "ai-cmd ai-cmd query \"<natural language query>\"",
                "options": [
                  {
                    "flag": "--threshold",
                    "description": "Confidence threshold for execution"
                  },
                  {
                    "flag": "--dry-run",
                    "description": "Preview without execution"
                  },
                  {
                    "flag": "--auto-execute",
                    "description": "Auto-execute high confidence matches"
                  },
                  {
                    "flag": "--engine",
                    "description": "AI engine tier: auto, tfidf, onnx, onnx-classifier, llm, mistral, genai, claude",
                    "default": "auto"
                  },
                  {
                    "flag": "--model-path",
                    "description": "Path to GGUF model for local LLM tier"
                  },
                  {
                    "flag": "--stream",
                    "description": "Stream response tokens in real-time"
                  },
                  {
                    "flag": "--temperature",
                    "description": "Sampling temperature 0.0-2.0 (default: 0.7)",
                    "default": "0.7"
                  },
                  {
                    "flag": "--model",
                    "description": "Model name for GenAI tier (supports local, OpenAI/Codex, Claude, Gemini, OpenRouter routing)"
                  },
                  {
                    "flag": "--tor-proxy",
                    "description": "Route cloud providers through Tor proxy"
                  },
                  {
                    "flag": "--use",
                    "description": "Use a specific GGUF model file from models/ directory"
                  },
                  {
                    "flag": "--no-gateway, --skip-gateway",
                    "description": "Bypass gateway validation and execute directly"
                  }
                ],
                "requires_sudo": false,
                "examples": [
                  "ai-cmd query \"check network connectivity\"",
                  "ai-cmd query \"start tor service\" --dry-run",
                  "ai-cmd query \"get my ip address\" --json",
                  "ai-cmd query \"block internet\" --threshold 0.8",
                  "ai-cmd query \"check tor\" --engine onnx",
                  "ai-cmd query \"check tor\" --engine mistral",
                  "ai-cmd query \"check tor\" --engine mistral --json",
                  "ai-cmd query \"check tor status\" --no-gateway --dry-run",
                  "ai-cmd query \"check tor status\" --skip-gateway --dry-run",
                  "ai-cmd query \"check tor status\" --engine genai --model gpt-4o-mini --dry-run",
                  "ai-cmd query \"check tor status\" --engine genai --model claude-sonnet-4-5 --tor-proxy --dry-run"
                ]
              },
              {
                "name": "interactive",
                "description": "Start interactive REPL mode for continuous queries",
                "usage": "ai-cmd ai-cmd interactive",
                "options": [
                  {
                    "flag": "--threshold",
                    "description": "Confidence threshold for execution"
                  },
                  {
                    "flag": "--engine",
                    "description": "AI engine tier: auto, tfidf, onnx, llm, claude",
                    "default": "auto"
                  },
                  {
                    "flag": "--model-path",
                    "description": "Path to GGUF model for local LLM tier"
                  }
                ],
                "requires_sudo": false,
                "examples": [
                  "ai-cmd interactive",
                  "ai-cmd interactive --threshold 0.8",
                  "ai-cmd interactive --engine onnx",
                  "ai-cmd interactive --engine claude --threshold 0.7",
                  "ai-cmd interactive --engine llm --model-path ./models/phi.gguf",
                  "ai-cmd interactive --engine genai"
                ]
              },
              {
                "name": "feedback",
                "description": "Submit feedback to improve intent classification",
                "usage": "ai-cmd ai-cmd feedback \"<query>\" [OPTIONS]",
                "options": [
                  {
                    "flag": "--correct-intent",
                    "description": "Specify the correct intent ID"
                  },
                  {
                    "flag": "--correct-command",
                    "description": "Specify the correct command"
                  },
                  {
                    "flag": "--comment",
                    "description": "Add a comment"
                  }
                ],
                "requires_sudo": false,
                "examples": [
                  "ai-cmd feedback \"check network\" --correct-intent network_check",
                  "ai-cmd feedback \"test internet\" --correct-command \"health-control net-check\"",
                  "ai-cmd feedback \"my ip\" --comment \"Should show IP address\""
                ]
              },
              {
                "name": "preview",
                "description": "Preview intent classification without execution",
                "usage": "ai-cmd ai-cmd preview \"<query>\"",
                "options": [
                  {
                    "flag": "--alternatives",
                    "description": "Number of alternative matches to show",
                    "default": "3"
                  }
                ],
                "requires_sudo": false,
                "examples": [
                  "ai-cmd preview \"check network\"",
                  "ai-cmd preview \"stop tor\" --alternatives 5",
                  "ai-cmd preview \"block internet\" --json"
                ]
              },
              {
                "name": "voice",
                "description": "Voice input mode for natural language queries",
                "usage": "ai-cmd ai-cmd voice [OPTIONS]",
                "options": [
                  {
                    "flag": "--continuous",
                    "description": "Enable continuous listening mode"
                  },
                  {
                    "flag": "--timeout",
                    "description": "Timeout for voice input in seconds",
                    "default": "30"
                  },
                  {
                    "flag": "--provider",
                    "description": "STT provider: whisper-cpp, vosk, placeholder, auto",
                    "default": "auto"
                  },
                  {
                    "flag": "--voice",
                    "description": "TTS voice name",
                    "default": "en"
                  },
                  {
                    "flag": "--speed",
                    "description": "Speech speed (words per minute)",
                    "default": "175"
                  },
                  {
                    "flag": "--list-devices",
                    "description": "List available audio devices"
                  },
                  {
                    "flag": "--check-deps",
                    "description": "Check voice engine dependencies"
                  }
                ],
                "requires_sudo": false,
                "examples": [
                  "ai-cmd voice",
                  "ai-cmd voice --continuous",
                  "ai-cmd voice --timeout 60",
                  "ai-cmd voice --provider whisper-cpp",
                  "ai-cmd voice --voice en-us --speed 200",
                  "ai-cmd voice --list-devices",
                  "ai-cmd voice --check-deps"
                ]
              },
              {
                "name": "suggest",
                "description": "Get proactive command suggestions based on usage patterns",
                "usage": "ai-cmd ai-cmd suggest [OPTIONS]",
                "options": [
                  {
                    "flag": "--limit",
                    "description": "Number of suggestions to show",
                    "default": "5"
                  },
                  {
                    "flag": "--proactive",
                    "description": "Show proactive suggestions"
                  }
                ],
                "requires_sudo": false,
                "examples": [
                  "ai-cmd suggest",
                  "ai-cmd suggest --limit 10",
                  "ai-cmd suggest --proactive"
                ]
              },
              {
                "name": "workflow",
                "description": "Execute workflow profiles via natural language queries",
                "usage": "ai-cmd workflow [OPTIONS]",
                "options": [],
                "requires_sudo": false
              },
              {
                "name": "tiers",
                "description": "List all AI engine tiers and their availability status",
                "usage": "ai-cmd ai-cmd tiers [--json]",
                "options": [],
                "requires_sudo": false,
                "examples": [
                  "ai-cmd tiers",
                  "ai-cmd tiers --json"
                ]
              },
              {
                "name": "tools",
                "description": "List all callable AI tools with parameter schemas",
                "usage": "ai-cmd ai-cmd tools [--json]",
                "options": [],
                "requires_sudo": false,
                "examples": [
                  "ai-cmd tools",
                  "ai-cmd tools --json"
                ]
              },
              {
                "name": "providers",
                "description": "List available GenAI providers and model configuration",
                "usage": "ai-cmd ai-cmd providers [--json]",
                "options": [],
                "requires_sudo": false,
                "examples": [
                  "ai-cmd providers",
                  "ai-cmd providers --json"
                ]
              },
              {
                "name": "model-info",
                "description": "Show loaded AI model details and configuration",
                "usage": "ai-cmd ai-cmd model-info [--json]",
                "options": [],
                "requires_sudo": false,
                "examples": [
                  "ai-cmd model-info",
                  "ai-cmd model-info --json"
                ]
              },
              {
                "name": "policy",
                "description": "Show current AI policy (intent thresholds, tool allowlist, risk mode)",
                "usage": "ai-cmd ai-cmd policy [--json]",
                "options": [],
                "requires_sudo": false,
                "examples": [
                  "ai-cmd policy",
                  "ai-cmd policy --json"
                ]
              },
              {
                "name": "export-intents",
                "description": "Export all intents as JSON catalog for shared libraries",
                "usage": "ai-cmd ai-cmd export-intents [--output FILE] [--json]",
                "options": [],
                "requires_sudo": false,
                "examples": [
                  "ai-cmd export-intents",
                  "ai-cmd export-intents --output intent-catalog.json",
                  "ai-cmd export-intents --json"
                ]
              }
            ]
          }
        ],
        "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": "--json-pretty",
            "description": "Pretty-print JSON output with indentation"
          },
          {
            "flag": "--json-human",
            "description": "Enhanced JSON output with improved formatting (like jq)"
          },
          {
            "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 timeout (default: 30)"
          },
          {
            "flag": "--retry <COUNT>",
            "description": "Retry attempts (default: 3)"
          }
        ],
        "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": {
          "5": "File not found",
          "1": "General error",
          "0": "Success",
          "2": "Invalid arguments",
          "3": "Permission denied",
          "4": "Network error"
        }
      },
      "errors": [],
      "warnings": [],
      "metadata": {
        "executionTime": 1,
        "hostname": "Boardroom-System",
        "user": "kodachi"
      }
    },
    "flag_e": {
      "status": "success",
      "timestamp": "2026-04-11T17:16:27.198047889Z",
      "command": "examples",
      "version": "9.0.1",
      "data": {
        "name": "ai-cmd",
        "description": "Usage examples for ai-cmd",
        "categories": [
          {
            "id": "1_basic",
            "title": "Basic Usage",
            "description": "Basic natural language queries (safe mode examples)",
            "examples": [
              {
                "command": "ai-cmd query \"check network connectivity\" --dry-run",
                "description": "Check network status using natural language",
                "expectedOutput": "Dry-run preview of matched command"
              },
              {
                "command": "ai-cmd query \"what is my ip address\" --dry-run --json",
                "description": "Get IP address query result with JSON output",
                "expectedOutput": "JSON with intent and command preview"
              }
            ]
          },
          {
            "id": "2_advanced",
            "title": "Advanced Features",
            "description": "Advanced query options and preview workflows",
            "examples": [
              {
                "command": "ai-cmd query \"start tor service\" --dry-run",
                "description": "Preview command execution without running",
                "expectedOutput": "Dry-run preview of Tor command"
              },
              {
                "command": "ai-cmd interactive --help",
                "description": "Show interactive mode usage",
                "expectedOutput": "Interactive mode options and examples"
              },
              {
                "command": "ai-cmd preview \"block internet\" --alternatives 5",
                "description": "Preview intent matching with alternatives",
                "expectedOutput": "Intent analysis with alternative matches"
              },
              {
                "command": "ai-cmd query \"test dns leak\" --threshold 0.8 --dry-run",
                "description": "Use custom confidence threshold with dry-run",
                "expectedOutput": "Dry-run preview gated by threshold"
              }
            ]
          },
          {
            "id": "3_feedback",
            "title": "Feedback System",
            "description": "Feedback command syntax and usage patterns",
            "examples": [
              {
                "command": "ai-cmd feedback \"check network\" --correct-intent network_check --help",
                "description": "Show feedback syntax for intent correction",
                "expectedOutput": "Feedback command usage help"
              },
              {
                "command": "ai-cmd feedback \"check tor\" --correct-command \"tor-switch tor-status\" --help",
                "description": "Show feedback syntax for command correction",
                "expectedOutput": "Feedback command usage help"
              },
              {
                "command": "ai-cmd feedback \"check tor\" --comment \"Should use tor-status subcommand\" --help",
                "description": "Show feedback syntax for comments",
                "expectedOutput": "Feedback command usage help"
              }
            ]
          },
          {
            "id": "4_voice",
            "title": "Voice Input",
            "description": "Voice command usage, diagnostics, and device checks",
            "examples": [
              {
                "command": "ai-cmd voice --help",
                "description": "Show voice mode usage and options",
                "expectedOutput": "Voice command help"
              },
              {
                "command": "ai-cmd voice --continuous --help",
                "description": "Show continuous voice mode usage",
                "expectedOutput": "Voice command help for continuous mode"
              },
              {
                "command": "ai-cmd voice --timeout 10 --help",
                "description": "Show timeout option usage",
                "expectedOutput": "Voice command help with timeout option"
              },
              {
                "command": "ai-cmd voice --provider vosk --help",
                "description": "Show provider selection usage",
                "expectedOutput": "Voice command help with provider option"
              },
              {
                "command": "ai-cmd voice --list-devices",
                "description": "List available audio input devices",
                "expectedOutput": "Audio device list"
              },
              {
                "command": "ai-cmd voice --check-deps",
                "description": "Check voice dependencies",
                "expectedOutput": "Voice dependency status report"
              }
            ]
          },
          {
            "id": "5_suggestions",
            "title": "AI Suggestions",
            "description": "Get command suggestions based on usage patterns",
            "examples": [
              {
                "command": "ai-cmd suggest",
                "description": "Get recent command suggestions",
                "expectedOutput": "List of suggested commands"
              },
              {
                "command": "ai-cmd suggest --proactive",
                "description": "Get proactive suggestions",
                "expectedOutput": "Popular or proactive suggestions"
              },
              {
                "command": "ai-cmd suggest --limit 5",
                "description": "Limit number of suggestions",
                "expectedOutput": "Top 5 suggestions"
              }
            ]
          },
          {
            "id": "6_interactive",
            "title": "Interactive Mode",
            "description": "Interactive REPL usage and configuration options",
            "examples": [
              {
                "command": "ai-cmd interactive --help",
                "description": "Show interactive mode usage",
                "expectedOutput": "Interactive mode help"
              },
              {
                "command": "ai-cmd interactive --threshold 0.8 --help",
                "description": "Show threshold usage in interactive mode",
                "expectedOutput": "Interactive help with threshold option"
              },
              {
                "command": "ai-cmd interactive --engine onnx --help",
                "description": "Show ONNX engine interactive usage",
                "expectedOutput": "Interactive help with engine option"
              },
              {
                "command": "ai-cmd interactive --engine claude --threshold 0.7 --help",
                "description": "Show Claude interactive syntax",
                "expectedOutput": "Interactive help with Claude engine options"
              },
              {
                "command": "ai-cmd interactive --engine llm --model-path ./models/phi.gguf --help",
                "description": "Show local LLM interactive syntax",
                "expectedOutput": "Interactive help with model-path option"
              }
            ]
          },
          {
            "id": "7_engine_tiers",
            "title": "AI Engine Tiers",
            "description": "Select specific AI engine tiers for query processing",
            "examples": [
              {
                "command": "ai-cmd query \"check tor\" --engine auto --dry-run",
                "description": "Auto-select best available engine tier",
                "expectedOutput": "Dry-run preview using auto-selected tier"
              },
              {
                "command": "ai-cmd query \"check tor\" --engine tfidf --dry-run",
                "description": "Use TF-IDF keyword matching tier",
                "expectedOutput": "Dry-run preview using tfidf tier"
              },
              {
                "command": "ai-cmd query \"check tor\" --engine onnx --dry-run",
                "description": "Use ONNX semantic matching tier",
                "expectedOutput": "Dry-run preview using onnx tier"
              },
              {
                "command": "ai-cmd query \"check tor\" --engine mistral --help",
                "description": "Show Mistral tier syntax and options",
                "expectedOutput": "Query help with mistral engine"
              },
              {
                "command": "ai-cmd query \"check tor\" --engine genai --help",
                "description": "Show GenAI tier syntax and options",
                "expectedOutput": "Query help with genai engine"
              },
              {
                "command": "ai-cmd query \"check tor\" --engine llm --help",
                "description": "Show legacy LLM tier syntax",
                "expectedOutput": "Query help with llm engine"
              },
              {
                "command": "ai-cmd query \"check tor\" --engine llm --model-path ./models/phi.gguf --help",
                "description": "Show custom model-path syntax",
                "expectedOutput": "Query help with model-path option"
              },
              {
                "command": "ai-cmd query \"check tor\" --engine claude --help",
                "description": "Show Claude tier syntax and options",
                "expectedOutput": "Query help with claude engine"
              },
              {
                "command": "ai-cmd query \"check tor status\" --engine onnx --dry-run",
                "description": "ONNX engine with dry-run preview",
                "expectedOutput": "Preview matched command without executing"
              },
              {
                "command": "ai-cmd query \"test dns leak\" --engine onnx --dry-run",
                "description": "ONNX engine dry-run validation",
                "expectedOutput": "Dry-run DNS leak query preview"
              },
              {
                "command": "ai-cmd tiers",
                "description": "Show all available AI tiers and status",
                "expectedOutput": "Tier list with availability indicators"
              }
            ]
          },
          {
            "id": "7b_mistral_local",
            "title": "Mistral.rs Local LLM",
            "description": "Mistral tier command syntax and diagnostics",
            "examples": [
              {
                "command": "ai-cmd query \"is my system secure?\" --engine mistral --help",
                "description": "Show local mistral query syntax",
                "expectedOutput": "Query help with mistral options"
              },
              {
                "command": "ai-cmd query \"check all services\" --engine mistral --stream --help",
                "description": "Show mistral streaming syntax",
                "expectedOutput": "Query help including stream option"
              },
              {
                "command": "ai-cmd query \"run dns leak test\" --engine mistral --temperature 0.3 --help",
                "description": "Show mistral temperature option usage",
                "expectedOutput": "Query help including temperature option"
              },
              {
                "command": "ai-cmd model-info --json",
                "description": "Show loaded model details and tier metadata",
                "expectedOutput": "JSON model status"
              }
            ]
          },
          {
            "id": "7c_genai_ollama",
            "title": "Ollama / GenAI Provider",
            "description": "GenAI tier syntax and provider discovery",
            "examples": [
              {
                "command": "ai-cmd query \"analyze my network\" --engine genai --help",
                "description": "Show genai query syntax",
                "expectedOutput": "Query help with genai options"
              },
              {
                "command": "ai-cmd query \"security audit\" --engine genai --model llama3:8b --help",
                "description": "Show genai model override syntax",
                "expectedOutput": "Query help with model option"
              },
              {
                "command": "ai-cmd providers --json",
                "description": "List available providers and models",
                "expectedOutput": "JSON provider list"
              },
              {
                "command": "ai-cmd query \"detailed analysis\" --engine genai --model gpt-4o-mini --tor-proxy --help",
                "description": "Show OpenAI/Codex model syntax with tor-proxy flag",
                "expectedOutput": "Query help including tor-proxy option"
              },
              {
                "command": "ai-cmd query \"check tor status\" --engine genai --model claude-sonnet-4-5 --dry-run",
                "description": "Show Claude model syntax (direct key or OpenRouter fallback)",
                "expectedOutput": "Dry-run preview using Claude-compatible cloud routing"
              },
              {
                "command": "ai-cmd query \"check dns status\" --engine genai --model gemini-2.0-flash --dry-run",
                "description": "Show Gemini model syntax (direct key or OpenRouter fallback)",
                "expectedOutput": "Dry-run preview using Gemini-compatible cloud routing"
              }
            ]
          },
          {
            "id": "7d_tool_calling",
            "title": "Tool Calling",
            "description": "Tool-calling queries and tool catalog inspection",
            "examples": [
              {
                "command": "ai-cmd query \"what's my tor status and dns config?\" --dry-run",
                "description": "Tool-calling query in safe dry-run mode",
                "expectedOutput": "Dry-run preview for multi-tool query"
              },
              {
                "command": "ai-cmd tools --json",
                "description": "List all callable tools with JSON metadata",
                "expectedOutput": "JSON tool definitions"
              },
              {
                "command": "ai-cmd tools",
                "description": "Show tools grouped by domain",
                "expectedOutput": "Human-readable tool catalog"
              }
            ]
          },
          {
            "id": "7e_security_routing",
            "title": "Security-First Routing",
            "description": "Fast-path and fallback-path routing examples",
            "examples": [
              {
                "command": "ai-cmd query \"check tor status\" --dry-run",
                "description": "Fast-path style query with dry-run",
                "expectedOutput": "Dry-run preview for tor status"
              },
              {
                "command": "ai-cmd query \"explain tor routing in detail\" --engine mistral --help",
                "description": "Show slow-path mistral syntax",
                "expectedOutput": "Query help for mistral explanation path"
              },
              {
                "command": "ai-cmd query \"change dns to cloudflare\" --dry-run",
                "description": "Configuration change flow with safety preview",
                "expectedOutput": "Dry-run preview of DNS change"
              }
            ]
          },
          {
            "id": "7f_ai_policy",
            "title": "AI Policy",
            "description": "View and manage AI policy configuration including intent thresholds, tool allowlists, and risk mode.",
            "examples": [
              {
                "command": "ai-cmd policy",
                "description": "Show current AI policy (thresholds, tools, risk mode)",
                "expectedOutput": "Policy details with intent thresholds and tool list"
              },
              {
                "command": "ai-cmd policy --json",
                "description": "AI policy as JSON for programmatic use",
                "expectedOutput": "JSON with version, thresholds, allowlist, signature status"
              }
            ]
          },
          {
            "id": "7g_model_management",
            "title": "Model Management",
            "description": "Download, list, and select GGUF models for local LLM inference",
            "examples": [
              {
                "command": "ai-cmd query \"check tor\" --use Qwen2.5-3B-Instruct-Q4_K_M.gguf --help",
                "description": "Show syntax for selecting a specific GGUF model file",
                "expectedOutput": "Query help with --use model selector",
                "notes": "Use --use without --help when the model file exists in models/"
              },
              {
                "command": "ai-cmd model-info --json",
                "description": "Show details of loaded model",
                "expectedOutput": "Model path, architecture, and capabilities"
              },
              {
                "command": "ai-cmd tiers --json",
                "description": "Show all AI tiers including model availability",
                "expectedOutput": "JSON with tier details and download status"
              }
            ]
          },
          {
            "id": "8_linux_commands",
            "title": "Linux System Commands",
            "description": "General-purpose Linux system commands via natural language",
            "examples": [
              {
                "command": "ai-cmd query \"how much disk space\" --dry-run",
                "description": "Disk usage request preview",
                "expectedOutput": "Dry-run preview for disk space command"
              },
              {
                "command": "ai-cmd query \"list running processes\" --dry-run",
                "description": "Process listing request preview",
                "expectedOutput": "Dry-run preview for process listing command"
              },
              {
                "command": "ai-cmd query \"check if port 80 is open\" --dry-run",
                "description": "Network port check request preview",
                "expectedOutput": "Dry-run preview for port inspection command"
              },
              {
                "command": "ai-cmd query \"update system packages\" --dry-run",
                "description": "Safe preview of package update flow",
                "expectedOutput": "Dry-run preview of package update",
                "notes": "Remove --dry-run to execute after authentication"
              },
              {
                "command": "ai-cmd query \"ping google\" --dry-run",
                "description": "Network diagnostic request preview",
                "expectedOutput": "Dry-run preview for ping diagnostic"
              },
              {
                "command": "ai-cmd query \"show system logs\" --engine tfidf --dry-run",
                "description": "Log viewing with explicit TF-IDF engine",
                "expectedOutput": "Dry-run preview using tfidf tier"
              },
              {
                "command": "ai-cmd query \"restart nginx service\" --threshold 0.9 --dry-run",
                "description": "Service management query with strict confidence threshold",
                "expectedOutput": "Dry-run preview gated by 0.9 threshold"
              },
              {
                "command": "ai-cmd query \"check firewall rules\" --dry-run",
                "description": "Firewall inspection query preview",
                "expectedOutput": "Dry-run preview for firewall status command"
              }
            ]
          },
          {
            "id": "9_threshold_ref",
            "title": "Confidence Threshold Reference",
            "description": "The --threshold flag controls minimum confidence required for a match. Range: 0.3 to 1.0. Default: 0.6.",
            "examples": [
              {
                "command": "ai-cmd query \"check tor\" --threshold 0.3 --dry-run",
                "description": "Minimum threshold for broad matching",
                "expectedOutput": "Dry-run preview with loose confidence gating"
              },
              {
                "command": "ai-cmd query \"check tor\" --threshold 0.6 --dry-run",
                "description": "Default threshold balance",
                "expectedOutput": "Dry-run preview with default confidence gating"
              },
              {
                "command": "ai-cmd query \"block internet\" --threshold 0.8 --dry-run",
                "description": "Higher threshold for sensitive operations",
                "expectedOutput": "Dry-run preview with strict confidence gating"
              },
              {
                "command": "ai-cmd query \"check tor\" --threshold 0.95 --dry-run",
                "description": "Very strict threshold for near-exact matching",
                "expectedOutput": "Dry-run preview requiring near-exact match"
              }
            ]
          },
          {
            "id": "10_workflows",
            "title": "Workflow Profiles",
            "description": "Execute multi-step workflow profiles for complete operations",
            "examples": [
              {
                "command": "ai-cmd workflow --list",
                "description": "List all available workflow profiles",
                "expectedOutput": "Profiles grouped by category (privacy, emergency, network, etc.)"
              },
              {
                "command": "ai-cmd workflow \"maximum privacy setup\" --preview",
                "description": "Preview privacy workflow profile",
                "expectedOutput": "Workflow details, steps, and services used",
                "notes": "Use without --preview to execute after review"
              },
              {
                "command": "ai-cmd workflow \"emergency recovery\" --preview",
                "description": "Preview emergency recovery workflow",
                "expectedOutput": "Workflow details, steps, and services used"
              },
              {
                "command": "ai-cmd workflow \"setup network\" --dry-run",
                "description": "Dry-run workflow execution",
                "expectedOutput": "Shows what would be executed without running commands"
              },
              {
                "command": "ai-cmd workflow \"tor setup\" --threshold 0.7 --preview",
                "description": "Preview with custom confidence threshold",
                "expectedOutput": "Workflow preview if confidence >= 0.7"
              },
              {
                "command": "ai-cmd workflow --stats",
                "description": "Show workflow registry statistics",
                "expectedOutput": "Profile counts, categories, and service usage"
              },
              {
                "command": "ai-cmd workflow \"complete anonymity\" --param country=us --preview",
                "description": "Preview workflow with custom parameters",
                "expectedOutput": "Workflow with custom parameter values",
                "notes": "Pass key=value pairs for profile parameters"
              }
            ]
          },
          {
            "id": "11_setup",
            "title": "Setup & Model Management",
            "description": "Download AI models and manage engine tiers (via ai-trainer)",
            "examples": [
              {
                "command": "ai-cmd tiers",
                "description": "List all AI engine tiers and their availability",
                "expectedOutput": "Tier list showing which engines are available",
                "notes": "Shows setup hints for unavailable tiers"
              },
              {
                "command": "ai-cmd model-info",
                "description": "Show active model paths and availability across AI tiers",
                "expectedOutput": "Model inventory for embeddings/LLM backends",
                "notes": "Useful before running complex queries"
              },
              {
                "command": "ai-cmd model-info --json",
                "description": "Get model inventory in JSON format",
                "expectedOutput": "Structured model metadata",
                "notes": "Suitable for automation checks"
              },
              {
                "command": "ai-cmd providers",
                "description": "List available provider backends",
                "expectedOutput": "Provider list and status"
              },
              {
                "command": "ai-cmd providers --json",
                "description": "List providers in JSON format",
                "expectedOutput": "Structured provider status details",
                "notes": "Includes fields useful for health checks"
              },
              {
                "command": "ai-cmd tiers --json",
                "description": "Show AI tier readiness in JSON format",
                "expectedOutput": "Tier availability and setup hints as JSON"
              }
            ]
          },
          {
            "id": "12_gateway_core",
            "title": "Gateway Core Integration",
            "description": "ai-cmd and ai-gateway share the same registry/policy/executor core for consistent behavior",
            "examples": [
              {
                "command": "ai-cmd query \"check tor status\" --dry-run --json",
                "description": "Service-style queries now validate through shared gateway core",
                "expectedOutput": "Dry-run preview with consistent policy decision"
              },
              {
                "command": "ai-cmd query \"check tor status\" --no-gateway --dry-run",
                "description": "Bypass gateway validation and execute directly (primary flag)",
                "expectedOutput": "Dry-run preview without gateway validation step"
              },
              {
                "command": "ai-cmd query \"check tor status\" --skip-gateway --dry-run",
                "description": "Same bypass behavior using alias flag",
                "expectedOutput": "Dry-run preview without gateway validation step",
                "notes": "`--skip-gateway` is an alias of `--no-gateway`"
              },
              {
                "command": "ai-cmd query \"test dns leak\" --skip-gateway --dry-run",
                "description": "Skip gateway for commands with long execution times",
                "expectedOutput": "Dry-run preview bypassing gateway timeout"
              },
              {
                "command": "ai-cmd policy --json",
                "description": "Display policy guard configuration used by shared gateway core",
                "expectedOutput": "JSON policy summary",
                "notes": "Confirms deny/allow behavior used during execution"
              },
              {
                "command": "ai-cmd tools --json",
                "description": "List tool metadata exposed through the shared core",
                "expectedOutput": "JSON tool catalog with safety tiers",
                "notes": "Use this to verify command availability before query execution"
              }
            ]
          }
        ],
        "quickReference": [
          "sudo ai-cmd --help",
          "sudo ai-cmd --version",
          "sudo ai-cmd --info --json",
          "sudo ai-cmd --examples --json"
        ]
      },
      "errors": [],
      "warnings": [],
      "metadata": {
        "executionTime": 1,
        "hostname": "Boardroom-System",
        "user": "kodachi"
      }
    }
  }
}
