import { WithAsync } from "../util/type-utils.mjs"; import { CommandTypesBase } from "../types/command.mjs"; import { StandardSchemaV1 } from "@standard-schema/spec"; //#region src/extension/env.d.ts type PadroneEnvOptions = { /** Env modes to load (e.g. `['production']`). Loads `.env.{mode}` files. */modes?: string[]; /** Whether to load `.env.local` and `.env.{mode}.local` files. @default true */ local?: boolean; /** Directory to search for `.env` files. @default process.cwd() */ dir?: string; /** When `true`, file values override `process.env` values. @default false */ override?: boolean; /** When `false`, the base `.env` (and `.env.local`) files are not loaded. @default true */ base?: boolean; }; /** * Extension that reads environment variables, validates them against a schema, * and merges the transformed values into command arguments. * * Supports loading `.env` files with mode-based overrides and variable expansion. * * ```ts * // Schema only (reads process.env) * .extend(padroneEnv( * z.object({ PORT: z.string() }).transform(e => ({ port: Number(e.PORT) })) * )) * * // Schema + .env file loading * .extend(padroneEnv( * z.object({ PORT: z.string() }).transform(e => ({ port: Number(e.PORT) })), * { modes: ['production'] } * )) * * // .env file loading only (no schema validation) * .extend(padroneEnv({ modes: ['production'] })) * ``` * * Env values have lower precedence than CLI args and stdin, but higher than config files. */ declare function padroneEnv(schema: StandardSchemaV1): (builder: T) => WithAsync; declare function padroneEnv(schema: StandardSchemaV1, options: PadroneEnvOptions): (builder: T) => WithAsync; declare function padroneEnv(options: PadroneEnvOptions): (builder: T) => WithAsync; //#endregion export { PadroneEnvOptions, padroneEnv }; //# sourceMappingURL=env.d.mts.map