politty 0.4.7 → 0.4.8

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.
Files changed (61) hide show
  1. package/dist/{schema-extractor-DoDO4M_i.d.ts → arg-registry-BDybpyo5.d.cts} +151 -90
  2. package/dist/arg-registry-BDybpyo5.d.cts.map +1 -0
  3. package/dist/{schema-extractor-BoWkcP9a.d.cts → arg-registry-CHmAzJOM.d.ts} +151 -90
  4. package/dist/arg-registry-CHmAzJOM.d.ts.map +1 -0
  5. package/dist/augment.d.cts +1 -1
  6. package/dist/augment.d.ts +1 -1
  7. package/dist/completion/index.cjs +2 -2
  8. package/dist/completion/index.d.cts +1 -1
  9. package/dist/completion/index.d.ts +1 -1
  10. package/dist/completion/index.js +2 -2
  11. package/dist/{completion-Df0eZ70u.cjs → completion-BADAzqT9.cjs} +3 -3
  12. package/dist/completion-BADAzqT9.cjs.map +1 -0
  13. package/dist/{completion-_AnQsWh9.js → completion-Dj7ytbLu.js} +2 -2
  14. package/dist/completion-Dj7ytbLu.js.map +1 -0
  15. package/dist/docs/index.cjs +3 -3
  16. package/dist/docs/index.d.cts +2 -1
  17. package/dist/docs/index.d.cts.map +1 -1
  18. package/dist/docs/index.d.ts +2 -1
  19. package/dist/docs/index.d.ts.map +1 -1
  20. package/dist/docs/index.js +3 -3
  21. package/dist/{index-BA0GkZQx.d.cts → index-DcwMaTvt.d.ts} +3 -2
  22. package/dist/index-DcwMaTvt.d.ts.map +1 -0
  23. package/dist/{index-rMDe9hp1.d.ts → index-DjU9BErU.d.cts} +3 -2
  24. package/dist/index-DjU9BErU.d.cts.map +1 -0
  25. package/dist/index.cjs +3 -3
  26. package/dist/index.d.cts +4 -8
  27. package/dist/index.d.cts.map +1 -1
  28. package/dist/index.d.ts +4 -8
  29. package/dist/index.d.ts.map +1 -1
  30. package/dist/index.js +3 -3
  31. package/dist/{lazy-DHlvJiQQ.cjs → lazy-B_E2X0KR.cjs} +27 -4
  32. package/dist/lazy-B_E2X0KR.cjs.map +1 -0
  33. package/dist/{lazy-DSyfzR-F.js → lazy-D6nL_iKJ.js} +26 -3
  34. package/dist/lazy-D6nL_iKJ.js.map +1 -0
  35. package/dist/{runner-D4ByDT5I.js → runner-BQcd2UEj.js} +29 -3
  36. package/dist/runner-BQcd2UEj.js.map +1 -0
  37. package/dist/{runner-Cn6Oq4ZZ.cjs → runner-nKNXknDl.cjs} +29 -3
  38. package/dist/runner-nKNXknDl.cjs.map +1 -0
  39. package/dist/schema-extractor-D1sJW-sc.d.ts +117 -0
  40. package/dist/schema-extractor-D1sJW-sc.d.ts.map +1 -0
  41. package/dist/schema-extractor-RainqdRn.d.cts +117 -0
  42. package/dist/schema-extractor-RainqdRn.d.cts.map +1 -0
  43. package/dist/{subcommand-router-sZHhUP7b.cjs → subcommand-router-BTOzDQnY.cjs} +2 -2
  44. package/dist/{subcommand-router-sZHhUP7b.cjs.map → subcommand-router-BTOzDQnY.cjs.map} +1 -1
  45. package/dist/{subcommand-router-CKuy6D2b.js → subcommand-router-Bu3YTw_f.js} +2 -2
  46. package/dist/{subcommand-router-CKuy6D2b.js.map → subcommand-router-Bu3YTw_f.js.map} +1 -1
  47. package/package.json +1 -1
  48. package/dist/arg-registry-2m40k1Et.d.ts +0 -144
  49. package/dist/arg-registry-2m40k1Et.d.ts.map +0 -1
  50. package/dist/arg-registry-BNoIwnNr.d.cts +0 -144
  51. package/dist/arg-registry-BNoIwnNr.d.cts.map +0 -1
  52. package/dist/completion-Df0eZ70u.cjs.map +0 -1
  53. package/dist/completion-_AnQsWh9.js.map +0 -1
  54. package/dist/index-BA0GkZQx.d.cts.map +0 -1
  55. package/dist/index-rMDe9hp1.d.ts.map +0 -1
  56. package/dist/lazy-DHlvJiQQ.cjs.map +0 -1
  57. package/dist/lazy-DSyfzR-F.js.map +0 -1
  58. package/dist/runner-Cn6Oq4ZZ.cjs.map +0 -1
  59. package/dist/runner-D4ByDT5I.js.map +0 -1
  60. package/dist/schema-extractor-BoWkcP9a.d.cts.map +0 -1
  61. package/dist/schema-extractor-DoDO4M_i.d.ts.map +0 -1
@@ -1,4 +1,3 @@
1
- import { n as CompletionMeta } from "./arg-registry-2m40k1Et.js";
2
1
  import { z } from "zod";
3
2
 
4
3
  //#region src/lazy.d.ts
