> For the complete documentation index, see [llms.txt](https://asus-isg-aidc.gitbook.io/guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://asus-isg-aidc.gitbook.io/guide/v1.4.0/cli/commandreference/bios.md).

# BIOS Operations

| Developer | Last modified |
| --------- | ------------- |
| AIDC Team | 2026/04/29    |

## Table of Contents

* [1. Overview](#overview)
* [2. Subcommands](#subcommands)
* [3. Quick Summary](#quick-summary)
* [4. Usage Examples](#usage-examples)

***

## 1. Overview <a href="#overview" id="overview"></a>

The `bios` command provides BIOS configuration management operations — including reading and writing configuration, boot order control, PXE boot interface setup, password management, and factory reset.

```bash
aidc-cli bios <subcommand> [flags]
```

***

## 2. Subcommands <a href="#subcommands" id="subcommands"></a>

### 2.1 `get-bootorder` — Get BIOS Boot Order

Retrieves the current BIOS boot order from target nodes.

```bash
aidc-cli bios get-bootorder
```

***

### 2.2 `get-cfg` — Get BIOS Configuration

Reads and displays the current BIOS configuration settings.

```bash
aidc-cli bios get-cfg
```

***

### 2.3 `save-cfg` — Save BIOS Configuration

Saves the current BIOS configuration to a specified file path.

```bash
aidc-cli bios save-cfg [--ip <bmc-ip>] -f <file-path>
```

| Flag          | Short | Required | Description                                                             |
| ------------- | :---: | :------: | ----------------------------------------------------------------------- |
| `--ip`        |   —   |    ❌\*   | BMC IP of the target node (or use `-i` global flag with hostname/OS IP) |
| `--file-path` |  `-f` |     ✅    | File path to save the BIOS configuration                                |

{% hint style="info" %}
Either `--ip` or the global `-i` flag must resolve to a valid BMC IP. When `-i <hostname>` is provided, the BMC IP is automatically looked up from the node inventory.
{% endhint %}

***

### 2.4 `set-cfg` — Set BIOS Configuration

Applies a specific BIOS configuration attribute by index to target nodes.

```bash
aidc-cli bios set-cfg [--ip <bmc-ip>] -x <index> [-u <value>]
```

| Flag      | Short | Required | Description                                                                                          |
| --------- | :---: | :------: | ---------------------------------------------------------------------------------------------------- |
| `--ip`    |   —   |    ❌\*   | BMC IP of the target node (or use `-i` global flag with hostname/OS IP)                              |
| `--index` |  `-x` |     ✅    | Index of the BIOS attribute to set (must be greater than 0; use `get-cfg` to find attribute indices) |
| `--value` |  `-u` |     ❌    | Value to assign to the BIOS attribute                                                                |

{% hint style="warning" %}
This command requires a **host reboot** to take effect. The BIOS changes are staged and applied on the next boot cycle.
{% endhint %}

{% hint style="info" %}
Either `--ip` or the global `-i` flag must resolve to a valid BMC IP. Use `aidc-cli bios get-cfg` first to identify the target attribute index.
{% endhint %}

***

### 2.5 `restore-cfg` — Restore BIOS Configuration

Restores the BIOS configuration from a previously saved file.

```bash
aidc-cli bios restore-cfg [--ip <bmc-ip>]
```

| Flag   | Short | Required | Description                                                             |
| ------ | :---: | :------: | ----------------------------------------------------------------------- |
| `--ip` |   —   |    ❌\*   | BMC IP of the target node (or use `-i` global flag with hostname/OS IP) |

{% hint style="warning" %}
This command requires a **host reboot** to take effect.
{% endhint %}

{% hint style="info" %}
Either `--ip` or the global `-i` flag must resolve to a valid BMC IP.
{% endhint %}

***

### 2.6 `reset-default` — Reset BIOS to Default

Resets all BIOS settings back to factory defaults.

```bash
aidc-cli bios reset-default [--ip <bmc-ip>]
```

| Flag   | Short | Required | Description                                                             |
| ------ | :---: | :------: | ----------------------------------------------------------------------- |
| `--ip` |   —   |    ❌\*   | BMC IP of the target node (or use `-i` global flag with hostname/OS IP) |

{% hint style="danger" %}
This will erase all custom BIOS settings. A **host reboot** is required for the reset to take effect.
{% endhint %}

{% hint style="info" %}
Either `--ip` or the global `-i` flag must resolve to a valid BMC IP.
{% endhint %}

***

### 2.7 `set-password` — Set BIOS Password

Sets the BIOS password for a specified account on the target node.

```bash
aidc-cli bios set-password [--ip <bmc-ip>] -n <name> -w <new-password> [-d <old-password>]
```

| Flag             | Short | Required | Description                                                             |
| ---------------- | :---: | :------: | ----------------------------------------------------------------------- |
| `--ip`           |   —   |    ❌\*   | BMC IP of the target node (or use `-i` global flag with hostname/OS IP) |
| `--name`         |  `-n` |     ✅    | BIOS password account name (e.g., `Administrator`, `User`)              |
| `--new-password` |  `-w` |     ✅    | New BIOS password to set                                                |
| `--old-password` |  `-d` |     ❌    | Current BIOS password (required when an existing password is set)       |

{% hint style="warning" %}
This command requires a **host reboot** to take effect.
{% endhint %}

{% hint style="info" %}
Either `--ip` or the global `-i` flag must resolve to a valid BMC IP.
{% endhint %}

***

### 2.8 `set-pxeboot` — Set BIOS PXE Boot Interface

Configures the target PXE boot network interface by MAC address or interface name.

```bash
aidc-cli bios set-pxeboot --ip <bmc-ip> [--mac <mac-address> | --name <interface-name>]
```

| Flag     | Short | Required | Description                                          |
| -------- | :---: | :------: | ---------------------------------------------------- |
| `--ip`   |   —   |     ✅    | BMC IP of the target node for PXE boot configuration |
| `--mac`  |  `-m` |    ❌\*   | PXE interface MAC address                            |
| `--name` |  `-n` |    ❌\*   | PXE interface name (e.g., `i210`, `i350`)            |

{% hint style="info" %}
Either `--mac` or `--name` must be specified. This command requires a **host reboot** to take effect.
{% endhint %}

***

## 3. Quick Summary <a href="#quick-summary" id="quick-summary"></a>

| Subcommand      | Action                               | Reboot Required | Key Flags                                            |
| --------------- | ------------------------------------ | :-------------: | ---------------------------------------------------- |
| `get-bootorder` | Read current boot order              |        ❌        | —                                                    |
| `get-cfg`       | Read BIOS configuration              |        ❌        | —                                                    |
| `save-cfg`      | Save BIOS configuration to file      |        ❌        | `--ip`, `--file-path`                                |
| `set-cfg`       | Apply BIOS attribute by index        |        ✅        | `--ip`, `--index`, `--value`                         |
| `restore-cfg`   | Restore BIOS configuration from file |        ✅        | `--ip`                                               |
| `reset-default` | Factory reset BIOS settings          |        ✅        | `--ip`                                               |
| `set-password`  | Set BIOS password                    |        ✅        | `--ip`, `--name`, `--new-password`, `--old-password` |
| `set-pxeboot`   | Set PXE boot interface               |        ✅        | `--ip`, `--mac` or `--name`                          |

***

## 4. Usage Examples <a href="#usage-examples" id="usage-examples"></a>

```bash
# Read BIOS boot order from all nodes
aidc-cli bios get-bootorder

# Read BIOS configuration from all nodes
aidc-cli bios get-cfg

# Save current BIOS configuration to a file (specify BMC IP directly)
aidc-cli bios save-cfg --ip 192.168.100.10 -f /home/admin/data/bios_backup.json

# Save BIOS configuration using node hostname via -i (BMC IP resolved from inventory)
aidc-cli bios save-cfg -i node01 -f /home/admin/data/bios_backup.json

# Apply a BIOS attribute by index (requires get-cfg to find the index first)
aidc-cli bios set-cfg --ip 192.168.100.10 -x 5 -u "Enabled"
aidc-cli bmc power-reset --ip 192.168.100.10  # Reboot to apply

# Restore BIOS from a previously saved file
aidc-cli bios restore-cfg --ip 192.168.100.10
aidc-cli bmc power-reset --ip 192.168.100.10  # Reboot to apply

# Reset BIOS to factory defaults on a specific node
aidc-cli bios reset-default --ip 192.168.100.10
aidc-cli bmc power-reset --ip 192.168.100.10  # Reboot to apply

# Reset BIOS to factory defaults using hostname via -i
aidc-cli bios reset-default -i node01
aidc-cli bmc power-reset -l node01  # Reboot node01 to apply

# Set BIOS Administrator password (no existing password)
aidc-cli bios set-password --ip 192.168.100.10 -n Administrator -w NewPass123

# Change BIOS Administrator password (with existing password)
aidc-cli bios set-password --ip 192.168.100.10 -n Administrator -w NewPass456 -d OldPass123
aidc-cli bmc power-reset --ip 192.168.100.10  # Reboot to apply

# Configure PXE boot by MAC address
aidc-cli bios set-pxeboot --ip 192.168.100.10 --mac 04:42:1a:b2:c3:d4

# Configure PXE boot by interface name
aidc-cli bios set-pxeboot --ip 192.168.100.10 --name i350
```

{% hint style="info" %}
For nodes requiring PXE boot during OS deployment, use `aidc-cli bmc pxe-boot` for a simpler one-shot PXE boot without BIOS password or persistent changes.
{% endhint %}

***

## Related Commands <a href="#related-commands" id="related-commands"></a>

| Command                     | Purpose                                  |
| --------------------------- | ---------------------------------------- |
| `bmc pxe-boot`              | One-shot PXE boot (no BIOS write needed) |
| `bmc power-reset`           | Reboot nodes to apply BIOS changes       |
| `fwupdate bios-tool`        | Update BIOS firmware                     |
| `fwupdate bios-redfish-x86` | Update BIOS firmware via Redfish (x86)   |
