@karmaniverous/get-dotenv 5.0.0 → 5.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -95,6 +95,76 @@ interface GetDotenvOptions {
95
95
  useConfigLoader?: boolean;
96
96
  }
97
97
 
98
+ type Scripts$1 = Record<string, string | {
99
+ cmd: string;
100
+ shell?: string | boolean;
101
+ }>;
102
+ /**
103
+ * Options passed programmatically to `getDotenvCli`.
104
+ */
105
+ interface GetDotenvCliOptions extends Omit<GetDotenvOptions, 'paths' | 'vars'> {
106
+ /**
107
+ * Logs CLI internals when true.
108
+ */
109
+ debug?: boolean;
110
+ /**
111
+ * When true, capture child stdout/stderr and re-emit after completion.
112
+ * Useful for tests/CI. Default behavior is streaming via stdio: 'inherit'.
113
+ */
114
+ capture?: boolean;
115
+ /**
116
+ * A delimited string of paths to dotenv files.
117
+ */
118
+ paths?: string;
119
+ /**
120
+ * A delimiter string with which to split `paths`. Only used if
121
+ * `pathsDelimiterPattern` is not provided.
122
+ */
123
+ pathsDelimiter?: string;
124
+ /**
125
+ * A regular expression pattern with which to split `paths`. Supersedes
126
+ * `pathsDelimiter`.
127
+ */
128
+ pathsDelimiterPattern?: string;
129
+ /**
130
+ * Scripts that can be executed from the CLI, either individually or via the batch subcommand.
131
+ */
132
+ scripts?: Scripts$1;
133
+ /**
134
+ * Determines how commands and scripts are executed. If `false` or
135
+ * `undefined`, commands are executed as plain Javascript using the default
136
+ * execa parser. If `true`, commands are executed using the default OS shell
137
+ * parser. Otherwise the user may provide a specific shell string (e.g.
138
+ * `/bin/bash`)
139
+ */
140
+ shell?: string | boolean;
141
+ /**
142
+ * A delimited string of key-value pairs declaratively specifying variables &
143
+ * values to be loaded in addition to any dotenv files.
144
+ */
145
+ vars?: string;
146
+ /**
147
+ * A string with which to split keys from values in `vars`. Only used if
148
+ * `varsDelimiterPattern` is not provided.
149
+ */
150
+ varsAssignor?: string;
151
+ /**
152
+ * A regular expression pattern with which to split variable names from values
153
+ * in `vars`. Supersedes `varsAssignor`.
154
+ */
155
+ varsAssignorPattern?: string;
156
+ /**
157
+ * A string with which to split `vars` into key-value pairs. Only used if
158
+ * `varsDelimiterPattern` is not provided.
159
+ */
160
+ varsDelimiter?: string;
161
+ /**
162
+ * A regular expression pattern with which to split `vars` into key-value
163
+ * pairs. Supersedes `varsDelimiter`.
164
+ */
165
+ varsDelimiterPattern?: string;
166
+ }
167
+
98
168
  /** * Per-invocation context shared with plugins and actions. */
