Open
Conversation
Added a CLI interface, so this can be used for scripts.
Here is a sample:
```
(base) user@users-MacBook-Pro-M1-2 GenSMBIOS % python3 GenSMBIOS.py -h
usage: GenSMBIOS.py [-h] [--install] [--plist PLIST] [--plist-type {clover,opencore}] [--generate GENERATE [GENERATE ...]] [--uuid] [--rom] [--list]
[--toggle-rom] [--args ARGS] [--clear-args] [--version] [-j JSON]
GenSMBIOS CLI
options:
-h, --help show this help message and exit
--install Install/Update MacSerial
--plist PLIST Path to config.plist
--plist-type {clover,opencore}
Specify plist type if not auto-detected
--generate GENERATE [GENERATE ...]
Generate SMBIOS: <type> [times] (e.g., iMac18,3 5)
--uuid Generate UUID
--rom Generate ROM
--list List current SMBIOS
--toggle-rom Toggle generate ROM with SMBIOS
--args ARGS Set additional args for macserial
--clear-args Clear additional args for macserial
--version Show MacSerial version
-j JSON, --json JSON Export generated SMBIOS to JSON file
% python3 GenSMBIOS.py --plist ~/Documents/OCC/EfiMaker/2025-07-19-22h39m38s/EFI/OC/config.plist -j /tmp/test.json --generate iMac18,3 1
#######################################################
# Getting MacSerial Remote Version #
#######################################################
Gathering latest macserial info...
- Gathering info from OpenCorePkg...
iMac18,3 SMBIOS Info
Type: iMac18,3
Serial: C02YL8YJJ1GJ
Board Serial: C029164054NJ0PGJA
SmUUID: D74CF4E7-536D-43C2-9FAE-A23D26661530
Apple ROM: 24240E5554D7
Flushing SMBIOS entry to /Users/user/Documents/OCC/EfiMaker/2025-07-19-22h39m38s/EFI/OC/config.plist
Exported to /tmp/test.json
(base) user@users-MacBook-Pro-M1-2 GenSMBIOS % cat /tmp/test.json
{
"Type": "iMac18,3",
"Serial": "C02YL8YJJ1GJ",
"Board Serial": "C029164054NJ0PGJA",
"SmUUID": "D74CF4E7-536D-43C2-9FAE-A23D26661530",
"ROM": "24240E5554D7"
}
```
Now if it is started with a --plist and one specified, it will load the menu with the plist already loaded. Shorter options make less typing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Here is the CLI for GenSMBIOS. My 2nd commit refined the options, and the logic.