You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
balena env set fails when the environment variable value starts with hyphen #3113
When using balena env set to create an environment variable whose value starts with hyphen (for example, -hello), the CLI fails before executing the command.
Instead of treating the quoted string as the value of the environment variable, the CLI reports it as a nonexistent flag.
Steps to reproduce
balena env set TEST "-hello"
--device <device_uuid>
--service <service_name>
Expected behavior
The environment variable TEST should be created with the value: -hello
Actual behavior
The command fails with:
Error: Nonexistent flag: -hello
See more help with --help
See more help with --help
at validateArgs (/usr/local/lib/balena-cli/node_modules/@oclif/core/lib/parser/validate.js:10:19)
at validate (/usr/local/lib/balena-cli/node_modules/@oclif/core/lib/parser/validate.js:234:5)
at Object.parse (/usr/local/lib/balena-cli/node_modules/@oclif/core/lib/parser/index.js:22:35)
at async EnvSetCmd.parse (/usr/local/lib/balena-cli/node_modules/@oclif/core/lib/command.js:280:25)
at async EnvSetCmd.run (/usr/local/lib/balena-cli/build/commands/env/set.js:10:50)
at async EnvSetCmd._run (/usr/local/lib/balena-cli/node_modules/@oclif/core/lib/command.js:182:22)
at async Config.runCommand (/usr/local/lib/balena-cli/node_modules/@oclif/core/lib/config/config.js:456:25)
at async run (/usr/local/lib/balena-cli/node_modules/@oclif/core/lib/main.js:97:16)
at async /usr/local/lib/balena-cli/build/app.js:84:13
at async Promise.all (index 2)
changed the title [-]`balena env set` fails when the environment variable value starts with hyphens[/-][+]`balena env set` fails when the environment variable value starts with hyphen[/+]on Jul 16, 2026
Activity
[-]`balena env set` fails when the environment variable value starts with hyphens[/-][+]`balena env set` fails when the environment variable value starts with hyphen[/+]