/gaia-config-device-target

user-facing
Category:
Configuration
Lifecycle phase:
4 -- Implementation
Arguments:
<set|show|clear> <platform> [--os-versions ...] [--form-factors ...] [--screen-sizes WxH@D,...]

What 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_targets configuration section.
  • You set up a new project and need to configure the device_targets section.

Prerequisites

  • project-config.yaml must exist. Run /gaia-init to 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

  1. Locate project-config.yaml Resolves the configuration file path.
  2. Extract the device_targets section Reads the current device_targets block. If the section is missing, offers to scaffold a default.
  3. Present edit menu Shows the current device_targets configuration and an operation menu (add, remove, edit, view, exit).
  4. 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.
  5. Diff preview and confirmation Shows a unified diff of what will change. You must confirm before anything is written.
  6. Write back Writes only the modified section, preserving all other content byte-for-byte.
  7. Suggest validation Recommends running /gaia-config-validate to confirm the file still passes schema validation.

Inputs

InputSourceDescriptionExample
set|show|clearPositional argument (required)The subcommand to execute./gaia-config-device-target show ios
platformPositional argument (required)Platform identifier (must exist in platforms[])./gaia-config-device-target set ios ...
--os-versionsArgument (optional, set only)Comma-separated OS version strings./gaia-config-device-target set ios --os-versions "16.0,17.0"
--form-factorsArgument (optional, set only)Comma-separated form factors (phone, tablet, foldable, watch, tv)./gaia-config-device-target set ios --form-factors "phone,tablet"
--screen-sizesArgument (optional, set only)Comma-separated WxH@D values./gaia-config-device-target set ios --screen-sizes "390x844@3.0"

Outputs

OutputLocationDescription
Updated device_targets section.gaia/config/project-config.yamlThe 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

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.