Thank you @mcraa, this helped.
To read ENV variables, I can use:
balena envs --device <my_device_id>
or for a fleet:
balena envs --fleet <my_fleet_name>
After receiving from one device (or fleet), I was able to write to another device or fleet.
I made two scripts using the Balena CLI:
Script for adding ENV variables to a fleet:
#!/bin/bash
#
balena env add MY_ENV_KEY1 my_env_value1 --fleet $1
balena env add MY_ENV_KEY2 my_env_value2 --fleet $1
balena env add MY_ENV_KEY3 my_env_value3 --fleet $1
balena env add MY_ENV_KEY4 my_env_value4 --fleet $1
To execute, in a Terminal, type:
bash add_fleet_ENVs.sh <my_fleet_name>
Script for adding ENV variables to a device:
#!/bin/bash
#
balena env add MY_ENV_KEY1 my_env_value1 --device $1
balena env add MY_ENV_KEY2 my_env_value2 --device $1
balena env add MY_ENV_KEY3 my_env_value3 --device $1
balena env add MY_ENV_KEY4 my_env_value4 --device $1
To execute, in a Terminal, type:
bash add_device_envs.sh <my_device_id>