@@ -58,6 +57,10 @@ declare function lazy<T extends AnyCommand>(meta: T, load: () => Promise<AnyComm
58
57
  * ```
59
58
  */
60
59
  interface GlobalArgs {}
60
+ /**
61
+ * Detect empty interface (used for GlobalArgs declaration merging)
62
+ */
63
+ type IsEmpty<T> = keyof T extends never ? true : false;
61
64
  /**
62
65
  * Example definition for a command
63
66
  */
@@ -284,115 +287,173 @@ interface RunResultFailure {
284
287
  */
285
288
  type RunResult<T = unknown> = RunResultSuccess<T> | RunResultFailure;
286
289
  //#endregion
287
- //#region src/core/schema-extractor.d.ts
290
+ //#region src/core/arg-registry.d.ts
288
291
  /**
289
- * Resolved metadata for an argument field
292
+ * Built-in completion types
290
293
  */
291
- interface ResolvedFieldMeta {
292
- /** Field name (camelCase, as defined in schema) */
293
- name: string;
294
- /** CLI option name (kebab-case, for command line usage) */
295
- cliName: string;
296
- /** Short alias (e.g., 'v' for --verbose) */
297
- alias?: string | undefined;
294
+ type CompletionType = "file" | "directory" | "none";
295
+ /**
296
+ * Custom completion specification
297
+ */
298
+ interface CustomCompletion {
299
+ /** Static list of choices for completion */
300
+ choices?: string[];
301
+ /** Shell command to execute for dynamic completion */
302
+ shellCommand?: string;
303
+ }
304
+ /**
305
+ * Completion metadata for an argument
306
+ *
307
+ * @example
308
+ * ```ts
309
+ * // File completion with extension filter
310
+ * input: arg(z.string(), {
311
+ * completion: { type: "file", extensions: ["json", "yaml"] }
312
+ * })
313
+ *
314
+ * // Directory completion
315
+ * outputDir: arg(z.string(), {
316
+ * completion: { type: "directory" }
317
+ * })
318
+ *
319
+ * // Custom static choices
320
+ * logLevel: arg(z.string(), {
321
+ * completion: { custom: { choices: ["debug", "info", "warn", "error"] } }
322
+ * })
323
+ *
324
+ * // Dynamic completion from shell command
325
+ * branch: arg(z.string(), {
326
+ * completion: { custom: { shellCommand: "git branch --format='%(refname:short)'" } }
327
+ * })
328
+ *
329
+ * // File completion with glob pattern matcher
330
+ * envFile: arg(z.string(), {
331
+ * completion: { type: "file", matcher: [".env.*"] }
332
+ * })
333
+ * ```
334
+ */
335
+ type CompletionMeta = {
336
+ /** Built-in completion type */type?: CompletionType; /** Custom completion (takes precedence over type if both specified) */
337
+ custom?: CustomCompletion;
338
+ } & ({
339
+ /** File extension filter (only applies when type is "file") */extensions?: string[];
340
+ matcher?: never;
341
+ } | {
342
+ /** Glob patterns for file matching (only applies when type is "file") */matcher?: string[];
343
+ extensions?: never;
344
+ });
345
+ /**
346
+ * Context provided to effect callbacks.
347
+ * When GlobalArgs is extended via declaration merging, `globalArgs` is typed accordingly.
348
+ */
349
+ type EffectContext = {
350
+ /** Field name (camelCase) */name: string; /** Validated args for this schema (global args for global effects, command args for command effects) */
351
+ args: Readonly<Record<string, unknown>>;
352
+ } & (IsEmpty<GlobalArgs> extends true ? {
353
+ globalArgs?: Readonly<Record<string, unknown>>;
354
+ } : {
355
+ globalArgs?: Readonly<GlobalArgs>;
356
+ });
357
+ /**
358
+ * Base metadata shared by all argument types
359
+ */
360
+ interface BaseArgMeta<TValue = unknown> {
298
361
  /** Argument description */
299
- description?: string | undefined;
300
- /** Whether this is a positional argument */
301
- positional: boolean;
362
+ description?: string;
363
+ /** Treat as positional argument */
364
+ positional?: boolean;
302
365
  /** Placeholder for help display */
303
- placeholder?: string | undefined;
366
+ placeholder?: string;
304
367
  /**
305
368
  * Environment variable name(s) to read value from.
306
- * If an array, earlier entries take priority.
369
+ * If an array is provided, earlier entries take priority.
370
+ * CLI arguments always take precedence over environment variables.
371
+ *
372
+ * @example
373
+ * ```ts
374
+ * // Single env var
375
+ * port: arg(z.coerce.number(), { env: "PORT" })
376
+ *
377
+ * // Multiple env vars (PORT takes priority over SERVER_PORT)
378
+ * port: arg(z.coerce.number(), { env: ["PORT", "SERVER_PORT"] })
379
+ * ```
307
380
  */
308
- env?: string | string[] | undefined;
309
- /** Whether this argument is required */
310
- required: boolean;
311
- /** Default value if any */
312
- defaultValue?: unknown;
313
- /** Detected type from schema */
314
- type: "string" | "number" | "boolean" | "array" | "unknown";
315
- /** Original Zod schema */
316
- schema: z.ZodType;
317
- /** True if this overrides built-in aliases (-h, -H) */
318
- overrideBuiltinAlias?: true;
319
- /** Enum values if detected from schema (z.enum) */
320
- enumValues?: string[] | undefined;
321
- /** Completion metadata from arg() */
322
- completion?: CompletionMeta | undefined;
323
- }
324
- /**
325
- * Extracted fields from a schema
326
- */
327
- interface ExtractedFields {
328
- /** All field definitions */
329
- fields: ResolvedFieldMeta[];
330
- /** Original schema for validation */
331
- schema: ArgsSchema;
332
- /** Schema type */
333
- schemaType: "object" | "discriminatedUnion" | "union" | "xor" | "intersection";
334
- /** Discriminator key (for discriminatedUnion) */
335
- discriminator?: string;
336
- /** Variants (for discriminatedUnion) */
337
- variants?: Array<{
338
- discriminatorValue: string;
339
- fields: ResolvedFieldMeta[];
340
- description?: string;
341
- }>;
342
- /** Options (for union) */
343
- unionOptions?: ExtractedFields[];
344
- /** Schema description */
345
- description?: string;
381
+ env?: string | string[];
382
+ /** Completion configuration for shell tab-completion */
383
+ completion?: CompletionMeta;
346
384
  /**
347
- * Unknown keys handling mode
348
- * - "strict": Unknown keys cause validation errors (z.strictObject or z.object().strict())
349
- * - "strip": Unknown keys trigger warnings (default, z.object())
350
- * - "passthrough": Unknown keys are silently ignored (z.looseObject or z.object().passthrough())
385
+ * Side-effect callback executed after argument parsing and validation.
386
+ * Runs before the command lifecycle (setup/run/cleanup).
387
+ * Use Zod .transform() for value transformation instead.
388
+ *
389
+ * @example
390
+ * ```ts
391
+ * verbose: arg(z.boolean().default(false), {
392
+ * alias: "v",
393
+ * effect: (value) => {
394
+ * if (value) logger.setLevel("debug");
395
+ * },
396
+ * })
397
+ * ```
351
398
  */
352
- unknownKeysMode: UnknownKeysMode;
399
+ effect?: (value: TValue, context: EffectContext) => void | PromiseLike<void>;
353
400
  }
354
401
  /**
355
- * Unknown keys handling mode for object schemas
356
- * - "strict": Unknown keys cause validation errors
357
- * - "strip": Unknown keys are silently ignored (default)
358
- * - "passthrough": Unknown keys are passed through
402
+ * Metadata for regular arguments (non-builtin aliases)
359
403
  */
360
- type UnknownKeysMode = "strict" | "strip" | "passthrough";
404
+ interface RegularArgMeta<TValue = unknown> extends BaseArgMeta<TValue> {
405
+ /** Short alias (e.g., 'v' for --verbose) */
406
+ alias?: string;
407
+ }
361
408
  /**
362
- * Detect unknown keys handling mode from a Zod object schema
363
- *
364
- * In Zod v4:
365
- * - Default (strip): _def.catchall is undefined
366
- * - strict: _def.catchall is ZodNever (type = "never")
367
- * - passthrough: _def.catchall is ZodUnknown (type = "unknown")
409
+ * Metadata for overriding built-in aliases (-h, -H)
368
410
  */
369
- declare function getUnknownKeysMode(schema: z.ZodType): UnknownKeysMode;
411
+ interface BuiltinOverrideArgMeta<TValue = unknown> extends BaseArgMeta<TValue> {
412
+ /** Built-in alias to override ('h' or 'H') */
413
+ alias: "h" | "H";
414
+ /** Must be true to override built-in aliases */
415
+ overrideBuiltinAlias: true;
416
+ }
370
417
  /**
371
- * Convert camelCase to kebab-case
372
- * @example toKebabCase("dryRun") => "dry-run"
373
- * @example toKebabCase("outputDir") => "output-dir"
374
- * @example toKebabCase("XMLParser") => "xml-parser"
418
+ * Metadata options for argument definition
375
419
  */
376
- declare function toKebabCase(str: string): string;
420
+ type ArgMeta<TValue = unknown> = RegularArgMeta<TValue> | BuiltinOverrideArgMeta<TValue>;
377
421
  /**
378
- * Convert hyphen-separated sequences to camelCase.
422
+ * Register metadata for a Zod schema
423
+ *
424
+ * @param schema - The Zod schema
425
+ * @param meta - Argument metadata
426
+ * @returns The same schema (for chaining)
379
427
  *
380
- * Replaces `-x` (hyphen followed by a lowercase letter) with the uppercase
381
- * variant. Non-hyphenated input (e.g., already camelCase) is returned as-is.
428
+ * @example
429
+ * ```ts
430
+ * import { z } from "zod";
431
+ * import { arg, defineCommand } from "politty";
382
432
  *
383
- * @param str - A string that may contain hyphens
384
- * @example toCamelCase("dry-run") => "dryRun"
385
- * @example toCamelCase("output-dir") => "outputDir"
386
- * @example toCamelCase("dryRun") => "dryRun"
433
+ * const cmd = defineCommand({
434
+ * args: z.object({
435
+ * name: arg(z.string(), { description: "User name", positional: true }),
436
+ * verbose: arg(z.boolean().default(false), { alias: "v" }),
437
+ * }),
438
+ * run: (args) => {
439
+ * console.log(args.name, args.verbose);
440
+ * },
441
+ * });
442
+ * ```
387
443
  */
388
- declare function toCamelCase(str: string): string;
389
444
  /**
390
- * Extract all fields from a schema
391
- *
392
- * @param schema - The args schema (ZodObject, ZodDiscriminatedUnion, etc.)
393
- * @returns Extracted field information
445
+ * Type helper to validate ArgMeta
446
+ * Forces a type error if alias is "h" or "H" without overrideBuiltinAlias: true
394
447
  */
395
- declare function extractFields(schema: ArgsSchema): ExtractedFields;
448
+ type ValidateArgMeta<M> = M extends {
449
+ alias: "h" | "H";
450
+ } ? M extends {
451
+ overrideBuiltinAlias: true;
452
+ } ? M : { [K in keyof M]: M[K] } & {
453
+ __typeError: "Alias 'h' or 'H' requires overrideBuiltinAlias: true";
454
+ } : M;
455
+ declare function arg<T extends z.ZodType>(schema: T): T;
456
+ declare function arg<T extends z.ZodType, M extends ArgMeta<z.output<T>>>(schema: T, meta: ValidateArgMeta<M>): T;
396
457
  //#endregion
397
- export { SubCommandValue as A, NonRunnableCommand as C, RunResultSuccess as D, RunResultFailure as E, LazyCommand as M, isLazyCommand as N, RunnableCommand as O, lazy as P, MainOptions as S, RunResult as T, GlobalSetupContext as _, getUnknownKeysMode as a, LogStream as b, AnyCommand as c, CollectedLogs as d, Command as f, GlobalCleanupContext as g, GlobalArgs as h, extractFields as i, SubCommandsRecord as j, SetupContext as k, ArgsSchema as l, Example as m, ResolvedFieldMeta as n, toCamelCase as o, CommandBase as p, UnknownKeysMode as r, toKebabCase as s, ExtractedFields as t, CleanupContext as u, LogEntry as v, RunCommandOptions as w, Logger as x, LogLevel as y };
398
- //# sourceMappingURL=schema-extractor-DoDO4M_i.d.ts.map
458
+ export { SubCommandValue as A, NonRunnableCommand as C, RunResultSuccess as D, RunResultFailure as E, LazyCommand as M, isLazyCommand as N, RunnableCommand as O, lazy as P, MainOptions as S, RunResult as T, IsEmpty as _, EffectContext as a, LogStream as b, ArgsSchema as c, Command as d, CommandBase as f, GlobalSetupContext as g, GlobalCleanupContext as h, CustomCompletion as i, SubCommandsRecord as j, SetupContext as k, CleanupContext as l, GlobalArgs as m, CompletionMeta as n, arg as o, Example as p, CompletionType as r, AnyCommand as s, ArgMeta as t, CollectedLogs as u, LogEntry as v, RunCommandOptions as w, Logger as x, LogLevel as y };
459
+ //# sourceMappingURL=arg-registry-BDybpyo5.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arg-registry-BDybpyo5.d.cts","names":[],"sources":["../src/lazy.ts","../src/types.ts","../src/core/arg-registry.ts"],"mappings":";;;;;;;;UAgBiB,WAAA,WAAsB,UAAA,GAAa,UAAA;EAAA,SACzC,gBAAA;EAAA,SACA,IAAA,EAAM,CAAA;EAAA,SACN,IAAA,QAAY,OAAA,CAAQ,UAAA;AAAA;;;;iBAMf,aAAA,CAAc,KAAA,YAAiB,KAAA,IAAS,WAAA;;;;;;;AAAxD;;;;;;;;;AAkCA;;;;;;;;;;;;;iBAAgB,IAAA,WAAe,UAAA,CAAA,CAC7B,IAAA,EAAM,CAAA,EACN,IAAA,QAAY,OAAA,CAAQ,UAAA,IACnB,WAAA,CAAY,CAAA;;;;AA9Cf;;;;;;;;;UCDiB,UAAA;;;;KAKL,OAAA,YAAmB,CAAA;;;;UAKd,OAAA;EDNwB;ECQvC,GAAA;EDFc;ECId,IAAA;;EAEA,MAAA;AAAA;;;;;UAOe,MAAA;EDqBG;ECnBlB,GAAA,CAAI,OAAA;EDmByB;ECjB7B,KAAA,CAAM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,CAAA,CAAE,OAAA,YAAmB,OAAA,CAAQ,CAAA,CAAE,MAAA,CAAO,CAAA,GAAA,CAClE,MAAA,EAAQ,CAAA,EACR,IAAA,EAAM,eAAA,CAAgB,CAAA,IACrB,CAAA"}
@@ -1,4 +1,3 @@
1
- import { n as CompletionMeta } from "./arg-registry-BNoIwnNr.cjs";
2
1
  import { z } from "zod";
3
2
 
4
3
  //#region src/lazy.d.ts
@@ -58,6 +57,10 @@ declare function lazy<T extends AnyCommand>(meta: T, load: () => Promise<AnyComm
58
57
  * ```
59
58
  */
60
59
  interface GlobalArgs {}
60
+ /**
61
+ * Detect empty interface (used for GlobalArgs declaration merging)
62
+ */
63
+ type IsEmpty<T> = keyof T extends never ? true : false;
61
64
  /**
62
65
  * Example definition for a command
63
66
  */
@@ -284,115 +287,173 @@ interface RunResultFailure {
284
287
  */
285
288
  type RunResult<T = unknown> = RunResultSuccess<T> | RunResultFailure;
286
289
  //#endregion
287
- //#region src/core/schema-extractor.d.ts
290
+ //#region src/core/arg-registry.d.ts
288
291
  /**
289
- * Resolved metadata for an argument field
292
+ * Built-in completion types
290
293
  */
291
- interface ResolvedFieldMeta {
292
- /** Field name (camelCase, as defined in schema) */
293
- name: string;
294
- /** CLI option name (kebab-case, for command line usage) */
295
- cliName: string;
296
- /** Short alias (e.g., 'v' for --verbose) */
297
- alias?: string | undefined;
294
+ type CompletionType = "file" | "directory" | "none";
295
+ /**
296
+ * Custom completion specification
297
+ */
298
+ interface CustomCompletion {
299
+ /** Static list of choices for completion */
300
+ choices?: string[];
301
+ /** Shell command to execute for dynamic completion */
302
+ shellCommand?: string;
303
+ }
304
+ /**
305
+ * Completion metadata for an argument
306
+ *
307
+ * @example
308
+ * ```ts
309
+ * // File completion with extension filter
310
+ * input: arg(z.string(), {
311
+ * completion: { type: "file", extensions: ["json", "yaml"] }
312
+ * })
313
+ *
314
+ * // Directory completion
315
+ * outputDir: arg(z.string(), {
316
+ * completion: { type: "directory" }
317
+ * })
318
+ *
319
+ * // Custom static choices
320
+ * logLevel: arg(z.string(), {
321
+ * completion: { custom: { choices: ["debug", "info", "warn", "error"] } }
322
+ * })
323
+ *
324
+ * // Dynamic completion from shell command
325
+ * branch: arg(z.string(), {
326
+ * completion: { custom: { shellCommand: "git branch --format='%(refname:short)'" } }
327
+ * })
328
+ *
329
+ * // File completion with glob pattern matcher
330
+ * envFile: arg(z.string(), {
331
+ * completion: { type: "file", matcher: [".env.*"] }
332
+ * })
333
+ * ```
334
+ */
335
+ type CompletionMeta = {
336
+ /** Built-in completion type */type?: CompletionType; /** Custom completion (takes precedence over type if both specified) */
337
+ custom?: CustomCompletion;
338
+ } & ({
339
+ /** File extension filter (only applies when type is "file") */extensions?: string[];
340
+ matcher?: never;
341
+ } | {
342
+ /** Glob patterns for file matching (only applies when type is "file") */matcher?: string[];
343
+ extensions?: never;
344
+ });
345
+ /**
346
+ * Context provided to effect callbacks.
347
+ * When GlobalArgs is extended via declaration merging, `globalArgs` is typed accordingly.
348
+ */
349
+ type EffectContext = {
350
+ /** Field name (camelCase) */name: string; /** Validated args for this schema (global args for global effects, command args for command effects) */
351
+ args: Readonly<Record<string, unknown>>;
352
+ } & (IsEmpty<GlobalArgs> extends true ? {
353
+ globalArgs?: Readonly<Record<string, unknown>>;
354
+ } : {
355
+ globalArgs?: Readonly<GlobalArgs>;
356
+ });
357
+ /**
358
+ * Base metadata shared by all argument types
359
+ */
360
+ interface BaseArgMeta<TValue = unknown> {
298
361
  /** Argument description */
299
- description?: string | undefined;
300
- /** Whether this is a positional argument */
301
- positional: boolean;
362
+ description?: string;
363
+ /** Treat as positional argument */
364
+ positional?: boolean;
302
365
  /** Placeholder for help display */
303
- placeholder?: string | undefined;
366
+ placeholder?: string;
304
367
  /**
305
368
  * Environment variable name(s) to read value from.
306
- * If an array, earlier entries take priority.
369
+ * If an array is provided, earlier entries take priority.
370
+ * CLI arguments always take precedence over environment variables.
371
+ *
372
+ * @example
373
+ * ```ts
374
+ * // Single env var
375
+ * port: arg(z.coerce.number(), { env: "PORT" })
376
+ *
377
+ * // Multiple env vars (PORT takes priority over SERVER_PORT)
378
+ * port: arg(z.coerce.number(), { env: ["PORT", "SERVER_PORT"] })
379
+ * ```
307
380
  */
308
- env?: string | string[] | undefined;
309
- /** Whether this argument is required */
310
- required: boolean;
311
- /** Default value if any */
312
- defaultValue?: unknown;
313
- /** Detected type from schema */
314
- type: "string" | "number" | "boolean" | "array" | "unknown";
315
- /** Original Zod schema */
316
- schema: z.ZodType;
317
- /** True if this overrides built-in aliases (-h, -H) */
318
- overrideBuiltinAlias?: true;
319
- /** Enum values if detected from schema (z.enum) */
320
- enumValues?: string[] | undefined;
321
- /** Completion metadata from arg() */
322
- completion?: CompletionMeta | undefined;
323
- }
324
- /**
325
- * Extracted fields from a schema
326
- */
327
- interface ExtractedFields {
328
- /** All field definitions */
329
- fields: ResolvedFieldMeta[];
330
- /** Original schema for validation */
331
- schema: ArgsSchema;
332
- /** Schema type */
333
- schemaType: "object" | "discriminatedUnion" | "union" | "xor" | "intersection";
334
- /** Discriminator key (for discriminatedUnion) */
335
- discriminator?: string;
336
- /** Variants (for discriminatedUnion) */
337
- variants?: Array<{
338
- discriminatorValue: string;
339
- fields: ResolvedFieldMeta[];
340
- description?: string;
341
- }>;
342
- /** Options (for union) */
343
- unionOptions?: ExtractedFields[];
344
- /** Schema description */
345
- description?: string;
381
+ env?: string | string[];
382
+ /** Completion configuration for shell tab-completion */
383
+ completion?: CompletionMeta;
346
384
  /**
347
- * Unknown keys handling mode
348
- * - "strict": Unknown keys cause validation errors (z.strictObject or z.object().strict())
349
- * - "strip": Unknown keys trigger warnings (default, z.object())
350
- * - "passthrough": Unknown keys are silently ignored (z.looseObject or z.object().passthrough())
385
+ * Side-effect callback executed after argument parsing and validation.
386
+ * Runs before the command lifecycle (setup/run/cleanup).
387
+ * Use Zod .transform() for value transformation instead.
388
+ *
389
+ * @example
390
+ * ```ts
391
+ * verbose: arg(z.boolean().default(false), {
392
+ * alias: "v",
393
+ * effect: (value) => {
394
+ * if (value) logger.setLevel("debug");
395
+ * },
396
+ * })
397
+ * ```
351
398
  */
352
- unknownKeysMode: UnknownKeysMode;
399
+ effect?: (value: TValue, context: EffectContext) => void | PromiseLike<void>;
353
400
  }
354
401
  /**
355
- * Unknown keys handling mode for object schemas
356
- * - "strict": Unknown keys cause validation errors
357
- * - "strip": Unknown keys are silently ignored (default)
358
- * - "passthrough": Unknown keys are passed through
402
+ * Metadata for regular arguments (non-builtin aliases)
359
403
  */
360
- type UnknownKeysMode = "strict" | "strip" | "passthrough";
404
+ interface RegularArgMeta<TValue = unknown> extends BaseArgMeta<TValue> {
405
+ /** Short alias (e.g., 'v' for --verbose) */
406
+ alias?: string;
407
+ }
361
408
  /**
362
- * Detect unknown keys handling mode from a Zod object schema
363
- *
364
- * In Zod v4:
365
- * - Default (strip): _def.catchall is undefined
366
- * - strict: _def.catchall is ZodNever (type = "never")
367
- * - passthrough: _def.catchall is ZodUnknown (type = "unknown")
409
+ * Metadata for overriding built-in aliases (-h, -H)
368
410
  */
369
- declare function getUnknownKeysMode(schema: z.ZodType): UnknownKeysMode;
411
+ interface BuiltinOverrideArgMeta<TValue = unknown> extends BaseArgMeta<TValue> {
412
+ /** Built-in alias to override ('h' or 'H') */
413
+ alias: "h" | "H";
414
+ /** Must be true to override built-in aliases */
415
+ overrideBuiltinAlias: true;
416
+ }
370
417
  /**
371
- * Convert camelCase to kebab-case
372
- * @example toKebabCase("dryRun") => "dry-run"
373
- * @example toKebabCase("outputDir") => "output-dir"
374
- * @example toKebabCase("XMLParser") => "xml-parser"
418
+ * Metadata options for argument definition
375
419
  */
376
- declare function toKebabCase(str: string): string;
420
+ type ArgMeta<TValue = unknown> = RegularArgMeta<TValue> | BuiltinOverrideArgMeta<TValue>;
377
421
  /**
378
- * Convert hyphen-separated sequences to camelCase.
422
+ * Register metadata for a Zod schema
423
+ *
424
+ * @param schema - The Zod schema
425
+ * @param meta - Argument metadata
426
+ * @returns The same schema (for chaining)
379
427
  *
380
- * Replaces `-x` (hyphen followed by a lowercase letter) with the uppercase
381
- * variant. Non-hyphenated input (e.g., already camelCase) is returned as-is.
428
+ * @example
429
+ * ```ts
430
+ * import { z } from "zod";
431
+ * import { arg, defineCommand } from "politty";
382
432
  *
383
- * @param str - A string that may contain hyphens
384
- * @example toCamelCase("dry-run") => "dryRun"
385
- * @example toCamelCase("output-dir") => "outputDir"
386
- * @example toCamelCase("dryRun") => "dryRun"
433
+ * const cmd = defineCommand({
434
+ * args: z.object({
435
+ * name: arg(z.string(), { description: "User name", positional: true }),
436
+ * verbose: arg(z.boolean().default(false), { alias: "v" }),
437
+ * }),
438
+ * run: (args) => {
439
+ * console.log(args.name, args.verbose);
440
+ * },
441
+ * });
442
+ * ```
387
443
  */
388
- declare function toCamelCase(str: string): string;
389
444
  /**
390
- * Extract all fields from a schema
391
- *
392
- * @param schema - The args schema (ZodObject, ZodDiscriminatedUnion, etc.)
393
- * @returns Extracted field information
445
+ * Type helper to validate ArgMeta
446
+ * Forces a type error if alias is "h" or "H" without overrideBuiltinAlias: true
394
447
  */
395
- declare function extractFields(schema: ArgsSchema): ExtractedFields;
448
+ type ValidateArgMeta<M> = M extends {
449
+ alias: "h" | "H";
450
+ } ? M extends {
451
+ overrideBuiltinAlias: true;
452
+ } ? M : { [K in keyof M]: M[K] } & {
453
+ __typeError: "Alias 'h' or 'H' requires overrideBuiltinAlias: true";
454
+ } : M;
455
+ declare function arg<T extends z.ZodType>(schema: T): T;
456
+ declare function arg<T extends z.ZodType, M extends ArgMeta<z.output<T>>>(schema: T, meta: ValidateArgMeta<M>): T;
396
457
  //#endregion
397
- export { SubCommandValue as A, NonRunnableCommand as C, RunResultSuccess as D, RunResultFailure as E, LazyCommand as M, isLazyCommand as N, RunnableCommand as O, lazy as P, MainOptions as S, RunResult as T, GlobalSetupContext as _, getUnknownKeysMode as a, LogStream as b, AnyCommand as c, CollectedLogs as d, Command as f, GlobalCleanupContext as g, GlobalArgs as h, extractFields as i, SubCommandsRecord as j, SetupContext as k, ArgsSchema as l, Example as m, ResolvedFieldMeta as n, toCamelCase as o, CommandBase as p, UnknownKeysMode as r, toKebabCase as s, ExtractedFields as t, CleanupContext as u, LogEntry as v, RunCommandOptions as w, Logger as x, LogLevel as y };
398
- //# sourceMappingURL=schema-extractor-BoWkcP9a.d.cts.map
458
+ export { SubCommandValue as A, NonRunnableCommand as C, RunResultSuccess as D, RunResultFailure as E, LazyCommand as M, isLazyCommand as N, RunnableCommand as O, lazy as P, MainOptions as S, RunResult as T, IsEmpty as _, EffectContext as a, LogStream as b, ArgsSchema as c, Command as d, CommandBase as f, GlobalSetupContext as g, GlobalCleanupContext as h, CustomCompletion as i, SubCommandsRecord as j, SetupContext as k, CleanupContext as l, GlobalArgs as m, CompletionMeta as n, arg as o, Example as p, CompletionType as r, AnyCommand as s, ArgMeta as t, CollectedLogs as u, LogEntry as v, RunCommandOptions as w, Logger as x, LogLevel as y };
459
+ //# sourceMappingURL=arg-registry-CHmAzJOM.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arg-registry-CHmAzJOM.d.ts","names":[],"sources":["../src/lazy.ts","../src/types.ts","../src/core/arg-registry.ts"],"mappings":";;;;;;;;UAgBiB,WAAA,WAAsB,UAAA,GAAa,UAAA;EAAA,SACzC,gBAAA;EAAA,SACA,IAAA,EAAM,CAAA;EAAA,SACN,IAAA,QAAY,OAAA,CAAQ,UAAA;AAAA;;;;iBAMf,aAAA,CAAc,KAAA,YAAiB,KAAA,IAAS,WAAA;;;;;;;AAAxD;;;;;;;;;AAkCA;;;;;;;;;;;;;iBAAgB,IAAA,WAAe,UAAA,CAAA,CAC7B,IAAA,EAAM,CAAA,EACN,IAAA,QAAY,OAAA,CAAQ,UAAA,IACnB,WAAA,CAAY,CAAA;;;;AA9Cf;;;;;;;;;UCDiB,UAAA;;;;KAKL,OAAA,YAAmB,CAAA;;;;UAKd,OAAA;EDNwB;ECQvC,GAAA;EDFc;ECId,IAAA;;EAEA,MA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,CAAA,CAAE,OAAA,CAAA,CAAS,MAAA,EAAQ,CAAA,GAAI,CAAA;AAAA,iBACrC,GAAA,WAAc,CAAA,CAAE,OAAA,YAAmB,OAAA,CAAQ,CAAA,CAAE,MAAA,CAAO,CAAA,GAAA,CAClE,MAAA,EAAQ,CAAA,EACR,IAAA,EAAM,eAAA,CAAgB,CAAA,IACrB,CAAA"}
@@ -1,4 +1,4 @@
1
- import { t as ArgMeta } from "./arg-registry-BNoIwnNr.cjs";
1
+ import { t as ArgMeta } from "./arg-registry-BDybpyo5.cjs";
2
2
 
3
3
  //#region src/augment.d.ts
4
4
  declare module "zod" {
package/dist/augment.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { t as ArgMeta } from "./arg-registry-2m40k1Et.js";
1
+ import { t as ArgMeta } from "./arg-registry-CHmAzJOM.js";
2
2
 
3
3
  //#region src/augment.d.ts
4
4
  declare module "zod" {
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- require('../lazy-DHlvJiQQ.cjs');
3
- const require_completion = require('../completion-Df0eZ70u.cjs');
2
+ require('../lazy-B_E2X0KR.cjs');
3
+ const require_completion = require('../completion-BADAzqT9.cjs');
4
4
 
5
5
  exports.CompletionDirective = require_completion.CompletionDirective;
6
6
  exports.createCompletionCommand = require_completion.createCompletionCommand;
@@ -1,2 +1,2 @@
1
- import { C as CompletableSubcommand, D as CompletionResult, E as CompletionOptions, O as ShellType, S as CompletableOption, T as CompletionGenerator, _ as CompletionDirective, a as getSupportedShells, b as CompletionType, c as resolveValueCompletion, d as ShellFormatOptions, f as formatForShell, g as CompletionCandidate, h as CandidateResult, i as generateCompletion, l as extractCompletionData, m as hasCompleteCommand, n as createCompletionCommand, o as withCompletionCommand, p as createDynamicCompleteCommand, r as detectShell, s as ValueCompletionField, t as WithCompletionOptions, u as extractPositionals, v as generateCandidates, w as CompletionData, x as parseCompletionContext, y as CompletionContext } from "../index-BA0GkZQx.cjs";
1
+ import { C as CompletableSubcommand, D as CompletionResult, E as CompletionOptions, O as ShellType, S as CompletableOption, T as CompletionGenerator, _ as CompletionDirective, a as getSupportedShells, b as CompletionType, c as resolveValueCompletion, d as ShellFormatOptions, f as formatForShell, g as CompletionCandidate, h as CandidateResult, i as generateCompletion, l as extractCompletionData, m as hasCompleteCommand, n as createCompletionCommand, o as withCompletionCommand, p as createDynamicCompleteCommand, r as detectShell, s as ValueCompletionField, t as WithCompletionOptions, u as extractPositionals, v as generateCandidates, w as CompletionData, x as parseCompletionContext, y as CompletionContext } from "../index-DjU9BErU.cjs";
2
2
  export { CandidateResult, CompletableOption, CompletableSubcommand, CompletionCandidate, CompletionContext, CompletionData, CompletionDirective, CompletionGenerator, CompletionOptions, CompletionResult, CompletionType, ShellFormatOptions, ShellType, ValueCompletionField, WithCompletionOptions, createCompletionCommand, createDynamicCompleteCommand, detectShell, extractCompletionData, extractPositionals, formatForShell, generateCandidates, generateCompletion, getSupportedShells, hasCompleteCommand, parseCompletionContext, resolveValueCompletion, withCompletionCommand };
@@ -1,2 +1,2 @@
1
- import { C as CompletableSubcommand, D as CompletionResult, E as CompletionOptions, O as ShellType, S as CompletableOption, T as CompletionGenerator, _ as CompletionDirective, a as getSupportedShells, b as CompletionType, c as resolveValueCompletion, d as ShellFormatOptions, f as formatForShell, g as CompletionCandidate, h as CandidateResult, i as generateCompletion, l as extractCompletionData, m as hasCompleteCommand, n as createCompletionCommand, o as withCompletionCommand, p as createDynamicCompleteCommand, r as detectShell, s as ValueCompletionField, t as WithCompletionOptions, u as extractPositionals, v as generateCandidates, w as CompletionData, x as parseCompletionContext, y as CompletionContext } from "../index-rMDe9hp1.js";
1
+ import { C as CompletableSubcommand, D as CompletionResult, E as CompletionOptions, O as ShellType, S as CompletableOption, T as CompletionGenerator, _ as CompletionDirective, a as getSupportedShells, b as CompletionType, c as resolveValueCompletion, d as ShellFormatOptions, f as formatForShell, g as CompletionCandidate, h as CandidateResult, i as generateCompletion, l as extractCompletionData, m as hasCompleteCommand, n as createCompletionCommand, o as withCompletionCommand, p as createDynamicCompleteCommand, r as detectShell, s as ValueCompletionField, t as WithCompletionOptions, u as extractPositionals, v as generateCandidates, w as CompletionData, x as parseCompletionContext, y as CompletionContext } from "../index-DcwMaTvt.js";
2
2
  export { CandidateResult, CompletableOption, CompletableSubcommand, CompletionCandidate, CompletionContext, CompletionData, CompletionDirective, CompletionGenerator, CompletionOptions, CompletionResult, CompletionType, ShellFormatOptions, ShellType, ValueCompletionField, WithCompletionOptions, createCompletionCommand, createDynamicCompleteCommand, detectShell, extractCompletionData, extractPositionals, formatForShell, generateCandidates, generateCompletion, getSupportedShells, hasCompleteCommand, parseCompletionContext, resolveValueCompletion, withCompletionCommand };
@@ -1,4 +1,4 @@
1
- import "../lazy-DSyfzR-F.js";
2
- import { a as withCompletionCommand, c as formatForShell, d as generateCandidates, f as extractCompletionData, i as getSupportedShells, l as parseCompletionContext, m as resolveValueCompletion, n as detectShell, o as createDynamicCompleteCommand, p as extractPositionals, r as generateCompletion, s as hasCompleteCommand, t as createCompletionCommand, u as CompletionDirective } from "../completion-_AnQsWh9.js";
1
+ import "../lazy-D6nL_iKJ.js";
2
+ import { a as withCompletionCommand, c as formatForShell, d as generateCandidates, f as extractCompletionData, i as getSupportedShells, l as parseCompletionContext, m as resolveValueCompletion, n as detectShell, o as createDynamicCompleteCommand, p as extractPositionals, r as generateCompletion, s as hasCompleteCommand, t as createCompletionCommand, u as CompletionDirective } from "../completion-Dj7ytbLu.js";
3
3
 
4
4
  export { CompletionDirective, createCompletionCommand, createDynamicCompleteCommand, detectShell, extractCompletionData, extractPositionals, formatForShell, generateCandidates, generateCompletion, getSupportedShells, hasCompleteCommand, parseCompletionContext, resolveValueCompletion, withCompletionCommand };
@@ -1,5 +1,5 @@
1
- const require_subcommand_router = require('./subcommand-router-sZHhUP7b.cjs');
2
- const require_lazy = require('./lazy-DHlvJiQQ.cjs');
1
+ const require_subcommand_router = require('./subcommand-router-BTOzDQnY.cjs');
2
+ const require_lazy = require('./lazy-B_E2X0KR.cjs');
3
3
  let zod = require("zod");
4
4
  let node_child_process = require("node:child_process");
5
5
 
@@ -1872,4 +1872,4 @@ Object.defineProperty(exports, 'withCompletionCommand', {
1872
1872
  return withCompletionCommand;
1873
1873
  }
1874
1874
  });
1875
- //# sourceMappingURL=completion-Df0eZ70u.cjs.map
1875
+ //# sourceMappingURL=completion-BADAzqT9.cjs.map