Skip to Content
Octopus Energy Packages
CLI

oe.flags global-config

Create, update, list, inspect, delete, and migrate flags in Global Config

The oe.flags global-config commands manage flag definitions stored in a Vercel Global Config item.

Requirements

Install @vercel/global-config in the project where you run the CLI. All commands require a connection string in GLOBAL_CONFIG or EDGE_CONFIG; GLOBAL_CONFIG takes precedence when both are set. Write operations additionally require VERCEL_API_TOKEN.

list, inspect, create, update, and delete use the item named by OE_FLAGS_GLOBAL_CONFIG_KEY, falling back to flags when the environment variable is unset. An explicit --key takes precedence.

Commands

list

List all flags in the Global Config item:

npm exec oe.flags global-config list
OptionDescription
-k, --keyGlobal Config item key (default: environment variable or flags)
--jsonOutput as JSON

inspect

Display detailed information about a single flag:

npm exec oe.flags global-config inspect theme
OptionDescription
-k, --keyGlobal Config item key (default: environment variable or flags)
--jsonOutput as JSON

create

Run create without arguments to define a flag through guided prompts:

npm exec oe.flags global-config create

The prompts collect the name, description, value type, variants, default variant, and optional activation periods. Dates and 24-hour times are entered in the system's local timezone and stored as UTC ISO 8601 datetimes. The completed flag is shown for confirmation before it is written.

Pass --interactive or -i to seed the prompts with command-line values:

npm exec oe.flags global-config create theme --kind string --default-variant light --variant "light:Light=light" --variant "dark:Dark=dark" --description "UI theme" -i

For non-interactive use, provide a name, kind, and default variant:

npm exec oe.flags global-config create new-dashboard --kind boolean --default-variant off --variant on=true --variant off=false
OptionDescription
--kind <type>Value type: boolean, string, number, json (required without -i)
--default-variant <key>Key of the default variant (required without -i)
--variant <key[:[label]]=value>Variant definition (repeatable)
--activation <variant:start[::end]>Activation period (repeatable)
--description <text>Human-readable description
-i, --interactivePrompt for and review the flag definition
-k, --key <name>Global Config item key (default: environment variable or flags)

Interactive creation requires interactive input and output terminals. In CI or piped environments, provide all required values without -i.

update

Run update without arguments to select a flag, or provide only its name to open the interactive editor directly:

npm exec oe.flags global-config update
npm exec oe.flags global-config update theme

The editor can change the description and default variant; add, edit, rename, or remove variants; and manage activation periods. Renaming a variant updates its default and activation references. Removing a referenced variant shows the consequences and requires confirmation.

Pass --interactive or -i to apply command-line options to an initial draft before reviewing and amending it:

npm exec oe.flags global-config update theme --description "Updated theme controls" -i

Before writing, the CLI compares the original and proposed definitions. Declining the save confirmation returns to the editor. The command reads the flag again before writing and stops if it changed during editing.

For non-interactive use, provide a name and at least one mutation option:

npm exec oe.flags global-config update theme --default-variant dark
OptionDescription
--default-variant <key>New default variant key
--variant <key[:[label]]=value>New variant definitions (repeatable, replaces all variants)
--activation <variant:start[::end]>Add activation period (repeatable, appended to existing)
--clear-activationsRemove all activation periods
--description <text>New description; an empty value removes it
-i, --interactiveReview and edit changes interactively
-k, --key <name>Global Config item key (default: environment variable or flags)

The value type (kind) is inferred from the existing flag definition. Interactive updates require interactive input and output terminals. In CI or piped environments, provide a name and mutation options without -i.

migrate

Migrate flags from @krakentech/blueprint-utils/feature-flags to @octopus-energy/flags:

npm exec oe.flags global-config migrate

The command reads from flags and writes to oe-flags by default. It shows each proposed flag for approval, editing, or omission. The source item is not changed.

OptionDescription
--from <key>Source Global Config item key (default: flags)
--to <key>Destination Global Config item key (default: oe-flags)
-y, --yesAccept valid, non-conflicting migrations without review

Existing destination flags are preserved. During interactive review, conflicting incoming flags can be renamed or omitted. With --yes, invalid and conflicting flags are skipped. The command checks the destination again before writing and stops if it changed during the migration.

See Migrate Blueprint flags for the schema conversion rules and a complete migration workflow.

delete

Delete a flag (requires confirmation):

npm exec oe.flags global-config delete new-dashboard --yes
OptionDescription
-y, --yesSkip confirmation prompt
-k, --keyGlobal Config item key (default: environment variable or flags)

Variant syntax

The --variant flag accepts two formats:

FormatExampleResult
key=valueon=trueVariant on with value true
key:label=value"light:Light=light"Variant light, label "Light", value light

Activation syntax

The --activation flag accepts variant:startDate[::endDate]. Dates can be provided in three formats:

FormatExampleInterpretation
Date only2026-07-01Local midnight, converted to UTC
Local datetime2026-07-01T09:00:00Local time, converted to UTC
UTC datetime2026-07-01T00:00:00ZExplicit UTC, stored as-is

Omitting the end date creates an open-ended activation (active from the start date onward indefinitely). When provided, the end date must be strictly later than the start date and is exclusive.

Overlapping activation periods are rejected with a validation error. Adjacent activations may share an end/start boundary.

Help

Run command-specific help for full option details:

npm exec oe.flags global-config --help
npm exec oe.flags global-config create --help
npm exec oe.flags global-config migrate --help

On this page