Skip to main content

Working with Files

fetch

You can fetch a set of one or experiment/rollout recipes:

nimbus-cli --app fenix --channel developer fetch --output archived.json android-notification-surface-validation

You can use stage/production to specify a Nimbus API instance.

This command fetches the android-research-surface-validation experiment from production and crolloutmobile from stage, and puts it in archived.json.

nimbus-cli --app fenix --channel developer fetch --output archived.json android-research-surface-validation stage/crolloutmobile

This might be useful for attaching to bug reports.

tip

If --output is missing, the file is printed to the console.

You can get a view of the experiment JSON from an experimenter URL like this:

nimbus-cli --app fenix --channel developer fetch https://experimenter.services.mozilla.com/nimbus/release-android-onboarding-redesign

This may be helpful when info isn't enough.

nimbus-cli --app fenix --channel developer info https://experimenter.services.mozilla.com/nimbus/release-android-onboarding-redesign

fetch-list

Alternatively, you fetch the entire contents of a server's experiments:

nimbus-cli --app fenix --channel developer \
fetch-list \
--output archived.json

By default, this uses Remote Settings: you can see the contents of that the apps are currently seeing.

This is quick— it shows only live experiments, but changes in the experiments in Experimenter aren't reflected in Remote Settings for approximately an hour.

You can get all experiments from the API— both live and completed— using the --use-api flag.

list

The list command takes a --file parameter to make working with these files a little easier:

nimbus-cli --app fenix --channel developer list --file archived.json
tip

Anywhere you specify an experiment, you can load it from a file with --file.

For example: you may want fetch-list from a Remote Settings

nimbus-cli --app fenix --channel developer fetch-list --output list-for-bugreport.json

Later, you may investigate the file, and find that two experiments in particular are causing problems.

nimbus-cli --app fenix --channel developer list --file list-for-bugreport.json

You can isolate those experiments in a different file using the fetch command with an input --file and an output --output file parameters.

nimbus-cli --app fenix --channel developer \
fetch \
mobile-default-browser-cta-copy-test fx-release-android-re-engagement-notifications-114-rollout \
--file list-for-bugreport.json \
--output isolated-list.json

enroll

The enroll command takes --file parameter, so you can enroll from recipes stored locally:

nimbus-cli --app fenix --channel developer \
--file archived.json \
enroll android-research-surface-validation --branch treatment

apply-file

You can also upload the whole file straight to the SDK:

nimbus-cli --app fenix --channel developer \
apply-file archived.json
info

Many nimbus-cli commands reads (--file) and writes (--output) to JSON files. For all these commands, If the file extension is yaml or yml, then it will treat it as YAML.