Skip to main content

Command: phala envs update

Syntax

phala envs update [options] [<cvm_id>]

Description

Encrypt and push sealed environment variables to a CVM (only readable inside TEE)

Arguments

ArgumentDescription
<cvm_id>?CVM identifier (UUID, app_id, instance_id, or name)

Options

OptionDescription
-e, --env <value>Environment variable (KEY=VALUE) or env file path (repeatable)
--encrypted-env <value>Pre-encrypted environment variables as hex string (from ‘phala envs encrypt’)

Advanced Options

OptionDescription
--private-key <value>Private key for signing on-chain transactions (or set PRIVATE_KEY env var)
--rpc-url <value>RPC URL for on-chain KMS transactions (or set ETH_RPC_URL env var)

Global Options

OptionDescription
-h, --helpShow help information for the current command
-v, --versionShow CLI version
--api-token TOKEN, --api-key TOKENAPI token for authenticating with Phala Cloud
-j, --json, --no-jsonOutput in JSON format
-i, --interactiveEnable interactive mode
--cvm-id <value>CVM identifier (UUID, app_id, instance_id, or name)
--profile PROFILETemporarily use a different auth profile for this command
--api-version <value>API version to use (e.g. 2025-10-28, 2026-01-21)

Examples

  • Update with inline variables
phala envs update app_abc123 -e SECRET=newvalue -e API_KEY=xxx
  • Update from env file
phala envs update app_abc123 -e .env.production
  • Update with CVM from phala.toml
phala envs update -e .env
  • Update with pre-encrypted hex (from ‘phala envs encrypt’)
phala envs update app_abc123 --encrypted-env $(phala envs encrypt app_abc123 -e .env)
  • Update with on-chain KMS
phala envs update app_abc123 -e .env --private-key <key>