メインコンテンツへスキップ
アプリケーションの環境変数を一覧表示、設定、削除、または置換します。list の場合、アプリケーション ID は省略可能で、引数、次に squarecloud.app 設定ファイル、最後にインタラクティブな選択メニューの順で解決されます。setremovereplace では位置引数が変数名に使われるため、代わりに --app でアプリケーション ID を指定してください。
squarecloud app env list
# Lists the environment variables of the app from squarecloud.app or an interactive picker.
squarecloud app env list <appID> --json
# Lists a specific app's variables as JSON.
squarecloud app env set KEY=VALUE ANOTHER=VALUE --app <appID>
# Sets one or more variables without touching the rest.
squarecloud app env set --from-file .env --app <appID>
# Sets variables read from a .env style file.
squarecloud app env remove KEY ANOTHER --app <appID>
# Removes one or more variables. Aliases: "delete", "unset".
squarecloud app env replace KEY=VALUE --app <appID>
# Replaces the ENTIRE set of variables with the ones provided; existing ones not listed are removed.
replace サブコマンドは破壊的な操作です。既存の変数をすべて消去する前に y/N の確認を求めます。確認をスキップするには -y/--yes を指定してください。
squarecloud app env replace --from-file .env --app <appID> -y
# Replaces all variables from a file without a confirmation prompt.
このコマンドの詳細については squarecloud app env --help を使用してください。