The dya CLI reads configuration from four places: a project file, a per-user global config, key files in the working directory, and command-line flags. This page documents each one and the order they are resolved in.
Project config
dya init and dya setup write a file named .deployyourapp in the current directory. It is JSON, it is meant to be committed, and it links the directory to an app on the server.
{
"appId": "com.example.shop",
"channel": "production",
"path": "dist/spa"
}
| Field | Type | Default | Description |
|---|---|---|---|
appId |
string | "" |
The app identifier registered on the server. Must start with a letter and contain only letters, numbers, ., _, or -, up to 255 characters. |
channel |
string | production |
Channel used by dya deploy and dya rollback when --channel is not passed. |
path |
string | null | null |
Directory of built web assets, stored as a relative forward-slash path so the file works on any machine and OS. |
The file is written with two-space indentation and a trailing newline. Missing or malformed JSON is treated as "no project config": dya deploy and dya rollback then exit 1 and tell you to run dya init.
When path is null, dya init and dya deploy auto-detect it by trying dist/spa, dist/pwa, dist, www, build, public in that order and accepting the first directory that contains an index.html. Nested outputs are checked before their parents so a dist folder holding only subdirectories never shadows the real assets.
Which commands read it:
| Command | Uses |
|---|---|
dya deploy |
appId, channel, path |
dya rollback |
appId, channel |
dya channels list / create / delete |
appId |
dya keys generate / upload |
appId, unless --app-id overrides it |
Global config
Credentials and the active organization live in a per-user JSON file outside your project, managed by the conf package. It is created with 0600 permissions because it holds a session token or API key. You normally never edit it by hand.
| Field | Type | Default | Set by |
|---|---|---|---|
token |
string | — | dya login (browser flow). A 30-day session token. Deleted by dya login --api-key and dya logout. |
apiKey |
string | — | dya login --api-key. Deleted by the browser login and dya logout. |
activeOrgId |
string | — | dya orgs switch, dya setup, or auto-selected when your account has exactly one organization. |
activeOrgName |
string | — | Display name for activeOrgId, cached so commands can show the organization name without an extra request. Always written at the same time as activeOrgId, so the two cannot drift apart. |
serverUrl |
string | https://api.deployyour.app |
dya login --server <url> or dya setup --server <url>. Trailing slashes are stripped before storing. |
File location
The file is named config.json and lives in the per-user config directory for dya-nodejs:
| OS | Path |
|---|---|
| Windows | %APPDATA%\dya-nodejs\Config\config.json |
| macOS | ~/Library/Preferences/dya-nodejs/config.json |
| Linux | $XDG_CONFIG_HOME/dya-nodejs/config.json, or ~/.config/dya-nodejs/config.json when XDG_CONFIG_HOME is unset |
Because the config is per-user and not per-project, one login covers every project on the machine, and one dya orgs switch changes the organization for all of them.
Authentication headers
token and apiKey are never both used. An API key is sent as X-API-Key. A session token is sent as both an Authorization: Bearer header and a dya.session_token cookie. When both values are somehow present, the API key wins.
Key files
Signing and encryption are driven entirely by the presence of PEM files in the directory you run dya deploy from. There are no flags to turn them on.
| File | Read by | Effect |
|---|---|---|
dya-signing-private.pem |
dya deploy |
Signs the uploaded bytes with RSA-4096/SHA-256. Absent means the bundle is uploaded unsigned, with a warning. |
dya-signing-public.pem |
dya keys upload |
Uploaded to the server so it can verify signatures. |
dya-encryption-public.pem |
dya deploy, dya keys upload |
Present means the archive is encrypted with AES-256-GCM before the checksum and signature are computed. |
dya-encryption-private.pem |
dya setup |
Offered for embedding in your app binary. This is the decryption key; it is never uploaded. |
dya keys generate writes all four, with 0600 on the two private keys (a no-op
on Windows, where file permissions work differently). It also adds both private
keys to .gitignore, creating the file if your project has none, and leaves any
existing entries untouched.
The .gitignore entry stops the keys reaching a remote; it does not back them
up. Keep copies in a password manager or secrets vault. Losing
dya-signing-private.pem means you cannot ship another update that installed
apps will accept — they verify against the public key already compiled into
them. Leaking it means anyone can sign a bundle your users' apps will install
and run.
Running dya deploy with no keys present stops and offers to generate them. In
CI there is no terminal to prompt, so it deploys unsigned with a warning rather
than minting a key that would vanish with the build agent.
For backward compatibility dya deploy falls back to .deployyourapp-private.pem for signing and .deployyourapp-encrypt.pem for encryption when the dya- names are absent.
Environment variables
The CLI reads no environment variable for authentication. There is no DYA_API_KEY or equivalent — an API key must be passed explicitly to dya login --api-key, typically from a shell variable your CI provides.
These variables do affect the CLI:
| Variable | Type | Default | Effect |
|---|---|---|---|
API_URL |
string | https://api.deployyour.app |
Fallback API server base URL. Only used when serverUrl is absent from the global config, so a previous dya login --server overrides it. |
PRODUCT_DOMAIN |
string | — | Domain the default API_URL is derived from, as https://api.<domain>. Ignored when API_URL is set. |
PRODUCT_NAME |
string | DeployYourApp |
Product name in the CLI's help text. |
XDG_CONFIG_HOME |
string | ~/.config |
Linux only. Parent directory of the global config. |
APPDATA |
string | %USERPROFILE%\AppData\Roaming |
Windows only. Parent directory of the global config. |
FORCE_COLOR |
0–3, true, false |
— | Forces colored output on or off. Useful when a CI log viewer renders ANSI colors. |
Precedence
For a value used by dya deploy, highest priority first:
- Command-line flag —
--channel beta,--path dist,--version 1.4.0. - Project config —
channelandpathfrom.deployyourapp. - Auto-detection or built-in default — the assets directory scan,
productionfor the channel,100for the rollout,capacitorfor the target, and a generatedYYYY.MMDD.HHMMSSversion.
The channel specifically resolves as flag > channel in .deployyourapp > production, and dya deploy and dya rollback share that one resolver. A bare dya rollback therefore targets the same channel a bare dya deploy shipped to. An empty or whitespace-only --channel is treated as if the flag were absent.
For the server URL, highest priority first:
--server <url>on the currentdya loginordya setupinvocation, which also persists it.serverUrlin the global config, from an earlier--server.- The
API_URLenvironment variable. - The built-in default,
https://api.deployyour.app.
Note the ordering consequence: once --server has been used on a machine, setting API_URL has no effect. Run dya login --server <url> again to change it.
For the organization, highest priority first:
activeOrgIdin the global config.- Auto-selection, when the account belongs to exactly one organization. The result is written back to
activeOrgId. - Nothing — commands that need an organization exit
1and ask you to rundya orgs switch.
Pointing at another environment
Almost nobody needs this. The CLI targets https://api.deployyour.app, the
hosted service at deployyour.app, and that is the only
environment most people ever use. --server exists for working against a
different DeployYourApp API — a local server during development, or a staging
environment:
dya login --server http://localhost:3000
DeployYourApp is a hosted service; there is no self-hosted distribution of the server to point this at.
The URL persists in the global config and applies to every later command, including dya setup. When the CLI is pointed at a non-default server, dya setup also writes updateUrl and statsUrl into the generated Capacitor plugin config so devices check the same server.
Related pages
- Command reference — every flag and its default.
- CI/CD integration — configuring the CLI in a pipeline.