@navios/commander 1.4.0 → 1.5.1

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 (120) hide show
  1. package/.turbo/turbo-build.log +49 -0
  2. package/.turbo/turbo-check.log +2 -0
  3. package/.turbo/turbo-lint.log +3 -0
  4. package/.turbo/turbo-test$colon$ci.log +117 -0
  5. package/CHANGELOG.md +9 -3
  6. package/README.md +8 -16
  7. package/dist/src/commander.factory.d.mts +126 -122
  8. package/dist/src/commander.factory.d.mts.map +1 -1
  9. package/dist/src/commands/help.command.d.mts +15 -11
  10. package/dist/src/commands/help.command.d.mts.map +1 -1
  11. package/dist/src/commands/index.d.mts +2 -2
  12. package/dist/src/decorators/cli-module.decorator.d.mts +51 -40
  13. package/dist/src/decorators/cli-module.decorator.d.mts.map +1 -1
  14. package/dist/src/decorators/command.decorator.d.mts +49 -37
  15. package/dist/src/decorators/command.decorator.d.mts.map +1 -1
  16. package/dist/src/decorators/index.d.mts +3 -3
  17. package/dist/src/define-environment.d.mts +9 -8
  18. package/dist/src/define-environment.d.mts.map +1 -1
  19. package/dist/src/index.d.mts +10 -10
  20. package/dist/src/interfaces/abstract-cli-adapter.interface.d.mts +45 -45
  21. package/dist/src/interfaces/command-handler.interface.d.mts +9 -9
  22. package/dist/src/interfaces/commander-execution-context.interface.d.mts +30 -30
  23. package/dist/src/interfaces/commander-execution-context.interface.d.mts.map +1 -1
  24. package/dist/src/interfaces/environment.interface.d.mts +7 -7
  25. package/dist/src/interfaces/index.d.mts +5 -5
  26. package/dist/src/legacy-compat/decorators/cli-module.decorator.d.mts +6 -5
  27. package/dist/src/legacy-compat/decorators/cli-module.decorator.d.mts.map +1 -1
  28. package/dist/src/legacy-compat/decorators/command.decorator.d.mts +7 -6
  29. package/dist/src/legacy-compat/decorators/command.decorator.d.mts.map +1 -1
  30. package/dist/src/legacy-compat/decorators/index.d.mts +3 -3
  31. package/dist/src/legacy-compat/index.d.mts +3 -3
  32. package/dist/src/metadata/command-entry.metadata.d.mts +5 -5
  33. package/dist/src/metadata/command-entry.metadata.d.mts.map +1 -1
  34. package/dist/src/metadata/command.metadata.d.mts +30 -24
  35. package/dist/src/metadata/command.metadata.d.mts.map +1 -1
  36. package/dist/src/metadata/index.d.mts +3 -3
  37. package/dist/src/overrides/help.command.d.mts +15 -11
  38. package/dist/src/overrides/help.command.d.mts.map +1 -1
  39. package/dist/src/services/cli-parser.service.d.mts +54 -54
  40. package/dist/src/services/cli-parser.service.d.mts.map +1 -1
  41. package/dist/src/services/command-registry.service.d.mts +75 -74
  42. package/dist/src/services/command-registry.service.d.mts.map +1 -1
  43. package/dist/src/services/commander-adapter.service.d.mts +49 -48
  44. package/dist/src/services/commander-adapter.service.d.mts.map +1 -1
  45. package/dist/src/services/index.d.mts +4 -4
  46. package/dist/src/tokens/execution-context.token.d.mts +9 -4
  47. package/dist/src/tokens/execution-context.token.d.mts.map +1 -1
  48. package/dist/src/tokens/help-command.token.d.mts +5 -4
  49. package/dist/src/tokens/index.d.mts +2 -2
  50. package/dist/src/utils/index.d.mts +2 -2
  51. package/dist/src/utils/runtime.d.mts +2 -2
  52. package/dist/tsconfig.lib.tsbuildinfo +1 -1
  53. package/dist/tsconfig.tsbuildinfo +1 -1
  54. package/dist/tsdown.config.d.mts +3 -3
  55. package/dist/vitest.config.d.mts +3 -3
  56. package/lib/{cli-module.decorator-DVl8009Q.d.cts → cli-module.decorator-BzsOEMPH.d.cts} +8 -8
  57. package/lib/cli-module.decorator-BzsOEMPH.d.cts.map +1 -0
  58. package/lib/{cli-module.decorator-DGuGfpex.d.mts → cli-module.decorator-CCV_elPP.d.mts} +13 -13
  59. package/lib/cli-module.decorator-CCV_elPP.d.mts.map +1 -0
  60. package/lib/{cli-module.decorator-CkP22084.cjs → cli-module.decorator-CXt38aqF.cjs} +2 -2
  61. package/lib/cli-module.decorator-CXt38aqF.cjs.map +1 -0
  62. package/lib/{cli-module.decorator-UGbtkRYc.mjs → cli-module.decorator-DAjf_r_W.mjs} +2 -2
  63. package/lib/cli-module.decorator-DAjf_r_W.mjs.map +1 -0
  64. package/lib/{command.decorator-UrNJmQN0.cjs → command.decorator-HziankUv.cjs} +3 -3
  65. package/lib/command.decorator-HziankUv.cjs.map +1 -0
  66. package/lib/{command.decorator-DVLSAqYZ.mjs → command.decorator-QiRU7ny3.mjs} +3 -3
  67. package/lib/command.decorator-QiRU7ny3.mjs.map +1 -0
  68. package/lib/{help-command.token-CMWYI6em.cjs → help-command.token-DamE31Aw.cjs} +4 -4
  69. package/lib/{help-command.token-CMWYI6em.cjs.map → help-command.token-DamE31Aw.cjs.map} +1 -1
  70. package/lib/{help-command.token-C0Kgj60o.mjs → help-command.token-XHx3WkoD.mjs} +4 -4
  71. package/lib/{help-command.token-C0Kgj60o.mjs.map → help-command.token-XHx3WkoD.mjs.map} +1 -1
  72. package/lib/{help.command-dtZbhq0w.mjs → help.command-Bynoll_7.mjs} +5 -8
  73. package/lib/help.command-Bynoll_7.mjs.map +1 -0
  74. package/lib/{help.command-DQyv6ali.cjs → help.command-DvKmMpB7.cjs} +6 -9
  75. package/lib/help.command-DvKmMpB7.cjs.map +1 -0
  76. package/lib/index.cjs +103 -103
  77. package/lib/index.cjs.map +1 -1
  78. package/lib/index.d.cts +95 -95
  79. package/lib/index.d.cts.map +1 -1
  80. package/lib/index.d.mts +90 -90
  81. package/lib/index.d.mts.map +1 -1
  82. package/lib/index.mjs +102 -102
  83. package/lib/index.mjs.map +1 -1
  84. package/lib/legacy-compat/index.cjs +6 -28
  85. package/lib/legacy-compat/index.cjs.map +1 -1
  86. package/lib/legacy-compat/index.d.cts +2 -2
  87. package/lib/legacy-compat/index.d.cts.map +1 -1
  88. package/lib/legacy-compat/index.d.mts +2 -2
  89. package/lib/legacy-compat/index.d.mts.map +1 -1
  90. package/lib/legacy-compat/index.mjs +4 -25
  91. package/lib/legacy-compat/index.mjs.map +1 -1
  92. package/package.json +26 -16
  93. package/src/__tests__/commander.factory.e2e.spec.mts +22 -66
  94. package/src/commander.factory.mts +3 -1
  95. package/src/commands/help.command.mts +1 -1
  96. package/src/decorators/cli-module.decorator.mts +4 -9
  97. package/src/decorators/command.decorator.mts +4 -4
  98. package/src/define-environment.mts +4 -4
  99. package/src/interfaces/command-handler.interface.mts +1 -1
  100. package/src/interfaces/commander-execution-context.interface.mts +1 -1
  101. package/src/legacy-compat/decorators/cli-module.decorator.mts +2 -1
  102. package/src/legacy-compat/decorators/command.decorator.mts +3 -2
  103. package/src/metadata/command-entry.metadata.mts +3 -6
  104. package/src/metadata/command.metadata.mts +6 -8
  105. package/src/overrides/help.command.mts +2 -2
  106. package/src/services/__tests__/cli-parser.service.spec.mts +23 -178
  107. package/src/services/cli-parser.service.mts +23 -27
  108. package/src/services/command-registry.service.mts +5 -5
  109. package/src/services/commander-adapter.service.mts +10 -27
  110. package/src/tokens/execution-context.token.mts +4 -6
  111. package/tsconfig.json +3 -0
  112. package/lib/cli-module.decorator-CkP22084.cjs.map +0 -1
  113. package/lib/cli-module.decorator-DGuGfpex.d.mts.map +0 -1
  114. package/lib/cli-module.decorator-DVl8009Q.d.cts.map +0 -1
  115. package/lib/cli-module.decorator-UGbtkRYc.mjs.map +0 -1
  116. package/lib/command.decorator-DVLSAqYZ.mjs.map +0 -1
  117. package/lib/command.decorator-UrNJmQN0.cjs.map +0 -1
  118. package/lib/help.command-DQyv6ali.cjs.map +0 -1
  119. package/lib/help.command-dtZbhq0w.mjs.map +0 -1
  120. package/project.json +0 -66
