/gaia-config-device-target
user-facingWhat it does
/gaia-config-device-target edits the device_targets section of .gaia/config/project-config.yaml. The device_targets section defines per-platform device matrices with OS versions, form factors, and screen sizes for mobile testing. The editor preserves all YAML comments and formatting outside the edited section. Every edit goes through a diff preview and confirmation gate before writing.
When to use it
- You need to add, remove, or modify entries in the
device_targetsconfiguration section. - You set up a new project and need to configure the
device_targetssection.
Prerequisites
- project-config.yaml must exist. Run
/gaia-initto create one if missing.
How to invoke
/gaia-config-device-target show ios
/gaia-config-device-target set ios --os-versions "16.0,17.0" --form-factors "phone,tablet" --screen-sizes "390x844@3.0"
/gaia-config-device-target clear android
What it does step by step
- Locate project-config.yaml Resolves the configuration file path.
- Extract the device_targets section Reads the current device_targets block. If the section is missing, offers to scaffold a default.
- Present edit menu Shows the current device_targets configuration and an operation menu (add, remove, edit, view, exit).
- Apply operation Collects the new values and validates them. Screen sizes use the WxH@D format (e.g., 390x844@3.0). The platform must exist in the platforms list.
- Diff preview and confirmation Shows a unified diff of what will change. You must confirm before anything is written.
- Write back Writes only the modified section, preserving all other content byte-for-byte.
- Suggest validation Recommends running
/gaia-config-validateto confirm the file still passes schema validation.
Inputs
| Input | Source | Description | Example |
|---|---|---|---|
set|show|clear | Positional argument (required) | The subcommand to execute. | /gaia-config-device-target show ios |
platform | Positional argument (required) | Platform identifier (must exist in platforms[]). | /gaia-config-device-target set ios ... |
--os-versions | Argument (optional, set only) | Comma-separated OS version strings. | /gaia-config-device-target set ios --os-versions "16.0,17.0" |
--form-factors | Argument (optional, set only) | Comma-separated form factors (phone, tablet, foldable, watch, tv). | /gaia-config-device-target set ios --form-factors "phone,tablet" |
--screen-sizes | Argument (optional, set only) | Comma-separated WxH@D values. | /gaia-config-device-target set ios --screen-sizes "390x844@3.0" |
Outputs
| Output | Location | Description |
|---|---|---|
| Updated device_targets section | .gaia/config/project-config.yaml | The modified device_targets configuration. |
Example session
> /gaia-config-device-target
Current device_targets configuration:
ios:
os_versions: ["17", "18"]
form_factors: ["phone", "tablet"]
Operations: [s] set key [r] remove key [v] view [x] exit
> s
Key: android.os_versions
Value: ["13", "14", "15"]
Diff preview:
device_targets:
ios:
os_versions: ["17", "18"]
form_factors: ["phone", "tablet"]
+ android:
+ os_versions: ["13", "14", "15"]
Apply this edit? [y/n]
> y
Device_targets section updated. Run /gaia-config-validate to verify.
What to run next
/gaia-config-validate-- validate the modified configuration file./gaia-config-show device_targets-- view the section after editing.
Troubleshooting
device_targets section not found
The section does not exist in your config file. The command offers to scaffold a default:
device_targets:
ios:
os_versions: ["16.0", "17.0"]
form_factors: [phone, tablet]
screen_sizes:
- {width: 390, height: 844, density: 3.0}Edit cancelled
You chose not to apply the edit. The file remains unchanged.