HotCodePush

Global options

The nine options every hotcodepush command accepts, from --json, --no-input and --yes to --config, --app and --organization, with the environment variables beside them.

Every hotcodepush command accepts the same nine options beside its own and reads the same environment variables. The --help output lists them last, after the command's own. The command pages list only what a command adds.

OptionTypeDescription
--app <id|name>stringThe app, by id or name, when no hotcodepush.json is found or another app is meant.
--config <path>stringThe hotcodepush.json to use, when it is not the nearest one up from the working directory.
--help (-h)booleanPrint this help.
--jsonbooleanPrint machine output as JSON on stdout.
--no-inputbooleanAsk nothing: a missing value is an error and a change that needs a confirmation is refused.
--organization <id|name>stringThe organization, by id or name, when you belong to several.
--verbosebooleanPrint the detail behind an error.
--version (-v)booleanPrint the CLI's version.
--yes (-y)booleanTake every default, ask nothing, confirm nothing.

-h, -v and -y are the only short flags.

Interactive or not

The CLI is interactive when stdin and stdout are a terminal, the CI variable is unset, and neither --no-input nor --yes is passed. Interactively, a missing required value is a prompt: a picker, a text field, or a masked field for a secret. Otherwise the same missing value is missing_parameter naming the flag.

A command that changes what devices receive, sends a mail or cannot be undone asks once, stating the consequence. Non-interactively it stops with confirmation_required unless --yes answers for you.

--json

--json puts one JSON document on stdout and nothing else. Prompts, progress lines and notices go to stderr. The rows are the API's own, with the same field names, and a value the CLI computes, such as a device count, is text output only. An error is { "error": { "code": "not_logged_in", "message": "…", "fix": "… or null" } } on stdout with the exit code of its class, and diagnostics go to stderr.

--json only formats. In a terminal the command still asks, on stderr. A program that reads stdout is no terminal, so a missing value is missing_parameter naming the flag.

--no-input

--no-input makes the CLI non-interactive without taking any default. A missing value is missing_parameter and a change that needs a confirmation is confirmation_required, so nothing runs that you did not name. An agent in a pseudo-terminal passes it beside --json.

--yes

--yes takes every default, asks nothing and confirms nothing. A value without a default is then an error rather than a prompt, so npx hotcodepush release create --yes is the command a pipeline runs. On init, --yes also declines the two steps only a person takes, the signing key and the first release.

--config, --app and --organization

The CLI finds hotcodepush.json walking up from the working directory to the nearest one. --config <path> names the file when it lies elsewhere. Both --app and --organization take an id or a name: a UUID is an id, anything else a name, matched without regard to case. By default --app is the file's appId and --organization the only organization you belong to.

app transfer reads --organization as the target, and audit-log list reads --app as a filter that never defaults to the file's app.

Environment variables

VariableRead byDoes
CIevery commandEvery CI runner sets it. It makes the CLI non-interactive, fails a store build without a token and silences the update notice.
HOTCODEPUSH_CHANNELbinary create, resource-file writeNames the channel a build follows, over hotcodepush.json's, for a build flavour.
HOTCODEPUSH_CONSOLE_BASE_URLopen, sso-provider getNames the console the CLI opens pages of, over the one derived from the API URL.
HOTCODEPUSH_FILES_BASE_URL, HOTCODEPUSH_UPDATES_BASE_URLthe build steps, doctor, device probeName the hosts a device reads from, over the ones derived from the API URL.
HOTCODEPUSH_NO_UPDATE_NOTIFIERevery command1 silences the daily check for a newer version and the notice it prints on stderr. completion never checks.
HOTCODEPUSH_OFFLINEbinary create, resource-file write1 makes a build ask the API nothing: no channel is resolved by name and no binary is created.
HOTCODEPUSH_SIGNING_KEYbundle upload, release create, doctorHolds the content of the private key file, set from a CI secret. --private-key-path wins.
HOTCODEPUSH_TELEMETRY_DISABLED, DO_NOT_TRACKevery command1 turns the usage and error telemetry off.
HOTCODEPUSH_TOKENevery commandHolds an API token that wins over the stored session, for CI and for agents. The verbs that need a session say so on their pages.
NO_COLOR, TERMevery commandNO_COLOR set or TERM=dumb switches colour off.
XDG_CONFIG_HOME, APPDATAevery commandSay where config.json lives, as Files says.

The API URL is not a variable: hotcodepush login --api-url <url> stores it in config.json, and hotcodepush whoami names it when it is not production.

Last updated on

On this page