Najeebsk

AI-COMMANDS-PRO-MAX.py

Apr 21st, 2026
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 133.79 KB | None | 0 0
  1. # -*- coding: utf-8 -*-
  2. """
  3. NAJEEB V6.5 AI PRO CLI - STABLE EDITION (UPDATED)
  4. ✅ Windows 7 32-bit / Python 3.7.9 Compatible
  5. ✅ Professional Dark UI - All ttk/tk compatibility fixed
  6. ✅ Live Console | Themes | Edit-Before-Run | Alias Search
  7. ✅ JSON Import/Export | Scrollbar Fixed | JSON Error Recovery
  8. ✅ CRITICAL: Pack/Pady errors fixed | AttributeError resolved
  9. ✅ NEW: AI-BACKUPS REMOVED | History+Favorites saved in AI-CONFIG.json
  10. ✅ NEW: Direct Save/Edit Aliases in AI-DATA.json
  11. """
  12. import tkinter as tk
  13. from tkinter import ttk, messagebox, simpledialog, filedialog
  14. import subprocess, json, os, datetime, threading, re, sys
  15. from difflib import get_close_matches
  16.  
  17. # ================= CONFIGURATION =================
  18. DATA_FILE = "AI-DATA.json"        # Aliases Database
  19. CONFIG_FILE = "AI-CONFIG.json"     # Theme + History + Favorites
  20.  
  21. DANGEROUS_KEYWORDS = [
  22.     "format", "del /s", "del /f", "erase", "shutdown", "taskkill",
  23.     "reg delete", "diskpart", "cleanmgr", "sfc /scannow", "chkdsk /f",
  24.     "fdisk", "rd /s", "deltree", "wmic os call shutdown", "net user"
  25. ]
  26.  
  27. # ================= THEME CONFIGS =================
  28. THEMES = {
  29.     "Dark": {
  30.         "bg": "#121212", "fg": "#e0e0e0", "entry_bg": "#252526", "entry_fg": "#ffffff",
  31.         "console_bg": "#1e1e1e", "console_fg": "#00ff00", "header_fg": "#00bcd4",
  32.         "status_fg": "#888888", "border": "#3e3e42", "select": "#094771",
  33.         "tree_bg": "#1e1e1e", "tree_fg": "#d4d4d4", "highlight": "#00ffcc"
  34.     },
  35.     "Light": {
  36.         "bg": "#f3f3f3", "fg": "#1e1e1e", "entry_bg": "#ffffff", "entry_fg": "#000000",
  37.         "console_bg": "#ffffff", "console_fg": "#006400", "header_fg": "#00796b",
  38.         "status_fg": "#555555", "border": "#cccccc", "select": "#cce8ff",
  39.         "tree_bg": "#ffffff", "tree_fg": "#333333", "highlight": "#00796b"
  40.     },
  41.     "Azure": {
  42.         "bg": "#0078d7", "fg": "#ffffff", "entry_bg": "#1a8fe3", "entry_fg": "#ffffff",
  43.         "console_bg": "#005a9e", "console_fg": "#ffffff", "header_fg": "#ffffff",
  44.         "status_fg": "#e0f0ff", "border": "#0090d1", "select": "#0090d1",
  45.         "tree_bg": "#0063b1", "tree_fg": "#ffffff", "highlight": "#ffcc00"
  46.     }
  47. }
  48.  
  49. # ================= DEFAULT AI BRAIN =================
  50. default_data = {
  51.    
  52.     "info sys": "systeminfo",
  53.     "info hostname": "hostname",
  54.     "info current user": "whoami",
  55.     "info username": "echo %USERNAME%",
  56.     "info computer name": "echo %COMPUTERNAME%",
  57.     "info environment variables": "set",
  58.     "info path variable": "echo %PATH%",
  59.     "info current date": "date /t",
  60.     "info current time": "time /t",
  61.     "info system architecture": "wmic os get osarchitecture",
  62.     "info dxdiag": "dxdiag",
  63.     "info cpu": "wmic cpu get name,numberOfCores,threadCount,maxClockSpeed",
  64.     "info serial number": "wmic bios get serialnumber",
  65.     "info gpu": "wmic path win32_VideoController get name",
  66.     "info ram details": "wmic memorychip get capacity, speed, manufacturer",
  67.     "info total ram": "systeminfo | findstr /C:\"Total Physical Memory\"",
  68.     "info uptime": "net statistics workstation",
  69.     "info last boot time": "wmic os get lastbootuptime",
  70.     "info monitor": "wmic desktopmonitor get screenheight, screenwidth",
  71.     "ver py": "python3 --version",
  72.     "ver pip": "pip3 --version",
  73.     "ver windows": "ver",
  74.     "ver bios": "wmic bios get smbiosbiosversion",
  75.     "ver magick": "magick --version",
  76.     "ver ffmpeg": "ffmpeg -version",
  77.     "help arp": "arp /?",
  78.     "help magick": "magick --help",
  79.     "help ffmpeg": "ffmpeg -h",
  80.     "help ffmpeg full": "ffmpeg -h full > help.txt",
  81.     "help ffmpeg codecs": "ffmpeg -codecs",
  82.     "help ffmpeg formats": "ffmpeg -formats",
  83.     "help ffmpeg encoders": "ffmpeg -encoders",
  84.     "help ffmpeg decoders": "ffmpeg -decoders",
  85.     "help ffmpeg filters": "ffmpeg -filters",
  86.     "help powershell": "powershell -?",
  87.     "help cmd": "help",
  88.     "help dir": "help findstr",
  89.     "help diskpart": "help diskpart",
  90.     "help bcdedit": "help bcdedit",
  91.     "help wmic": "wmic /?",
  92.     "help where": "where /?",
  93.     "help assign": "help assign",
  94.     "help create": "help create",
  95.     "help format": "help format",
  96.     "List D:\\": "dir D:\\",
  97.     "list E:\\": "dir E:\\",
  98.     "list F:\\": "dir F:\\",
  99.     "list G:\\": "dir G:\\",
  100.     "list H:\\": "dir H:\\",
  101.     "list G:\\ find mp3": "dir G:\\*File-name*.mp3 /s /b",
  102.     "list pdf files": "dir *.pdf /s /b",
  103.     "list recent files": "dir /o:d /t:w",
  104.     "start paint": "mspaint",
  105.     "start note": "START notepad",
  106.     "start write": "START write",
  107.     "start cmd": "START cmd",
  108.     "start calc": "calc",
  109.     "start exp": "START explorer",
  110.     "start con": "START control",
  111.     "start youtube": "start chrome https://www.youtube.com",
  112.     "start google": "START http://www.google.com/",
  113.     "start Drive": "START D:\\",
  114.     "start snipping": "snippingtool",
  115.     "start magnifier": "magnify",
  116.     "start Okeyboard": "osk",
  117.     "start charmap": "charmap",
  118.     "start disk cleanup": "cleanmgr",
  119.     "start defrag": "dfrgui",
  120.     "start systeminfo": "msinfo32",
  121.     "start resource monitor": "resmon",
  122.     "start performance monitor": "perfmon",
  123.     "start event viewer": "eventvwr",
  124.     "start task scheduler": "taskschd.msc",
  125.     "start local security policy": "secpol.msc",
  126.     "start group policy": "gpedit.msc",
  127.     "start registry": "regedit",
  128.     "start services": "services.msc",
  129.     "start computer mgmt": "compmgmt.msc",
  130.     "start device manager": "devmgmt.msc",
  131.     "start disk management": "diskmgmt.msc",
  132.     "start print management": "printmanagement.msc",
  133.     "start firewall": "wf.msc",
  134.     "start windowsupdate": "control update",
  135.     "start programs": "appwiz.cpl",
  136.     "start date/time": "timedate.cpl",
  137.     "start mouse": "main.cpl",
  138.     "start keyboard": "control keyboard",
  139.     "start sound": "mmsys.cpl",
  140.     "start display": "desk.cpl",
  141.     "start network connections": "ncpa.cpl",
  142.     "start power options": "powercfg.cpl",
  143.     "start system": "sysdm.cpl",
  144.     "start user accounts": "control userpasswords2",
  145.     "start accessibility": "control accessibility",
  146.     "start fonts": "control fonts",
  147.     "start internet options": "inetcpl.cpl",
  148.     "start regional settings": "intl.cpl",
  149.     "start language settings": "control intl.cpl",
  150.     "start backup and restore": "sdclt",
  151.     "start recovery": "recovery",
  152.     "start action center": "wscui.cpl",
  153.     "start windows defender": "windowsdefender:",
  154.     "start settings app": "start ms-settings:",
  155.     "start store": "start ms-windows-store:",
  156.     "start photos": "start ms-photos:",
  157.     "start maps": "start ms-maps:",
  158.     "start weather": "start bingweather:",
  159.     "start news": "start bingnews:",
  160.     "start sports": "start bingsports:",
  161.     "start finance": "start bingfinance:",
  162.     "start feedback hub": "start microsoft.windows.feedback:",
  163.     "start xbox": "start xbox:",
  164.     "start camera": "start microsoft.windows.camera:",
  165.     "start voice recorder": "start soundrecorder:",
  166.     "start alaram clock": "start ms-clock:",
  167.     "start calculator": "start calc:",
  168.     "start calendar": "outlookcal:",
  169.     "start mail": "outlookmail:",
  170.     "start contacts": "outlookcontacts:",
  171.     "start tasks": "outlooktasks:",
  172.     "start notes": "onenote:",
  173.     "start skype": "start skype:",
  174.     "start teams": "start msteams:",
  175.     "start zoom": "start zoom:",
  176.     "start slack": "start slack:",
  177.     "start discord": "start discord:",
  178.     "start spotify": "start spotify:",
  179.     "start netflix": "start netflix:",
  180.     "start github": "start chrome https://github.com",
  181.     "start stackoverflow": "start chrome https://stackoverflow.com",
  182.     "start linkedin": "start chrome https://linkedin.com",
  183.     "start twitter": "start chrome https://twitter.com",
  184.     "start facebook": "start chrome https://facebook.com",
  185.     "start instagram": "start chrome https://instagram.com",
  186.     "start reddit": "start chrome https://reddit.com",
  187.     "start wikipedia": "start chrome https://wikipedia.org",
  188.     "start paypal": "start chrome https://paypal.com",
  189.     "start box": "start chrome https://box.com",
  190.     "start evernote": "start evernote:",
  191.     "start webex": "start webex:",
  192.     "shell:adminTools": "shell:adminTools",
  193.     "shell:cache": "shell:cache",
  194.     "shell:camera roll": "shell:camera roll",
  195.     "shell:common adminTools": "shell:common adminTools",
  196.     "shell:common documents": "shell:common documents",
  197.     "shell:common programs": "shell:common programs",
  198.     "shell:common startup": "shell:common startup",
  199.     "shell:common templates": "shell:common templates",
  200.     "shell:conflictresolutionfolder": "shell:conflictresolutionfolder",
  201.     "shell:connections": "shell:connections",
  202.     "shell:controlpanelfolder": "shell:controlpanelfolder",
  203.     "shell:cookies": "shell:cookies",
  204.     "shell:desktop": "shell:desktop",
  205.     "shell:deviceMetadataStore": "shell:deviceMetadataStore",
  206.     "shell:documents": "shell:documents",
  207.     "shell:downloads": "shell:downloads",
  208.     "shell:fonts": "shell:fonts",
  209.     "shell:games": "shell:games",
  210.     "shell:history": "shell:history",
  211.     "shell:libraries": "shell:libraries",
  212.     "shell:local appdata": "shell:local appdata",
  213.     "shell:music": "shell:music",
  214.     "shell:my music": "shell:my music",
  215.     "shell:my pictures": "shell:my pictures",
  216.     "shell:my video": "shell:my video",
  217.     "shell:netHood": "shell:netHood",
  218.     "shell:networkplaces": "shell:networkplaces",
  219.     "shell:original images": "shell:original images",
  220.     "shell:photo album": "shell:photo album",
  221.     "shell:pictures": "shell:pictures",
  222.     "shell:printHood": "shell:printHood",
  223.     "shell:printersfolder": "shell:printersfolder",
  224.     "shell:profile": "shell:profile",
  225.     "shell:programs": "shell:programs",
  226.     "shell:recent": "shell:recent",
  227.     "shell:recyclebinfolder": "shell:recyclebinfolder",
  228.     "shell:screenshots": "shell:screenshots",
  229.     "shell:searches": "shell:searches",
  230.     "shell:sendto": "shell:sendto",
  231.     "shell:skydriedocuments": "shell:skydriedocuments",
  232.     "shell:skydrive": "shell:skydrive",
  233.     "shell:skydrivecamera": "shell:skydrivecamera",
  234.     "shell:skydrivemusic": "shell:skydrivemusic",
  235.     "shell:skydrivepictures": "shell:skydrivepictures",
  236.     "shell:skydrivevideos": "shell:skydrivevideos",
  237.     "shell:startup": "shell:startup",
  238.     "shell:syncresultsfolder": "shell:syncresultsfolder",
  239.     "shell:syncsetupfolder": "shell:syncsetupfolder",
  240.     "shell:usersfilesfolder": "shell:usersfilesfolder",
  241.     "shell:usersprofiles": "shell:usersprofiles",
  242.     "shell:videos": "shell:videos",
  243.     "shortcuts allusersprofile": "%allusersprofile%",
  244.     "shortcuts appdata": "%appdata%",
  245.     "shortcuts homedrive": "%homedrive%",
  246.     "shortcuts homepath": "%homepath%",
  247.     "shortcuts programdata": "%programdata%",
  248.     "shortcuts programfiles": "%programfiles%",
  249.     "shortcuts programfiles x86": "%programfiles(x86)%",
  250.     "shortcuts public": "%public%",
  251.     "shortcuts systemdrive": "%systemdrive%",
  252.     "shortcuts temp": "%temp%",
  253.     "shortcuts userprofile": "%userprofile%",
  254.     "shortcuts windir": "%windir%",
  255.     "control uninstall programs": "appwiz.cpl",
  256.     "control certificates": "certmgr.msc",
  257.     "control network": "ncpa.cpl",
  258.     "control security center": "wscui.cpl",
  259.     "control power options": "powercfg.cpl",
  260.     "control panel": "control",
  261.     "control display settings": "desk.cpl",
  262.     "control internet options": "inetcpl.cpl",
  263.     "control region settings": "intl.cpl",
  264.     "control firewall": "firewall.cpl",
  265.     "control mouse": "main.cpl",
  266.     "control sound": "mmsys.cpl",
  267.     "tool character map": "charmap",
  268.     "tool command prompt": "cmd",
  269.     "tool computer management": "compmgmt.msc",
  270.     "tool device manager": "devmgmt.msc",
  271.     "tool defragment": "dfrg.msc",
  272.     "tool disk management": "diskmgmt.msc",
  273.     "tool directx info": "dxdiag",
  274.     "tool event viewer": "eventvwr.msc",
  275.     "tool shared folders": "fsmgmt.msc",
  276.     "tool group policy": "gpedit.msc",
  277.     "tool users manager": "lusrmgr.msc",
  278.     "tool magnifier": "magnify",
  279.     "tool system config": "msconfig",
  280.     "tool system info": "msinfo32",
  281.     "tool on screen keyboard": "osk",
  282.     "tool performance monitor": "perfmon.msc",
  283.     "tool powershell": "powershell",
  284.     "tool registry editor": "regedit",
  285.     "tool registry editor alt": "regedit32",
  286.     "tool rsop": "rsop.msc",
  287.     "tool security policy": "secpol.msc",
  288.     "tool services": "services.msc",
  289.     "tool volume mixer": "sndvol",
  290.     "tool snipping tool": "snippingtool",
  291.     "control system properties": "sysdm.cpl",
  292.     "tool task manager": "taskmgr",
  293.     "tool task scheduler": "taskschd.msc",
  294.     "control date time": "timedate.cpl",
  295.     "tool ease access": "utilman",
  296.     "tool windows version": "winver",
  297.     "tool wmi": "wmimgmt.msc",
  298.     "system driver list save": "Driverquery > List.txt",
  299.     "dir basic list": "dir /4",
  300.     "dir show all": "dir /a",
  301.     "dir directories only": "dir /a:d",
  302.     "dir hidden files": "dir /a:h",
  303.     "dir system files": "dir /a:s",
  304.     "dir bare format": "dir /b",
  305.     "dir with commas": "dir /c",
  306.     "dir lowercase": "dir /l",
  307.     "dir long list": "dir /n",
  308.     "dir sorted": "dir /o",
  309.     "dir sort date desc": "dir /o:-d",
  310.     "dir sort ext desc": "dir /o:-e",
  311.     "dir sort name desc": "dir /o:-n",
  312.     "dir sort size desc": "dir /o:-s",
  313.     "dir sort date": "dir /o:d",
  314.     "dir sort ext": "dir /o:e",
  315.     "dir sort name": "dir /o:n",
  316.     "dir sort size": "dir /o:s",
  317.     "dir paginated": "dir /p",
  318.     "dir owner info": "dir /q",
  319.     "dir alt streams": "dir /r",
  320.     "dir recursive": "dir /s",
  321.     "dir time info": "dir /t",
  322.     "dir access time": "dir /t:a",
  323.     "dir creation time": "dir /t:c",
  324.     "dir write time": "dir /t:w",
  325.     "dir short names": "dir /x",
  326.     "dir exe files": "DIR *.exe",
  327.     "dir txt doc files": "DIR *.txt *.doc",
  328.     "dir wide view": "DIR /w",
  329.     "dir recursive wide paged": "DIR /s /w /p",
  330.     "dir sort by name": "DIR /o:n",
  331.     "dir bare recursive": "DIR /b /s [Directory or Filename]",
  332.     "dir read only": "DIR /a:r",
  333.     "dir extension filter": "DIR /B *.EXT",
  334.     "dir program files scan": "DIR /s /w /p \"C:\\Program Files\"",
  335.     "dir windows hidden scan": "DIR /s /q /a:sh /p C:\\Windows",
  336.     "dir csv export": "DIR c:\\*.csv /s /b > c:\\users\\tim\\desktop\\csvfiles.txt",
  337.     "dir append list": "DIR /W /B >> LIST.EXT",
  338.     "dir computer list": "DIR C:\\\"Program Files\" >> %COMPUTERNAME%-IS.txt",
  339.     "dir drive C full list": "DIR /S /B /A  \"C:\\\" >> %COMPUTERNAME%-LISTC.txt",
  340.     "dir drive D full list": "DIR /S /B /A  \"D:\\\" >> %COMPUTERNAME%-LISTD.txt",
  341.     "dir drive E full list": "DIR /S /B /A  \"E:\\\" >> %COMPUTERNAME%-LISTE.txt",
  342.     "dir drive F full list": "DIR /S /B /A  \"F:\\\" >> %COMPUTERNAME%-LISTF.txt",
  343.     "dir drive G full list": "DIR /S /B /A  \"G:\\\" >> %COMPUTERNAME%-LISTG.txt",
  344.     "dir drive H full list": "DIR /S /B /A  \"H:\\\" >> %COMPUTERNAME%-LISTH.txt",
  345.     "dir drive I full list": "DIR /S /B /A  \"I:\\\" >> %COMPUTERNAME%-LISTI.txt",
  346.     "dir drive J full list": "DIR /S /B /A  \"J:\\\" >> %COMPUTERNAME%-LISTJ.txt",
  347.     "dir drive K full list": "DIR /S /B /A  \"K:\\\" >> %COMPUTERNAME%-LISTK.txt",
  348.     "dir hidden export": "DIR /A:H /S /B >> LIST.txt",
  349.     "cmd dir export": "CMD /R DIR /B > List.txt",
  350.     "dir mp3 list": "DIR \\*.mp3 /s /b > filename.txt",
  351.     "dir simple export": "DIR /B > List.txt",
  352.     "dir full export": "DIR > myfile.txt",
  353.     "dir windows audit": "DIR /s /a:hs /q C:\\Windows > myfile.txt",
  354.     "dir find i": "DIR \\ /s | find \"i\" | more",
  355.     "dir search string": "DIR \\ /s /b | find /I \"searchstring\"",
  356.     "dir search mike": "DIR \\ /s /b | find /I \"mike\"",
  357.     "dir pyw files": "dir *.pyw",
  358.     "dir pyw recursive": "dir /s /b *.pyw",
  359.     "dir pyw bare": "dir /b *.pyw",
  360.     "dir pyw specific path": "dir /s /b F:\\DATABASEZIP\\*.pyw",
  361.     "loop pyw full path": "for /r %f in (*.pyw) do @echo %f",
  362.     "count pyw files": "dir /s *.pyw | find /c \".pyw\"",
  363.     "copy file": "copy",
  364.     "copy multiple files": "copy *.txt D:\\backup\\",
  365.     "copy with overwrite": "copy /y file.txt D:\\backup\\",
  366.     "copy confirm overwrite": "copy /-y file.txt D:\\backup\\",
  367.     "copy binary mode": "copy /b file1.bin+file2.bin output.bin",
  368.     "copy text mode": "copy /a file1.txt+file2.txt output.txt",
  369.     "copy folder content": "copy folder\\* D:\\backup\\",
  370.     "copy all files recursive (basic)": "xcopy folder D:\\backup\\ /s",
  371.     "copy exe to msi": "COPY Y:\\install\\j93n.exe Y:\\more\\m1284.msi",
  372.     "copy iso to downloads": "COPY Z:\\Software\\program.iso C:\\Users\\Jon\\Downloads\\Programs\\",
  373.     "copy mp3 files verify overwrite": "COPY /y /v C:\\Users\\Jon\\Downloads\\*.mp3 C:\\Users\\Jon\\Music\\DownloadedMusic\\",
  374.     "combine text files": "COPY Z:\\file1.txt+Z:\\file2.txt+Z:\\file3.txt Z:\\combined.txt",
  375.     "hide rar inside jpg": "COPY /b DATA\\PIC.jpg + File.rar DATA\\PICNEW.jpg",
  376.     "jpg rar combine alt": "COPY /b DATA\\P.jpg + PIC.rar DATA\\PICR.jpg",
  377.     "merge text simple": "COPY myfile1.txt+myfile2.txt",
  378.     "image text combine": "COPY /b Pic.jpg+Text.txt NewPic.jpg",
  379.     "image rar combine": "COPY /b PIC.jpg + File.rar PICNEW.jpg",
  380.     "copy single file": "COPY file.txt C:\\Destination\\",
  381.     "copy all txt backup": "COPY *.txt D:\\Backup\\",
  382.     "move file": "move",
  383.     "move multiple files": "move *.txt D:\\backup\\",
  384.     "move folder": "move folder D:\\backup\\",
  385.     "move and rename": "move old.txt new.txt",
  386.     "rename file": "ren",
  387.     "rename multiple files": "ren *.txt *.bak",
  388.     "rename prefix": "ren *.txt new_*.txt",
  389.     "rename remove extension": "ren *.txt *.",
  390.     "xcopy basic": "xcopy source D:\\backup\\",
  391.     "xcopy recursive": "xcopy source D:\\backup\\ /s",
  392.     "xcopy include empty dirs": "xcopy source D:\\backup\\ /e",
  393.     "xcopy overwrite all": "xcopy source D:\\backup\\ /y",
  394.     "xcopy hidden system": "xcopy source D:\\backup\\ /h",
  395.     "xcopy preserve attributes": "xcopy source D:\\backup\\ /k",
  396.     "xcopy continue errors": "xcopy source D:\\backup\\ /c",
  397.     "xcopy no prompt": "xcopy source D:\\backup\\ /i",
  398.     "xcopy archive files only": "xcopy source D:\\backup\\ /a",
  399.     "xcopy exclude archive": "xcopy source D:\\backup\\ /m",
  400.     "xcopy full clone": "xcopy source D:\\backup\\ /e /h /k /y /c /i",
  401.     "xcopy network example": "xcopy C:\\data \\\\server\\share\\backup\\ /e /y",
  402.     "xcopy log output": "xcopy source D:\\backup\\ /s > log.txt",
  403.     "xcopy append log": "xcopy source D:\\backup\\ /s >> log.txt",
  404.     "cd root": "cd \\",
  405.     "cd parent": "cd ..",
  406.     "cd specific folder": "cd foldername",
  407.     "cd full path": "cd C:\\Users\\Public",
  408.     "cd with spaces": "cd \"C:\\Program Files\"",
  409.     "cd show current": "cd",
  410.     "cd change drive": "D:",
  411.     "cd drive and folder": "cd /d D:\\Projects",
  412.     "attrib show": "attrib",
  413.     "attrib read only": "attrib +r file.txt",
  414.     "attrib remove read only": "attrib -r file.txt",
  415.     "attrib hidden": "attrib +h file.txt",
  416.     "attrib unhide": "attrib -h file.txt",
  417.     "attrib system": "attrib +s file.txt",
  418.     "attrib remove system": "attrib -s file.txt",
  419.     "attrib archive": "attrib +a file.txt",
  420.     "attrib remove archive": "attrib -a file.txt",
  421.     "attrib recursive": "attrib +h /s /d folder",
  422.     "type view file": "type file.txt",
  423.     "type multiple files": "type file1.txt file2.txt",
  424.     "type with more": "type file.txt | more",
  425.     "call batch file": "call script.bat",
  426.     "call with parameters": "call script.bat arg1 arg2",
  427.     "call another label": "call :label",
  428.     "del file": "del file.txt",
  429.     "del multiple files": "del *.txt",
  430.     "del force": "del /f file.txt",
  431.     "del quiet": "del /q file.txt",
  432.     "del recursive": "del /s *.txt",
  433.     "del hidden files": "del /a:h file.txt",
  434.     "del read only": "del /a:r file.txt",
  435.     "del all files in folder": "del *.*",
  436.     "del folder files quietly": "del /q C:\\folder\\*",
  437.     "imagemagick convert jpg to png": "magick input.jpg output.png",
  438.     "imagemagick resize": "magick input.jpg -resize 800x600 output.jpg",
  439.     "imagemagick rotate": "magick input.jpg -rotate 90 output.jpg",
  440.     "imagemagick crop": "magick input.jpg -crop 200x200+10+10 output.jpg",
  441.     "imagemagick watermark": "magick input.jpg watermark.png -gravity southeast -composite output.jpg",
  442.     "imagemagick text overlay": "magick input.jpg -gravity south -pointsize 30 -draw \"text 0,10 'Hello'\" output.jpg",
  443.     "imagemagick grayscale": "magick input.jpg -colorspace Gray output.jpg",
  444.     "imagemagick compress": "magick input.jpg -quality 70 output.jpg",
  445.     "imagemagick batch resize": "magick mogrify -resize 50% *.jpg",
  446.     "imagemagick gif create": "magick *.png animation.gif",
  447.     "ffmpeg convert video": "ffmpeg -i input.mp4 output.avi",
  448.     "ffmpeg extract audio": "ffmpeg -i video.mp4 -vn audio.mp3",
  449.     "ffmpeg cut video": "ffmpeg -i input.mp4 -ss 00:00:10 -to 00:00:30 -c copy output.mp4",
  450.     "ffmpeg compress video": "ffmpeg -i input.mp4 -vcodec libx264 -crf 28 output.mp4",
  451.     "ffmpeg resize video": "ffmpeg -i input.mp4 -vf scale=1280:720 output.mp4",
  452.     "ffmpeg extract frames": "ffmpeg -i input.mp4 frame_%04d.png",
  453.     "ffmpeg merge videos": "ffmpeg -f concat -safe 0 -i list.txt -c copy output.mp4",
  454.     "ffmpeg add subtitle": "ffmpeg -i input.mp4 -vf subtitles=sub.srt output.mp4",
  455.     "ffmpeg gif create": "ffmpeg -i input.mp4 output.gif",
  456.     "ffmpeg audio convert": "ffmpeg -i input.wav output.mp3",
  457.     "wget download file": "wget https://example.com/file.zip",
  458.     "wget save as": "wget -O newname.zip https://example.com/file.zip",
  459.     "wget resume download": "wget -c https://example.com/file.zip",
  460.     "wget background download": "wget -b https://example.com/file.zip",
  461.     "wget download folder": "wget -r https://example.com/",
  462.     "wget limit speed": "wget --limit-rate=200k https://example.com/file.zip",
  463.     "wget user agent": "wget --user-agent=\"Mozilla\" https://example.com",
  464.     "wget with auth": "wget --user=user --password=pass https://example.com",
  465.     "wget download list": "wget -i urls.txt",
  466.     "wget mirror site": "wget -m https://example.com",
  467.     "where find command": "where cmd",
  468.     "where find exe": "where *.exe",
  469.     "where python path": "where python",
  470.     "where multiple": "where notepad.exe calc.exe",
  471.     "wmic system info": "wmic os get caption,version",
  472.     "wmic cpu info": "wmic cpu get name",
  473.     "wmic ram info": "wmic memorychip get capacity",
  474.     "wmic disk info": "wmic diskdrive get model,size",
  475.     "wmic bios serial": "wmic bios get serialnumber",
  476.     "wmic user list": "wmic useraccount get name",
  477.     "wmic process list": "wmic process list brief",
  478.     "wmic startup list": "wmic startup get caption,command",
  479.     "wmic installed programs": "wmic product get name,version",
  480.     "wmic network info": "wmic nic get name,macaddress",
  481.     "hide system drive E": "ATTRIB +S +H \"E:\\*\" /S /D",
  482.     "hide protect drive G": "ATTRIB +S +H +R /s /d G:\\*.*",
  483.     "unhide unprotect G": "ATTRIB -S -H -R /s /d G:\\*.*",
  484.     "remove all attributes G": "ATTRIB -S -H -A -R /s /d G:\\*.*",
  485.     "dir list to clipboard": "DIR /S /B | clip",
  486.     "dir list append file": "DIR /S /B >> LIST.txt",
  487.     "arp show table": "arp -a",
  488.     "arp show specific interface": "arp -a -N",
  489.     "arp delete all": "arp -d *",
  490.     "info": "systeminfo",
  491.     "windows version": "ver",
  492.     "hostname": "hostname",
  493.     "current user": "whoami",
  494.     "username": "echo %USERNAME%",
  495.     "computer name": "echo %COMPUTERNAME%",
  496.     "environment variables": "set",
  497.     "path variable": "echo %PATH%",
  498.     "current date": "date /t",
  499.     "current time": "time /t",
  500.     "system architecture": "wmic os get osarchitecture",
  501.     "list processes": "tasklist",
  502.     "show services": "sc query state= all",
  503.     "open services manager": "services.msc",
  504.     "open task manager": "taskmgr",
  505.     "open computer management": "compmgmt.msc",
  506.     "resource monitor": "resmon",
  507.     "performance monitor": "perfmon",
  508.     "show ip": "ipconfig",
  509.     "full ip info": "ipconfig /all",
  510.     "clear dns cache": "ipconfig /flushdns",
  511.     "renew ip address": "ipconfig /renew",
  512.     "release ip address": "ipconfig /release",
  513.     "network connections": "ncpa.cpl",
  514.     "show wifi profiles": "netsh wlan show profiles",
  515.     "show wifi password": "netsh wlan show profile name=\"PROFILE_NAME\" key=clear",
  516.     "ping google": "ping google.com -n 4",
  517.     "trace route to google": "tracert google.com",
  518.     "active connections": "netstat -ano",
  519.     "arp table": "arp -a",
  520.     "dns lookup google": "nslookup google.com",
  521.     "reset winsock": "netsh winsock reset",
  522.     "reset tcpip stack": "netsh int ip reset",
  523.     "list files": "dir",
  524.     "tree structure": "tree",
  525.     "disk space usage": "wmic logicaldisk get size,freespace,caption",
  526.     "check disk": "chkdsk",
  527.     "disk cleanup utility": "cleanmgr",
  528.     "open file explorer": "explorer",
  529.     "show hidden files": "attrib /s /d /l",
  530.     "copy command help": "xcopy /?",
  531.     "robocopy help": "robocopy /?",
  532.     "find text in files": "findstr /s /i /c:",
  533.     "show file attributes": "attrib",
  534.     "open notepad": "notepad",
  535.     "open calculator": "calc",
  536.     "open paint": "mspaint",
  537.     "open command prompt": "cmd",
  538.     "open powershell": "powershell",
  539.     "open control panel": "control",
  540.     "add remove programs": "appwiz.cpl",
  541.     "system properties": "sysdm.cpl",
  542.     "device manager": "devmgmt.msc",
  543.     "event viewer": "eventvwr.msc",
  544.     "registry editor": "regedit",
  545.     "windows firewall": "wf.msc",
  546.     "dxdiag info": "dxdiag",
  547.     "memory diagnostic": "mdsched.exe",
  548.     "open downloads": "explorer %USERPROFILE%\\Downloads",
  549.     "open desktop": "explorer %USERPROFILE%\\Desktop",
  550.     "open documents": "explorer %USERPROFILE%\\Documents",
  551.     "system file checker": "sfc /scannow",
  552.     "dism health check": "DISM /Online /Cleanup-Image /RestoreHealth",
  553.     "windows update trigger": "wuauclt /detectnow",
  554.     "system protection": "systempropertiesprotection",
  555.     "boot configuration": "msconfig",
  556.     "sleep computer": "rundll32.exe powrprof.dll,SetSuspendState Sleep",
  557.     "hibernate now": "shutdown /h",
  558.     "restart immediately": "shutdown /r /t 0",
  559.     "log off user": "shutdown /l",
  560.     "abort pending shutdown": "shutdown /a",
  561.     "start python web server": "python -m http.server 8000",
  562.     "clear console screen": "cls",
  563.     "show python version": "python --version",
  564.     "show pip version": "pip --version",
  565.     "open batch prompt": "cmd /k",
  566.     "show motherboard info": "wmic baseboard get product,manufacturer,serialnumber",
  567.     "show battery status": "powercfg /batteryreport",
  568.     "list D:\\": "dir D:\\",
  569.     "List E:\\": "dir E:\\",
  570.     "List F:\\": "dir F:\\",
  571.     "List G:\\": "dir G:\\",
  572.     "List H:\\": "dir H:\\",
  573.     "List G:\\ find mp3": "dir G:\\*File-name*.mp3 /s /b",
  574.     "START": "start \"\" \"\"",
  575.     "cpu info": "wmic cpu get name,numberOfCores,threadCount,maxClockSpeed",
  576.     "bios version": "wmic bios get smbiosbiosversion",
  577.     "serial number": "wmic bios get serialnumber",
  578.     "gpu info": "wmic path win32_VideoController get name",
  579.     "ram details": "wmic memorychip get capacity, speed, manufacturer",
  580.     "total ram": "systeminfo | findstr /C:\"Total Physical Memory\"",
  581.     "os build number": "ver",
  582.     "uptime": "net statistics workstation",
  583.     "last boot time": "wmic os get lastbootuptime",
  584.     "monitor info": "wmic desktopmonitor get screenheight, screenwidth",
  585.     "printer list": "wmic printer get name, default",
  586.     "sound devices": "wmic sounddev get productname",
  587.     "connected usb": "wmic usbcontroller get deviceid",
  588.     "temperature check": "wmic /namespace:\\\\root\\wmi PATH MSAcpi_ThermalZoneTemperature get CurrentTemperature",
  589.     "create folder": "mkdir",
  590.     "remove folder": "rmdir /s /q",
  591.     "delete file": "del /f /q",
  592.     "show large files": "dir /o:s /b",
  593.     "find large files": "forfiles /S /M * /C \"cmd /c if @fsize GTR 100000000 echo @path @fsize\"",
  594.     "empty recycle bin": "PowerShell -Command \"Clear-RecycleBin -Force\"",
  595.     "show extensions": "dir /x",
  596.     "read only file": "attrib +r",
  597.     "hidden file toggle": "attrib +h",
  598.     "system file toggle": "attrib +s",
  599.     "compare files": "fc file1.txt file2.txt",
  600.     "create empty file": "type nul > filename.txt",
  601.     "append text to file": "echo text >> filename.txt",
  602.     "overwrite text in file": "echo text > filename.txt",
  603.     "zip folder (powershell)": "Compress-Archive -Path .\\folder -DestinationPath archive.zip",
  604.     "unzip folder (powershell)": "Expand-Archive -Path archive.zip -DestinationPath .\\folder",
  605.     "public ip": "curl ifconfig.me",
  606.     "dns flush": "ipconfig /flushdns",
  607.     "dns register": "ipconfig /registerdns",
  608.     "display dns cache": "ipconfig /displaydns",
  609.     "wifi disconnect": "netsh wlan disconnect",
  610.     "wifi connect": "netsh wlan connect name=\"PROFILE_NAME\"",
  611.     "export wifi profiles": "netsh wlan export profile key=clear folder=C:\\WifiProfiles",
  612.     "show network adapters": "netsh interface show interface",
  613.     "set static ip": "netsh interface ip set address name=\"Wi-Fi\" static 192.168.1.100 255.255.255.0 192.168.1.1",
  614.     "set dns google": "netsh interface ip set dns name=\"Wi-Fi\" static 8.8.8.8",
  615.     "port scan localhost": "netstat -an | findstr LISTENING",
  616.     "ping specific port (tcp)": "Test-NetConnection -ComputerName google.com -Port 443",
  617.     "trace route no resolve": "tracert -d google.com",
  618.     "pathping test": "pathping google.com",
  619.     "arp delete entry": "arp -d *",
  620.     "route print": "route print",
  621.     "add route": "route add 192.168.1.0 mask 255.255.255.0 192.168.1.1",
  622.     "delete route": "route delete 192.168.1.0",
  623.     "netsh firewall show state": "netsh advfirewall show currentprofile",
  624.     "enable remote desktop": "reg add \"HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Terminal Server\" /v fDenyTSConnections /t REG_DWORD /d 0 /f",
  625.     "disable remote desktop": "reg add \"HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Terminal Server\" /v fDenyTSConnections /t REG_DWORD /d 1 /f",
  626.     "list local users": "net user",
  627.     "create new user": "net user username password /add",
  628.     "delete user": "net user username /delete",
  629.     "change password": "net user username newpassword",
  630.     "activate admin account": "net user administrator /active:yes",
  631.     "deactivate admin account": "net user administrator /active:no",
  632.     "show user groups": "net user %USERNAME%",
  633.     "add user to group": "net localgroup administrators username /add",
  634.     "remove user from group": "net localgroup administrators username /delete",
  635.     "list local groups": "net localgroup",
  636.     "whoami privileges": "whoami /priv",
  637.     "whoami groups": "whoami /groups",
  638.     "lock workstation": "rundll32.exe user32.dll,LockWorkStation",
  639.     "kill process by name": "taskkill /IM process.exe /F",
  640.     "kill process by pid": "taskkill /PID 1234 /F",
  641.     "kill all chrome": "taskkill /IM chrome.exe /F",
  642.     "start process hidden": "start /B process.exe",
  643.     "priority high": "wmic process where name=\"process.exe\" call setpriority 128",
  644.     "service start": "net start ServiceName",
  645.     "service stop": "net stop ServiceName",
  646.     "service restart": "net stop ServiceName && net start ServiceName",
  647.     "service disable": "sc config ServiceName start= disabled",
  648.     "service auto start": "sc config ServiceName start= auto",
  649.     "query service config": "sc qc ServiceName",
  650.     "get service pid": "sc queryex ServiceName",
  651.     "list drivers": "driverquery",
  652.     "list signed drivers": "driverquery /si",
  653.     "defrag c drive": "defrag C: /U /V",
  654.     "optimize ssd": "defrag C: /L",
  655.     "convert fat to ntfs": "convert D: /fs:ntfs",
  656.     "label disk": "label C: MyDrive",
  657.     "volume info": "vol C:",
  658.     "diskpart list disk": "diskpart /s list_disk.txt",
  659.     "mount iso": "PowerShell Mount-DiskImage -ImagePath \"C:\\file.iso\"",
  660.     "dismount iso": "PowerShell Dismount-DiskImage -ImagePath \"C:\\file.iso\"",
  661.     "show partitions": "wmic partition get name,size,type",
  662.     "clean temp files": "del /q/f/s %TEMP%\\*",
  663.     "clean prefetch": "del /q/f/s C:\\Windows\\Prefetch\\*",
  664.     "check update history": "wmic qfe list brief /format:table",
  665.     "install updates (ps)": "Install-WindowsUpdate -AcceptAll -AutoReboot",
  666.     "stop windows update": "net stop wuauserv",
  667.     "start windows update": "control update",
  668.     "reset update components": "net stop bits && net stop wuauserv && del %windir%\\SoftwareDistribution\\* /q && net start bits && net start wuauserv",
  669.     "ps get date": "powershell Get-Date",
  670.     "ps get services": "powershell Get-Service",
  671.     "ps get processes": "powershell Get-Process",
  672.     "ps system info": "powershell Get-ComputerInfo",
  673.     "ps installed apps": "powershell Get-WmiObject -Class Win32_Product | Select-Object Name, Version",
  674.     "ps bitlocker status": "powershell Get-BitLockerVolume",
  675.     "ps enable bitlocker": "powershell Enable-BitLocker -MountPoint C: -RecoveryPasswordProtector",
  676.     "ps disable bitlocker": "powershell Disable-BitLocker -MountPoint C:",
  677.     "ps get event logs": "powershell Get-EventLog -LogName Application -Newest 10",
  678.     "ps clear event logs": "powershell Clear-EventLog -LogName Application",
  679.     "node version": "node -v",
  680.     "npm version": "npm -v",
  681.     "git version": "git --version",
  682.     "git status": "git status",
  683.     "java version": "java -version",
  684.     "docker version": "docker --version",
  685.     "docker ps": "docker ps",
  686.     "vscode open": "code .",
  687.     "open terminal here": "start cmd",
  688.     "open powershell here": "start powershell",
  689.     "open browser edge": "start msedge",
  690.     "open browser chrome": "start chrome",
  691.     "open firefox": "start firefox",
  692.     "take ownership": "takeown /f filename",
  693.     "grant full control": "icacls filename /grant administrators:F",
  694.     "reset permissions": "icacls filename /reset",
  695.     "audit policy": "auditpol /get /category:*",
  696.     "bitlocker status": "manage-bde -status",
  697.     "encrypt file": "cipher /e filename",
  698.     "decrypt file": "cipher /d filename",
  699.     "wipe free space": "cipher /w:C:",
  700.     "shutdown in 1 hour": "shutdown /s /t 3600",
  701.     "restart in 10 mins": "shutdown /r /t 600",
  702.     "force shutdown": "shutdown /s /f /t 0",
  703.     "force restart": "shutdown /r /f /t 0",
  704.     "hybrid sleep": "rundll32.exe powrprof.dll,SetSuspendState HybridSleep",
  705.     "turn off monitor": "nircmd.exe monitor off",
  706.     "power plan list": "powercfg /list",
  707.     "power plan high perf": "powercfg /setactive 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c",
  708.     "battery saver on": "powercfg /setbatteryvalue AC INDEX 1",
  709.     "hibernate timeout": "powercfg /h timeout 0",
  710.     "clipboard copy": "clip < filename.txt",
  711.     "speak text": "powershell Add-Type -AssemblyName System.Speech; $synth = New-Object System.Speech.Synthesis.SpeechSynthesizer; $synth.Speak('Hello')",
  712.     "beep sound": "echo ^G",
  713.     "color green": "color 0a",
  714.     "color reset": "color 07",
  715.     "title window": "title My Window",
  716.     "prompt change": "prompt $P$G",
  717.     "doskey macro": "doskey ls=dir /b",
  718.     "history": "doskey /history",
  719.     "macro list": "doskey /macros",
  720.     "verify mode": "verify",
  721.     "break on/off": "break on",
  722.     "chcp utf8": "chcp 65001",
  723.     "chcp ascii": "chcp 437",
  724.     "mode con cols": "mode con cols=100 lines=30",
  725.     "start notepad": "notepad",
  726.     "start wordpad": "write",
  727.     "start snipping tool": "snippingtool",
  728.     "start onscreen keyboard": "osk",
  729.     "start character map": "charmap",
  730.     "start system info": "msinfo32",
  731.     "start gmail": "start chrome https://mail.google.com",
  732.     "start amazon": "start chrome https://amazon.com",
  733.     "start ebay": "start chrome https://ebay.com",
  734.     "start dropbox": "start dropbox:",
  735.     "start googledrive": "start chrome https://drive.google.com",
  736.     "start onedrive": "start onedrive:",
  737.     "start trello": "start chrome https://trello.com",
  738.     "start asana": "start chrome https://asana.com",
  739.     "start jira": "start chrome https://jira.atlassian.com",
  740.     "start confluence": "start chrome https://confluence.atlassian.com",
  741.     "start gotomeeting": "start gotomeeting:",
  742.     "start bluejeans": "start bluejeans:",
  743.     "start skype for business": "start lync:",
  744.     "sfc scan": "sfc /scannow",
  745.     "dism online": "DISM /Online /Cleanup-Image /RestoreHealth",
  746.     "dism offline": "DISM /Offline /Cleanup-Image /RestoreHealth",
  747.     "chkdsk fix": "chkdsk C: /f /r",
  748.     "chkdsk read only": "chkdsk C:",
  749.     "bootrec fixmbr": "bootrec /fixmbr",
  750.     "bootrec fixboot": "bootrec /fixboot",
  751.     "bootrec rebuildbcd": "bootrec /rebuildbcd",
  752.     "bcdedit export": "bcdedit /export C:\\BCD_Backup",
  753.     "bcdedit import": "bcdedit /import C:\\BCD_Backup",
  754.     "bcdedit delete bad": "bcdedit /deletevalue {default} recoveryenabled",
  755.     "enable safe boot": "bcdedit /set {current} safeboot minimal",
  756.     "disable safe boot": "bcdedit /deletevalue {current} safeboot",
  757.     "enable networking safe boot": "bcdedit /set {current} safeboot network",
  758.     "show boot entries": "bcdedit /enum",
  759.     "memory test": "mdsched.exe",
  760.     "reliability monitor": "perfmon /rel",
  761.     "data collector sets": "perfmon /datacollectorsets",
  762.     "report set": "perfmon /report",
  763.     "system diagnostics": "perfmon /report",
  764.     "system performance": "perfmon /sysperformance",
  765.     "system summary": "msinfo32",
  766.     "directx diag": "dxdiag",
  767.     "microsoft support diagnostic": "msdt",
  768.     "windows troubleshooting": "control /name Microsoft.Troubleshooting",
  769.     "network troubleshooter": "msdt.exe -id NetworkDiagnosticsNetworkAdapter",
  770.     "audio troubleshooter": "msdt.exe -id AudioPlaybackDiagnostic",
  771.     "printer troubleshooter": "msdt.exe -id PrinterDiagnostic",
  772.     "windows update troubleshooter": "msdt.exe -id WindowsUpdateDiagnostic",
  773.     "bluetooth troubleshooter": "msdt.exe -id BluetoothDiagnostic",
  774.     "keyboard troubleshooter": "msdt.exe -id KeyboardDiagnostic",
  775.     "power troubleshooter": "msdt.exe -id PowerDiagnostic",
  776.     "search and indexing troubleshooter": "msdt.exe -id SearchDiagnostic",
  777.     "hardware and devices troubleshooter": "msdt.exe -id HardwareDiagnostic",
  778.     "internet connections troubleshooter": "msdt.exe -id NetworkDiagnosticsWeb",
  779.     "incoming connections troubleshooter": "msdt.exe -id NetworkDiagnosticsInbound",
  780.     "shared folders troubleshooter": "msdt.exe -id NetworkDiagnosticsFileShare",
  781.     "windows store apps troubleshooter": "msdt.exe -id WindowsStoreAppsDiagnostic",
  782.     "maintenance troubleshooter": "msdt.exe -id MaintenanceDiagnostic",
  783.     "compatibility troubleshooter": "msdt.exe -id CompatibilityDiagnostic",
  784.     "device center troubleshooter": "msdt.exe -id DeviceCenterDiagnostic",
  785.     "speech troubleshooter": "msdt.exe -id SpeechDiagnostic",
  786.     "video playback troubleshooter": "msdt.exe -id VideoPlaybackDiagnostic",
  787.     "windows activation troubleshooter": "msdt.exe -id ActivationDiagnostic",
  788.     "bitlocker troubleshooter": "msdt.exe -id BitLockerDiagnostic",
  789.     "homegroup troubleshooter": "msdt.exe -id HomeGroupDiagnostic",
  790.     "ie browse web troubleshooter": "msdt.exe -id IEBrowseWebDiagnostic",
  791.     "ie security troubleshooter": "msdt.exe -id IESecurityDiagnostic",
  792.     "program compatibility troubleshooter": "msdt.exe -id ProgramCompatibilityDiagnostic",
  793.     "windows media player troubleshooter": "msdt.exe -id WMPDiagnostic",
  794.     "windows explorer troubleshooter": "msdt.exe -id ExplorerDiagnostic",
  795.     "desktop icon troubleshooter": "msdt.exe -id DesktopIconDiagnostic",
  796.     "screen resolution troubleshooter": "msdt.exe -id ScreenResolutionDiagnostic",
  797.     "tablet pc troubleshooter": "msdt.exe -id TabletPCDiagnostic",
  798.     "touchscreen troubleshooter": "msdt.exe -id TouchscreenDiagnostic",
  799.     "pen and touch troubleshooter": "msdt.exe -id PenAndTouchDiagnostic",
  800.     "location sensor troubleshooter": "msdt.exe -id LocationSensorDiagnostic",
  801.     "ambient light sensor troubleshooter": "msdt.exe -id AmbientLightSensorDiagnostic",
  802.     "accelerometer troubleshooter": "msdt.exe -id AccelerometerDiagnostic",
  803.     "gyrometer troubleshooter": "msdt.exe -id GyrometerDiagnostic",
  804.     "compass troubleshooter": "msdt.exe -id CompassDiagnostic",
  805.     "gps troubleshooter": "msdt.exe -id GPSDiagnostic",
  806.     "nfc troubleshooter": "msdt.exe -id NFCDiagnostic",
  807.     "fingerprint troubleshooter": "msdt.exe -id FingerprintDiagnostic",
  808.     "smart card troubleshooter": "msdt.exe -id SmartCardDiagnostic",
  809.     "virtual smart card troubleshooter": "msdt.exe -id VirtualSmartCardDiagnostic",
  810.     "tpm troubleshooter": "msdt.exe -id TPMDiagnostic",
  811.     "secure boot troubleshooter": "msdt.exe -id SecureBootDiagnostic",
  812.     "uefi troubleshooter": "msdt.exe -id UEFIDiagnostic",
  813.     "bios troubleshooter": "msdt.exe -id BIOSDiagnostic",
  814.     "firmware troubleshooter": "msdt.exe -id FirmwareDiagnostic",
  815.     "driver troubleshooter": "msdt.exe -id DriverDiagnostic",
  816.     "plug and play troubleshooter": "msdt.exe -id PlugAndPlayDiagnostic",
  817.     "device installation troubleshooter": "msdt.exe -id DeviceInstallationDiagnostic",
  818.     "device manager troubleshooter": "msdt.exe -id DeviceManagerDiagnostic",
  819.     "device properties troubleshooter": "msdt.exe -id DevicePropertiesDiagnostic",
  820.     "device status troubleshooter": "msdt.exe -id DeviceStatusDiagnostic",
  821.     "device resources troubleshooter": "msdt.exe -id DeviceResourcesDiagnostic",
  822.     "device events troubleshooter": "msdt.exe -id DeviceEventsDiagnostic",
  823.     "device driver details troubleshooter": "msdt.exe -id DeviceDriverDetailsDiagnostic",
  824.     "device driver update troubleshooter": "msdt.exe -id DeviceDriverUpdateDiagnostic",
  825.     "device driver rollback troubleshooter": "msdt.exe -id DeviceDriverRollbackDiagnostic",
  826.     "device driver uninstall troubleshooter": "msdt.exe -id DeviceDriverUninstallDiagnostic",
  827.     "device driver install troubleshooter": "msdt.exe -id DeviceDriverInstallDiagnostic",
  828.     "device driver verify troubleshooter": "msdt.exe -id DeviceDriverVerifyDiagnostic",
  829.     "device driver sign troubleshooter": "msdt.exe -id DeviceDriverSignDiagnostic",
  830.     "device driver certificate troubleshooter": "msdt.exe -id DeviceDriverCertificateDiagnostic",
  831.     "device driver publisher troubleshooter": "msdt.exe -id DeviceDriverPublisherDiagnostic",
  832.     "device driver version troubleshooter": "msdt.exe -id DeviceDriverVersionDiagnostic",
  833.     "device driver date troubleshooter": "msdt.exe -id DeviceDriverDateDiagnostic",
  834.     "device driver provider troubleshooter": "msdt.exe -id DeviceDriverProviderDiagnostic",
  835.     "device driver class troubleshooter": "msdt.exe -id DeviceDriverClassDiagnostic",
  836.     "device driver guid troubleshooter": "msdt.exe -id DeviceDriverGUIDDiagnostic",
  837.     "device driver inf troubleshooter": "msdt.exe -id DeviceDriverINFDiagnostic",
  838.     "device driver sys troubleshooter": "msdt.exe -id DeviceDriverSYSDiagnostic",
  839.     "device driver dll troubleshooter": "msdt.exe -id DeviceDriverDLLDiagnostic",
  840.     "device driver exe troubleshooter": "msdt.exe -id DeviceDriverEXEDiagnostic",
  841.     "device driver ocx troubleshooter": "msdt.exe -id DeviceDriverOCXDiagnostic",
  842.     "device driver cab troubleshooter": "msdt.exe -id DeviceDriverCABDiagnostic",
  843.     "device driver cat troubleshooter": "msdt.exe -id DeviceDriverCATDiagnostic",
  844.     "device driver inf section troubleshooter": "msdt.exe -id DeviceDriverINFSectionDiagnostic",
  845.     "device driver inf directive troubleshooter": "msdt.exe -id DeviceDriverINFDirectiveDiagnostic",
  846.     "device driver inf key troubleshooter": "msdt.exe -id DeviceDriverINFKeyDiagnostic",
  847.     "device driver inf value troubleshooter": "msdt.exe -id DeviceDriverINFValueDiagnostic",
  848.     "device driver inf comment troubleshooter": "msdt.exe -id DeviceDriverINFCommentDiagnostic",
  849.     "device driver inf include troubleshooter": "msdt.exe -id DeviceDriverINFIncludeDiagnostic",
  850.     "device driver inf needs troubleshooter": "msdt.exe -id DeviceDriverINFNeedsDiagnostic",
  851.     "device driver inf copyfiles troubleshooter": "msdt.exe -id DeviceDriverINFCopyFilesDiagnostic",
  852.     "device driver inf delfiles troubleshooter": "msdt.exe -id DeviceDriverINFDelFilesDiagnostic",
  853.     "device driver inf renamefiles troubleshooter": "msdt.exe -id DeviceDriverINFRenameFilesDiagnostic",
  854.     "device driver inf addreg troubleshooter": "msdt.exe -id DeviceDriverINFAddRegDiagnostic",
  855.     "device driver inf delreg troubleshooter": "msdt.exe -id DeviceDriverINFDelRegDiagnostic",
  856.     "device driver inf bitreg troubleshooter": "msdt.exe -id DeviceDriverINFBitRegDiagnostic",
  857.     "device driver inf logconf troubleshooter": "msdt.exe -id DeviceDriverINFLogConfDiagnostic",
  858.     "device driver inf interfaces troubleshooter": "msdt.exe -id DeviceDriverINFInterfacesDiagnostic",
  859.     "device driver inf services troubleshooter": "msdt.exe -id DeviceDriverINFServicesDiagnostic",
  860.     "device driver inf eventlog troubleshooter": "msdt.exe -id DeviceDriverINFEventLogDiagnostic",
  861.     "device driver inf propertypages troubleshooter": "msdt.exe -id DeviceDriverINFPropertyPagesDiagnostic",
  862.     "device driver inf icons troubleshooter": "msdt.exe -id DeviceDriverINFIconsDiagnostic",
  863.     "device driver inf defaulticon troubleshooter": "msdt.exe -id DeviceDriverINFDefaultIconDiagnostic",
  864.     "device driver inf shell troubleshooter": "msdt.exe -id DeviceDriverINFShellDiagnostic",
  865.     "device driver inf shellex troubleshooter": "msdt.exe -id DeviceDriverINFShellExDiagnostic",
  866.     "device driver inf drophandler troubleshooter": "msdt.exe -id DeviceDriverINFDropHandlerDiagnostic",
  867.     "device driver inf contextmenuhandlers troubleshooter": "msdt.exe -id DeviceDriverINFContextMenuHandlersDiagnostic",
  868.     "device driver inf columnhandlers troubleshooter": "msdt.exe -id DeviceDriverINFColumnHandlersDiagnostic",
  869.     "device driver inf infoproxyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFInfoProxyHandlersDiagnostic",
  870.     "device driver inf previewhandlers troubleshooter": "msdt.exe -id DeviceDriverINFPreviewHandlersDiagnostic",
  871.     "device driver inf thumbnailhandlers troubleshooter": "msdt.exe -id DeviceDriverINFThumbnailHandlersDiagnostic",
  872.     "device driver inf tileinfohandlers troubleshooter": "msdt.exe -id DeviceDriverINFTileInfoHandlersDiagnostic",
  873.     "device driver inf verbhandlers troubleshooter": "msdt.exe -id DeviceDriverINFVerbHandlersDiagnostic",
  874.     "device driver inf dragdrophandlers troubleshooter": "msdt.exe -id DeviceDriverINFDragDropHandlersDiagnostic",
  875.     "device driver inf dataobjecthandlers troubleshooter": "msdt.exe -id DeviceDriverINFDataObjectHandlersDiagnostic",
  876.     "device driver inf namespacehandlers troubleshooter": "msdt.exe -id DeviceDriverINFNamespaceHandlersDiagnostic",
  877.     "device driver inf propertyshellextensions troubleshooter": "msdt.exe -id DeviceDriverINFPropertyShellExtensionsDiagnostic",
  878.     "device driver inf queryinfohandlers troubleshooter": "msdt.exe -id DeviceDriverINFQueryInfoHandlersDiagnostic",
  879.     "device driver inf retrieveinfohandlers troubleshooter": "msdt.exe -id DeviceDriverINFRetrieveInfoHandlersDiagnostic",
  880.     "device driver inf initializepropertystorehandlers troubleshooter": "msdt.exe -id DeviceDriverINFInitializePropertyStoreHandlersDiagnostic",
  881.     "device driver inf lazywritehandlers troubleshooter": "msdt.exe -id DeviceDriverINFLazyWriteHandlersDiagnostic",
  882.     "device driver inf readhandlers troubleshooter": "msdt.exe -id DeviceDriverINFReadHandlersDiagnostic",
  883.     "device driver inf writehandlers troubleshooter": "msdt.exe -id DeviceDriverINFWriteHandlersDiagnostic",
  884.     "device driver inf streamhandlers troubleshooter": "msdt.exe -id DeviceDriverINFStreamHandlersDiagnostic",
  885.     "device driver inf filterhandlers troubleshooter": "msdt.exe -id DeviceDriverINFFilterHandlersDiagnostic",
  886.     "device driver inf searchhandlers troubleshooter": "msdt.exe -id DeviceDriverINFSearchHandlersDiagnostic",
  887.     "device driver inf indexers troubleshooter": "msdt.exe -id DeviceDriverINFIndexersDiagnostic",
  888.     "device driver inf protocolhandlers troubleshooter": "msdt.exe -id DeviceDriverINFProtocolHandlersDiagnostic",
  889.     "device driver inf urlhandlers troubleshooter": "msdt.exe -id DeviceDriverINFURLHandlersDiagnostic",
  890.     "device driver inf mimehandlers troubleshooter": "msdt.exe -id DeviceDriverINFMIMEHandlersDiagnostic",
  891.     "device driver inf contenttypehandlers troubleshooter": "msdt.exe -id DeviceDriverINFContentTypeHandlersDiagnostic",
  892.     "device driver inf encodinghandlers troubleshooter": "msdt.exe -id DeviceDriverINFEncodingHandlersDiagnostic",
  893.     "device driver inf charsethandlers troubleshooter": "msdt.exe -id DeviceDriverINFCharsetHandlersDiagnostic",
  894.     "device driver inf languagehandlers troubleshooter": "msdt.exe -id DeviceDriverINFLanguageHandlersDiagnostic",
  895.     "device driver inf localehandlers troubleshooter": "msdt.exe -id DeviceDriverINFLocaleHandlersDiagnostic",
  896.     "device driver inf regionhandlers troubleshooter": "msdt.exe -id DeviceDriverINFRegionHandlersDiagnostic",
  897.     "device driver inf timezonehandlers troubleshooter": "msdt.exe -id DeviceDriverINFTimezoneHandlersDiagnostic",
  898.     "device driver inf currencyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFCurrencyHandlersDiagnostic",
  899.     "device driver inf numberhandlers troubleshooter": "msdt.exe -id DeviceDriverINFNumberHandlersDiagnostic",
  900.     "device driver inf datehandlers troubleshooter": "msdt.exe -id DeviceDriverINFDateHandlersDiagnostic",
  901.     "device driver inf timehandlers troubleshooter": "msdt.exe -id DeviceDriverINFTimeHandlersDiagnostic",
  902.     "device driver inf calendarehandlers troubleshooter": "msdt.exe -id DeviceDriverINFCalendarHandlersDiagnostic",
  903.     "device driver inf collationhandlers troubleshooter": "msdt.exe -id DeviceDriverINFCollationHandlersDiagnostic",
  904.     "device driver inf comparisonhandlers troubleshooter": "msdt.exe -id DeviceDriverINFComparisonHandlersDiagnostic",
  905.     "device driver inf sortinghandlers troubleshooter": "msdt.exe -id DeviceDriverINFSortingHandlersDiagnostic",
  906.     "device driver inf normalizationhandlers troubleshooter": "msdt.exe -id DeviceDriverINFNormalizationHandlersDiagnostic",
  907.     "device driver inf conversionhandlers troubleshooter": "msdt.exe -id DeviceDriverINFConversionHandlersDiagnostic",
  908.     "device driver inf parsinghandlers troubleshooter": "msdt.exe -id DeviceDriverINFParsingHandlersDiagnostic",
  909.     "device driver inf formattinghandlers troubleshooter": "msdt.exe -id DeviceDriverINFFormattingHandlersDiagnostic",
  910.     "device driver inf validationhandlers troubleshooter": "msdt.exe -id DeviceDriverINFValidationHandlersDiagnostic",
  911.     "device driver inf sanitizationhandlers troubleshooter": "msdt.exe -id DeviceDriverINFSanitizationHandlersDiagnostic",
  912.     "device driver inf escapinghandlers troubleshooter": "msdt.exe -id DeviceDriverINFescapingHandlersDiagnostic",
  913.     "device driver inf decodinghandlers troubleshooter": "msdt.exe -id DeviceDriverINFDecodingHandlersDiagnostic",
  914.     "device driver inf compressionhandlers troubleshooter": "msdt.exe -id DeviceDriverINFCompressionHandlersDiagnostic",
  915.     "device driver inf decompressionhandlers troubleshooter": "msdt.exe -id DeviceDriverINFDecompressionHandlersDiagnostic",
  916.     "device driver inf encryptionhandlers troubleshooter": "msdt.exe -id DeviceDriverINFEncryptionHandlersDiagnostic",
  917.     "device driver inf decryptionhandlers troubleshooter": "msdt.exe -id DeviceDriverINFDecryptionHandlersDiagnostic",
  918.     "device driver inf hashinghandlers troubleshooter": "msdt.exe -id DeviceDriverINFHashingHandlersDiagnostic",
  919.     "device driver inf signinghandlers troubleshooter": "msdt.exe -id DeviceDriverINFSigningHandlersDiagnostic",
  920.     "device driver inf verificationhandlers troubleshooter": "msdt.exe -id DeviceDriverINFVerificationHandlersDiagnostic",
  921.     "device driver inf authenticationhandlers troubleshooter": "msdt.exe -id DeviceDriverINFAuthenticationHandlersDiagnostic",
  922.     "device driver inf authorizationhandlers troubleshooter": "msdt.exe -id DeviceDriverINFAuthorizationHandlersDiagnostic",
  923.     "device driver inf accountinghandlers troubleshooter": "msdt.exe -id DeviceDriverINFAccountingHandlersDiagnostic",
  924.     "device driver inf auditinghandlers troubleshooter": "msdt.exe -id DeviceDriverINFAuditingHandlersDiagnostic",
  925.     "device driver inf logginghandlers troubleshooter": "msdt.exe -id DeviceDriverINFLoggingHandlersDiagnostic",
  926.     "device driver inf monitoringhandlers troubleshooter": "msdt.exe -id DeviceDriverINFMonitoringHandlersDiagnostic",
  927.     "device driver inf tracinghandlers troubleshooter": "msdt.exe -id DeviceDriverINFTracingHandlersDiagnostic",
  928.     "device driver inf debugginghandlers troubleshooter": "msdt.exe -id DeviceDriverINFDebuggingHandlersDiagnostic",
  929.     "device driver inf profilinghandlers troubleshooter": "msdt.exe -id DeviceDriverINFProfilingHandlersDiagnostic",
  930.     "device driver inf testinghandlers troubleshooter": "msdt.exe -id DeviceDriverINFTestingHandlersDiagnostic",
  931.     "device driver inf benchmarkinghandlers troubleshooter": "msdt.exe -id DeviceDriverINFBenchmarkingHandlersDiagnostic",
  932.     "device driver inf analysishandlers troubleshooter": "msdt.exe -id DeviceDriverINFAnalysisManagementHandlersDiagnostic",
  933.     "device driver inf reporthandlers troubleshooter": "msdt.exe -id DeviceDriverINFReportHandlersDiagnostic",
  934.     "device driver inf documentationhandlers troubleshooter": "msdt.exe -id DeviceDriverINFDocumentationHandlersDiagnostic",
  935.     "device driver inf helphandlers troubleshooter": "msdt.exe -id DeviceDriverINFHelpHandlersDiagnostic",
  936.     "device driver inf supporthandlers troubleshooter": "msdt.exe -id DeviceDriverINFSupportHandlersDiagnostic",
  937.     "device driver inf feedbackhandlers troubleshooter": "msdt.exe -id DeviceDriverINFFeedbackHandlersDiagnostic",
  938.     "device driver inf suggestionhandlers troubleshooter": "msdt.exe -id DeviceDriverINFSuggestionHandlersDiagnostic",
  939.     "device driver inf recommendationhandlers troubleshooter": "msdt.exe -id DeviceDriverINFRecommendationHandlersDiagnostic",
  940.     "device driver inf predictionhandlers troubleshooter": "msdt.exe -id DeviceDriverINFPredictionHandlersDiagnostic",
  941.     "device driver inf forecastinghandlers troubleshooter": "msdt.exe -id DeviceDriverINFForecastingHandlersDiagnostic",
  942.     "device driver inf planninghandlers troubleshooter": "msdt.exe -id DeviceDriverINFPlanningHandlersDiagnostic",
  943.     "device driver inf schedulinghandlers troubleshooter": "msdt.exe -id DeviceDriverINFSchedulingHandlersDiagnostic",
  944.     "device driver inf coordinationhandlers troubleshooter": "msdt.exe -id DeviceDriverINFCoordinationHandlersDiagnostic",
  945.     "device driver inf collaborationhandlers troubleshooter": "msdt.exe -id DeviceDriverINFCollaborationHandlersDiagnostic",
  946.     "device driver inf communicationhandlers troubleshooter": "msdt.exe -id DeviceDriverINFCommunicationHandlersDiagnostic",
  947.     "device driver inf notificationhandlers troubleshooter": "msdt.exe -id DeviceDriverINFNotificationHandlersDiagnostic",
  948.     "device driver inf alert.handlers troubleshooter": "msdt.exe -id DeviceDriverINFAlertHandlersDiagnostic",
  949.     "device driver inf warninghandlers troubleshooter": "msdt.exe -id DeviceDriverINFWarningHandlersDiagnostic",
  950.     "device driver inf errorhandlers troubleshooter": "msdt.exe -id DeviceDriverINFErrorHandlersDiagnostic",
  951.     "device driver inf exceptionhandlers troubleshooter": "msdt.exe -id DeviceDriverINFExceptionHandlersDiagnostic",
  952.     "device driver inf crashhandlers troubleshooter": "msdt.exe -id DeviceDriverINFCrashHandlersDiagnostic",
  953.     "device driver inf recoveryhandlers troubleshooter": "msdt.exe -id DeviceDriverINFRecoveryHandlersDiagnostic",
  954.     "device driver inf restorationhandlers troubleshooter": "msdt.exe -id DeviceDriverINFRestorationHandlersDiagnostic",
  955.     "device driver inf backuphandlers troubleshooter": "msdt.exe -id DeviceDriverINFBackupHandlersDiagnostic",
  956.     "device driver inf restorehandlers troubleshooter": "msdt.exe -id DeviceDriverINFRestoreHandlersDiagnostic",
  957.     "device driver inf synchandlers troubleshooter": "msdt.exe -id DeviceDriverINFSyncHandlersDiagnostic",
  958.     "device driver inf assimilationhandlers troubleshooter": "msdt.exe -id DeviceDriverINFAssimilationHandlersDiagnostic",
  959.     "device driver inf integrationhandlers troubleshooter": "msdt.exe -id DeviceDriverINFIntegrationHandlersDiagnostic",
  960.     "device driver inf migrationhandlers troubleshooter": "msdt.exe -id DeviceDriverINFMigrationHandlersDiagnostic",
  961.     "device driver inf upgradehandlers troubleshooter": "msdt.exe -id DeviceDriverINFUpgradeHandlersDiagnostic",
  962.     "device driver inf downgradehandlers troubleshooter": "msdt.exe -id DeviceDriverINFDowngradeHandlersDiagnostic",
  963.     "device driver inf patchhandlers troubleshooter": "msdt.exe -id DeviceDriverINFPatchHandlersDiagnostic",
  964.     "device driver inf updatehandlers troubleshooter": "msdt.exe -id DeviceDriverINFUpdateHandlersDiagnostic",
  965.     "device driver inf installhandlers troubleshooter": "msdt.exe -id DeviceDriverINFInstallHandlersDiagnostic",
  966.     "device driver inf uninstallhandlers troubleshooter": "msdt.exe -id DeviceDriverINFUninstallHandlersDiagnostic",
  967.     "device driver inf configurehandlers troubleshooter": "msdt.exe -id DeviceDriverINFConfigureHandlersDiagnostic",
  968.     "device driver inf setuphandlers troubleshooter": "msdt.exe -id DeviceDriverINFSetupHandlersDiagnostic",
  969.     "device driver inf initializationhandlers troubleshooter": "msdt.exe -id DeviceDriverINFInitializationHandlersDiagnostic",
  970.     "device driver inf terminationhandlers troubleshooter": "msdt.exe -id DeviceDriverINFTerminationHandlersDiagnostic",
  971.     "device driver inf startuphandlers troubleshooter": "msdt.exe -id DeviceDriverINFStartupHandlersDiagnostic",
  972.     "device driver inf shutdownhandlers troubleshooter": "msdt.exe -id DeviceDriverINFShutdownHandlersDiagnostic",
  973.     "device driver inf resumehandlers troubleshooter": "msdt.exe -id DeviceDriverINFResumeHandlersDiagnostic",
  974.     "device driver inf suspendhandlers troubleshooter": "msdt.exe -id DeviceDriverINFSuspendHandlersDiagnostic",
  975.     "device driver inf hibernatehandlers troubleshooter": "msdt.exe -id DeviceDriverINFHibernateHandlersDiagnostic",
  976.     "device driver inf sleephandlers troubleshooter": "msdt.exe -id DeviceDriverINFSleepHandlersDiagnostic",
  977.     "device driver inf wakeuphandlers troubleshooter": "msdt.exe -id DeviceDriverINFWakeUpHandlersDiagnostic",
  978.     "device driver inf powerhandlers troubleshooter": "msdt.exe -id DeviceDriverINFPowerHandlersDiagnostic",
  979.     "device driver inf batteryhandlers troubleshooter": "msdt.exe -id DeviceDriverINFBatteryHandlersDiagnostic",
  980.     "device driver inf achandlers troubleshooter": "msdt.exe -id DeviceDriverINFACHandlersDiagnostic",
  981.     "device driver inf dc handlers troubleshooter": "msdt.exe -id DeviceDriverINFDCHandlersDiagnostic",
  982.     "device driver inf thermalhandlers troubleshooter": "msdt.exe -id DeviceDriverINFThermalHandlersDiagnostic",
  983.     "device driver inf fanhandlers troubleshooter": "msdt.exe -id DeviceDriverINFFanHandlersDiagnostic",
  984.     "device driver inf coolinghandlers troubleshooter": "msdt.exe -id DeviceDriverINFCoolingHandlersDiagnostic",
  985.     "device driver inf heatinghandlers troubleshooter": "msdt.exe -id DeviceDriverINFHeatingHandlersDiagnostic",
  986.     "device driver inf ventilationhandlers troubleshooter": "msdt.exe -id DeviceDriverINFVentilationHandlersDiagnostic",
  987.     "device driver inf airflohandlers troubleshooter": "msdt.exe -id DeviceDriverINFAirflowHandlersDiagnostic",
  988.     "device driver inf dustfilters troubleshooter": "msdt.exe -id DeviceDriverINFDustFiltersDiagnostic",
  989.     "device driver inf cleaninghandlers troubleshooter": "msdt.exe -id DeviceDriverINFCleaningHandlersDiagnostic",
  990.     "device driver inf maintenancehandlers troubleshooter": "msdt.exe -id DeviceDriverINFMaintenanceHandlersDiagnostic",
  991.     "device driver inf repairhandlers troubleshooter": "msdt.exe -id DeviceDriverINFRepairHandlersDiagnostic",
  992.     "device driver inf replacementhandlers troubleshooter": "msdt.exe -id DeviceDriverINFReplacementHandlersDiagnostic",
  993.     "device driver inf spareparthandlers troubleshooter": "msdt.exe -id DeviceDriverINFSparePartHandlersDiagnostic",
  994.     "device driver inf inventoryhandlers troubleshooter": "msdt.exe -id DeviceDriverINFInventoryHandlersDiagnostic",
  995.     "device driver inf assethandlers troubleshooter": "msdt.exe -id DeviceDriverINFAssetHandlersDiagnostic",
  996.     "device driver inf licensehandlers troubleshooter": "msdt.exe -id DeviceDriverINFLicenseHandlersDiagnostic",
  997.     "device driver inf activationhandlers troubleshooter": "msdt.exe -id DeviceDriverINFActivationHandlersDiagnostic",
  998.     "device driver inf registrationhandlers troubleshooter": "msdt.exe -id DeviceDriverINFRegistrationHandlersDiagnostic",
  999.     "device driver inf warrantyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFWarrantyHandlersDiagnostic",
  1000.     "device driver inf supportcontracthandlers troubleshooter": "msdt.exe -id DeviceDriverINFSupportContractHandlersDiagnostic",
  1001.     "device driver inf servicelevelagreementhandlers troubleshooter": "msdt.exe -id DeviceDriverINFServiceLevelAgreementHandlersDiagnostic",
  1002.     "device driver inf sla handlers troubleshooter": "msdt.exe -id DeviceDriverINFSLAHandlersDiagnostic",
  1003.     "device driver inf compliancehandlers troubleshooter": "msdt.exe -id DeviceDriverINFComplianceHandlersDiagnostic",
  1004.     "device driver inf regulationhandlers troubleshooter": "msdt.exe -id DeviceDriverINFRegulationHandlersDiagnostic",
  1005.     "device driver inf standardhandlers troubleshooter": "msdt.exe -id DeviceDriverINFStandardHandlersDiagnostic",
  1006.     "device driver inf policyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFPolicyHandlersDiagnostic",
  1007.     "device driver inf procedurehandlers troubleshooter": "msdt.exe -id DeviceDriverINFProcedureHandlersDiagnostic",
  1008.     "device driver inf guidelinehandlers troubleshooter": "msdt.exe -id DeviceDriverINFGuidelineHandlersDiagnostic",
  1009.     "device driver inf bestpracticehandlers troubleshooter": "msdt.exe -id DeviceDriverINFBestPracticeHandlersDiagnostic",
  1010.     "device driver inf checklisthandlers troubleshooter": "msdt.exe -id DeviceDriverINFChecklistHandlersDiagnostic",
  1011.     "device driver inf templatehandlers troubleshooter": "msdt.exe -id DeviceDriverINFTemplateHandlersDiagnostic",
  1012.     "device driver inf formathandlers troubleshooter": "msdt.exe -id DeviceDriverINFFormatHandlersDiagnostic",
  1013.     "device driver inf stylehandlers troubleshooter": "msdt.exe -id DeviceDriverINFStyleHandlersDiagnostic",
  1014.     "device driver inf layouthandlers troubleshooter": "msdt.exe -id DeviceDriverINFLayoutHandlersDiagnostic",
  1015.     "device driver inf designhandlers troubleshooter": "msdt.exe -id DeviceDriverINFDesignHandlersDiagnostic",
  1016.     "device driver inf uxhandlers troubleshooter": "msdt.exe -id DeviceDriverINFUXHandlersDiagnostic",
  1017.     "device driver inf uihandlers troubleshooter": "msdt.exe -id DeviceDriverINFUIHandlersDiagnostic",
  1018.     "device driver inf graphicaluserinterfacehandlers troubleshooter": "msdt.exe -id DeviceDriverINFGUIHandlersDiagnostic",
  1019.     "device driver inf commandlineinterfacehandlers troubleshooter": "msdt.exe -id DeviceDriverINFCLIHandlersDiagnostic",
  1020.     "device driver inf applicationprogramminginterfacehandlers troubleshooter": "msdt.exe -id DeviceDriverINFAPIHandlersDiagnostic",
  1021.     "device driver inf softwaredevelopmentkithandlers troubleshooter": "msdt.exe -id DeviceDriverINFSDKHandlersDiagnostic",
  1022.     "device driver inf integrateddevelopmentenvironmenthandlers troubleshooter": "msdt.exe -id DeviceDriverINFIDEHandlersDiagnostic",
  1023.     "device driver inf codeeditorhandlers troubleshooter": "msdt.exe -id DeviceDriverINFCodeEditorHandlersDiagnostic",
  1024.     "device driver inf debuggerhandlers troubleshooter": "msdt.exe -id DeviceDriverINFDebuggerHandlersDiagnostic",
  1025.     "device driver inf compilerhandlers troubleshooter": "msdt.exe -id DeviceDriverINFCompilerHandlersDiagnostic",
  1026.     "device driver inf interpreterhandlers troubleshooter": "msdt.exe -id DeviceDriverINFInterpreterHandlersDiagnostic",
  1027.     "device driver inf assemblerhandlers troubleshooter": "msdt.exe -id DeviceDriverINFAssemblerHandlersDiagnostic",
  1028.     "device driver inf linkerhandlers troubleshooter": "msdt.exe -id DeviceDriverINFLinkerHandlersDiagnostic",
  1029.     "device driver inf loaderhandlers troubleshooter": "msdt.exe -id DeviceDriverINFLoaderHandlersDiagnostic",
  1030.     "device driver inf runtimehandlers troubleshooter": "msdt.exe -id DeviceDriverINFRuntimeHandlersDiagnostic",
  1031.     "device driver inf libraryhandlers troubleshooter": "msdt.exe -id DeviceDriverINFLibraryHandlersDiagnostic",
  1032.     "device driver inf frameworkhandlers troubleshooter": "msdt.exe -id DeviceDriverINFFrameworkHandlersDiagnostic",
  1033.     "device driver inf platformhandlers troubleshooter": "msdt.exe -id DeviceDriverINFPlatformHandlersDiagnostic",
  1034.     "device driver inf operatingystemhandlers troubleshooter": "msdt.exe -id DeviceDriverINFOSHandlersDiagnostic",
  1035.     "device driver inf kernelhandlers troubleshooter": "msdt.exe -id DeviceDriverINFKernelHandlersDiagnostic",
  1036.     "device driver inf shellhandlers troubleshooter": "msdt.exe -id DeviceDriverINFShellHandlersDiagnostic",
  1037.     "device driver inf filesystemhandlers troubleshooter": "msdt.exe -id DeviceDriverINFFileSystemHandlersDiagnostic",
  1038.     "device driver inf networkstackhandlers troubleshooter": "msdt.exe -id DeviceDriverINFNetworkStackHandlersDiagnostic",
  1039.     "device driver inf securitysubsystemhandlers troubleshooter": "msdt.exe -id DeviceDriverINFSecuritySubsystemHandlersDiagnostic",
  1040.     "device driver inf graphicsubsystemhandlers troubleshooter": "msdt.exe -id DeviceDriverINFGraphicSubsystemHandlersDiagnostic",
  1041.     "device driver inf audiosubsystemhandlers troubleshooter": "msdt.exe -id DeviceDriverINFAudioSubsystemHandlersDiagnostic",
  1042.     "device driver inf inputsubsystemhandlers troubleshooter": "msdt.exe -id DeviceDriverINFInputSubsystemHandlersDiagnostic",
  1043.     "device driver inf outputsubsystemhandlers troubleshooter": "msdt.exe -id DeviceDriverINFOutputSubsystemHandlersDiagnostic",
  1044.     "device driver inf storagesubsystemhandlers troubleshooter": "msdt.exe -id DeviceDriverINFStorageSubsystemHandlersDiagnostic",
  1045.     "device driver inf memorysubsystemhandlers troubleshooter": "msdt.exe -id DeviceDriverINFMemorySubsystemHandlersDiagnostic",
  1046.     "device driver inf processorsubsystemhandlers troubleshooter": "msdt.exe -id DeviceDriverINFProcessorSubsystemHandlersDiagnostic",
  1047.     "device driver inf busesubsystemhandlers troubleshooter": "msdt.exe -id DeviceDriverINFBusSubsystemHandlersDiagnostic",
  1048.     "device driver inf peripheralsubsystemhandlers troubleshooter": "msdt.exe -id DeviceDriverINFPeripheralSubsystemHandlersDiagnostic",
  1049.     "device driver inf virtualizationsubsystemhandlers troubleshooter": "msdt.exe -id DeviceDriverINFVirtualizationSubsystemHandlersDiagnostic",
  1050.     "device driver inf containersubsystemhandlers troubleshooter": "msdt.exe -id DeviceDriverINFContainerSubsystemHandlersDiagnostic",
  1051.     "device driver inf cloudsubsystemhandlers troubleshooter": "msdt.exe -id DeviceDriverINFCloudSubsystemHandlersDiagnostic",
  1052.     "device driver inf iotsubsystemhandlers troubleshooter": "msdt.exe -id DeviceDriverINFIoTSubsystemHandlersDiagnostic",
  1053.     "device driver inf aisubsystemhandlers troubleshooter": "msdt.exe -id DeviceDriverINFAISubsystemHandlersDiagnostic",
  1054.     "device driver inf mlsubsystemhandlers troubleshooter": "msdt.exe -id DeviceDriverINFMLSubsystemHandlersDiagnostic",
  1055.     "device driver inf dlsubsystemhandlers troubleshooter": "msdt.exe -id DeviceDriverINFDLSubsystemHandlersDiagnostic",
  1056.     "device driver inf nnsubsystemhandlers troubleshooter": "msdt.exe -id DeviceDriverINFNNSubsystemHandlersDiagnostic",
  1057.     "device driver inf cvsubsystemhandlers troubleshooter": "msdt.exe -id DeviceDriverINFCVSubsystemHandlersDiagnostic",
  1058.     "device driver inf nlp subsystemhandlers troubleshooter": "msdt.exe -id DeviceDriverINFNLPSubsystemHandlersDiagnostic",
  1059.     "device driver inf speechsubsystemhandlers troubleshooter": "msdt.exe -id DeviceDriverINFSpeechSubsystemHandlersDiagnostic",
  1060.     "device driver inf visionsubsystemhandlers troubleshooter": "msdt.exe -id DeviceDriverINFVisionSubsystemHandlersDiagnostic",
  1061.     "device driver inf roboticsubsystemhandlers troubleshooter": "msdt.exe -id DeviceDriverINFRoboticsSubsystemHandlersDiagnostic",
  1062.     "device driver inf automationsubsystemhandlers troubleshooter": "msdt.exe -id DeviceDriverINFAutomationSubsystemHandlersDiagnostic",
  1063.     "device driver inf controlsubsystemhandlers troubleshooter": "msdt.exe -id DeviceDriverINFControlSubsystemHandlersDiagnostic",
  1064.     "device driver inf monitorsubsystemhandlers troubleshooter": "msdt.exe -id DeviceDriverINFMonitorSubsystemHandlersDiagnostic",
  1065.     "device driver inf alarmsubsystemhandlers troubleshooter": "msdt.exe -id DeviceDriverINFAlarmSubsystemHandlersDiagnostic",
  1066.     "device driver inf safetysubsystemhandlers troubleshooter": "msdt.exe -id DeviceDriverINFSafetySubsystemHandlersDiagnostic",
  1067.     "device driver inf emergencysubsystemhandlers troubleshooter": "msdt.exe -id DeviceDriverINFEmergencySubsystemHandlersDiagnostic",
  1068.     "device driver inf backupsystemhandlers troubleshooter": "msdt.exe -id DeviceDriverINFBackupSystemHandlersDiagnostic",
  1069.     "device driver inf recoverysystemhandlers troubleshooter": "msdt.exe -id DeviceDriverINFRecoverySystemHandlersDiagnostic",
  1070.     "device driver inf disatersubsystemhandlers troubleshooter": "msdt.exe -id DeviceDriverINFDisasterSubsystemHandlersDiagnostic",
  1071.     "device driver inf businesscontinuityhandlers troubleshooter": "msdt.exe -id DeviceDriverINFBusinessContinuityHandlersDiagnostic",
  1072.     "device driver inf incidentresponsehandlers troubleshooter": "msdt.exe -id DeviceDriverINFIncidentResponseHandlersDiagnostic",
  1073.     "device driver inf threatintelligencehandlers troubleshooter": "msdt.exe -id DeviceDriverINFThreatIntelligenceHandlersDiagnostic",
  1074.     "device driver inf vulnerabilitymanagementhandlers troubleshooter": "msdt.exe -id DeviceDriverINFVulnerabilityManagementHandlersDiagnostic",
  1075.     "device driver inf riskmanagementhandlers troubleshooter": "msdt.exe -id DeviceDriverINFRiskManagementHandlersDiagnostic",
  1076.     "device driver inf governancehandlers troubleshooter": "msdt.exe -id DeviceDriverINFGovernanceHandlersDiagnostic",
  1077.     "device driver inf ethichandlers troubleshooter": "msdt.exe -id DeviceDriverINFEthicHandlersDiagnostic",
  1078.     "device driver inf privacyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFPrivacyHandlersDiagnostic",
  1079.     "device driver inf confidentialityhandlers troubleshooter": "msdt.exe -id DeviceDriverINFConfidentialityHandlersDiagnostic",
  1080.     "device driver inf integrityhandlers troubleshooter": "msdt.exe -id DeviceDriverINFIntegrityHandlersDiagnostic",
  1081.     "device driver inf availabilityhandlers troubleshooter": "msdt.exe -id DeviceDriverINFAvailabilityHandlersDiagnostic",
  1082.     "device driver inf nonrepudiationhandlers troubleshooter": "msdt.exe -id DeviceDriverINFNonRepudiationHandlersDiagnostic",
  1083.     "device driver inf accountabilityhandlers troubleshooter": "msdt.exe -id DeviceDriverINFAccountabilityHandlersDiagnostic",
  1084.     "device driver inf authenticityhandlers troubleshooter": "msdt.exe -id DeviceDriverINFAuthenticityHandlersDiagnostic",
  1085.     "device driver inf reliabilityhandlers troubleshooter": "msdt.exe -id DeviceDriverINFReliabilityHandlersDiagnostic",
  1086.     "device driver inf resiliencehandlers troubleshooter": "msdt.exe -id DeviceDriverINFResilienceHandlersDiagnostic",
  1087.     "device driver inf robustnesshandlers troubleshooter": "msdt.exe -id DeviceDriverINFRobustnessHandlersDiagnostic",
  1088.     "device driver inf scalabilityhandlers troubleshooter": "msdt.exe -id DeviceDriverINFScalabilityHandlersDiagnostic",
  1089.     "device driver inf performancehandlers troubleshooter": "msdt.exe -id DeviceDriverINFPerformanceHandlersDiagnostic",
  1090.     "device driver inf efficiencyhandlers troubleshooter": "msdt.exe -id DeviceDriverINEfficiencyHandlersDiagnostic",
  1091.     "device driver inf effectivenesshandlers troubleshooter": "msdt.exe -id DeviceDriverINFEffectivenessHandlersDiagnostic",
  1092.     "device driver inf productivityhandlers troubleshooter": "msdt.exe -id DeviceDriverINFProductivityHandlersDiagnostic",
  1093.     "device driver inf qualityhandlers troubleshooter": "msdt.exe -id DeviceDriverINFQualityHandlersDiagnostic",
  1094.     "device driver inf satisfactionhandlers troubleshooter": "msdt.exe -id DeviceDriverINFSatisfactionHandlersDiagnostic",
  1095.     "device driver inf loyaltyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFLoyaltyHandlersDiagnostic",
  1096.     "device driver inf retentionhandlers troubleshooter": "msdt.exe -id DeviceDriverINFRetentionHandlersDiagnostic",
  1097.     "device driver inf acquisitionhandlers troubleshooter": "msdt.exe -id DeviceDriverINFAcquisitionHandlersDiagnostic",
  1098.     "device driver inf engagementhandlers troubleshooter": "msdt.exe -id DeviceDriverINFEngagementHandlersDiagnostic",
  1099.     "device driver inf interactionhandlers troubleshooter": "msdt.exe -id DeviceDriverINFInteractionHandlersDiagnostic",
  1100.     "device driver inf experiencehandlers troubleshooter": "msdt.exe -id DeviceDriverINFExperienceHandlersDiagnostic",
  1101.     "device driver inf journeyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFJourneyHandlersDiagnostic",
  1102.     "device driver inf touchpointhandlers troubleshooter": "msdt.exe -id DeviceDriverINFTouchpointHandlersDiagnostic",
  1103.     "device driver inf channelhandlers troubleshooter": "msdt.exe -id DeviceDriverINFChannelHandlersDiagnostic",
  1104.     "device driver inf mediumhandlers troubleshooter": "msdt.exe -id DeviceDriverINFMediumHandlersDiagnostic",
  1105.     "device driver inf ecosystemhandlers troubleshooter": "msdt.exe -id DeviceDriverINFEEcosystemHandlersDiagnostic",
  1106.     "device driver inf communityhandlers troubleshooter": "msdt.exe -id DeviceDriverINFCommunityHandlersDiagnostic",
  1107.     "device driver inf socialhandlers troubleshooter": "msdt.exe -id DeviceDriverINFSocialHandlersDiagnostic",
  1108.     "device driver inf networkhandlers troubleshooter": "msdt.exe -id DeviceDriverINFNetworkHandlersDiagnostic",
  1109.     "device driver inf connectionhandlers troubleshooter": "msdt.exe -id DeviceDriverINFConnectionHandlersDiagnostic",
  1110.     "device driver inf relationshiphandlers troubleshooter": "msdt.exe -id DeviceDriverINFRelationshipHandlersDiagnostic",
  1111.     "device driver inf partnershiphandlers troubleshooter": "msdt.exe -id DeviceDriverINFPartnershipHandlersDiagnostic",
  1112.     "device driver inf alliancehandlers troubleshooter": "msdt.exe -id DeviceDriverINFAllianceHandlersDiagnostic",
  1113.     "device driver inf cooperationhandlers troubleshooter": "msdt.exe -id DeviceDriverINFCooperationHandlersDiagnostic",
  1114.     "device driver inf synchronizationhandlers troubleshooter": "msdt.exe -id DeviceDriverINFSynchronizationHandlersDiagnostic",
  1115.     "device driver inf harmonizationhandlers troubleshooter": "msdt.exe -id DeviceDriverINFHarmonizationHandlersDiagnostic",
  1116.     "device driver inf standardizationhandlers troubleshooter": "msdt.exe -id DeviceDriverINFStandardizationHandlersDiagnostic",
  1117.     "device driver inf optimizationhandlers troubleshooter": "msdt.exe -id DeviceDriverINFOptimizationHandlersDiagnostic",
  1118.     "device driver inf enhancementhandlers troubleshooter": "msdt.exe -id DeviceDriverINFEnhancementHandlersDiagnostic",
  1119.     "device driver inf improvementhandlers troubleshooter": "msdt.exe -id DeviceDriverINFImprovementHandlersDiagnostic",
  1120.     "device driver inf innovationhandlers troubleshooter": "msdt.exe -id DeviceDriverINFInnovationHandlersDiagnostic",
  1121.     "device driver inf transformationhandlers troubleshooter": "msdt.exe -id DeviceDriverINFTransformationHandlersDiagnostic",
  1122.     "device driver inf evolutionhandlers troubleshooter": "msdt.exe -id DeviceDriverINFEvolutionHandlersDiagnostic",
  1123.     "device driver inf revolutionhandlers troubleshooter": "msdt.exe -id DeviceDriverINFRevolutionHandlersDiagnostic",
  1124.     "device driver inf disruptionhandlers troubleshooter": "msdt.exe -id DeviceDriverINFDisruptionHandlersDiagnostic",
  1125.     "device driver inf changemanagementhandlers troubleshooter": "msdt.exe -id DeviceDriverINFChangeManagementHandlersDiagnostic",
  1126.     "device driver inf projectmanagementhandlers troubleshooter": "msdt.exe -id DeviceDriverINFProjectManagementHandlersDiagnostic",
  1127.     "device driver inf programmanagementhandlers troubleshooter": "msdt.exe -id DeviceDriverINFProgramManagementHandlersDiagnostic",
  1128.     "device driver inf portfoliomanagementhandlers troubleshooter": "msdt.exe -id DeviceDriverINFPortfolioManagementHandlersDiagnostic",
  1129.     "device driver inf resourcemanagementhandlers troubleshooter": "msdt.exe -id DeviceDriverINFResourceManagementHandlersDiagnostic",
  1130.     "device driver inf timemanagementhandlers troubleshooter": "msdt.exe -id DeviceDriverINFTimeManagementHandlersDiagnostic",
  1131.     "device driver inf costmanagementhandlers troubleshooter": "msdt.exe -id DeviceDriverINFCostManagementHandlersDiagnostic",
  1132.     "device driver inf budgetmanagementhandlers troubleshooter": "msdt.exe -id DeviceDriverINFBudgetManagementHandlersDiagnostic",
  1133.     "device driver inf financialmanagementhandlers troubleshooter": "msdt.exe -id DeviceDriverINFFinancialManagementHandlersDiagnostic",
  1134.     "device driver inf accountingmanagementhandlers troubleshooter": "msdt.exe -id DeviceDriverINFAccountingManagementHandlersDiagnostic",
  1135.     "device driver inf auditingmanagementhandlers troubleshooter": "msdt.exe -id DeviceDriverINFAuditingManagementHandlersDiagnostic",
  1136.     "device driver inf reportingmanagementhandlers troubleshooter": "msdt.exe -id DeviceDriverINFReportingManagementHandlersDiagnostic",
  1137.     "device driver inf strategicmanagementhandlers troubleshooter": "msdt.exe -id DeviceDriverINFStrategicManagementHandlersDiagnostic",
  1138.     "device driver inf tacticalmanagementhandlers troubleshooter": "msdt.exe -id DeviceDriverINFTacticalManagementHandlersDiagnostic",
  1139.     "device driver inf operationalmanagementhandlers troubleshooter": "msdt.exe -id DeviceDriverINFOperationalManagementHandlersDiagnostic",
  1140.     "device driver inf executivemanagementhandlers troubleshooter": "msdt.exe -id DeviceDriverINFExecutiveManagementHandlersDiagnostic",
  1141.     "device driver inf leadershipmanagementhandlers troubleshooter": "msdt.exe -id DeviceDriverINFLeadershipManagementHandlersDiagnostic",
  1142.     "device driver inf visionmanagementhandlers troubleshooter": "msdt.exe -id DeviceDriverINFVisionManagementHandlersDiagnostic",
  1143.     "device driver inf missionmanagementhandlers troubleshooter": "msdt.exe -id DeviceDriverINFMissionManagementHandlersDiagnostic",
  1144.     "device driver inf valuesmanagementhandlers troubleshooter": "msdt.exe -id DeviceDriverINFValuesManagementHandlersDiagnostic",
  1145.     "device driver inf culturemanagementhandlers troubleshooter": "msdt.exe -id DeviceDriverINFCultureManagementHandlersDiagnostic",
  1146.     "device driver inf diversitymanagementhandlers troubleshooter": "msdt.exe -id DeviceDriverINFDiversityManagementHandlersDiagnostic",
  1147.     "device driver inf inclusionmanagementhandlers troubleshooter": "msdt.exe -id DeviceDriverINFInclusionManagementHandlersDiagnostic",
  1148.     "device driver inf equitymanagementhandlers troubleshooter": "msdt.exe -id DeviceDriverINFEquityManagementHandlersDiagnostic",
  1149.     "device driver inf belongingmanagementhandlers troubleshooter": "msdt.exe -id DeviceDriverINFBelongingManagementHandlersDiagnostic",
  1150.     "device driver inf wellbeingsubsystemhandlers troubleshooter": "msdt.exe -id DeviceDriverINFWellbeingSubsystemHandlersDiagnostic",
  1151.     "device driver inf healthsubsystemhandlers troubleshooter": "msdt.exe -id DeviceDriverINFHealthSubsystemHandlersDiagnostic",
  1152.     "device driver inf environmentalsubsystemhandlers troubleshooter": "msdt.exe -id DeviceDriverINFEnvironmentalSubsystemHandlersDiagnostic",
  1153.     "device driver inf sustainabilityhandlers troubleshooter": "msdt.exe -id DeviceDriverINFSustainabilityHandlersDiagnostic",
  1154.     "device driver inf greentechnologyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFGreenTechnologyHandlersDiagnostic",
  1155.     "device driver inf cleanenergyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFCleanEnergyHandlersDiagnostic",
  1156.     "device driver inf renewableenergyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFRenewableEnergyHandlersDiagnostic",
  1157.     "device driver inf solarpowerhandlers troubleshooter": "msdt.exe -id DeviceDriverINFSolarPowerHandlersDiagnostic",
  1158.     "device driver inf windpowerhandlers troubleshooter": "msdt.exe -id DeviceDriverINFWindPowerHandlersDiagnostic",
  1159.     "device driver inf hydropowerhandlers troubleshooter": "msdt.exe -id DeviceDriverINFHydroPowerHandlersDiagnostic",
  1160.     "device driver inf geothermalpowerhandlers troubleshooter": "msdt.exe -id DeviceDriverINFGeothermalPowerHandlersDiagnostic",
  1161.     "device driver inf biomasspowerhandlers troubleshooter": "msdt.exe -id DeviceDriverINFBiomassPowerHandlersDiagnostic",
  1162.     "device driver inf nuclearpowerhandlers troubleshooter": "msdt.exe -id DeviceDriverINFNuclearPowerHandlersDiagnostic",
  1163.     "device driver inf fossilfuelhandlers troubleshooter": "msdt.exe -id DeviceDriverINFFossilFuelHandlersDiagnostic",
  1164.     "device driver inf carbonemissionhandlers troubleshooter": "msdt.exe -id DeviceDriverINFCarbonEmissionHandlersDiagnostic",
  1165.     "device driver inf greenhousegasemissionhandlers troubleshooter": "msdt.exe -id DeviceDriverINFGreenhouseGasEmissionHandlersDiagnostic",
  1166.     "device driver inf climatechangehandlers troubleshooter": "msdt.exe -id DeviceDriverINFClimateChangeHandlersDiagnostic",
  1167.     "device driver inf globalwarminghandlers troubleshooter": "msdt.exe -id DeviceDriverINFGlobalWarmingHandlersDiagnostic",
  1168.     "device driver inf pollutionhandlers troubleshooter": "msdt.exe -id DeviceDriverINFPollutionHandlersDiagnostic",
  1169.     "device driver inf waste managementhandlers troubleshooter": "msdt.exe -id DeviceDriverINFWasteManagementHandlersDiagnostic",
  1170.     "device driver inf recyclinghandlers troubleshooter": "msdt.exe -id DeviceDriverINFRecyclingHandlersDiagnostic",
  1171.     "device driver inf upcyclinghandlers troubleshooter": "msdt.exe -id DeviceDriverINFUpcyclingHandlersDiagnostic",
  1172.     "device driver inf downcyclinghandlers troubleshooter": "msdt.exe -id DeviceDriverINFDowncyclingHandlersDiagnostic",
  1173.     "device driver inf circular economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFCircularEconomyHandlersDiagnostic",
  1174.     "device driver inf linear economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFLinearEconomyHandlersDiagnostic",
  1175.     "device driver inf sharing economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFSharingEconomyHandlersDiagnostic",
  1176.     "device driver inf gig economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFGigEconomyHandlersDiagnostic",
  1177.     "device driver inf creator economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFCreatorEconomyHandlersDiagnostic",
  1178.     "device driver inf attention economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFAttentionEconomyHandlersDiagnostic",
  1179.     "device driver inf data economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFDataEconomyHandlersDiagnostic",
  1180.     "device driver inf knowledge economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFKnowledgeEconomyHandlersDiagnostic",
  1181.     "device driver inf innovation economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFInnovationEconomyHandlersDiagnostic",
  1182.     "device driver inf digital economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFDigitalEconomyHandlersDiagnostic",
  1183.     "device driver inf internet of things economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFIoTEconomyHandlersDiagnostic",
  1184.     "device driver inf artificial intelligence economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFAIEconomyHandlersDiagnostic",
  1185.     "device driver inf blockchain economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFBlockchainEconomyHandlersDiagnostic",
  1186.     "device driver inf cryptocurrency economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFCryptocurrencyEconomyHandlersDiagnostic",
  1187.     "device driver inf metaverse economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFMetaverseEconomyHandlersDiagnostic",
  1188.     "device driver inf web3 economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFWeb3EconomyHandlersDiagnostic",
  1189.     "device driver inf decentralized finance economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFDeFiEconomyHandlersDiagnostic",
  1190.     "device driver inf non-fungible token economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFNFTEconomyHandlersDiagnostic",
  1191.     "device driver inf smart contract economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFSmartContractEconomyHandlersDiagnostic",
  1192.     "device driver inf distributed ledger technology economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFDLTEconomyHandlersDiagnostic",
  1193.     "device driver inf peer-to-peer economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFP2PEconomyHandlersDiagnostic",
  1194.     "device driver inf marketplace economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFMarketplaceEconomyHandlersDiagnostic",
  1195.     "device driver inf platform economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFPlatformEconomyHandlersDiagnostic",
  1196.     "device driver inf ecosystem economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFEEcosystemEconomyHandlersDiagnostic",
  1197.     "device driver inf network economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFNetworkEconomyHandlersDiagnostic",
  1198.     "device driver inf community economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFCommunityEconomyHandlersDiagnostic",
  1199.     "device driver inf social economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFSocialEconomyHandlersDiagnostic",
  1200.     "device driver inf collaborative economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFCollaborativeEconomyHandlersDiagnostic",
  1201.     "device driver inf cooperative economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFCooperativeEconomyHandlersDiagnostic",
  1202.     "device driver inf mutual aid economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFMutualAidEconomyHandlersDiagnostic",
  1203.     "device driver inf gift economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFGiftEconomyHandlersDiagnostic",
  1204.     "device driver inf barter economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFBarterEconomyHandlersDiagnostic",
  1205.     "device driver inf trade economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFTradeEconomyHandlersDiagnostic",
  1206.     "device driver inf commerce economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFCommerceEconomyHandlersDiagnostic",
  1207.     "device driver inf business economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFBusinessEconomyHandlersDiagnostic",
  1208.     "device driver inf industry economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFIndustryEconomyHandlersDiagnostic",
  1209.     "device driver inf market economyhandlers troubleshooter": "msdt.exe -id DeviceDoctorINFMarketEconomyHandlersDiagnostic",
  1210.     "device driver inf command economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFCommandEconomyHandlersDiagnostic",
  1211.     "device driver inf mixed economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFMixedEconomyHandlersDiagnostic",
  1212.     "device driver inf traditional economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFTraditionalEconomyHandlersDiagnostic",
  1213.     "device driver inf transition economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFTransitionEconomyHandlersDiagnostic",
  1214.     "device driver inf developing economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFDevelopingEconomyHandlersDiagnostic",
  1215.     "device driver inf developed economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFDevelopedEconomyHandlersDiagnostic",
  1216.     "device driver inf emerging economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFEmergingEconomyHandlersDiagnostic",
  1217.     "device driver inf advanced economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFAdvancedEconomyHandlersDiagnostic",
  1218.     "device driver inf global economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFGlobalEconomyHandlersDiagnostic",
  1219.     "device driver inf local economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFLEconomyHandlersDiagnostic",
  1220.     "device driver inf national economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFNationalEconomyHandlersDiagnostic",
  1221.     "device driver inf regional economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFRegionalEconomyHandlersDiagnostic",
  1222.     "device driver inf urban economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFUrbanEconomyHandlersDiagnostic",
  1223.     "device driver inf rural economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFRuralEconomyHandlersDiagnostic",
  1224.     "device driver inf suburban economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFSuburbanEconomyHandlersDiagnostic",
  1225.     "device driver inf metropolitan economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFMetropolitanEconomyHandlersDiagnostic",
  1226.     "device driver inf cosmopolitan economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFCosmopolitanEconomyHandlersDiagnostic",
  1227.     "device driver inf provincial economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFProvincialEconomyHandlersDiagnostic",
  1228.     "device driver inf municipal economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFMunicipalEconomyHandlersDiagnostic",
  1229.     "device driver inf county economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFCountyEconomyHandlersDiagnostic",
  1230.     "device driver inf state economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFStateEconomyHandlersDiagnostic",
  1231.     "device driver inf federal economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFFederalEconomyHandlersDiagnostic",
  1232.     "device driver inf international economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFInternationalEconomyHandlersDiagnostic",
  1233.     "device driver inf supranational economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFSupranationalEconomyHandlersDiagnostic",
  1234.     "device driver inf transnational economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFTransnationalEconomyHandlersDiagnostic",
  1235.     "device driver inf multinational economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFMultinationalEconomyHandlersDiagnostic",
  1236.     "device driver inf bilateral economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFBilateralEconomyHandlersDiagnostic",
  1237.     "device driver inf multilateral economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFMultilateralEconomyHandlersDiagnostic",
  1238.     "device driver inf unilateral economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFUnilateralEconomyHandlersDiagnostic",
  1239.     "device driver inf plurilateral economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFPlurilateralEconomyHandlersDiagnostic",
  1240.     "device driver inf minilateral economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFMinilateralEconomyHandlersDiagnostic",
  1241.     "device driver inf trilateral economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFTrilateralEconomyHandlersDiagnostic",
  1242.     "device driver inf quadrilateral economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFQuadrilateralEconomyHandlersDiagnostic",
  1243.     "device driver inf pentagonal economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFPentagonalEconomyHandlersDiagnostic",
  1244.     "device driver inf hexagonal economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFHexagonalEconomyHandlersDiagnostic",
  1245.     "device driver inf heptagonal economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFHeptagonalEconomyHandlersDiagnostic",
  1246.     "device driver inf octagonal economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFOctagonalEconomyHandlersDiagnostic",
  1247.     "device driver inf nonagonal economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFNonagonalEconomyHandlersDiagnostic",
  1248.     "device driver inf decagonal economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFDecagonalEconomyHandlersDiagnostic",
  1249.     "device driver inf hendecagonal economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFHendecagonalEconomyHandlersDiagnostic",
  1250.     "device driver inf dodecagonal economyhandlers troubleshooter": "msdt.exe -id DeviceDriverINFDodecagonalEconomyHandlersDiagnostic",
  1251.     "python version": "python3 --version",
  1252.     "pip version": "pip3 --version",
  1253.     "pip list": "pip list",
  1254.     "list installed packages": "pip3 list --format=columns",
  1255.     "outdated packages": "pip3 list --outdated --format=columns",
  1256.     "freeze requirements": "pip3 freeze > requirements.txt",
  1257.     "install from requirements": "pip3 install -r requirements.txt",
  1258.     "upgrade pip itself": "python3 -m pip install --upgrade pip",
  1259.     "show package info": "pip3 show <package_name>",
  1260.     "uninstall package": "pip3 uninstall <package_name>",
  1261.     "check python path": "python3 -c \"import sys; print(sys.executable)\"",
  1262.     "virtual env create": "python3 -m venv venv",
  1263.     "activate venv linux/mac": "source venv/bin/activate",
  1264.     "activate venv windows": "venv\\Scripts\\activate",
  1265.     "os details": "uname -a 2>/dev/null || ver",
  1266.     "cpu info linux/mac": "lscpu 2>/dev/null || sysctl -n machdep.cpu.brand_string",
  1267.     "cpu info windows": "wmic cpu get name,NumberOfCores,MaxClockSpeed",
  1268.     "gpu info linux": "lspci | grep -i vga 2>/dev/null",
  1269.     "gpu info windows": "wmic path win32_VideoController get name",
  1270.     "ram usage linux/mac": "free -h 2>/dev/null || vm_stat 2>/dev/null",
  1271.     "ram details windows": "wmic memorychip get capacity, speed, manufacturer",
  1272.     "disk usage": "df -h 2>/dev/null || wmic logicaldisk get size,freespace,caption",
  1273.     "system uptime linux/mac": "uptime 2>/dev/null",
  1274.     "system uptime windows": "net statistics workstation",
  1275.     "ip address linux/mac": "ip addr show 2>/dev/null || ifconfig 2>/dev/null",
  1276.     "ip address windows": "ipconfig",
  1277.     "open ports linux": "ss -tuln 2>/dev/null || netstat -tuln",
  1278.     "open ports windows": "netstat -an",
  1279.     "running processes top": "top -bn1 2>/dev/null || tasklist",
  1280.     "battery status linux": "upower -i /org/freedesktop/UPower/devices/battery_BAT0 2>/dev/null",
  1281.     "battery status windows": "powercfg /batteryreport",
  1282.     "connected usb devices": "lsusb 2>/dev/null || wmic usbcontroller get deviceid"
  1283. }
  1284.  
  1285. # ================= UTILITY FUNCTIONS =================
  1286. def load_data():
  1287.     """Load JSON data with error recovery for malformed files"""
  1288.     try:
  1289.         if os.path.exists(DATA_FILE):
  1290.             with open(DATA_FILE, "r", encoding="utf-8") as f:
  1291.                 content = f.read()
  1292.                 return json.loads(content)
  1293.     except json.JSONDecodeError as e:
  1294.         print("[WARN] Failed to load JSON: {}".format(e))
  1295.         repaired = _repair_json(DATA_FILE)
  1296.         if repaired:
  1297.             print("[INFO] JSON repaired and loaded successfully")
  1298.             return repaired
  1299.         print("[INFO] Using default data")
  1300.         return default_data.copy()
  1301.     except Exception as e:
  1302.         print("[WARN] Failed to load JSON: {}".format(e))
  1303.         return default_data.copy()
  1304.     return default_data.copy()
  1305.  
  1306. def _repair_json(filepath):
  1307.     """Attempt to repair common JSON syntax errors"""
  1308.     try:
  1309.         with open(filepath, "r", encoding="utf-8") as f:
  1310.             content = f.read()
  1311.         # Remove trailing commas before } or ]
  1312.         content = re.sub(r',(\s*[}\]])', r'\1', content)
  1313.         # Fix missing commas between key-value pairs
  1314.         content = re.sub(r'"\s*\n\s*"', '",\n"', content)
  1315.         # Fix unquoted keys (basic attempt)
  1316.         content = re.sub(r'(\{|,)\s*([a-zA-Z_][a-zA-Z0-9_]*)\s*:', r'\1"\2":', content)
  1317.         return json.loads(content)
  1318.     except:
  1319.         return None
  1320.  
  1321. def save_data(data):
  1322.     """Save aliases to AI-DATA.json - DIRECT SAVE (NO BACKUP)"""
  1323.     try:
  1324.         with open(DATA_FILE, "w", encoding="utf-8") as f:
  1325.             json.dump(data, f, indent=4, ensure_ascii=False)
  1326.         return True
  1327.     except Exception as e:
  1328.         messagebox.showerror("Save Error", "Failed to save database:\n{}".format(e))
  1329.         return False
  1330.  
  1331. def load_config():
  1332.     """Load config including history and favorites from AI-CONFIG.json"""
  1333.     default_cfg = {"theme": "Dark", "history": [], "favorites": []}
  1334.     try:
  1335.         if os.path.exists(CONFIG_FILE):
  1336.             with open(CONFIG_FILE, "r", encoding="utf-8") as f:
  1337.                 cfg = json.load(f)
  1338.                 # Ensure required keys exist
  1339.                 if "history" not in cfg:
  1340.                     cfg["history"] = []
  1341.                 if "favorites" not in cfg:
  1342.                     cfg["favorites"] = []
  1343.                 return cfg
  1344.     except Exception as e:
  1345.         print("[WARN] Failed to load config: {}".format(e))
  1346.     return default_cfg
  1347.  
  1348. def save_config(config):
  1349.     """Save config including history and favorites to AI-CONFIG.json"""
  1350.     try:
  1351.         with open(CONFIG_FILE, "w", encoding="utf-8") as f:
  1352.             json.dump(config, f, indent=4, ensure_ascii=False)
  1353.         return True
  1354.     except Exception as e:
  1355.         print("[WARN] Failed to save config: {}".format(e))
  1356.         return False
  1357.  
  1358. def find_command(user_input, db):
  1359.     text = user_input.lower().strip()
  1360.     if not text:
  1361.         return None
  1362.     if text in db:
  1363.         return db[text]
  1364.     for key in db:
  1365.         if text in key or key in text:
  1366.             return db[key]
  1367.     match = get_close_matches(text, db.keys(), n=1, cutoff=0.6)
  1368.     if match:
  1369.         return db[match[0]]
  1370.     return None
  1371.  
  1372. def search_aliases(query, db, limit=50):
  1373.     if not query:
  1374.         return sorted(db.items())[:limit]
  1375.     query = query.lower()
  1376.     results = []
  1377.     for k, v in db.items():
  1378.         if query in k.lower() or query in v.lower():
  1379.             results.append((k, v))
  1380.     if len(results) < limit:
  1381.         fuzzy = get_close_matches(query, db.keys(), n=limit-len(results), cutoff=0.4)
  1382.         for k in fuzzy:
  1383.             if k not in [r[0] for r in results]:
  1384.                 results.append((k, db[k]))
  1385.     return results[:limit]
  1386.  
  1387. def is_dangerous(cmd):
  1388.     return any(kw in cmd.lower() for kw in DANGEROUS_KEYWORDS)
  1389.  
  1390. # ═══════════════════════════════════════════════════════════════
  1391. # 🗄️ PROFESSIONAL DATABASE EDITOR WINDOW - V6.5
  1392. # ═══════════════════════════════════════════════════════════════
  1393. class JsonEditorWindow:
  1394.     def __init__(self, parent, main_app):
  1395.         self.parent = parent
  1396.         self.main = main_app
  1397.         self.theme = main_app.theme_cfg
  1398.         self.data = main_app.ai_db.copy()
  1399.         self.clipboard = None
  1400.         self.tree = None
  1401.        
  1402.         self.win = tk.Toplevel(parent)
  1403.         self.win.title("NAJEEB AI COMMANDS - DATABASE MANAGER")
  1404.         self.win.geometry("1000x700")
  1405.         self.win.configure(bg=self.theme["bg"])
  1406.         self.win.transient(parent)
  1407.         self.win.grab_set()
  1408.        
  1409.         # Center window
  1410.         self.win.update_idletasks()
  1411.         w, h = 1000, 700
  1412.         x = (self.win.winfo_screenwidth() // 2) - (w // 2)
  1413.         y = (self.win.winfo_screenheight() // 2) - (h // 2)
  1414.         self.win.geometry("{}x{}+{}+{}".format(w, h, max(0,x), max(0,y)))
  1415.        
  1416.         try:
  1417.             self._setup_styles()
  1418.             self._build_ui()
  1419.             self._populate_tree()
  1420.             self._update_stats()
  1421.         except Exception as e:
  1422.             messagebox.showerror("UI Error", "Failed to build editor window:\n{}".format(e), parent=self.win)
  1423.             self.win.destroy()
  1424.             return
  1425.        
  1426.         self.win.bind("<Control-n>", lambda e: self._focus_add())
  1427.         self.win.bind("<Control-e>", lambda e: self.edit_entry())
  1428.         self.win.bind("<Control-d>", lambda e: self.delete_entry())
  1429.         self.win.bind("<Control-s>", lambda e: self.save_to_file())
  1430.         self.win.bind("<Control-f>", lambda e: self.search_entry.focus_set())
  1431.         self.win.bind("<Control-i>", lambda e: self.import_json_file())
  1432.  
  1433.     def _setup_styles(self):
  1434.         style = ttk.Style()
  1435.         style.theme_use("clam")
  1436.         style.configure("Pro.TFrame", background=self.theme["bg"])
  1437.         style.configure("Pro.TLabelframe", background=self.theme["bg"],
  1438.                        foreground=self.theme["header_fg"], font=("Segoe UI", 9, "bold"))
  1439.         style.configure("Pro.TLabelframe.Label", background=self.theme["bg"],
  1440.                        foreground=self.theme["header_fg"])
  1441.         style.configure("Pro.TLabel", background=self.theme["bg"],
  1442.                        foreground=self.theme["fg"], font=("Segoe UI", 9))
  1443.         style.configure("Header.TLabel", background=self.theme["bg"],
  1444.                        foreground=self.theme["header_fg"], font=("Segoe UI", 10, "bold"))
  1445.         style.configure("Pro.TEntry", fieldbackground=self.theme["entry_bg"],
  1446.                        foreground=self.theme["entry_fg"], insertcolor=self.theme["highlight"],
  1447.                        font=("Consolas", 10), padding=5)
  1448.         style.configure("Pro.TButton", font=("Segoe UI", 9, "bold"), padding=5)
  1449.         style.map("Pro.TButton",
  1450.                  background=[("active", self.theme["select"]), ("pressed", "#003366")],
  1451.                  foreground=[("active", "white"), ("pressed", "white")])
  1452.         style.configure("Pro.Treeview", background=self.theme["tree_bg"],
  1453.                        foreground=self.theme["tree_fg"], fieldbackground=self.theme["tree_bg"],
  1454.                        font=("Consolas", 10), rowheight=28, borderwidth=0)
  1455.         style.configure("Pro.Treeview.Heading", background=self.theme["border"],
  1456.                        foreground=self.theme["header_fg"], font=("Segoe UI", 9, "bold"), relief="flat")
  1457.         style.map("Pro.Treeview", background=[("selected", self.theme["select"])],
  1458.                  foreground=[("selected", "white")])
  1459.         style.configure("Pro.Vertical.TScrollbar", background=self.theme["border"],
  1460.                        troughcolor=self.theme["bg"], arrowcolor=self.theme["fg"], gripcount=0)
  1461.         style.configure("Pro.Horizontal.TScrollbar", background=self.theme["border"],
  1462.                        troughcolor=self.theme["bg"], arrowcolor=self.theme["fg"], gripcount=0)
  1463.  
  1464.     def _build_ui(self):
  1465.         main_frame = ttk.Frame(self.win, style="Pro.TFrame")
  1466.         main_frame.pack(fill="both", expand=True, padx=12, pady=10)
  1467.        
  1468.         # Header
  1469.         header = ttk.Frame(main_frame, style="Pro.TFrame")
  1470.         header.pack(fill="x", pady=(0, 8))
  1471.         ttk.Label(header, text="🗄️ COMMAND DATABASE MANAGER",
  1472.                  style="Header.TLabel").pack(side="left")
  1473.         self.stats_lbl = ttk.Label(header, text="", style="Pro.TLabel",
  1474.                                   foreground=self.theme["status_fg"])
  1475.         self.stats_lbl.pack(side="right")
  1476.        
  1477.         # Search & Import Bar
  1478.         search_bar = ttk.LabelFrame(main_frame, text="Search & Import",
  1479.                                    style="Pro.TLabelframe", padding=8)
  1480.         search_bar.pack(fill="x", pady=(0, 8))
  1481.        
  1482.         search_frm = ttk.Frame(search_bar, style="Pro.TFrame")
  1483.         search_frm.pack(fill="x")
  1484.         ttk.Label(search_frm, text="Find:", style="Pro.TLabel").pack(side="left", padx=(0, 5))
  1485.         self.search_entry = ttk.Entry(search_frm, style="Pro.TEntry", width=40)
  1486.         self.search_entry.pack(side="left", fill="x", expand=True, padx=(0, 10))
  1487.         self.search_entry.bind("<KeyRelease>", self._on_search)
  1488.         ttk.Button(search_frm, text="✕ Clear", style="Pro.TButton",
  1489.                   command=lambda: self._clear_search()).pack(side="left", padx=2)
  1490.        
  1491.         import_frm = ttk.Frame(search_bar, style="Pro.TFrame")
  1492.         import_frm.pack(fill="x", pady=(5, 0))
  1493.         ttk.Button(import_frm, text="📥 Import JSON", style="Pro.TButton",
  1494.                   command=self.import_json_file).pack(side="left", padx=2)
  1495.         ttk.Button(import_frm, text="📤 Export List", style="Pro.TButton",
  1496.                   command=self._export_list).pack(side="left", padx=2)
  1497.         ttk.Button(import_frm, text="📋 Copy Selected", style="Pro.TButton",
  1498.                   command=self.copy_command).pack(side="right", padx=2)
  1499.        
  1500.         # Edit Panel
  1501.         edit_panel = ttk.LabelFrame(main_frame, text="✏️ Edit Entry",
  1502.                                    style="Pro.TLabelframe", padding=10)
  1503.         edit_panel.pack(fill="x", pady=(0, 8))
  1504.         input_frame = ttk.Frame(edit_panel, style="Pro.TFrame")
  1505.         input_frame.pack(fill="x")
  1506.        
  1507.         ttk.Label(input_frame, text="Alias (Key):", style="Pro.TLabel",
  1508.                  width=12).grid(row=0, column=0, sticky="w", padx=(0, 10), pady=2)
  1509.         self.key_var = tk.StringVar()
  1510.         self.key_entry = ttk.Entry(input_frame, textvariable=self.key_var,
  1511.                                   style="Pro.TEntry")
  1512.         self.key_entry.grid(row=0, column=1, sticky="we", padx=(0, 20), pady=2)
  1513.        
  1514.         ttk.Label(input_frame, text="Command:", style="Pro.TLabel",
  1515.                  width=12).grid(row=1, column=0, sticky="nw", padx=(0, 10), pady=2)
  1516.         self.cmd_var = tk.StringVar()
  1517.         self.cmd_entry = ttk.Entry(input_frame, textvariable=self.cmd_var,
  1518.                                   style="Pro.TEntry")
  1519.         self.cmd_entry.grid(row=1, column=1, sticky="we", padx=(0, 20), pady=2)
  1520.         input_frame.grid_columnconfigure(1, weight=1)
  1521.        
  1522.         btn_frame = ttk.Frame(edit_panel, style="Pro.TFrame")
  1523.         btn_frame.pack(fill="x", pady=(8, 0))
  1524.         ttk.Button(btn_frame, text="➕ Add New", style="Pro.TButton",
  1525.                   command=self.add_entry).pack(side="left", padx=2)
  1526.         ttk.Button(btn_frame, text="✏️ Update", style="Pro.TButton",
  1527.                   command=self.edit_entry).pack(side="left", padx=2)
  1528.         ttk.Button(btn_frame, text="❌ Delete", style="Pro.TButton",
  1529.                   command=self.delete_entry).pack(side="left", padx=2)
  1530.         ttk.Button(btn_frame, text="📋 Paste", style="Pro.TButton",
  1531.                   command=self.paste_command).pack(side="left", padx=2)
  1532.         ttk.Button(btn_frame, text="Reset Fields", style="Pro.TButton",
  1533.                   command=self._clear_inputs).pack(side="right", padx=2)
  1534.         ttk.Button(btn_frame, text="💾 Save Changes", style="Pro.TButton",
  1535.                   command=self.save_to_file).pack(side="right", padx=(15, 2))
  1536.  
  1537.         # Treeview with scrollbars
  1538.         tree_frame = ttk.LabelFrame(main_frame, text="Database Entries",
  1539.                                    style="Pro.TLabelframe", padding=5)
  1540.         tree_frame.pack(fill="both", expand=True, pady=(0, 8))
  1541.        
  1542.         self.tree = ttk.Treeview(tree_frame, columns=("alias", "command"),
  1543.                                 show="headings", style="Pro.Treeview",
  1544.                                 selectmode="browse", takefocus=True)
  1545.         self.tree.heading("alias", text="ALIAS / KEY", command=lambda: self._sort_column("alias", False))
  1546.         self.tree.heading("command", text="⚙️ COMMAND", command=lambda: self._sort_column("command", False))
  1547.         self.tree.column("alias", width=280, minwidth=200, stretch=False, anchor="w")
  1548.         self.tree.column("command", width=550, minwidth=300, anchor="w")
  1549.        
  1550.         vsb = ttk.Scrollbar(tree_frame, orient="vertical", command=self.tree.yview, style="Pro.Vertical.TScrollbar")
  1551.         hsb = ttk.Scrollbar(tree_frame, orient="horizontal", command=self.tree.xview, style="Pro.Horizontal.TScrollbar")
  1552.         self.tree.configure(yscrollcommand=vsb.set, xscrollcommand=hsb.set)
  1553.        
  1554.         self.tree.grid(row=0, column=0, sticky="nsew")
  1555.         vsb.grid(row=0, column=1, sticky="ns")
  1556.         hsb.grid(row=1, column=0, sticky="ew")
  1557.         tree_frame.grid_rowconfigure(0, weight=1)
  1558.         tree_frame.grid_columnconfigure(0, weight=1)
  1559.        
  1560.         self.tree.bind("<<TreeviewSelect>>", self._on_select)
  1561.         self.tree.bind("<Double-1>", self._on_double_click)
  1562.         self.tree.bind("<Delete>", lambda e: self.delete_entry())
  1563.         self.tree.bind("<Return>", lambda e: self.edit_entry())
  1564.         self.tree.bind("<Control-c>", lambda e: self.copy_command())
  1565.         self.tree.bind("<Control-v>", lambda e: self.paste_command())
  1566.  
  1567.         # Status Bar
  1568.         status_bar = ttk.Frame(main_frame, style="Pro.TFrame")
  1569.         status_bar.pack(fill="x", pady=(5, 0))
  1570.         self.status_var = tk.StringVar()
  1571.         self.status_var.set("✅ Ready | Ctrl+N:Add | Ctrl+E:Edit | Ctrl+D:Delete | Ctrl+S:Save | Ctrl+I:Import")
  1572.         ttk.Label(status_bar, textvariable=self.status_var, style="Pro.TLabel",
  1573.                  foreground=self.theme["status_fg"], font=("Segoe UI", 9)).pack(side="left")
  1574.         ttk.Button(status_bar, text="🗑️ Load Defaults", style="Pro.TButton",
  1575.                   command=self._confirm_reset).pack(side="right")
  1576.  
  1577.     def _sort_column(self, col, reverse):
  1578.         data = [(self.tree.set(child, col), child) for child in self.tree.get_children('')]
  1579.         data.sort(reverse=reverse)
  1580.         for index, (val, child) in enumerate(data):
  1581.             self.tree.move(child, '', index)
  1582.         self.tree.heading(col, command=lambda: self._sort_column(col, not reverse))
  1583.  
  1584.     def _populate_tree(self, data=None):
  1585.         if self.tree is None:
  1586.             return
  1587.         self.tree.delete(*self.tree.get_children())
  1588.         items = data if data else sorted(self.data.items())
  1589.         for alias, command in items:
  1590.             self.tree.insert("", "end", values=(alias, command), iid=alias, tags=('entry',))
  1591.         self.tree.tag_configure('entry', background=self.theme["tree_bg"])
  1592.  
  1593.     def _on_search(self, event=None):
  1594.         if self.tree is None:
  1595.             return
  1596.         query = self.search_entry.get().strip()
  1597.         results = search_aliases(query, self.data, limit=100)
  1598.         self._populate_tree(results)
  1599.         self._update_stats(len(results))
  1600.  
  1601.     def _clear_search(self):
  1602.         if self.tree is None:
  1603.             return
  1604.         self.search_entry.delete(0, tk.END)
  1605.         self._populate_tree()
  1606.         self._update_stats()
  1607.  
  1608.     def _on_select(self, event=None):
  1609.         if self.tree is None:
  1610.             return
  1611.         sel = self.tree.selection()
  1612.         if not sel:
  1613.             return
  1614.         alias = sel[0]
  1615.         item = self.tree.item(alias)
  1616.         values = item["values"]
  1617.         if len(values) >= 2:
  1618.             self.key_var.set(values[0])
  1619.             self.cmd_var.set(values[1])
  1620.             self._status("📍 Selected: {}".format(values[0]))
  1621.  
  1622.     def _on_double_click(self, event):
  1623.         if self.tree is None:
  1624.             return
  1625.         item = self.tree.identify_row(event.y)
  1626.         if item:
  1627.             self.tree.selection_set(item)
  1628.             self._on_select()
  1629.             self.key_entry.focus_set()
  1630.             self.key_entry.icursor(tk.END)
  1631.  
  1632.     def _focus_add(self, event=None):
  1633.         self._clear_inputs()
  1634.         self.key_entry.focus_set()
  1635.  
  1636.     def _clear_inputs(self):
  1637.         self.key_var.set("")
  1638.         self.cmd_var.set("")
  1639.         if self.tree:
  1640.             self.tree.selection_remove(self.tree.selection())
  1641.  
  1642.     def _update_stats(self, count=None):
  1643.         total = len(self.data)
  1644.         shown = count if count is not None else total
  1645.         if hasattr(self, 'stats_lbl') and self.stats_lbl:
  1646.             self.stats_lbl.config(text="Showing: {}/{} entries".format(shown, total))
  1647.  
  1648.     def _status(self, msg):
  1649.         if hasattr(self, 'status_var'):
  1650.             self.status_var.set(msg)
  1651.             if hasattr(self, 'win'):
  1652.                 self.win.after(3000, lambda: self._status("✅ Ready | Ctrl+N:Add | Ctrl+E:Edit | Ctrl+D:Delete | Ctrl+S:Save | Ctrl+I:Import"))
  1653.  
  1654.     def import_json_file(self):
  1655.         file_path = filedialog.askopenfilename(
  1656.             parent=self.win,
  1657.             title="Import Aliases from JSON",
  1658.             filetypes=[("JSON Files", "*.json"), ("All Files", "*.*")],
  1659.             initialdir=os.getcwd()
  1660.         )
  1661.         if not file_path:
  1662.             return
  1663.         try:
  1664.             with open(file_path, "r", encoding="utf-8") as f:
  1665.                 imported_data = json.load(f)
  1666.             if not isinstance(imported_data, dict):
  1667.                 messagebox.showerror("Invalid Format", "JSON file must contain a dictionary of aliases.", parent=self.win)
  1668.                 return
  1669.             new_count = sum(1 for k in imported_data if k not in self.data)
  1670.             update_count = sum(1 for k in imported_data if k in self.data)
  1671.             if new_count == 0 and update_count == 0:
  1672.                 messagebox.showinfo("No Changes", "All entries already exist in database.", parent=self.win)
  1673.                 return
  1674.             msg = "Import Summary:\n• New entries: {}\n• Updates: {}\n\nProceed with import?".format(new_count, update_count)
  1675.             if not messagebox.askyesno("Confirm Import", msg, parent=self.win):
  1676.                 return
  1677.             self.data.update(imported_data)
  1678.             self._populate_tree()
  1679.             self._update_stats()
  1680.             self._status("✅ Imported {} entries from {}".format(len(imported_data), os.path.basename(file_path)))
  1681.             messagebox.showinfo("Success", "Successfully imported {} aliases!".format(len(imported_data)), parent=self.win)
  1682.         except json.JSONDecodeError as e:
  1683.             messagebox.showerror("JSON Error", "Invalid JSON format:\n{}".format(e), parent=self.win)
  1684.         except Exception as e:
  1685.             messagebox.showerror("Import Error", "Failed to import file:\n{}".format(e), parent=self.win)
  1686.  
  1687.     def add_entry(self):
  1688.         key = self.key_var.get().strip()
  1689.         cmd = self.cmd_var.get().strip()
  1690.         if not key or not cmd:
  1691.             messagebox.showwarning("⚠️ Input Required", "Please fill both Alias and Command fields.", parent=self.win)
  1692.             return
  1693.         if key in self.data:
  1694.             if not messagebox.askyesno("⚠️ Entry Exists", "Alias '{}' already exists.\nOverwrite?".format(key), parent=self.win):
  1695.                 return
  1696.         self.data[key] = cmd
  1697.         self._populate_tree()
  1698.         self._update_stats()
  1699.         self._clear_inputs()
  1700.         self._status("✅ Added: '{}'".format(key))
  1701.         self.search_entry.focus_set()
  1702.  
  1703.     def edit_entry(self):
  1704.         if self.tree is None:
  1705.             return
  1706.         sel = self.tree.selection()
  1707.         if not sel:
  1708.             messagebox.showinfo("ℹ️ Select First", "Please select an entry from the list to edit.", parent=self.win)
  1709.             return
  1710.         old_key = sel[0]
  1711.         new_key = self.key_var.get().strip()
  1712.         new_cmd = self.cmd_var.get().strip()
  1713.         if not new_key or not new_cmd:
  1714.             messagebox.showwarning("⚠️ Input Required", "Both fields are required.", parent=self.win)
  1715.             return
  1716.         if new_key != old_key and new_key in self.data:
  1717.             if not messagebox.askyesno("⚠️ Key Exists", "Alias '{}' already exists.\nReplace?".format(new_key), parent=self.win):
  1718.                 return
  1719.         if old_key in self.data:
  1720.             del self.data[old_key]
  1721.         self.data[new_key] = new_cmd
  1722.         self._populate_tree()
  1723.         self._update_stats()
  1724.         self._status("✅ Updated: '{}' → '{}'".format(old_key, new_key))
  1725.  
  1726.     def delete_entry(self):
  1727.         if self.tree is None:
  1728.             return
  1729.         sel = self.tree.selection()
  1730.         if not sel:
  1731.             return
  1732.         keys = [self.tree.item(s)["values"][0] for s in sel]
  1733.         if not messagebox.askyesno("🗑️ Confirm Delete", "Delete {} entry(ies)?\n\n{}".format(len(keys), "\n".join(keys[:5]) + ("..." if len(keys)>5 else "")), parent=self.win):
  1734.             return
  1735.         for k in keys:
  1736.             self.data.pop(k, None)
  1737.         self._populate_tree()
  1738.         self._update_stats()
  1739.         self._clear_inputs()
  1740.         self._status("✅ Deleted {} entry(ies)".format(len(keys)))
  1741.  
  1742.     def copy_command(self):
  1743.         if self.tree is None:
  1744.             return
  1745.         sel = self.tree.selection()
  1746.         if not sel:
  1747.             cmd = self.cmd_var.get().strip()
  1748.             if not cmd:
  1749.                 self._status("⚠️ Nothing to copy")
  1750.                 return
  1751.         else:
  1752.             cmd = self.tree.item(sel[0])["values"][1]
  1753.         self.clipboard = cmd
  1754.         self.parent.clipboard_clear()
  1755.         self.parent.clipboard_append(cmd)
  1756.         self._status("Copied to clipboard")
  1757.  
  1758.     def paste_command(self):
  1759.         try:
  1760.             text = self.parent.clipboard_get().strip()
  1761.             if text:
  1762.                 self.cmd_var.set(text)
  1763.                 self._status("Pasted from clipboard")
  1764.         except tk.TclError:
  1765.             if self.clipboard:
  1766.                 self.cmd_var.set(self.clipboard)
  1767.                 self._status("Pasted from internal clipboard")
  1768.             else:
  1769.                 self._status("⚠️ Clipboard empty")
  1770.  
  1771.     def save_to_file(self):
  1772.         if save_data(self.data):
  1773.             self.main.ai_db = self.data.copy()
  1774.             self.parent.event_generate("<<RefreshMain>>")
  1775.             self._status("Saved successfully to {}".format(DATA_FILE))
  1776.             messagebox.showinfo("✅ Success", "Database saved & synced!", parent=self.win)
  1777.         else:
  1778.             self._status("❌ Save failed")
  1779.  
  1780.     def _export_list(self):
  1781.         filename = filedialog.asksaveasfilename(
  1782.             parent=self.win,
  1783.             title="Export Aliases",
  1784.             defaultextension=".txt",
  1785.             filetypes=[("Text Files", "*.txt"), ("JSON Files", "*.json"), ("All Files", "*.*")],
  1786.             initialfile="aliases_export_{}.txt".format(datetime.datetime.now().strftime("%Y%m%d_%H%M%S"))
  1787.         )
  1788.         if not filename:
  1789.             return
  1790.         try:
  1791.             if filename.endswith('.json'):
  1792.                 with open(filename, "w", encoding="utf-8") as f:
  1793.                     json.dump(self.data, f, indent=4, ensure_ascii=False)
  1794.             else:
  1795.                 with open(filename, "w", encoding="utf-8") as f:
  1796.                     f.write("# NAJEEB AI - Alias Export\n")
  1797.                     f.write("# Generated: {}\n\n".format(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")))
  1798.                     for alias, cmd in sorted(self.data.items()):
  1799.                         f.write("[{}] → {}\n".format(alias, cmd))
  1800.             self._status("Exported to {}".format(os.path.basename(filename)))
  1801.             messagebox.showinfo("Exported", "Alias list saved to:\n{}".format(filename), parent=self.win)
  1802.         except Exception as e:
  1803.             messagebox.showerror("Export Error", str(e), parent=self.win)
  1804.  
  1805.     def _confirm_reset(self):
  1806.         if messagebox.askyesno("⚠️ Reset Database", "Replace ALL entries with default commands?\n\nThis cannot be undone!", parent=self.win):
  1807.             self.data = default_data.copy()
  1808.             self._populate_tree()
  1809.             self._update_stats()
  1810.             self._clear_inputs()
  1811.             self._status("🔄 Reset to defaults")
  1812.  
  1813. # ═══════════════════════════════════════════════════════════════
  1814. # 🎯 MAIN APPLICATION - V6.5 WITH HISTORY/FAVORITES PERSISTENCE
  1815. # ═══════════════════════════════════════════════════════════════
  1816. class MainApp:
  1817.     def __init__(self, root):
  1818.         self.root = root
  1819.         self.root.title("NAJEEB AI PRO COMMANDS CLI V6.5 | Stable Edition")
  1820.         self.root.geometry("1100x750")
  1821.         self.root.minsize(900, 600)
  1822.        
  1823.         # Load config with history & favorites
  1824.         self.config = load_config()
  1825.         self.current_theme = self.config.get("theme", "Dark")
  1826.         self.theme_cfg = THEMES[self.current_theme]
  1827.         self.root.configure(bg=self.theme_cfg["bg"])
  1828.        
  1829.         # Load aliases database
  1830.         self.ai_db = load_data()
  1831.        
  1832.         # Load history & favorites from config (with limits)
  1833.         self.history = self.config.get("history", [])[-50:]  # Keep last 50
  1834.         self.favorites = self.config.get("favorites", [])
  1835.        
  1836.         self.pending_cmd = None
  1837.        
  1838.         self.ai_var = tk.StringVar()
  1839.         self.search_var = tk.StringVar()
  1840.         self.edit_alias_var = tk.StringVar()
  1841.         self.edit_cmd_var = tk.StringVar()
  1842.         self.result_var = tk.StringVar(value="Search → Select → Edit → Run")
  1843.         self.status_var = tk.StringVar(value="✅ Ready")
  1844.        
  1845.         self._setup_styles()
  1846.         self._build_ui()
  1847.         self._update_lists()
  1848.         self._log("NAJEEB AI PRO COMMANDS CLI V6.5 Initialized\nTheme: {}\n✏️ Edit-Before-Run: ON\nHistory: {} | Favorites: {}\n".format(
  1849.             self.current_theme, len(self.history), len(self.favorites)))
  1850.        
  1851.         self.root.bind("<<RefreshMain>>", lambda e: self._status("🔄 Database refreshed"))
  1852.         self.root.bind("<Return>", lambda e: self._search_execute())
  1853.         self.root.protocol("WM_DELETE_WINDOW", self._on_close)
  1854.         self._populate_results()
  1855.  
  1856.     def _setup_styles(self):
  1857.         style = ttk.Style()
  1858.         style.theme_use("clam")
  1859.         style.configure("TFrame", background=self.theme_cfg["bg"])
  1860.         style.configure("TLabel", background=self.theme_cfg["bg"], foreground=self.theme_cfg["fg"], font=("Segoe UI", 10))
  1861.         style.configure("TEntry", fieldbackground=self.theme_cfg["entry_bg"], foreground=self.theme_cfg["entry_fg"], font=("Consolas", 11))
  1862.         style.configure("TButton", font=("Segoe UI", 10, "bold"))
  1863.         style.configure("Header.TLabel", font=("Segoe UI", 13, "bold"), foreground=self.theme_cfg["header_fg"])
  1864.         style.configure("Status.TLabel", font=("Segoe UI", 9), foreground=self.theme_cfg["status_fg"])
  1865.  
  1866.     def _build_ui(self):
  1867.         header = ttk.Frame(self.root)
  1868.         header.pack(fill="x", padx=15, pady=(12, 5))
  1869.         ttk.Label(header, text="NAJEEB AI PRO ALIASES COMMANDS CENTER", style="Header.TLabel").pack(side="left")
  1870.         theme_frm = ttk.Frame(header)
  1871.         theme_frm.pack(side="right")
  1872.         ttk.Label(theme_frm, text="THEME▶").pack(side="left")
  1873.         self.theme_cb = ttk.Combobox(theme_frm, values=list(THEMES.keys()), state="readonly", width=8)
  1874.         self.theme_cb.set(self.current_theme)
  1875.         self.theme_cb.pack(side="left")
  1876.         self.theme_cb.bind("<<ComboboxSelected>>", self._change_theme)
  1877.  
  1878.         search_frm = ttk.Frame(self.root)
  1879.         search_frm.pack(fill="x", padx=15, pady=5)
  1880.         ttk.Label(search_frm, text="SEARCH").pack(side="left")
  1881.         ttk.Entry(search_frm, textvariable=self.search_var, width=55).pack(side="left", padx=5)
  1882.         ttk.Button(search_frm, text="Find", command=self._populate_results).pack(side="left", padx=2)
  1883.         ttk.Button(search_frm, text="✕CLEAR", command=lambda: self.search_var.set("")).pack(side="left", padx=2)
  1884.  
  1885.         results_frm = ttk.Frame(self.root)
  1886.         results_frm.pack(fill="x", padx=15, pady=(0, 5))
  1887.         ttk.Label(results_frm, text="Results:", style="Header.TLabel").pack(anchor="w")
  1888.         self.results_lb = tk.Listbox(results_frm, bg=self.theme_cfg["tree_bg"], fg=self.theme_cfg["tree_fg"],
  1889.                                      font=("Consolas", 10), height=5, selectbackground=self.theme_cfg["select"],
  1890.                                      activestyle='none')
  1891.         self.results_lb.pack(fill="x")
  1892.         self.results_lb.bind("<Double-1>", self._select_result)
  1893.  
  1894.         edit_frm = ttk.LabelFrame(self.root, text="✏️ Edit & Run", padding=10)
  1895.         edit_frm.pack(fill="x", padx=15, pady=5)
  1896.         ttk.Label(edit_frm, text="Alias:").grid(row=0, column=0, sticky="w")
  1897.         ttk.Entry(edit_frm, textvariable=self.edit_alias_var, state="readonly", width=35).grid(row=0, column=1, padx=10, sticky="we")
  1898.         ttk.Label(edit_frm, text="Command:").grid(row=0, column=2, sticky="w")
  1899.         ttk.Entry(edit_frm, textvariable=self.edit_cmd_var, width=50).grid(row=0, column=3, padx=10, sticky="we")
  1900.         edit_frm.grid_columnconfigure(1, weight=1)
  1901.         edit_frm.grid_columnconfigure(3, weight=3)
  1902.         btn_row = ttk.Frame(edit_frm)
  1903.         btn_row.grid(row=1, column=0, columnspan=4, pady=8)
  1904.         ttk.Button(btn_row, text="▶ RUN", command=self._run_cmd, style="TButton").pack(side="left", padx=3)
  1905.         ttk.Button(btn_row, text="Learn", command=self._learn).pack(side="left", padx=3)
  1906.         ttk.Button(btn_row, text="⭐ Favorite", command=self._add_fav).pack(side="left", padx=3)
  1907.         ttk.Button(btn_row, text="Clear", command=self._clear_edit).pack(side="left", padx=3)
  1908.         ttk.Button(btn_row, text="DB Editor", command=self._open_editor).pack(side="right", padx=3)
  1909.  
  1910.         tk.Label(self.root, textvariable=self.result_var,
  1911.                 fg=self.theme_cfg["highlight"], bg=self.theme_cfg["bg"],
  1912.                 font=("Consolas", 10, "bold"), justify="left", anchor="w").pack(pady=5, fill="x", padx=15)
  1913.  
  1914.         list_frm = ttk.Frame(self.root)
  1915.         list_frm.pack(fill="x", padx=15, pady=5)
  1916.         ttk.Label(list_frm, text="▶ History", style="Header.TLabel").pack(side="left", expand=True)
  1917.         ttk.Label(list_frm, text="⭐ Favorites", style="Header.TLabel").pack(side="right", expand=True)
  1918.         self.hist_lb = tk.Listbox(list_frm, bg=self.theme_cfg["tree_bg"], fg="cyan", font=("Consolas", 10), height=4, activestyle='none')
  1919.         self.fav_lb = tk.Listbox(list_frm, bg=self.theme_cfg["tree_bg"], fg="gold", font=("Consolas", 10), height=4, activestyle='none')
  1920.         self.hist_lb.pack(side="left", fill="x", expand=True, padx=(0, 10))
  1921.         self.fav_lb.pack(side="right", fill="x", expand=True)
  1922.         self.hist_lb.bind("<Double-1>", self._run_from_list)
  1923.         self.fav_lb.bind("<Double-1>", self._run_from_list)
  1924.  
  1925.         console_frm = ttk.Frame(self.root)
  1926.         console_frm.pack(fill="both", expand=True, padx=15, pady=5)
  1927.         self.console = tk.Text(console_frm, bg=self.theme_cfg["console_bg"], fg=self.theme_cfg["console_fg"],
  1928.                               font=("Consolas", 10), state="disabled", wrap=tk.WORD, height=10,
  1929.                               insertbackground=self.theme_cfg["highlight"])
  1930.         scr = ttk.Scrollbar(console_frm, command=self.console.yview)
  1931.         self.console.configure(yscrollcommand=scr.set)
  1932.         self.console.pack(side="left", fill="both", expand=True)
  1933.         scr.pack(side="right", fill="y")
  1934.  
  1935.         cons_btn = ttk.Frame(self.root)
  1936.         cons_btn.pack(fill="x", padx=15, pady=(0, 5))
  1937.         ttk.Button(cons_btn, text="▶Clear", command=self._clear_console).pack(side="left", padx=2)
  1938.         ttk.Button(cons_btn, text="Save Log", command=self._save_console).pack(side="left", padx=2)
  1939.  
  1940.         ttk.Label(self.root, textvariable=self.status_var, style="Status.TLabel").pack(fill="x", padx=10, pady=(0, 8))
  1941.  
  1942.     def _change_theme(self, event=None):
  1943.         new = self.theme_cb.get()
  1944.         if new in THEMES:
  1945.             self.current_theme = new
  1946.             self.theme_cfg = THEMES[new]
  1947.             self.config["theme"] = new
  1948.             self.root.configure(bg=self.theme_cfg["bg"])
  1949.             self._setup_styles()
  1950.             self._status("🎨 Theme: {}".format(new))
  1951.             self._log("[THEME] Switched to {}\n".format(new))
  1952.             self._update_lists()
  1953.             self._populate_results()
  1954.             save_config(self.config)  # Auto-save theme
  1955.  
  1956.     def _populate_results(self):
  1957.         q = self.search_var.get()
  1958.         results = search_aliases(q, self.ai_db, limit=50)
  1959.         self.results_lb.delete(0, tk.END)
  1960.         for alias, cmd in results:
  1961.             short = cmd[:70] + "..." if len(cmd) > 70 else cmd
  1962.             self.results_lb.insert(tk.END, "[{}] → {}".format(alias, short))
  1963.  
  1964.     def _search_execute(self):
  1965.         self._populate_results()
  1966.  
  1967.     def _select_result(self, event):
  1968.         sel = self.results_lb.curselection()
  1969.         if not sel: return
  1970.         item = self.results_lb.get(sel[0])
  1971.         if "→" in item:
  1972.             alias = item.split("→")[0].strip().strip("[]")
  1973.             cmd = self.ai_db.get(alias)
  1974.             if cmd:
  1975.                 self.edit_alias_var.set(alias)
  1976.                 self.edit_cmd_var.set(cmd)
  1977.                 self.result_var.set("✏️ Ready: {}".format(cmd[:75]))
  1978.                 self._status("✅ Selected: {}".format(alias))
  1979.  
  1980.     def _clear_edit(self):
  1981.         self.edit_alias_var.set("")
  1982.         self.edit_cmd_var.set("")
  1983.         self.result_var.set("Search → Select → Edit → Run")
  1984.  
  1985.     def _run_cmd(self):
  1986.         cmd = self.edit_cmd_var.get().strip()
  1987.         alias = self.edit_alias_var.get().strip()
  1988.         if not cmd:
  1989.             messagebox.showwarning("Empty", "No command to run.", parent=self.root)
  1990.             return
  1991.         if is_dangerous(cmd) and not messagebox.askyesno("⚠️ Warning", "Execute:\n{}".format(cmd), parent=self.root):
  1992.             return
  1993.         self.result_var.set("▶ {}".format(cmd))
  1994.         self._status("⏳ Running...")
  1995.         self._log("[RUN] {} → {}\n".format(alias or "custom", cmd))
  1996.         self._execute(cmd)
  1997.        
  1998.         # Save to history & config
  1999.         if cmd not in self.history:
  2000.             self.history.append(cmd)
  2001.             if len(self.history) > 50:
  2002.                 self.history = self.history[-50:]  # Keep last 50
  2003.             self.config["history"] = self.history
  2004.             save_config(self.config)
  2005.             self._update_lists()
  2006.  
  2007.     def _log(self, msg):
  2008.         def _append():
  2009.             if hasattr(self, 'console') and self.console:
  2010.                 self.console.config(state="normal")
  2011.                 self.console.insert(tk.END, msg)
  2012.                 self.console.see(tk.END)
  2013.                 self.console.config(state="disabled")
  2014.         self.root.after(0, _append)
  2015.  
  2016.     def _clear_console(self):
  2017.         if hasattr(self, 'console') and self.console:
  2018.             self.console.config(state="normal")
  2019.             self.console.delete("1.0", tk.END)
  2020.             self.console.config(state="disabled")
  2021.             self._log("🧹 Console cleared.\n")
  2022.  
  2023.     def _save_console(self):
  2024.         if not hasattr(self, 'console') or not self.console:
  2025.             return
  2026.         content = self.console.get("1.0", tk.END)
  2027.         if not content.strip():
  2028.             messagebox.showinfo("Empty", "Nothing to save.", parent=self.root)
  2029.             return
  2030.         fn = "console_{}.txt".format(datetime.datetime.now().strftime("%Y%m%d_%H%M%S"))
  2031.         try:
  2032.             with open(fn, "w", encoding="utf-8") as f:
  2033.                 f.write(content)
  2034.             messagebox.showinfo("Saved", "Log saved to:\n{}".format(fn), parent=self.root)
  2035.         except Exception as e:
  2036.             messagebox.showerror("Error", str(e), parent=self.root)
  2037.  
  2038.     def _execute(self, cmd):
  2039.         def worker():
  2040.             try:
  2041.                 creation_flags = 0
  2042.                 if os.name == "nt":
  2043.                     try:
  2044.                         creation_flags = subprocess.CREATE_NO_WINDOW
  2045.                     except AttributeError:
  2046.                         pass
  2047.                 proc = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE,
  2048.                                        stderr=subprocess.STDOUT, universal_newlines=True,
  2049.                                        creationflags=creation_flags)
  2050.                 for line in proc.stdout:
  2051.                     self._log(line)
  2052.                 proc.stdout.close()
  2053.                 rc = proc.wait()
  2054.                 self._log("\n[{}] Exit code: {}\n".format("✓" if rc==0 else "✗", rc))
  2055.             except Exception as e:
  2056.                 self._log("\n[ERROR] {}\n".format(e))
  2057.             self.root.after(0, lambda: self._status("✅ Ready"))
  2058.         threading.Thread(target=worker, daemon=True).start()
  2059.  
  2060.     def _learn(self):
  2061.         alias = self.edit_alias_var.get().strip()
  2062.         cmd = self.edit_cmd_var.get().strip()
  2063.         if not alias or not cmd:
  2064.             messagebox.showwarning("Learn", "Select and edit a command first.", parent=self.root)
  2065.             return
  2066.         new_alias = simpledialog.askstring("Learn", "Alias name:", initialvalue=alias, parent=self.root)
  2067.         if new_alias and new_alias.strip():
  2068.             new_alias = new_alias.strip()
  2069.             if messagebox.askyesno("Confirm", "Save '{}' → '{}'?".format(new_alias, cmd), parent=self.root):
  2070.                 self.ai_db[new_alias] = cmd
  2071.                 if save_data(self.ai_db):
  2072.                     self._status("✅ Learned & saved")
  2073.                     self._log("[LEARN] {} → {}\n".format(new_alias, cmd))
  2074.                     self._populate_results()
  2075.  
  2076.     def _add_fav(self):
  2077.         cmd = self.edit_cmd_var.get().strip()
  2078.         if cmd and cmd not in self.favorites:
  2079.             self.favorites.append(cmd)
  2080.             self.config["favorites"] = self.favorites
  2081.             save_config(self.config)  # Auto-save favorites
  2082.             self._update_lists()
  2083.             self._status("⭐ Added to favorites")
  2084.  
  2085.     def _update_lists(self):
  2086.         if hasattr(self, 'hist_lb') and self.hist_lb:
  2087.             self.hist_lb.delete(0, tk.END)
  2088.             for h in self.history[-30:]:
  2089.                 self.hist_lb.insert(tk.END, h)
  2090.         if hasattr(self, 'fav_lb') and self.fav_lb:
  2091.             self.fav_lb.delete(0, tk.END)
  2092.             for f in self.favorites:
  2093.                 self.fav_lb.insert(tk.END, f)
  2094.  
  2095.     def _run_from_list(self, event):
  2096.         widget = event.widget
  2097.         sel = widget.curselection()
  2098.         if sel:
  2099.             cmd = widget.get(sel[0])
  2100.             self.edit_cmd_var.set(cmd)
  2101.             self.edit_alias_var.set("From "+("Favorites" if widget==self.fav_lb else "History"))
  2102.             self.result_var.set("✏️ Edit if needed, then ▶ RUN")
  2103.  
  2104.     def _open_editor(self):
  2105.         JsonEditorWindow(self.root, self)
  2106.  
  2107.     def _status(self, msg):
  2108.         if hasattr(self, 'status_var'):
  2109.             self.status_var.set(msg)
  2110.  
  2111.     def _on_close(self):
  2112.         # Final save of config on exit
  2113.         self.config["theme"] = self.current_theme
  2114.         self.config["history"] = self.history
  2115.         self.config["favorites"] = self.favorites
  2116.         save_config(self.config)
  2117.         if messagebox.askyesno("Exit", "Close NAJEEB AI PRO CLI?", parent=self.root):
  2118.             self.root.destroy()
  2119.  
  2120. # ═══════════════════════════════════════════════════════════════
  2121. # 🚀 ENTRY POINT
  2122. # ═══════════════════════════════════════════════════════════════
  2123. if __name__ == "__main__":
  2124.     if sys.platform == "win32":
  2125.         try:
  2126.             from ctypes import windll
  2127.             windll.shcore.SetProcessDpiAwareness(1)
  2128.         except:
  2129.             pass
  2130.     root = tk.Tk()
  2131.     try:
  2132.         root.iconbitmap(default="")
  2133.     except:
  2134.         pass
  2135.     app = MainApp(root)
  2136.     root.mainloop()
  2137.  
Add Comment
Please, Sign In to add comment