99
169
  type GetDotenvCliCtx<TOptions extends GetDotenvOptions = GetDotenvOptions> = {
100
170
  optionsResolved: TOptions;
@@ -102,6 +172,7 @@ type GetDotenvCliCtx<TOptions extends GetDotenvOptions = GetDotenvOptions> = {
102
172
  plugins?: Record<string, unknown>;
103
173
  pluginConfigs?: Record<string, unknown>;
104
174
  };
175
+ declare const HELP_HEADER_SYMBOL: unique symbol;
105
176
  /**
106
177
  * Plugin-first CLI host for get-dotenv. Extends Commander.Command.
107
178
  *
@@ -114,10 +185,13 @@ type GetDotenvCliCtx<TOptions extends GetDotenvOptions = GetDotenvOptions> = {
114
185
  * NOTE: This host is additive and does not alter the legacy CLI.
115
186
  */
116
187
  declare class GetDotenvCli<TOptions extends GetDotenvOptions = GetDotenvOptions> extends Command {
188
+ #private;
117
189
  /** Registered top-level plugins (composition happens via .use()) */
118
190
  private _plugins;
119
191
  /** One-time installation guard */
120
192
  private _installed;
193
+ /** Optional header line to prepend in help output */
194
+ private [HELP_HEADER_SYMBOL];
121
195
  constructor(alias?: string);
122
196
  /**
123
197
  * Resolve options (strict) and compute dotenv context. * Stores the context on the instance under a symbol.
@@ -127,9 +201,33 @@ declare class GetDotenvCli<TOptions extends GetDotenvOptions = GetDotenvOptions>
127
201
  * Retrieve the current invocation context (if any).
128
202
  */
129
203
  getCtx(): GetDotenvCliCtx<TOptions> | undefined;
204
+ /**
205
+ * Retrieve the merged root CLI options bag (if set by passOptions()).
206
+ * Downstream-safe: no generics required.
207
+ */
208
+ getOptions(): GetDotenvCliOptions | undefined;
209
+ /** Internal: set the merged root options bag for this run. */
210
+ _setOptionsBag(bag: GetDotenvCliOptions): void;
130
211
  /** * Convenience helper to create a namespaced subcommand.
131
212
  */
132
213
  ns(name: string): Command;
214
+ /**
215
+ * Tag options added during the provided callback as 'app' for grouped help.
216
+ * Allows downstream apps to demarcate their root-level options.
217
+ */
218
+ tagAppOptions<T>(fn: (root: Command) => T): T;
219
+ /**
220
+ * Branding helper: set CLI name/description/version and optional help header.
221
+ * If version is omitted and importMetaUrl is provided, attempts to read the
222
+ * nearest package.json version (best-effort; non-fatal on failure).
223
+ */
224
+ brand(args: {
225
+ name?: string;
226
+ description?: string;
227
+ version?: string;
228
+ importMetaUrl?: string;
229
+ helpHeader?: string;
230
+ }): Promise<this>;
133
231
  /**
134
232
  * Register a plugin for installation (parent level).
135
233
  * Installation occurs on first resolveAndLoad() (or explicit install()).
@@ -95,6 +95,76 @@ interface GetDotenvOptions {
95
95
  useConfigLoader?: boolean;
96
96
  }
97
97
 
98
+ type Scripts$1 = Record<string, string | {
99
+ cmd: string;
100
+ shell?: string | boolean;
101
+ }>;
102
+ /**
103
+ * Options passed programmatically to `getDotenvCli`.
104
+ */
105
+ interface GetDotenvCliOptions extends Omit<GetDotenvOptions, 'paths' | 'vars'> {
106
+ /**
107
+ * Logs CLI internals when true.
108
+ */
109
+ debug?: boolean;
110
+ /**
111
+ * When true, capture child stdout/stderr and re-emit after completion.
112
+ * Useful for tests/CI. Default behavior is streaming via stdio: 'inherit'.
113
+ */
114
+ capture?: boolean;
115
+ /**
116
+ * A delimited string of paths to dotenv files.
117
+ */
118
+ paths?: string;
119
+ /**
120
+ * A delimiter string with which to split `paths`. Only used if
121
+ * `pathsDelimiterPattern` is not provided.
122
+ */
123
+ pathsDelimiter?: string;
124
+ /**
125
+ * A regular expression pattern with which to split `paths`. Supersedes
126
+ * `pathsDelimiter`.
127
+ */
128
+ pathsDelimiterPattern?: string;
129
+ /**
130
+ * Scripts that can be executed from the CLI, either individually or via the batch subcommand.
131
+ */
132
+ scripts?: Scripts$1;
133
+ /**
134
+ * Determines how commands and scripts are executed. If `false` or
135
+ * `undefined`, commands are executed as plain Javascript using the default
136
+ * execa parser. If `true`, commands are executed using the default OS shell
137
+ * parser. Otherwise the user may provide a specific shell string (e.g.
138
+ * `/bin/bash`)
139
+ */
140
+ shell?: string | boolean;
141
+ /**
142
+ * A delimited string of key-value pairs declaratively specifying variables &
143
+ * values to be loaded in addition to any dotenv files.
144
+ */
145
+ vars?: string;
146
+ /**
147
+ * A string with which to split keys from values in `vars`. Only used if
148
+ * `varsDelimiterPattern` is not provided.
149
+ */
150
+ varsAssignor?: string;
151
+ /**
152
+ * A regular expression pattern with which to split variable names from values
153
+ * in `vars`. Supersedes `varsAssignor`.
154
+ */
155
+ varsAssignorPattern?: string;
156
+ /**
157
+ * A string with which to split `vars` into key-value pairs. Only used if
158
+ * `varsDelimiterPattern` is not provided.
159
+ */
160
+ varsDelimiter?: string;
161
+ /**
162
+ * A regular expression pattern with which to split `vars` into key-value
163
+ * pairs. Supersedes `varsDelimiter`.
164
+ */
165
+ varsDelimiterPattern?: string;
166
+ }
167
+
98
168
  /** * Per-invocation context shared with plugins and actions. */
99
169
  type GetDotenvCliCtx<TOptions extends GetDotenvOptions = GetDotenvOptions> = {
100
170
  optionsResolved: TOptions;
@@ -102,6 +172,7 @@ type GetDotenvCliCtx<TOptions extends GetDotenvOptions = GetDotenvOptions> = {
102
172
  plugins?: Record<string, unknown>;
103
173
  pluginConfigs?: Record<string, unknown>;
104
174
  };
175
+ declare const HELP_HEADER_SYMBOL: unique symbol;
105
176
  /**
106
177
  * Plugin-first CLI host for get-dotenv. Extends Commander.Command.
107
178
  *
@@ -114,10 +185,13 @@ type GetDotenvCliCtx<TOptions extends GetDotenvOptions = GetDotenvOptions> = {
114
185
  * NOTE: This host is additive and does not alter the legacy CLI.
115
186
  */
116
187
  declare class GetDotenvCli<TOptions extends GetDotenvOptions = GetDotenvOptions> extends Command {
188
+ #private;
117
189
  /** Registered top-level plugins (composition happens via .use()) */
118
190
  private _plugins;
119
191
  /** One-time installation guard */
120
192
  private _installed;
193
+ /** Optional header line to prepend in help output */
194
+ private [HELP_HEADER_SYMBOL];
121
195
  constructor(alias?: string);
122
196
  /**
123
197
  * Resolve options (strict) and compute dotenv context. * Stores the context on the instance under a symbol.
@@ -127,9 +201,33 @@ declare class GetDotenvCli<TOptions extends GetDotenvOptions = GetDotenvOptions>
127
201
  * Retrieve the current invocation context (if any).
128
202
  */
129
203
  getCtx(): GetDotenvCliCtx<TOptions> | undefined;
204
+ /**
205
+ * Retrieve the merged root CLI options bag (if set by passOptions()).
206
+ * Downstream-safe: no generics required.
207
+ */
208
+ getOptions(): GetDotenvCliOptions | undefined;
209
+ /** Internal: set the merged root options bag for this run. */
210
+ _setOptionsBag(bag: GetDotenvCliOptions): void;
130
211
  /** * Convenience helper to create a namespaced subcommand.
131
212
  */
132
213
  ns(name: string): Command;
214
+ /**
215
+ * Tag options added during the provided callback as 'app' for grouped help.
216
+ * Allows downstream apps to demarcate their root-level options.
217
+ */
218
+ tagAppOptions<T>(fn: (root: Command) => T): T;
219
+ /**
220
+ * Branding helper: set CLI name/description/version and optional help header.
221
+ * If version is omitted and importMetaUrl is provided, attempts to read the
222
+ * nearest package.json version (best-effort; non-fatal on failure).
223
+ */
224
+ brand(args: {
225
+ name?: string;
226
+ description?: string;
227
+ version?: string;
228
+ importMetaUrl?: string;
229
+ helpHeader?: string;
230
+ }): Promise<this>;
133
231
  /**
134
232
  * Register a plugin for installation (parent level).
135
233
  * Installation occurs on first resolveAndLoad() (or explicit install()).
@@ -95,6 +95,76 @@ interface GetDotenvOptions {
95
95
  useConfigLoader?: boolean;
96
96
  }
97
97
 
98
+ type Scripts = Record<string, string | {
99
+ cmd: string;
100
+ shell?: string | boolean;
101
+ }>;
102
+ /**
103
+ * Options passed programmatically to `getDotenvCli`.
104
+ */
105
+ interface GetDotenvCliOptions extends Omit<GetDotenvOptions, 'paths' | 'vars'> {
106
+ /**
107
+ * Logs CLI internals when true.
108
+ */
109
+ debug?: boolean;
110
+ /**
111
+ * When true, capture child stdout/stderr and re-emit after completion.
112
+ * Useful for tests/CI. Default behavior is streaming via stdio: 'inherit'.
113
+ */
114
+ capture?: boolean;
115
+ /**
116
+ * A delimited string of paths to dotenv files.
117
+ */
118
+ paths?: string;
119
+ /**
120
+ * A delimiter string with which to split `paths`. Only used if
121
+ * `pathsDelimiterPattern` is not provided.
122
+ */
123
+ pathsDelimiter?: string;
124
+ /**
125
+ * A regular expression pattern with which to split `paths`. Supersedes
126
+ * `pathsDelimiter`.
127
+ */
128
+ pathsDelimiterPattern?: string;
129
+ /**
130
+ * Scripts that can be executed from the CLI, either individually or via the batch subcommand.
131
+ */
132
+ scripts?: Scripts;
133
+ /**
134
+ * Determines how commands and scripts are executed. If `false` or
135
+ * `undefined`, commands are executed as plain Javascript using the default
136
+ * execa parser. If `true`, commands are executed using the default OS shell
137
+ * parser. Otherwise the user may provide a specific shell string (e.g.
138
+ * `/bin/bash`)
139
+ */
140
+ shell?: string | boolean;
141
+ /**
142
+ * A delimited string of key-value pairs declaratively specifying variables &
143
+ * values to be loaded in addition to any dotenv files.
144
+ */
145
+ vars?: string;
146
+ /**
147
+ * A string with which to split keys from values in `vars`. Only used if
148
+ * `varsDelimiterPattern` is not provided.
149
+ */
150
+ varsAssignor?: string;
151
+ /**
152
+ * A regular expression pattern with which to split variable names from values
153
+ * in `vars`. Supersedes `varsAssignor`.
154
+ */
155
+ varsAssignorPattern?: string;
156
+ /**
157
+ * A string with which to split `vars` into key-value pairs. Only used if
158
+ * `varsDelimiterPattern` is not provided.
159
+ */
160
+ varsDelimiter?: string;
161
+ /**
162
+ * A regular expression pattern with which to split `vars` into key-value
163
+ * pairs. Supersedes `varsDelimiter`.
164
+ */
165
+ varsDelimiterPattern?: string;
166
+ }
167
+
98
168
  /** * Per-invocation context shared with plugins and actions. */
99
169
  type GetDotenvCliCtx<TOptions extends GetDotenvOptions = GetDotenvOptions> = {
100
170
  optionsResolved: TOptions;
@@ -102,6 +172,7 @@ type GetDotenvCliCtx<TOptions extends GetDotenvOptions = GetDotenvOptions> = {
102
172
  plugins?: Record<string, unknown>;
103
173
  pluginConfigs?: Record<string, unknown>;
104
174
  };
175
+ declare const HELP_HEADER_SYMBOL: unique symbol;
105
176
  /**
106
177
  * Plugin-first CLI host for get-dotenv. Extends Commander.Command.
107
178
  *
@@ -114,10 +185,13 @@ type GetDotenvCliCtx<TOptions extends GetDotenvOptions = GetDotenvOptions> = {
114
185
  * NOTE: This host is additive and does not alter the legacy CLI.
115
186
  */
116
187
  declare class GetDotenvCli<TOptions extends GetDotenvOptions = GetDotenvOptions> extends Command {
188
+ #private;
117
189
  /** Registered top-level plugins (composition happens via .use()) */
118
190
  private _plugins;
119
191
  /** One-time installation guard */
120
192
  private _installed;
193
+ /** Optional header line to prepend in help output */
194
+ private [HELP_HEADER_SYMBOL];
121
195
  constructor(alias?: string);
122
196
  /**
123
197
  * Resolve options (strict) and compute dotenv context. * Stores the context on the instance under a symbol.
@@ -127,9 +201,33 @@ declare class GetDotenvCli<TOptions extends GetDotenvOptions = GetDotenvOptions>
127
201
  * Retrieve the current invocation context (if any).
128
202
  */
129
203
  getCtx(): GetDotenvCliCtx<TOptions> | undefined;
204
+ /**
205
+ * Retrieve the merged root CLI options bag (if set by passOptions()).
206
+ * Downstream-safe: no generics required.
207
+ */
208
+ getOptions(): GetDotenvCliOptions | undefined;
209
+ /** Internal: set the merged root options bag for this run. */
210
+ _setOptionsBag(bag: GetDotenvCliOptions): void;
130
211
  /** * Convenience helper to create a namespaced subcommand.
131
212
  */
132
213
  ns(name: string): Command;
214
+ /**
215
+ * Tag options added during the provided callback as 'app' for grouped help.
216
+ * Allows downstream apps to demarcate their root-level options.
217
+ */
218
+ tagAppOptions<T>(fn: (root: Command) => T): T;
219
+ /**
220
+ * Branding helper: set CLI name/description/version and optional help header.
221
+ * If version is omitted and importMetaUrl is provided, attempts to read the
222
+ * nearest package.json version (best-effort; non-fatal on failure).
223
+ */
224
+ brand(args: {
225
+ name?: string;
226
+ description?: string;
227
+ version?: string;
228
+ importMetaUrl?: string;
229
+ helpHeader?: string;
230
+ }): Promise<this>;
133
231
  /**
134
232
  * Register a plugin for installation (parent level).
135
233
  * Installation occurs on first resolveAndLoad() (or explicit install()).
@@ -95,6 +95,76 @@ interface GetDotenvOptions {
95
95
  useConfigLoader?: boolean;
96
96
  }
97
97
 
98
+ type Scripts = Record<string, string | {
99
+ cmd: string;
100
+ shell?: string | boolean;
101
+ }>;
102
+ /**
103
+ * Options passed programmatically to `getDotenvCli`.
104
+ */
105
+ interface GetDotenvCliOptions extends Omit<GetDotenvOptions, 'paths' | 'vars'> {
106
+ /**
107
+ * Logs CLI internals when true.
108
+ */
109
+ debug?: boolean;
110
+ /**
111
+ * When true, capture child stdout/stderr and re-emit after completion.
112
+ * Useful for tests/CI. Default behavior is streaming via stdio: 'inherit'.
113
+ */
114
+ capture?: boolean;
115
+ /**
116
+ * A delimited string of paths to dotenv files.
117
+ */
118
+ paths?: string;
119
+ /**
120
+ * A delimiter string with which to split `paths`. Only used if
121
+ * `pathsDelimiterPattern` is not provided.
122
+ */
123
+ pathsDelimiter?: string;
124
+ /**
125
+ * A regular expression pattern with which to split `paths`. Supersedes
126
+ * `pathsDelimiter`.
127
+ */
128
+ pathsDelimiterPattern?: string;
129
+ /**
130
+ * Scripts that can be executed from the CLI, either individually or via the batch subcommand.
131
+ */
132
+ scripts?: Scripts;
133
+ /**
134
+ * Determines how commands and scripts are executed. If `false` or
135
+ * `undefined`, commands are executed as plain Javascript using the default
136
+ * execa parser. If `true`, commands are executed using the default OS shell
137
+ * parser. Otherwise the user may provide a specific shell string (e.g.
138
+ * `/bin/bash`)
139
+ */
140
+ shell?: string | boolean;
141
+ /**
142
+ * A delimited string of key-value pairs declaratively specifying variables &
143
+ * values to be loaded in addition to any dotenv files.
144
+ */
145
+ vars?: string;
146
+ /**
147
+ * A string with which to split keys from values in `vars`. Only used if
148
+ * `varsDelimiterPattern` is not provided.
149
+ */
150
+ varsAssignor?: string;
151
+ /**
152
+ * A regular expression pattern with which to split variable names from values
153
+ * in `vars`. Supersedes `varsAssignor`.
154
+ */
155
+ varsAssignorPattern?: string;
156
+ /**
157
+ * A string with which to split `vars` into key-value pairs. Only used if
158
+ * `varsDelimiterPattern` is not provided.
159
+ */
160
+ varsDelimiter?: string;
161
+ /**
162
+ * A regular expression pattern with which to split `vars` into key-value
163
+ * pairs. Supersedes `varsDelimiter`.
164
+ */
165
+ varsDelimiterPattern?: string;
166
+ }
167
+
98
168
  /** * Per-invocation context shared with plugins and actions. */
99
169
  type GetDotenvCliCtx<TOptions extends GetDotenvOptions = GetDotenvOptions> = {
100
170
  optionsResolved: TOptions;
@@ -102,6 +172,7 @@ type GetDotenvCliCtx<TOptions extends GetDotenvOptions = GetDotenvOptions> = {
102
172
  plugins?: Record<string, unknown>;
103
173
  pluginConfigs?: Record<string, unknown>;
104
174
  };
175
+ declare const HELP_HEADER_SYMBOL: unique symbol;
105
176
  /**
106
177
  * Plugin-first CLI host for get-dotenv. Extends Commander.Command.
107
178
  *
@@ -114,10 +185,13 @@ type GetDotenvCliCtx<TOptions extends GetDotenvOptions = GetDotenvOptions> = {
114
185
  * NOTE: This host is additive and does not alter the legacy CLI.
115
186
  */
116
187
  declare class GetDotenvCli<TOptions extends GetDotenvOptions = GetDotenvOptions> extends Command {
188
+ #private;
117
189
  /** Registered top-level plugins (composition happens via .use()) */
118
190
  private _plugins;
119
191
  /** One-time installation guard */
120
192
  private _installed;
193
+ /** Optional header line to prepend in help output */
194
+ private [HELP_HEADER_SYMBOL];
121
195
  constructor(alias?: string);
122
196
  /**
123
197
  * Resolve options (strict) and compute dotenv context. * Stores the context on the instance under a symbol.
@@ -127,9 +201,33 @@ declare class GetDotenvCli<TOptions extends GetDotenvOptions = GetDotenvOptions>
127
201
  * Retrieve the current invocation context (if any).
128
202
  */
129
203
  getCtx(): GetDotenvCliCtx<TOptions> | undefined;
204
+ /**
205
+ * Retrieve the merged root CLI options bag (if set by passOptions()).
206
+ * Downstream-safe: no generics required.
207
+ */
208
+ getOptions(): GetDotenvCliOptions | undefined;
209
+ /** Internal: set the merged root options bag for this run. */
210
+ _setOptionsBag(bag: GetDotenvCliOptions): void;
130
211
  /** * Convenience helper to create a namespaced subcommand.
131
212
  */
132
213
  ns(name: string): Command;
214
+ /**
215
+ * Tag options added during the provided callback as 'app' for grouped help.
216
+ * Allows downstream apps to demarcate their root-level options.
217
+ */
218
+ tagAppOptions<T>(fn: (root: Command) => T): T;
219
+ /**
220
+ * Branding helper: set CLI name/description/version and optional help header.
221
+ * If version is omitted and importMetaUrl is provided, attempts to read the
222
+ * nearest package.json version (best-effort; non-fatal on failure).
223
+ */
224
+ brand(args: {
225
+ name?: string;
226
+ description?: string;
227
+ version?: string;
228
+ importMetaUrl?: string;
229
+ helpHeader?: string;
230
+ }): Promise<this>;
133
231
  /**
134
232
  * Register a plugin for installation (parent level).
135
233
  * Installation occurs on first resolveAndLoad() (or explicit install()).
@@ -95,6 +95,76 @@ interface GetDotenvOptions {
95
95
  useConfigLoader?: boolean;
96
96
  }
97
97
 
98
+ type Scripts = Record<string, string | {
99
+ cmd: string;
100
+ shell?: string | boolean;
101
+ }>;
102
+ /**
103
+ * Options passed programmatically to `getDotenvCli`.
104
+ */
105
+ interface GetDotenvCliOptions extends Omit<GetDotenvOptions, 'paths' | 'vars'> {
106
+ /**
107
+ * Logs CLI internals when true.
108
+ */
109
+ debug?: boolean;
110
+ /**
111
+ * When true, capture child stdout/stderr and re-emit after completion.
112
+ * Useful for tests/CI. Default behavior is streaming via stdio: 'inherit'.
113
+ */
114
+ capture?: boolean;
115
+ /**
116
+ * A delimited string of paths to dotenv files.
117
+ */
118
+ paths?: string;
119
+ /**
120
+ * A delimiter string with which to split `paths`. Only used if
121
+ * `pathsDelimiterPattern` is not provided.
122
+ */
123
+ pathsDelimiter?: string;
124
+ /**
125
+ * A regular expression pattern with which to split `paths`. Supersedes
126
+ * `pathsDelimiter`.
127
+ */
128
+ pathsDelimiterPattern?: string;
129
+ /**
130
+ * Scripts that can be executed from the CLI, either individually or via the batch subcommand.
131
+ */
132
+ scripts?: Scripts;
133
+ /**
134
+ * Determines how commands and scripts are executed. If `false` or
135
+ * `undefined`, commands are executed as plain Javascript using the default
136
+ * execa parser. If `true`, commands are executed using the default OS shell
137
+ * parser. Otherwise the user may provide a specific shell string (e.g.
138
+ * `/bin/bash`)
139
+ */
140
+ shell?: string | boolean;
141
+ /**
142
+ * A delimited string of key-value pairs declaratively specifying variables &
143
+ * values to be loaded in addition to any dotenv files.
144
+ */
145
+ vars?: string;
146
+ /**
147
+ * A string with which to split keys from values in `vars`. Only used if
148
+ * `varsDelimiterPattern` is not provided.
149
+ */
150
+ varsAssignor?: string;
151
+ /**
152
+ * A regular expression pattern with which to split variable names from values
153
+ * in `vars`. Supersedes `varsAssignor`.
154
+ */
155
+ varsAssignorPattern?: string;
156
+ /**
157
+ * A string with which to split `vars` into key-value pairs. Only used if
158
+ * `varsDelimiterPattern` is not provided.
159
+ */
160
+ varsDelimiter?: string;
161
+ /**
162
+ * A regular expression pattern with which to split `vars` into key-value
163
+ * pairs. Supersedes `varsDelimiter`.
164
+ */
165
+ varsDelimiterPattern?: string;
166
+ }
167
+
98
168
  /** * Per-invocation context shared with plugins and actions. */
99
169
  type GetDotenvCliCtx<TOptions extends GetDotenvOptions = GetDotenvOptions> = {
100
170
  optionsResolved: TOptions;
@@ -102,6 +172,7 @@ type GetDotenvCliCtx<TOptions extends GetDotenvOptions = GetDotenvOptions> = {
102
172
  plugins?: Record<string, unknown>;
103
173
  pluginConfigs?: Record<string, unknown>;
104
174
  };
175
+ declare const HELP_HEADER_SYMBOL: unique symbol;
105
176
  /**
106
177
  * Plugin-first CLI host for get-dotenv. Extends Commander.Command.
107
178
  *
@@ -114,10 +185,13 @@ type GetDotenvCliCtx<TOptions extends GetDotenvOptions = GetDotenvOptions> = {
114
185
  * NOTE: This host is additive and does not alter the legacy CLI.
115
186
  */
116
187
  declare class GetDotenvCli<TOptions extends GetDotenvOptions = GetDotenvOptions> extends Command {
188
+ #private;
117
189
  /** Registered top-level plugins (composition happens via .use()) */
118
190
  private _plugins;
119
191
  /** One-time installation guard */
120
192
  private _installed;
193
+ /** Optional header line to prepend in help output */
194
+ private [HELP_HEADER_SYMBOL];
121
195
  constructor(alias?: string);
122
196
  /**
123
197
  * Resolve options (strict) and compute dotenv context. * Stores the context on the instance under a symbol.
@@ -127,9 +201,33 @@ declare class GetDotenvCli<TOptions extends GetDotenvOptions = GetDotenvOptions>
127
201
  * Retrieve the current invocation context (if any).
128
202
  */
129
203
  getCtx(): GetDotenvCliCtx<TOptions> | undefined;
204
+ /**
205
+ * Retrieve the merged root CLI options bag (if set by passOptions()).
206
+ * Downstream-safe: no generics required.
207
+ */
208
+ getOptions(): GetDotenvCliOptions | undefined;
209
+ /** Internal: set the merged root options bag for this run. */
210
+ _setOptionsBag(bag: GetDotenvCliOptions): void;
130
211
  /** * Convenience helper to create a namespaced subcommand.
131
212
  */
132
213
  ns(name: string): Command;
214
+ /**
215
+ * Tag options added during the provided callback as 'app' for grouped help.
216
+ * Allows downstream apps to demarcate their root-level options.
217
+ */
218
+ tagAppOptions<T>(fn: (root: Command) => T): T;
219
+ /**
220
+ * Branding helper: set CLI name/description/version and optional help header.
221
+ * If version is omitted and importMetaUrl is provided, attempts to read the
222
+ * nearest package.json version (best-effort; non-fatal on failure).
223
+ */
224
+ brand(args: {
225
+ name?: string;
226
+ description?: string;
227
+ version?: string;
228
+ importMetaUrl?: string;
229
+ helpHeader?: string;
230
+ }): Promise<this>;
133
231
  /**
134
232
  * Register a plugin for installation (parent level).
135
233
  * Installation occurs on first resolveAndLoad() (or explicit install()).
package/package.json CHANGED
@@ -224,5 +224,5 @@
224
224
  },
225
225
  "type": "module",
226
226
  "types": "dist/index.d.ts",
227
- "version": "5.0.0"
227
+ "version": "5.1.0"
228
228
  }