@@ -1,7 +1,6 @@
1
1
  import { Container } from '@navios/core'
2
-
3
2
  import { beforeEach, describe, expect, it } from 'vitest'
4
- import { z } from 'zod'
3
+ import { z } from 'zod/v4'
5
4
 
6
5
  import { CliParserService } from '../cli-parser.service.mjs'
7
6
 
@@ -34,13 +33,7 @@ describe('CliParserService', () => {
34
33
  })
35
34
 
36
35
  it('should parse command with long options and values', () => {
37
- const result = parser.parse([
38
- 'node',
39
- 'script.js',
40
- 'test',
41
- '--config',
42
- 'prod',
43
- ])
36
+ const result = parser.parse(['node', 'script.js', 'test', '--config', 'prod'])
44
37
  expect(result.command).toBe('test')
45
38
  expect(result.options).toEqual({ config: 'prod' })
46
39
  })
@@ -71,16 +64,7 @@ describe('CliParserService', () => {
71
64
 
72
65
  it('should parse mixed options and positionals', () => {
73
66
  const result = parser.parse(
74
- [
75
- 'node',
76
- 'script.js',
77
- 'test',
78
- '--verbose',
79
- 'file1',
80
- '-c',
81
- 'prod',
82
- 'file2',
83
- ],
67
+ ['node', 'script.js', 'test', '--verbose', 'file1', '-c', 'prod', 'file2'],
84
68
  z.object({
85
69
  verbose: z.boolean(),
86
70
  c: z.string(),
@@ -92,13 +76,7 @@ describe('CliParserService', () => {
92
76
  })
93
77
 
94
78
  it('should parse options with equal sign syntax', () => {
95
- const result = parser.parse([
96
- 'node',
97
- 'script.js',
98
- 'test',
99
- '--config=prod',
100
- '--port=3000',
101
- ])
79
+ const result = parser.parse(['node', 'script.js', 'test', '--config=prod', '--port=3000'])
102
80
  expect(result.command).toBe('test')
103
81
  expect(result.options).toEqual({ config: 'prod', port: 3000 })
104
82
  })
@@ -125,68 +103,32 @@ describe('CliParserService', () => {
125
103
  })
126
104
 
127
105
  it('should parse integer values', () => {
128
- const result = parser.parse([
129
- 'node',
130
- 'script.js',
131
- 'test',
132
- '--port',
133
- '3000',
134
- ])
106
+ const result = parser.parse(['node', 'script.js', 'test', '--port', '3000'])
135
107
  expect(result.options).toEqual({ port: 3000 })
136
108
  })
137
109
 
138
110
  it('should parse negative integer values', () => {
139
- const result = parser.parse([
140
- 'node',
141
- 'script.js',
142
- 'test',
143
- '--offset',
144
- '"-10"',
145
- ])
111
+ const result = parser.parse(['node', 'script.js', 'test', '--offset', '"-10"'])
146
112
  expect(result.options).toEqual({ offset: '"-10"' })
147
113
  })
148
114
 
149
115
  it('should parse float values', () => {
150
- const result = parser.parse([
151
- 'node',
152
- 'script.js',
153
- 'test',
154
- '--ratio',
155
- '3.14',
156
- ])
116
+ const result = parser.parse(['node', 'script.js', 'test', '--ratio', '3.14'])
157
117
  expect(result.options).toEqual({ ratio: 3.14 })
158
118
  })
159
119
 
160
120
  it('should parse null value', () => {
161
- const result = parser.parse([
162
- 'node',
163
- 'script.js',
164
- 'test',
165
- '--value',
166
- 'null',
167
- ])
121
+ const result = parser.parse(['node', 'script.js', 'test', '--value', 'null'])
168
122
  expect(result.options).toEqual({ value: null })
169
123
  })
170
124
 
171
125
  it('should parse JSON object', () => {
172
- const result = parser.parse([
173
- 'node',
174
- 'script.js',
175
- 'test',
176
- '--data',
177
- '{"key":"value"}',
178
- ])
126
+ const result = parser.parse(['node', 'script.js', 'test', '--data', '{"key":"value"}'])
179
127
  expect(result.options).toEqual({ data: { key: 'value' } })
180
128
  })
181
129
 
182
130
  it('should parse JSON array', () => {
183
- const result = parser.parse([
184
- 'node',
185
- 'script.js',
186
- 'test',
187
- '--items',
188
- '[1,2,3]',
189
- ])
131
+ const result = parser.parse(['node', 'script.js', 'test', '--items', '[1,2,3]'])
190
132
  expect(result.options).toEqual({ items: [1, 2, 3] })
191
133
  })
192
134
  })
@@ -217,15 +159,7 @@ describe('CliParserService', () => {
217
159
  })
218
160
 
219
161
  const result = parser.parse(
220
- [
221
- 'node',
222
- 'script.js',
223
- 'test',
224
- '--verbose',
225
- '--dry-run',
226
- '--config',
227
- 'prod',
228
- ],
162
+ ['node', 'script.js', 'test', '--verbose', '--dry-run', '--config', 'prod'],
229
163
  schema,
230
164
  )
231
165
 
@@ -262,15 +196,7 @@ describe('CliParserService', () => {
262
196
 
263
197
  // Without schema, --verbose would incorrectly consume '--debug' as its value
264
198
  const result = parser.parse(
265
- [
266
- 'node',
267
- 'script.js',
268
- 'test',
269
- '--verbose',
270
- '--debug',
271
- '--config',
272
- 'prod',
273
- ],
199
+ ['node', 'script.js', 'test', '--verbose', '--debug', '--config', 'prod'],
274
200
  schema,
275
201
  )
276
202
 
@@ -313,14 +239,7 @@ describe('CliParserService', () => {
313
239
  })
314
240
 
315
241
  it('should work without schema (fallback behavior)', () => {
316
- const result = parser.parse([
317
- 'node',
318
- 'script.js',
319
- 'test',
320
- '--verbose',
321
- '--config',
322
- 'prod',
323
- ])
242
+ const result = parser.parse(['node', 'script.js', 'test', '--verbose', '--config', 'prod'])
324
243
 
325
244
  // Without schema, parser uses heuristics
326
245
  expect(result.options).toEqual({
@@ -335,10 +254,7 @@ describe('CliParserService', () => {
335
254
  c: z.string(),
336
255
  })
337
256
 
338
- const result = parser.parse(
339
- ['node', 'script.js', 'test', '-v', '-c', 'prod'],
340
- schema,
341
- )
257
+ const result = parser.parse(['node', 'script.js', 'test', '-v', '-c', 'prod'], schema)
342
258
 
343
259
  expect(result.options).toEqual({
344
260
  v: true,
@@ -356,16 +272,7 @@ describe('CliParserService', () => {
356
272
  })
357
273
 
358
274
  const result = parser.parse(
359
- [
360
- 'node',
361
- 'script.js',
362
- 'test',
363
- '--verbose',
364
- '--debug',
365
- '--quiet',
366
- '--config',
367
- 'production',
368
- ],
275
+ ['node', 'script.js', 'test', '--verbose', '--debug', '--quiet', '--config', 'production'],
369
276
  schema,
370
277
  )
371
278
 
@@ -386,13 +293,7 @@ describe('CliParserService', () => {
386
293
  })
387
294
 
388
295
  it('should handle options with dashes in values', () => {
389
- const result = parser.parse([
390
- 'node',
391
- 'script.js',
392
- 'test',
393
- '--branch',
394
- 'feature-test',
395
- ])
296
+ const result = parser.parse(['node', 'script.js', 'test', '--branch', 'feature-test'])
396
297
  expect(result.options).toEqual({ branch: 'feature-test' })
397
298
  })
398
299
 
@@ -409,17 +310,7 @@ describe('CliParserService', () => {
409
310
  })
410
311
 
411
312
  const result = parser.parse(
412
- [
413
- 'node',
414
- 'script.js',
415
- 'test',
416
- '--tags',
417
- 'foo',
418
- '--tags',
419
- 'bar',
420
- '--tags',
421
- 'baz',
422
- ],
313
+ ['node', 'script.js', 'test', '--tags', 'foo', '--tags', 'bar', '--tags', 'baz'],
423
314
  schema,
424
315
  )
425
316
 
@@ -449,15 +340,7 @@ describe('CliParserService', () => {
449
340
  })
450
341
 
451
342
  const result = parser.parse(
452
- [
453
- 'node',
454
- 'script.js',
455
- 'test',
456
- '--exclude-paths',
457
- 'node_modules',
458
- '--exclude-paths',
459
- 'dist',
460
- ],
343
+ ['node', 'script.js', 'test', '--exclude-paths', 'node_modules', '--exclude-paths', 'dist'],
461
344
  schema,
462
345
  )
463
346
 
@@ -473,16 +356,7 @@ describe('CliParserService', () => {
473
356
  })
474
357
 
475
358
  const result = parser.parse(
476
- [
477
- 'node',
478
- 'script.js',
479
- 'test',
480
- '--tags',
481
- 'foo',
482
- '--tags',
483
- 'bar',
484
- '--verbose',
485
- ],
359
+ ['node', 'script.js', 'test', '--tags', 'foo', '--tags', 'bar', '--verbose'],
486
360
  schema,
487
361
  )
488
362
 
@@ -548,10 +422,7 @@ describe('CliParserService', () => {
548
422
  t: z.array(z.string()),
549
423
  })
550
424
 
551
- const result = parser.parse(
552
- ['node', 'script.js', 'test', '-t', 'foo', '-t', 'bar'],
553
- schema,
554
- )
425
+ const result = parser.parse(['node', 'script.js', 'test', '-t', 'foo', '-t', 'bar'], schema)
555
426
 
556
427
  expect(result.options).toEqual({
557
428
  t: ['foo', 'bar'],
@@ -593,15 +464,7 @@ describe('CliParserService', () => {
593
464
  })
594
465
 
595
466
  const result = parser.parse(
596
- [
597
- 'node',
598
- 'script.js',
599
- 'test',
600
- '--items',
601
- '[1,2,3]',
602
- '--items',
603
- '["a","b"]',
604
- ],
467
+ ['node', 'script.js', 'test', '--items', '[1,2,3]', '--items', '["a","b"]'],
605
468
  schema,
606
469
  )
607
470
 
@@ -619,17 +482,7 @@ describe('CliParserService', () => {
619
482
  })
620
483
 
621
484
  const result = parser.parse(
622
- [
623
- 'node',
624
- 'script.js',
625
- 'test',
626
- '--tags',
627
- 'foo',
628
- 'file1.txt',
629
- '--tags',
630
- 'bar',
631
- 'file2.txt',
632
- ],
485
+ ['node', 'script.js', 'test', '--tags', 'foo', 'file1.txt', '--tags', 'bar', 'file2.txt'],
633
486
  schema,
634
487
  )
635
488
 
@@ -641,15 +494,7 @@ describe('CliParserService', () => {
641
494
 
642
495
  it('should not treat non-array options as arrays without schema', () => {
643
496
  // Without schema, multiple values should overwrite
644
- const result = parser.parse([
645
- 'node',
646
- 'script.js',
647
- 'test',
648
- '--tag',
649
- 'foo',
650
- '--tag',
651
- 'bar',
652
- ])
497
+ const result = parser.parse(['node', 'script.js', 'test', '--tag', 'foo', '--tag', 'bar'])
653
498
 
654
499
  expect(result.options).toEqual({
655
500
  tag: 'bar', // Last value wins without schema
@@ -1,7 +1,7 @@
1
- import type { ZodObject, ZodType } from 'zod'
2
-
3
1
  import { Injectable } from '@navios/core'
4
2
 
3
+ import type { z } from 'zod/v4'
4
+
5
5
  /**
6
6
  * Result of parsing command-line arguments.
7
7
  *
@@ -44,10 +44,10 @@ export class CliParserService {
44
44
  * Expected format: node script.js command [subcommand...] --flag value --boolean-flag positional1 positional2
45
45
  *
46
46
  * @param argv - Array of command-line arguments (typically process.argv)
47
- * @param optionsSchema - Optional Zod schema to determine boolean flags and option types
47
+ * @param optionsSchema - Optional zod/v4 schema to determine boolean flags and option types
48
48
  * @returns Parsed command (space-separated if multi-word), options, and positional arguments
49
49
  */
50
- parse(argv: string[], optionsSchema?: ZodObject): ParsedCliArgs {
50
+ parse(argv: string[], optionsSchema?: z.ZodObject): ParsedCliArgs {
51
51
  // Skip first two args (node and script path)
52
52
  const args = argv.slice(2)
53
53
 
@@ -59,9 +59,7 @@ export class CliParserService {
59
59
  const booleanFields = optionsSchema
60
60
  ? this.extractBooleanFields(optionsSchema)
61
61
  : new Set<string>()
62
- const arrayFields = optionsSchema
63
- ? this.extractArrayFields(optionsSchema)
64
- : new Set<string>()
62
+ const arrayFields = optionsSchema ? this.extractArrayFields(optionsSchema) : new Set<string>()
65
63
 
66
64
  // Collect command words until we hit an argument that starts with '-' or '--'
67
65
  const commandParts: string[] = []
@@ -91,8 +89,7 @@ export class CliParserService {
91
89
  const optionName = key.slice(0, equalIndex)
92
90
  const optionValue = key.slice(equalIndex + 1)
93
91
  const camelCaseKey = this.camelCase(optionName)
94
- const isArray =
95
- arrayFields.has(camelCaseKey) || arrayFields.has(optionName)
92
+ const isArray = arrayFields.has(camelCaseKey) || arrayFields.has(optionName)
96
93
 
97
94
  if (isArray) {
98
95
  // For array fields, accumulate values
@@ -107,8 +104,7 @@ export class CliParserService {
107
104
  } else {
108
105
  // Format: --key value or --boolean-flag
109
106
  const camelCaseKey = this.camelCase(key)
110
- const isBoolean =
111
- booleanFields.has(camelCaseKey) || booleanFields.has(key)
107
+ const isBoolean = booleanFields.has(camelCaseKey) || booleanFields.has(key)
112
108
  const isArray = arrayFields.has(camelCaseKey) || arrayFields.has(key)
113
109
  const nextArg = args[i + 1]
114
110
 
@@ -227,18 +223,18 @@ export class CliParserService {
227
223
  }
228
224
 
229
225
  /**
230
- * Extracts boolean field names from a Zod schema
231
- * Handles ZodObject, ZodOptional, and ZodDefault wrappers
226
+ * Extracts boolean field names from a zod/v4 schema
227
+ * Handles z.ZodObject, zod/v4Optional, and zod/v4Default wrappers
232
228
  */
233
- private extractBooleanFields(schema: ZodObject): Set<string> {
229
+ private extractBooleanFields(schema: z.ZodObject): Set<string> {
234
230
  const booleanFields = new Set<string>()
235
231
 
236
232
  try {
237
- // Check if schema has _def.typeName (Zod schema structure)
233
+ // Check if schema has _def.typeName (zod/v4 schema structure)
238
234
  const typeName = schema.def.type
239
235
 
240
236
  if (typeName === 'object') {
241
- // Extract shape from ZodObject
237
+ // Extract shape from z.ZodObject
242
238
  const shape = schema.def.shape
243
239
 
244
240
  if (shape && typeof shape === 'object') {
@@ -257,10 +253,10 @@ export class CliParserService {
257
253
  }
258
254
 
259
255
  /**
260
- * Extracts array field names from a Zod schema
261
- * Handles ZodObject, ZodOptional, and ZodDefault wrappers
256
+ * Extracts array field names from a zod/v4 schema
257
+ * Handles z.ZodObject, zod/v4Optional, and zod/v4Default wrappers
262
258
  */
263
- private extractArrayFields(schema: ZodObject): Set<string> {
259
+ private extractArrayFields(schema: z.ZodObject): Set<string> {
264
260
  const arrayFields = new Set<string>()
265
261
 
266
262
  try {
@@ -285,15 +281,15 @@ export class CliParserService {
285
281
  }
286
282
 
287
283
  /**
288
- * Checks if a Zod schema represents a boolean type
289
- * Unwraps ZodOptional and ZodDefault using Zod v4 API
284
+ * Checks if a zod/v4 schema represents a boolean type
285
+ * Unwraps zod/v4Optional and zod/v4Default using zod/v4 v4 API
290
286
  */
291
- private isSchemaBoolean(schema: ZodType): boolean {
287
+ private isSchemaBoolean(schema: z.ZodType): boolean {
292
288
  try {
293
289
  let currentSchema = schema
294
290
  let typeName = currentSchema.def.type
295
291
 
296
- // Unwrap ZodOptional and ZodDefault using Zod v4's def.innerType
292
+ // Unwrap zod/v4Optional and zod/v4Default using zod/v4 v4's def.innerType
297
293
  while (typeName === 'optional' || typeName === 'default') {
298
294
  currentSchema = (currentSchema as any)?.def?.innerType || currentSchema
299
295
  typeName = currentSchema.def.type
@@ -306,15 +302,15 @@ export class CliParserService {
306
302
  }
307
303
 
308
304
  /**
309
- * Checks if a Zod schema represents an array type
310
- * Unwraps ZodOptional and ZodDefault using Zod v4 API
305
+ * Checks if a zod/v4 schema represents an array type
306
+ * Unwraps zod/v4Optional and zod/v4Default using zod/v4 v4 API
311
307
  */
312
- private isSchemaArray(schema: ZodType): boolean {
308
+ private isSchemaArray(schema: z.ZodType): boolean {
313
309
  try {
314
310
  let currentSchema = schema
315
311
  let typeName = currentSchema.def.type
316
312
 
317
- // Unwrap ZodOptional and ZodDefault using Zod v4's def.innerType
313
+ // Unwrap zod/v4Optional and zod/v4Default using zod/v4 v4's def.innerType
318
314
  while (typeName === 'optional' || typeName === 'default') {
319
315
  currentSchema = (currentSchema as any)?.def?.innerType || currentSchema
320
316
  typeName = currentSchema.def.type
@@ -1,7 +1,7 @@
1
- import type { ClassType } from '@navios/core'
2
-
3
1
  import { Injectable } from '@navios/core'
4
2
 
3
+ import type { ClassType } from '@navios/core'
4
+
5
5
  import type { CommandMetadata } from '../metadata/index.mjs'
6
6
 
7
7
  /**
@@ -144,7 +144,7 @@ export class CommandRegistryService {
144
144
  }
145
145
 
146
146
  /**
147
- * Gets a human-readable type name from a Zod schema.
147
+ * Gets a human-readable type name from a zod/v4 schema.
148
148
  */
149
149
  private getSchemaTypeName(schema: any): string {
150
150
  try {
@@ -186,8 +186,8 @@ export class CommandRegistryService {
186
186
  }
187
187
 
188
188
  /**
189
- * Gets metadata from a Zod schema, traversing innerType if needed.
190
- * Zod v4 stores meta at the outermost layer when .meta() is called last,
189
+ * Gets metadata from a zod/v4 schema, traversing innerType if needed.
190
+ * zod/v4 v4 stores meta at the outermost layer when .meta() is called last,
191
191
  * or in innerType when .meta() is called before .optional()/.default().
192
192
  */
193
193
  private getSchemaMeta(schema: any): Record<string, unknown> | undefined {
@@ -1,26 +1,18 @@
1
+ import { Container, inject, Injectable, InjectionToken, Logger } from '@navios/core'
2
+
1
3
  import type { ClassType, ModuleMetadata } from '@navios/core'
2
4
 
3
- import {
4
- Container,
5
- inject,
6
- Injectable,
7
- InjectionToken,
8
- Logger,
9
- } from '@navios/core'
5
+ import { HelpCommand } from '../commands/help.command.mjs'
6
+ import { CommanderExecutionContext } from '../interfaces/commander-execution-context.interface.mjs'
7
+ import { CommandEntryKey } from '../metadata/command-entry.metadata.mjs'
8
+ import { extractCommandMetadata, hasCommandMetadata } from '../metadata/index.mjs'
9
+ import { CommandExecutionContext } from '../tokens/index.mjs'
10
10
 
11
11
  import type { AbstractCliAdapterInterface } from '../interfaces/abstract-cli-adapter.interface.mjs'
12
12
  import type { CommandHandler } from '../interfaces/command-handler.interface.mjs'
13
13
  import type { CliAdapterOptions } from '../interfaces/environment.interface.mjs'
14
14
  import type { CommandEntryValue } from '../metadata/command-entry.metadata.mjs'
15
15
 
16
- import { HelpCommand } from '../commands/help.command.mjs'
17
- import { CommanderExecutionContext } from '../interfaces/commander-execution-context.interface.mjs'
18
- import { CommandEntryKey } from '../metadata/command-entry.metadata.mjs'
19
- import {
20
- extractCommandMetadata,
21
- hasCommandMetadata,
22
- } from '../metadata/index.mjs'
23
- import { CommandExecutionContext } from '../tokens/index.mjs'
24
16
  import { CliParserService } from './cli-parser.service.mjs'
25
17
  import { CommandRegistryService } from './command-registry.service.mjs'
26
18
 
@@ -57,9 +49,7 @@ export class CommanderAdapterService implements AbstractCliAdapterInterface {
57
49
  this.registerBuiltInCommands()
58
50
 
59
51
  for (const [moduleName, metadata] of modules) {
60
- const commands = metadata.customEntries.get(CommandEntryKey) as
61
- | CommandEntryValue
62
- | undefined
52
+ const commands = metadata.customEntries.get(CommandEntryKey) as CommandEntryValue | undefined
63
53
  if (!commands) continue
64
54
 
65
55
  for (const commandClass of commands) {
@@ -156,10 +146,7 @@ export class CommanderAdapterService implements AbstractCliAdapterInterface {
156
146
  /**
157
147
  * Execute a command programmatically with the provided options.
158
148
  */
159
- async executeCommand(
160
- path: string,
161
- options: Record<string, unknown> = {},
162
- ): Promise<void> {
149
+ async executeCommand(path: string, options: Record<string, unknown> = {}): Promise<void> {
163
150
  const command = this.commandRegistry.getByPath(path)
164
151
  if (!command) {
165
152
  throw new Error(`[Navios Commander] Command not found: ${path}`)
@@ -174,11 +161,7 @@ export class CommanderAdapterService implements AbstractCliAdapterInterface {
174
161
  }
175
162
 
176
163
  // Create execution context
177
- const executionContext = new CommanderExecutionContext(
178
- metadata,
179
- path,
180
- validatedOptions,
181
- )
164
+ const executionContext = new CommanderExecutionContext(metadata, path, validatedOptions)
182
165
 
183
166
  // Begin request scope
184
167
  const requestId = `cmd-${Date.now()}-${Math.random().toString(36).substring(7)}`
@@ -2,8 +2,7 @@ import { InjectionToken } from '@navios/core'
2
2
 
3
3
  import type { CommanderExecutionContext } from '../interfaces/index.mjs'
4
4
 
5
- const CommandExecutionContextInjectionToken =
6
- 'CommanderExecutionContextInjectionToken'
5
+ const CommandExecutionContextInjectionToken = 'CommanderExecutionContextInjectionToken'
7
6
 
8
7
  /**
9
8
  * Injection token for accessing the current command execution context.
@@ -28,7 +27,6 @@ const CommandExecutionContextInjectionToken =
28
27
  * }
29
28
  * ```
30
29
  */
31
- export const CommandExecutionContext =
32
- InjectionToken.create<CommanderExecutionContext>(
33
- CommandExecutionContextInjectionToken,
34
- )
30
+ export const CommandExecutionContext = InjectionToken.create<CommanderExecutionContext>(
31
+ CommandExecutionContextInjectionToken,
32
+ )
package/tsconfig.json CHANGED
@@ -10,6 +10,9 @@
10
10
  },
11
11
  {
12
12
  "path": "./tsconfig.spec.json"
13
+ },
14
+ {
15
+ "path": "../commander-tui"
13
16
  }
14
17
  ]
15
18
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"cli-module.decorator-CkP22084.cjs","names":["Module","getModuleMetadata","getModuleCustomEntry","CommandEntryKey","CliModule","commands","controllers","imports","guards","overrides","priority","registry","target","context","kind","Error","result","metadata","commandSet","Set","command","add"],"sources":["../src/decorators/cli-module.decorator.mts"],"sourcesContent":["import type { ClassType, Registry } from '@navios/core'\n\nimport { Module, getModuleMetadata, getModuleCustomEntry } from '@navios/core'\n\nimport {\n CommandEntryKey,\n type CommandEntryValue,\n} from '../metadata/command-entry.metadata.mjs'\n\n/**\n * Options for the `@CliModule` decorator.\n *\n * @public\n */\nexport interface CliModuleOptions {\n /**\n * Array or Set of command classes to register in this module.\n * Commands must be decorated with `@Command`.\n */\n commands?: ClassType[] | Set<ClassType>\n /**\n * Array or Set of controller classes for HTTP endpoints.\n * Allows mixing HTTP and CLI functionality in the same module.\n */\n controllers?: ClassType[] | Set<ClassType>\n /**\n * Array or Set of other modules to import.\n * Imported modules' commands and controllers will be available.\n */\n imports?: ClassType[] | Set<ClassType>\n /**\n * Guards to apply to all controllers in this module.\n * Guards are executed in reverse order (last guard first).\n */\n guards?: ClassType[] | Set<ClassType>\n /**\n * Service override classes to import for side effects.\n * These classes are imported to ensure their @Injectable decorators execute,\n * allowing them to register with the DI system. Overrides should use the same\n * InjectionToken as the original service with a higher priority.\n */\n overrides?: ClassType[] | Set<ClassType>\n /**\n * Priority level for the module.\n * Higher priority modules will be loaded first.\n */\n priority?: number\n /**\n * Registry to use for the module.\n * Registry is used to store the module and its commands.\n */\n registry?: Registry\n}\n\n/**\n * Decorator that marks a class as a CLI module.\n *\n * This decorator extends the standard @Module decorator, adding support for\n * CLI commands while maintaining full compatibility with HTTP controllers.\n * Modules organize commands and can import other modules to compose larger\n * CLI applications.\n *\n * The module can optionally implement `NaviosModule` interface for lifecycle hooks.\n *\n * @param options - Configuration options for the module\n * @returns A class decorator function\n *\n * @example\n * ```typescript\n * import { CliModule } from '@navios/commander'\n * import { GreetCommand } from './greet.command'\n * import { UserModule } from './user.module'\n *\n * @CliModule({\n * commands: [GreetCommand],\n * imports: [UserModule]\n * })\n * export class AppModule {}\n * ```\n *\n * @example\n * ```typescript\n * // Mixed HTTP and CLI module\n * @CliModule({\n * controllers: [HealthController],\n * commands: [MigrateCommand],\n * imports: [DatabaseModule],\n * })\n * export class AppModule {}\n * ```\n */\nexport function CliModule(\n {\n commands = [],\n controllers = [],\n imports = [],\n guards = [],\n overrides = [],\n priority,\n registry,\n }: CliModuleOptions = {\n commands: [],\n controllers: [],\n imports: [],\n guards: [],\n overrides: [],\n },\n) {\n return (target: ClassType, context: ClassDecoratorContext) => {\n if (context.kind !== 'class') {\n throw new Error(\n '[Navios Commander] @CliModule decorator can only be used on classes.',\n )\n }\n\n // Apply standard @Module decorator first\n const result = Module({\n controllers,\n imports,\n guards,\n overrides,\n priority,\n registry,\n })(target, context)\n\n // Get the module metadata that @Module just created\n const metadata = getModuleMetadata(target, context)\n\n // Store commands in customEntries\n const commandSet = getModuleCustomEntry<CommandEntryValue>(\n metadata,\n CommandEntryKey,\n () => new Set(),\n )\n for (const command of commands) {\n commandSet.add(command)\n }\n\n return result\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2FA,SAAgBI,UACd,EACEC,WAAW,EAAE,EACbC,cAAc,EAAE,EAChBC,UAAU,EAAE,EACZC,SAAS,EAAE,EACXC,YAAY,EAAE,EACdC,UACAC,aACoB;CACpBN,UAAU,EAAE;CACZC,aAAa,EAAE;CACfC,SAAS,EAAE;CACXC,QAAQ,EAAE;CACVC,WAAW,EAAE;CACd,EAAA;AAED,SAAQG,QAAmBC,YAAAA;AACzB,MAAIA,QAAQC,SAAS,QACnB,OAAM,IAAIC,MACR,uEAAA;EAKJ,MAAMC,kCAAgB;GACpBV;GACAC;GACAC;GACAC;GACAC;GACAC;GACF,CAAA,CAAGC,QAAQC,QAAAA;EAMX,MAAMK,wFAH6BN,QAAQC,QAAAA,EAKzCV,iEACM,IAAIgB,KAAAA,CAAAA;AAEZ,OAAK,MAAMC,WAAWf,SACpBa,YAAWG,IAAID,QAAAA;AAGjB,SAAOJ"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"cli-module.decorator-DGuGfpex.d.mts","names":["CommandHandler","TOptions","Promise","AbstractAdapterInterface","AbstractCliAdapterInterface","Promise","Record","Array","AdapterEnvironment","AbstractCliAdapterInterface","CliAdapterOptions","CliEnvironment","ClassType","ZodObject","CommandMetadataKey","CommandMetadata","Map","getCommandMetadata","ClassDecoratorContext","extractCommandMetadata","hasCommandMetadata","CommandMetadata","CommanderExecutionContext","InjectionToken","ClassType","ClassTypeWithInstance","Registry","ZodObject","CommandHandler","CommandOptions","Command","path","description","token","optionsSchema","priority","registry","ClassDecoratorContext","ClassType","Registry","CliModuleOptions","Set","CliModule","commands","controllers","imports","guards","overrides","priority","registry","ClassDecoratorContext"],"sources":["../src/interfaces/command-handler.interface.d.mts","../src/interfaces/abstract-cli-adapter.interface.d.mts","../src/interfaces/environment.interface.d.mts","../src/metadata/command.metadata.d.mts","../src/interfaces/commander-execution-context.interface.d.mts","../src/decorators/command.decorator.d.mts","../src/decorators/cli-module.decorator.d.mts"],"sourcesContent":["/**\n * Interface that all command classes must implement.\n *\n * Commands decorated with `@Command` must implement this interface.\n * The `execute` method is called when the command is invoked.\n *\n * @template TOptions - The type of options that the command accepts\n *\n * @example\n * ```typescript\n * import { Command, CommandHandler } from '@navios/commander'\n * import { z } from 'zod'\n *\n * const optionsSchema = z.object({\n * name: z.string()\n * })\n *\n * type Options = z.infer<typeof optionsSchema>\n *\n * @Command({ path: 'greet', optionsSchema })\n * export class GreetCommand implements CommandHandler<Options> {\n * async execute(options: Options) {\n * console.log(`Hello, ${options.name}!`)\n * }\n * }\n * ```\n */\nexport interface CommandHandler<TOptions = any> {\n /**\n * Executes the command with the provided options.\n *\n * @param options - The validated command options (validated against the command's schema if provided)\n * @returns A promise or void\n */\n execute(options: TOptions): void | Promise<void>;\n}\n//# sourceMappingURL=command-handler.interface.d.mts.map","import type { AbstractAdapterInterface } from '@navios/core';\n/**\n * Interface for CLI adapters.\n * Extends the base adapter interface with CLI-specific methods.\n *\n * @public\n */\nexport interface AbstractCliAdapterInterface extends AbstractAdapterInterface {\n /**\n * Run the CLI application with the given arguments.\n * Parses arguments and executes the matching command.\n *\n * @param argv - Command-line arguments array (defaults to `process.argv`)\n *\n * @example\n * ```typescript\n * const adapter = app.getAdapter() as AbstractCliAdapterInterface\n * await adapter.run(process.argv)\n * ```\n */\n run(argv?: string[]): Promise<void>;\n /**\n * Execute a command programmatically with the provided options.\n *\n * @param path - The command path (e.g., 'greet', 'user:create')\n * @param options - The command options object\n *\n * @example\n * ```typescript\n * await adapter.executeCommand('user:create', {\n * name: 'John',\n * email: 'john@example.com',\n * })\n * ```\n */\n executeCommand(path: string, options: Record<string, unknown>): Promise<void>;\n /**\n * Get all registered command paths and their class references.\n *\n * @returns Array of objects containing path and class\n *\n * @example\n * ```typescript\n * const commands = adapter.getAllCommands()\n * commands.forEach(({ path }) => console.log(path))\n * ```\n */\n getAllCommands(): Array<{\n path: string;\n class: unknown;\n }>;\n}\n//# sourceMappingURL=abstract-cli-adapter.interface.d.mts.map","import type { AdapterEnvironment } from '@navios/core';\nimport type { AbstractCliAdapterInterface } from './abstract-cli-adapter.interface.mjs';\n/**\n * Options for configuring the CLI adapter.\n *\n * @public\n */\nexport interface CliAdapterOptions {\n}\n/**\n * Environment type definition for CLI adapters.\n * Used with NaviosFactory.create<CliEnvironment>() for type-safe CLI applications.\n *\n * @public\n *\n * @example\n * ```typescript\n * import { NaviosFactory } from '@navios/core'\n * import { defineCliEnvironment, type CliEnvironment } from '@navios/commander'\n *\n * const app = await NaviosFactory.create<CliEnvironment>(AppModule, {\n * adapter: defineCliEnvironment(),\n * })\n * ```\n */\nexport interface CliEnvironment extends AdapterEnvironment {\n options: CliAdapterOptions;\n adapter: AbstractCliAdapterInterface;\n}\n//# sourceMappingURL=environment.interface.d.mts.map","import type { ClassType } from '@navios/core';\nimport type { ZodObject } from 'zod';\n/**\n * @internal\n * Symbol key used to store command metadata on classes.\n */\nexport declare const CommandMetadataKey: unique symbol;\n/**\n * Metadata associated with a command.\n *\n * @public\n */\nexport interface CommandMetadata {\n /**\n * The command path (e.g., 'greet', 'user:create').\n */\n path: string;\n /**\n * Optional description of the command for help text.\n */\n description?: string;\n /**\n * Optional Zod schema for validating command options.\n */\n optionsSchema?: ZodObject;\n /**\n * Map of custom attributes that can be attached to the command.\n */\n customAttributes: Map<string | symbol, any>;\n}\n/**\n * Gets or creates command metadata for a class.\n *\n * @internal\n * @param target - The command class\n * @param context - The decorator context\n * @param path - The command path\n * @param description - Optional description for help text\n * @param optionsSchema - Optional Zod schema\n * @returns The command metadata\n */\nexport declare function getCommandMetadata(target: ClassType, context: ClassDecoratorContext, path: string, description?: string, optionsSchema?: ZodObject): CommandMetadata;\n/**\n * Extracts command metadata from a class.\n *\n * @param target - The command class\n * @returns The command metadata\n * @throws {Error} If the class is not decorated with @Command\n *\n * @example\n * ```typescript\n * const metadata = extractCommandMetadata(GreetCommand)\n * console.log(metadata.path) // 'greet'\n * ```\n */\nexport declare function extractCommandMetadata(target: ClassType): CommandMetadata;\n/**\n * Checks if a class has command metadata.\n *\n * @param target - The class to check\n * @returns `true` if the class is decorated with @Command, `false` otherwise\n */\nexport declare function hasCommandMetadata(target: ClassType): boolean;\n//# sourceMappingURL=command.metadata.d.mts.map","import type { CommandMetadata } from '../metadata/command.metadata.mjs';\n/**\n * Execution context for a command execution.\n *\n * Provides access to command metadata, path, and validated options during command execution.\n * This context is automatically injected and available via the `CommandExecutionContext` token.\n *\n * @example\n * ```typescript\n * import { inject, Injectable } from '@navios/core'\n * import { CommandExecutionContext } from '@navios/commander'\n *\n * @Injectable()\n * class CommandLogger {\n * private ctx = inject(CommandExecutionContext)\n *\n * log() {\n * console.log('Command:', this.ctx.getCommandPath())\n * console.log('Options:', this.ctx.getOptions())\n * }\n * }\n * ```\n */\nexport declare class CommanderExecutionContext {\n private readonly command;\n private readonly commandPath;\n private readonly options;\n /**\n * @internal\n * Creates a new execution context.\n */\n constructor(command: CommandMetadata, commandPath: string, options: any);\n /**\n * Gets the command metadata.\n *\n * @returns The command metadata including path and options schema\n */\n getCommand(): CommandMetadata;\n /**\n * Gets the command path that was invoked.\n *\n * @returns The command path (e.g., 'greet', 'user:create')\n */\n getCommandPath(): string;\n /**\n * Gets the validated command options.\n *\n * Options are validated against the command's Zod schema if one was provided.\n *\n * @returns The validated options object\n */\n getOptions(): any;\n}\n//# sourceMappingURL=commander-execution-context.interface.d.mts.map","import { InjectionToken } from '@navios/core';\nimport type { ClassType, ClassTypeWithInstance, Registry } from '@navios/core';\nimport type { ZodObject } from 'zod';\nimport type { CommandHandler } from '../interfaces/index.mjs';\n/**\n * Options for the `@Command` decorator.\n *\n * @public\n */\nexport interface CommandOptions {\n /**\n * The token to use for the command.\n * If provided, the command will be registered with this token.\n */\n token?: InjectionToken<ClassTypeWithInstance<CommandHandler<any>>>;\n /**\n * The command path that users will invoke from the CLI.\n * Can be a single word (e.g., 'greet') or multi-word with colons (e.g., 'user:create', 'db:migrate').\n */\n path: string;\n /**\n * Optional description of the command for help text.\n * Displayed when users run `help` or `--help`.\n */\n description?: string;\n /**\n * Optional Zod schema for validating command options.\n * If provided, options will be validated and parsed according to this schema.\n */\n optionsSchema?: ZodObject;\n /**\n * Priority level for the command.\n * Higher priority commands will be loaded first.\n */\n priority?: number;\n /**\n * Registry to use for the command.\n * Registry is used to store the command and its options schema.\n */\n registry?: Registry;\n}\n/**\n * Decorator that marks a class as a CLI command.\n *\n * The decorated class must implement the `CommandHandler` interface with an `execute` method.\n * The command will be automatically registered when its module is loaded.\n *\n * @param options - Configuration options for the command\n * @returns A class decorator function\n *\n * @example\n * ```typescript\n * import { Command, CommandHandler } from '@navios/commander'\n * import { z } from 'zod'\n *\n * const optionsSchema = z.object({\n * name: z.string(),\n * greeting: z.string().optional().default('Hello')\n * })\n *\n * @Command({\n * path: 'greet',\n * optionsSchema: optionsSchema\n * })\n * export class GreetCommand implements CommandHandler<z.infer<typeof optionsSchema>> {\n * async execute(options) {\n * console.log(`${options.greeting}, ${options.name}!`)\n * }\n * }\n * ```\n */\nexport declare function Command({ path, description, token, optionsSchema, priority, registry, }: CommandOptions): (target: ClassType, context: ClassDecoratorContext) => any;\n//# sourceMappingURL=command.decorator.d.mts.map","import type { ClassType, Registry } from '@navios/core';\n/**\n * Options for the `@CliModule` decorator.\n *\n * @public\n */\nexport interface CliModuleOptions {\n /**\n * Array or Set of command classes to register in this module.\n * Commands must be decorated with `@Command`.\n */\n commands?: ClassType[] | Set<ClassType>;\n /**\n * Array or Set of controller classes for HTTP endpoints.\n * Allows mixing HTTP and CLI functionality in the same module.\n */\n controllers?: ClassType[] | Set<ClassType>;\n /**\n * Array or Set of other modules to import.\n * Imported modules' commands and controllers will be available.\n */\n imports?: ClassType[] | Set<ClassType>;\n /**\n * Guards to apply to all controllers in this module.\n * Guards are executed in reverse order (last guard first).\n */\n guards?: ClassType[] | Set<ClassType>;\n /**\n * Service override classes to import for side effects.\n * These classes are imported to ensure their @Injectable decorators execute,\n * allowing them to register with the DI system. Overrides should use the same\n * InjectionToken as the original service with a higher priority.\n */\n overrides?: ClassType[] | Set<ClassType>;\n /**\n * Priority level for the module.\n * Higher priority modules will be loaded first.\n */\n priority?: number;\n /**\n * Registry to use for the module.\n * Registry is used to store the module and its commands.\n */\n registry?: Registry;\n}\n/**\n * Decorator that marks a class as a CLI module.\n *\n * This decorator extends the standard @Module decorator, adding support for\n * CLI commands while maintaining full compatibility with HTTP controllers.\n * Modules organize commands and can import other modules to compose larger\n * CLI applications.\n *\n * The module can optionally implement `NaviosModule` interface for lifecycle hooks.\n *\n * @param options - Configuration options for the module\n * @returns A class decorator function\n *\n * @example\n * ```typescript\n * import { CliModule } from '@navios/commander'\n * import { GreetCommand } from './greet.command'\n * import { UserModule } from './user.module'\n *\n * @CliModule({\n * commands: [GreetCommand],\n * imports: [UserModule]\n * })\n * export class AppModule {}\n * ```\n *\n * @example\n * ```typescript\n * // Mixed HTTP and CLI module\n * @CliModule({\n * controllers: [HealthController],\n * commands: [MigrateCommand],\n * imports: [DatabaseModule],\n * })\n * export class AppModule {}\n * ```\n */\nexport declare function CliModule({ commands, controllers, imports, guards, overrides, priority, registry, }?: CliModuleOptions): (target: ClassType, context: ClassDecoratorContext) => ClassType;\n//# sourceMappingURL=cli-module.decorator.d.mts.map"],"mappings":"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"}