> 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/lateset/cli/commandreference/bios.md).

# BIOS Operations

| Developer | Last modified |
| --------- | ------------- |
| AIDC Team | 2026/07/06    |

## 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>

{% hint style="warning" %}
**⚠️ Prerequisite: `aidc-cli init` required first**

This command depends on settings saved by [`aidc-cli init`](/guide/lateset/cli/commandreference/init.md). Before running it, make sure you have completed:

* [`aidc-cli init inventory`](/guide/lateset/cli/commandreference/init.md#inventory) — render the node inventory from `aidc.csv`
* [`aidc-cli init bmc-set`](/guide/lateset/cli/commandreference/init.md#bmc-configuration) — save the BMC credentials

For the full setup sequence, see the [Getting Started](/guide/lateset/cli/gettingstarted.md) guide.
{% endhint %}

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.

`get-bootorder` and `get-cfg` read BIOS data for the current inventory scope. The write-oriented subcommands (`save-cfg`, `restore-cfg`, `set-cfg`, `set-password`, `set-pxeboot`, `reset-default`) operate on a single BMC target selected by `--ip` or the global `-i` flag.

```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
```

{% hint style="info" %}
This is an inventory-scoped read operation. Use the global `--limit-hosts` flag when you want to query only specific nodes.
{% endhint %}

***

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

Reads and displays the current BIOS configuration settings.

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

{% hint style="info" %}
This is an inventory-scoped read operation. Use the global `--limit-hosts` flag when you want to query only specific nodes.
{% endhint %}

***

### 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 a single target node.

```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; run `get-cfg` first to find the index) |
| `--value` |  `-u` |     ❌    | New value to write to the BIOS attribute (see value types below)                                   |

#### About `--value` (`-u`)

`--value` is optional.

* **When omitted** — the tool enters interactive mode: it prints the attribute's name, current value, and available options for that index, then prompts you to enter a value. Use this to explore options before committing a write.
* **When provided** — the value is applied non-interactively. The accepted format depends on the attribute type:

| Attribute type  | What to pass with `-u`                                                                   | Example                                           |
| --------------- | ---------------------------------------------------------------------------------------- | ------------------------------------------------- |
| **Enumeration** | The **option number** (1-based) shown in the interactive menu — **not** the display name | `-u 1` (selects the first option, e.g. "Enabled") |
| **Integer**     | A number within the attribute's allowed range and increment                              | `-u 10`                                           |
| **String**      | A string within the attribute's min/max character length                                 | `-u "MyValue"`                                    |

{% hint style="warning" %}
For **Enumeration** attributes, pass the **number** of the option (1, 2, 3…), not the text name. Passing a string like `Enabled` to an Enumeration attribute will fail with an invalid index error.
{% endhint %}

**Recommended workflow:**

```bash
# Step 1 — Collect the full BIOS attribute list (output saved to report)
aidc-cli bios get-cfg --limit-hosts node01
# Report: /home/admin/data/report/bios-config/CLI_bios_get_cfg_<timestamp>.json
# Each row in the terminal output:
#   Index     Display Name                    Current Value   Help Text
#   5         Hyper-Threading                 Enabled         Enables/disables HT technology

# Step 2 — Query the specific attribute to see its type and available options
#   (omit -u to enter interactive mode without writing anything)
aidc-cli bios set-cfg --ip 10.10.48.101 -x 5
# Terminal output (example):
#   Name: Hyper-Threading
#   Current Value: Enabled
#   Please select an index from the following options:
#   [1] Enabled
#   [2] Disabled
#   >>

# Step 3 — Write the value by passing the option number
aidc-cli bios set-cfg --ip 10.10.48.101 -x 5 -u 2   # selects [2] Disabled

# Step 4 — Reboot to apply
aidc-cli bmc power-reset --limit-hosts node01
```

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

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

***

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

Restores BIOS configuration on the selected target node.

```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.

The current AIDC-CLI surface does **not** accept a restore file path for `restore-cfg`.
{% 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 (or use `-i` global flag with hostname/OS IP) |
| `--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. Either `--ip` or the global `-i` flag must resolve to a valid BMC IP. 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                   |        ❌        | global `--limit-hosts`                               |
| `get-cfg`       | Read BIOS configuration                   |        ❌        | global `--limit-hosts`                               |
| `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 on target node |        ✅        | `--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 one node by inventory scope
aidc-cli bios get-cfg --limit-hosts node01

# 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 (Enumeration: -u takes option number, not text)
#   e.g. index 5 = Hyper-Threading; [1] Enabled  [2] Disabled
aidc-cli bios set-cfg --ip 192.168.100.10 -x 5 -u 2   # selects Disabled
aidc-cli bmc power-reset --ip 192.168.100.10           # reboot to apply

# Restore BIOS configuration on a specific node (no restore file-path flag)
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`   | Update BIOS firmware through the current tool or Redfish workflow |
