Describe the Bug
In cli.py, the list-plugins command handler is placed inside the main try block (line 230-238) that occurs after the full Scanner initialization (line 193-199). This means running ghostcheck list-plugins unnecessarily:
- Loads and instantiates all 34 security checker modules
- Loads and parses the results cache from disk
- Initializes baseline fingerprinting
- Auto-detects framework presets
None of these are needed just to list available plugins.
Expected Behavior
ghostcheck list-plugins should be handled early in the CLI flow (similar to list-checks at line 164) to avoid unnecessary Scanner initialization overhead.
Proposed Fix
Move the list-plugins handler block to be adjacent to the list-checks handler (before Scanner initialization), using PluginManager directly instead of scanner.plugin_manager.
Impact
- Faster
list-plugins execution (skip ~500ms of unnecessary init)
- No behavioral change for end users
Describe the Bug
In
cli.py, thelist-pluginscommand handler is placed inside the maintryblock (line 230-238) that occurs after the fullScannerinitialization (line 193-199). This means runningghostcheck list-pluginsunnecessarily:None of these are needed just to list available plugins.
Expected Behavior
ghostcheck list-pluginsshould be handled early in the CLI flow (similar tolist-checksat line 164) to avoid unnecessary Scanner initialization overhead.Proposed Fix
Move the
list-pluginshandler block to be adjacent to thelist-checkshandler (before Scanner initialization), usingPluginManagerdirectly instead ofscanner.plugin_manager.Impact
list-pluginsexecution (skip ~500ms of unnecessary init)