gurl env

Manage environment variables for use in requests.

Usage

gurl env [subcommand] [flags]

Description

The env command group manages environments and variables. Environments allow you to define different variable sets for development, staging, production, etc.

Subcommands

create

Create a new environment.

gurl env create [name] [flags]
FlagShortDefaultDescription
--var-vnoneVariable as KEY=VALUE
--secret-snoneSecret variable (value prompted)

list

List all environments.

gurl env list

Aliases: ls, l

switch

Switch the active environment.

gurl env switch [name]

Aliases: use, activate

delete

Delete an environment.

gurl env delete [name]

Aliases: rm, del

show

Display environment variables.

gurl env show [name]

Aliases: display, view

set

Set a variable in an environment.

gurl env set [name] [KEY=VALUE|KEY VALUE] [flags]
FlagShortDefaultDescription
--var-vnoneVariable as KEY=VALUE (can repeat)
--secret-snoneSecret variable

unset

Remove a variable from an environment.

gurl env unset [name] [flags]
FlagShortDefaultDescription
--var-vnoneVariable name to remove

import

Import variables from a file.

gurl env import [name] [flags]
FlagShortDefaultDescription
--file-fnoneFile to import from

Examples

Create an environment

gurl env create production

Creates a new environment called “production”.

Add variables

gurl env create staging --var "API_URL=https://staging.example.com" --var "DEBUG=false"

Creates staging environment with variables.

Set variables

gurl env set production API_KEY "sk-prod-123"
gurl env set production API_URL=https://api.example.com
gurl env set production API_URL=https://api.example.com DEBUG=false
gurl env set production --var "TIMEOUT=30"

Sets variables in an existing environment. Positional KEY VALUE, positional KEY=VALUE, repeated positional KEY=VALUE, and repeated --var KEY=VALUE forms are supported.

Switch environment

gurl env switch production

Makes “production” the active environment.

Import from .env file

gurl env import production --file .env.production

Imports variables from a .env file.

See also