Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/cliffy/command/command.ts>Command#globalEnv

Command line framework for deno 🦕 Including Commandline-Interfaces, Prompts, CLI-Table, Arguments Parser and more...
Extremely Popular
Go to Latest
method Command.prototype.globalEnv
import { Command } from "https://deno.land/x/cliffy@v1.0.0-rc.1/command/command.ts";

Register a global environment variable.

Type Parameters

TNameAndValue extends string
TGlobalEnvVars extends TypedEnv<TNameAndValue, TPrefix, TCommandOptions, Merge<TParentCommandTypes, Merge<TCommandGlobalTypes, TCommandTypes>>, TRequired>
TMappedGlobalEnvVars extends MapValue<TGlobalEnvVars, TMappedValue>
optional
TRequired extends EnvVarOptions["required"] = undefined
optional
TPrefix extends EnvVarOptions["prefix"] = undefined
optional
TMappedValue = undefined

Parameters

Name of the environment variable.

description: string

The description of the environment variable.

optional
options: Omit<GlobalEnvVarOptions, "value"> & { required?: TRequired; prefix?: TPrefix; value?: EnvVarValueHandler<MapTypes<ValueOf<TGlobalEnvVars>>, TMappedValue>; }

Environment variable options.

Returns

Command<TParentCommandGlobals, TParentCommandTypes, TCommandOptions, TCommandArguments, Merge<TCommandGlobals, TMappedGlobalEnvVars>, TCommandTypes, TCommandGlobalTypes, TParentCommand>