Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ options:
--sys-platform STRING
Specify system platform (default: None)
--plugin-configs [STRING ...]
built-in config names or paths to plugin config JSONs. Available built-in configs: NodeStatus (default: None)
built-in config names or paths to plugin config JSONs. Available built-in configs: AllPlugins, NodeStatus (default: None)
--system-config STRING
Path to system config json (default: None)
--connection-config STRING
Expand Down Expand Up @@ -448,7 +448,11 @@ Below is an example that skips sudo requiring plugins and disables analysis.
```

#### Plugin config: **'--plugin-configs' command**
A plugin config can be used to compare the system data against the config specifications:
A plugin config can be used to compare the system data against the config specifications.
Built-in configs include **NodeStatus** (a subset of plugins) and **AllPlugins** (runs every
registered plugin with default arguments—useful for generating a reference config from the full system).

Using a JSON file:
```sh
node-scraper --plugin-configs plugin_config.json
```
Expand Down Expand Up @@ -509,7 +513,14 @@ Here is an example of a comprehensive plugin config that specifies analyzer args
This command can be used to generate a reference config that is populated with current system
configurations. Plugins that use analyzer args (where applicable) will be populated with system
data.
Sample command:

**Run all registered plugins (AllPlugins config):**
```sh
node-scraper --plugin-config AllPlugins

```

**Generate a reference config for specific plugins:**
```sh
node-scraper --gen-reference-config run-plugins BiosPlugin OsPlugin

Expand Down
11 changes: 10 additions & 1 deletion nodescraper/cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
from nodescraper.configregistry import ConfigRegistry
from nodescraper.constants import DEFAULT_LOGGER
from nodescraper.enums import ExecutionStatus, SystemInteractionLevel, SystemLocation
from nodescraper.models import SystemInfo
from nodescraper.models import PluginConfig, SystemInfo
from nodescraper.pluginexecutor import PluginExecutor
from nodescraper.pluginregistry import PluginRegistry

Expand Down Expand Up @@ -171,6 +171,7 @@ def build_parser(
)

subparsers = parser.add_subparsers(dest="subcmd", help="Subcommands")
subparsers.default = "run-plugins"

summary_parser = subparsers.add_parser(
"summary",
Expand Down Expand Up @@ -354,6 +355,14 @@ def main(arg_input: Optional[list[str]] = None):
plugin_reg = PluginRegistry()

config_reg = ConfigRegistry()
# Add synthetic "AllPlugins" config that includes every registered plugin
config_reg.configs["AllPlugins"] = PluginConfig(
name="AllPlugins",
desc="Run all registered plugins with default arguments",
global_args={},
plugins={name: {} for name in plugin_reg.plugins},
result_collators={},
)
parser, plugin_subparser_map = build_parser(plugin_reg, config_reg)

try:
Expand Down