@pikku/cli 0.10.0 → 0.10.2

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 (152) hide show
  1. package/.pikku/channel/pikku-channel-types.gen.ts +4 -3
  2. package/.pikku/channel/pikku-channels-map.gen.d.ts +2 -2
  3. package/.pikku/channel/pikku-channels-meta.gen.ts +1 -1
  4. package/.pikku/channel/pikku-channels.gen.ts +1 -1
  5. package/.pikku/cli/pikku-cli-types.gen.ts +23 -1
  6. package/.pikku/cli/pikku-cli-wirings-meta.gen.ts +4 -115
  7. package/.pikku/cli/pikku-cli-wirings.gen.ts +2 -3
  8. package/.pikku/function/pikku-function-types.gen.ts +1 -1
  9. package/.pikku/function/pikku-functions-meta.gen.ts +156 -138
  10. package/.pikku/function/pikku-functions-meta.min.gen.ts +37 -32
  11. package/.pikku/function/pikku-functions.gen.ts +1 -1
  12. package/.pikku/http/pikku-http-types.gen.ts +1 -1
  13. package/.pikku/http/pikku-http-wirings-map.gen.d.ts +2 -2
  14. package/.pikku/http/pikku-http-wirings-meta.gen.ts +1 -1
  15. package/.pikku/http/pikku-http-wirings.gen.ts +1 -1
  16. package/.pikku/mcp/pikku-mcp-types.gen.ts +1 -1
  17. package/.pikku/mcp/pikku-mcp-wirings-meta.gen.ts +1 -1
  18. package/.pikku/mcp/pikku-mcp-wirings.gen.ts +1 -1
  19. package/.pikku/pikku-bootstrap.gen.ts +1 -1
  20. package/.pikku/pikku-services.gen.ts +16 -12
  21. package/.pikku/pikku-types.gen.ts +1 -1
  22. package/.pikku/pikku-websocket.gen.ts +15 -1
  23. package/.pikku/queue/pikku-queue-types.gen.ts +1 -1
  24. package/.pikku/queue/pikku-queue-workers-wirings-map.gen.d.ts +2 -2
  25. package/.pikku/queue/pikku-queue-workers-wirings-meta.gen.ts +1 -1
  26. package/.pikku/queue/pikku-queue-workers-wirings.gen.ts +1 -1
  27. package/.pikku/rpc/pikku-rpc-wirings-map.gen.d.ts +2 -2
  28. package/.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts +10 -9
  29. package/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.ts +9 -8
  30. package/.pikku/scheduler/pikku-scheduler-types.gen.ts +1 -1
  31. package/.pikku/scheduler/pikku-schedulers-wirings-meta.gen.ts +1 -1
  32. package/.pikku/scheduler/pikku-schedulers-wirings.gen.ts +1 -1
  33. package/.pikku/schemas/register.gen.ts +5 -5
  34. package/.pikku/schemas/schemas/PikkuCLIConfig.schema.json +1 -1
  35. package/.pikku/schemas/schemas/PikkuChannelsOutput.schema.json +1 -1
  36. package/.pikku/schemas/schemas/PikkuSchemasOutput.schema.json +1 -1
  37. package/CHANGELOG.md +58 -0
  38. package/bin/pikku.ts +30 -21
  39. package/cli.schema.json +1 -1
  40. package/dist/.pikku/channel/pikku-channel-types.gen.d.ts +4 -3
  41. package/dist/.pikku/channel/pikku-channel-types.gen.js +1 -1
  42. package/dist/.pikku/channel/pikku-channels-meta.gen.js +1 -1
  43. package/dist/.pikku/channel/pikku-channels.gen.d.ts +1 -1
  44. package/dist/.pikku/channel/pikku-channels.gen.js +1 -1
  45. package/dist/.pikku/cli/pikku-cli-types.gen.d.ts +18 -1
  46. package/dist/.pikku/cli/pikku-cli-types.gen.js +20 -1
  47. package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.js +4 -115
  48. package/dist/.pikku/cli/pikku-cli-wirings.gen.d.ts +1 -2
  49. package/dist/.pikku/cli/pikku-cli-wirings.gen.js +1 -2
  50. package/dist/.pikku/function/pikku-function-types.gen.d.ts +1 -1
  51. package/dist/.pikku/function/pikku-function-types.gen.js +1 -1
  52. package/dist/.pikku/function/pikku-functions-meta.gen.js +156 -138
  53. package/dist/.pikku/function/pikku-functions-meta.min.gen.js +37 -32
  54. package/dist/.pikku/function/pikku-functions.gen.js +1 -1
  55. package/dist/.pikku/http/pikku-http-types.gen.d.ts +1 -1
  56. package/dist/.pikku/http/pikku-http-types.gen.js +1 -1
  57. package/dist/.pikku/http/pikku-http-wirings-meta.gen.js +1 -1
  58. package/dist/.pikku/http/pikku-http-wirings.gen.d.ts +1 -1
  59. package/dist/.pikku/http/pikku-http-wirings.gen.js +1 -1
  60. package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts +1 -1
  61. package/dist/.pikku/mcp/pikku-mcp-types.gen.js +1 -1
  62. package/dist/.pikku/mcp/pikku-mcp-wirings-meta.gen.js +1 -1
  63. package/dist/.pikku/mcp/pikku-mcp-wirings.gen.d.ts +1 -1
  64. package/dist/.pikku/mcp/pikku-mcp-wirings.gen.js +1 -1
  65. package/dist/.pikku/pikku-bootstrap.gen.d.ts +1 -1
  66. package/dist/.pikku/pikku-bootstrap.gen.js +1 -1
  67. package/dist/.pikku/pikku-services.gen.d.ts +9 -6
  68. package/dist/.pikku/pikku-services.gen.js +8 -2
  69. package/dist/.pikku/pikku-types.gen.d.ts +1 -1
  70. package/dist/.pikku/pikku-types.gen.js +1 -1
  71. package/dist/.pikku/pikku-websocket.gen.d.ts +15 -1
  72. package/dist/.pikku/pikku-websocket.gen.js +15 -1
  73. package/dist/.pikku/queue/pikku-queue-types.gen.d.ts +1 -1
  74. package/dist/.pikku/queue/pikku-queue-types.gen.js +1 -1
  75. package/dist/.pikku/queue/pikku-queue-workers-wirings-meta.gen.js +1 -1
  76. package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.d.ts +1 -1
  77. package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.js +1 -1
  78. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js +9 -8
  79. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts +1 -1
  80. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js +1 -1
  81. package/dist/.pikku/scheduler/pikku-schedulers-wirings-meta.gen.js +1 -1
  82. package/dist/.pikku/scheduler/pikku-schedulers-wirings.gen.d.ts +1 -1
  83. package/dist/.pikku/scheduler/pikku-schedulers-wirings.gen.js +1 -1
  84. package/dist/.pikku/schemas/register.gen.js +3 -3
  85. package/dist/.pikku/schemas/schemas/PikkuCLIConfig.schema.json +1 -1
  86. package/dist/.pikku/schemas/schemas/PikkuChannelsOutput.schema.json +1 -1
  87. package/dist/.pikku/schemas/schemas/PikkuSchemasOutput.schema.json +1 -1
  88. package/dist/bin/pikku.js +24 -19
  89. package/dist/src/cli.wiring.js +107 -99
  90. package/dist/src/functions/commands/all.js +31 -2
  91. package/dist/src/functions/commands/bootstrap.d.ts +1 -0
  92. package/dist/src/functions/commands/bootstrap.js +23 -0
  93. package/dist/src/functions/runtimes/nextjs/serialize-nextjs-backend-wrapper.js +46 -2
  94. package/dist/src/functions/wirings/channels/serialize-channel-types.js +3 -2
  95. package/dist/src/functions/wirings/channels/serialize-websocket-wrapper.js +14 -0
  96. package/dist/src/functions/wirings/cli/pikku-command-cli-entry.js +4 -4
  97. package/dist/src/functions/wirings/cli/serialize-channel-cli-client.js +24 -4
  98. package/dist/src/functions/wirings/cli/serialize-channel-cli.js +32 -7
  99. package/dist/src/functions/wirings/cli/serialize-cli-types.js +22 -0
  100. package/dist/src/functions/wirings/functions/pikku-command-services.d.ts +1 -1
  101. package/dist/src/functions/wirings/functions/pikku-command-services.js +54 -26
  102. package/dist/src/functions/wirings/functions/schemas.js +2 -2
  103. package/dist/src/functions/wirings/http/pikku-command-openapi.js +1 -1
  104. package/dist/src/functions/wirings/middleware/pikku-command-middleware.js +3 -10
  105. package/dist/src/middleware/log-command-info-and-time.d.ts +1 -1
  106. package/dist/src/middleware/log-command-info-and-time.js +8 -5
  107. package/dist/src/services/cli-logger.service.d.ts +7 -2
  108. package/dist/src/services/cli-logger.service.js +16 -4
  109. package/dist/src/services.js +77 -12
  110. package/dist/src/utils/check-required-types.js +11 -1
  111. package/dist/src/utils/command-summary.d.ts +43 -0
  112. package/dist/src/utils/command-summary.js +73 -0
  113. package/dist/src/utils/file-writer.js +2 -2
  114. package/dist/src/utils/pikku-cli-config.js +28 -0
  115. package/dist/src/utils/schema-generator.d.ts +2 -2
  116. package/dist/src/utils/schema-generator.js +3 -3
  117. package/dist/tsconfig.tsbuildinfo +1 -1
  118. package/package.json +3 -4
  119. package/pikku.config.json +5 -2
  120. package/src/cli.wiring.ts +106 -101
  121. package/src/functions/commands/all.ts +38 -2
  122. package/src/functions/commands/bootstrap.ts +27 -0
  123. package/src/functions/runtimes/nextjs/serialize-nextjs-backend-wrapper.ts +46 -2
  124. package/src/functions/wirings/channels/serialize-channel-types.ts +3 -2
  125. package/src/functions/wirings/channels/serialize-websocket-wrapper.ts +14 -0
  126. package/src/functions/wirings/cli/pikku-command-cli-entry.ts +4 -4
  127. package/src/functions/wirings/cli/serialize-channel-cli-client.ts +24 -4
  128. package/src/functions/wirings/cli/serialize-channel-cli.ts +40 -8
  129. package/src/functions/wirings/cli/serialize-cli-types.ts +22 -0
  130. package/src/functions/wirings/functions/pikku-command-services.ts +57 -28
  131. package/src/functions/wirings/functions/schemas.ts +4 -3
  132. package/src/functions/wirings/http/pikku-command-openapi.ts +2 -1
  133. package/src/functions/wirings/middleware/pikku-command-middleware.ts +11 -22
  134. package/src/middleware/log-command-info-and-time.ts +8 -5
  135. package/src/services/cli-logger.service.ts +20 -5
  136. package/src/services.ts +86 -11
  137. package/src/utils/check-required-types.ts +16 -1
  138. package/src/utils/command-summary.ts +101 -0
  139. package/src/utils/file-writer.ts +2 -2
  140. package/src/utils/pikku-cli-config.ts +28 -0
  141. package/src/utils/schema-generator.ts +5 -4
  142. package/types/application-types.d.ts +5 -1
  143. package/types/config.d.ts +16 -6
  144. package/.pikku/cli/pikku-cli-channel.gen.ts +0 -34
  145. package/.pikku/cli/pikku-cli-client.gen.ts +0 -43
  146. package/.pikku/cli/pikku-cli.gen.ts +0 -41
  147. package/dist/.pikku/cli/pikku-cli-channel.gen.d.ts +0 -1
  148. package/dist/.pikku/cli/pikku-cli-channel.gen.js +0 -33
  149. package/dist/.pikku/cli/pikku-cli-client.gen.d.ts +0 -10
  150. package/dist/.pikku/cli/pikku-cli-client.gen.js +0 -34
  151. package/dist/.pikku/cli/pikku-cli.gen.d.ts +0 -10
  152. package/dist/.pikku/cli/pikku-cli.gen.js +0 -38
@@ -15,7 +15,11 @@ export interface Config extends CoreConfig<PikkuCLIConfig> {
15
15
 
16
16
  export interface SingletonServices extends CoreSingletonServices<Config> {
17
17
  logger: CLILogger
18
- getInspectorState: (refresh?: boolean = false) => Promise<InspectorState>
18
+ getInspectorState: (
19
+ refresh?: boolean,
20
+ setupOnly?: boolean,
21
+ bootstrapMode?: boolean
22
+ ) => Promise<InspectorState>
19
23
  }
20
24
 
21
25
  export interface Services extends CoreServices<SingletonServices, {}> {}
package/types/config.d.ts CHANGED
@@ -78,8 +78,8 @@ export type PikkuCLIInput = {
78
78
 
79
79
  rootDir: string
80
80
  srcDirectories: string[]
81
+ ignoreFiles?: string[]
81
82
  packageMappings: Record<string, string>
82
- supportsImportAttributes: boolean
83
83
 
84
84
  configDir: string
85
85
  tsconfig: string
@@ -97,11 +97,16 @@ export type PikkuCLIInput = {
97
97
  additionalInfo: OpenAPISpecInfo
98
98
  }
99
99
 
100
+ schema?: {
101
+ additionalProperties?: boolean
102
+ supportsImportAttributes?: boolean
103
+ }
104
+
100
105
  cli?: {
101
106
  entrypoints?: Record<
102
107
  string,
103
108
  | string
104
- | { type: 'cli'; path: string }
109
+ | { type: 'local'; path: string }
105
110
  | {
106
111
  type: 'channel'
107
112
  name?: string
@@ -111,7 +116,7 @@ export type PikkuCLIInput = {
111
116
  }
112
117
  | Array<
113
118
  | string
114
- | { type: 'cli'; path: string }
119
+ | { type: 'local'; path: string }
115
120
  | {
116
121
  type: 'channel'
117
122
  name?: string
@@ -140,8 +145,8 @@ export type PikkuCLIConfig = {
140
145
 
141
146
  rootDir: string
142
147
  srcDirectories: string[]
148
+ ignoreFiles?: string[]
143
149
  packageMappings: Record<string, string>
144
- supportsImportAttributes: boolean
145
150
 
146
151
  configFile?: string
147
152
  tags?: string[]
@@ -167,11 +172,16 @@ export type PikkuCLIConfig = {
167
172
  additionalInfo: OpenAPISpecInfo
168
173
  }
169
174
 
175
+ schema?: {
176
+ additionalProperties?: boolean
177
+ supportsImportAttributes?: boolean
178
+ }
179
+
170
180
  cli?: {
171
181
  entrypoints?: Record<
172
182
  string,
173
183
  | string
174
- | { type: 'cli'; path: string }
184
+ | { type: 'local'; path: string }
175
185
  | {
176
186
  type: 'channel'
177
187
  name?: string
@@ -181,7 +191,7 @@ export type PikkuCLIConfig = {
181
191
  }
182
192
  | Array<
183
193
  | string
184
- | { type: 'cli'; path: string }
194
+ | { type: 'local'; path: string }
185
195
  | {
186
196
  type: 'channel'
187
197
  name?: string
@@ -1,34 +0,0 @@
1
- /**
2
- * This file was generated by @pikku/cli@0.10.0
3
- */
4
- /**
5
- * WebSocket channel backend for 'pikku' CLI commands
6
- */
7
- import { wireChannel } from '../channel/pikku-channel-types.gen.js'
8
- import { all } from '../../src/functions/commands/all.js'
9
- import { pikkuSchemas } from '../../src/functions/wirings/functions/schemas.js'
10
- import { pikkuFetch } from '../../src/functions/wirings/fetch/index.js'
11
- import { pikkuWebSocketTyped } from '../../src/functions/wirings/channels/pikku-command-websocket-typed.js'
12
- import { pikkuRPCClient } from '../../src/functions/wirings/rpc/pikku-command-rpc-client.js'
13
- import { pikkuQueueService } from '../../src/functions/wirings/queue/pikku-command-queue-service.js'
14
- import { pikkuOpenAPI } from '../../src/functions/wirings/http/pikku-command-openapi.js'
15
- import { pikkuNext } from '../../src/functions/runtimes/nextjs/pikku-command-nextjs.js'
16
-
17
- wireChannel({
18
- name: 'pikku-cli',
19
- route: '/cli/pikku',
20
- auth: false,
21
- onMessageWiring: {
22
- command: {
23
- 'all': all,
24
- 'schemas': pikkuSchemas,
25
- 'fetch': pikkuFetch,
26
- 'websocket': pikkuWebSocketTyped,
27
- 'rpc': pikkuRPCClient,
28
- 'queue-service': pikkuQueueService,
29
- 'openapi': pikkuOpenAPI,
30
- 'nextjs': pikkuNext
31
- }
32
- },
33
- tags: ['cli', 'pikku']
34
- })
@@ -1,43 +0,0 @@
1
- /**
2
- * This file was generated by @pikku/cli@0.10.0
3
- */
4
-
5
- import { executeCLIViaChannel } from '@pikku/core/cli/channel'
6
- import { CorePikkuWebsocket } from '@pikku/websocket'
7
- import '../pikku-bootstrap.gen.js'
8
- import { clientCLIRenderer } from '../../src/services.js'
9
-
10
- /**
11
- * Pikku CLI Client (via WebSocket Channel)
12
- * Executes CLI commands over a WebSocket connection
13
- */
14
- export async function PikkuCLIClient(
15
- url: string,
16
- args?: string[]
17
- ): Promise<void> {
18
- // Create WebSocket connection
19
- const pikkuWS = new CorePikkuWebsocket(url)
20
-
21
- // Register renderers for CLI commands
22
- const renderers = {}
23
-
24
- await executeCLIViaChannel({
25
- programName: 'pikku',
26
- pikkuWS,
27
- args,
28
- renderers,
29
- defaultRenderer: clientCLIRenderer,
30
- })
31
- }
32
-
33
- // Export as default for easy importing
34
- export default PikkuCLIClient
35
-
36
- // For direct execution (if this file is run directly)
37
- if (import.meta.url === `file://${process.argv[1]}`) {
38
- const url = process.env.PIKKU_WS_URL || 'ws://localhost:3000/cli/pikku'
39
- PikkuCLIClient(url, process.argv.slice(2)).catch(error => {
40
- console.error('Fatal error:', error.message)
41
- process.exit(1)
42
- })
43
- }
@@ -1,41 +0,0 @@
1
- /**
2
- * This file was generated by @pikku/cli@0.10.0
3
- */
4
-
5
- import { executeCLI, CLIError } from '@pikku/core/cli'
6
- import { createConfig as createConfig } from '../../src/services.js'
7
- import { createSingletonServices as createSingletonServices } from '../../src/services.js'
8
- import { createSessionServices as createSessionServices } from '../../src/services.js'
9
- import '../pikku-bootstrap.gen.js'
10
-
11
- /**
12
- * Pikku CLI function
13
- * Handles command line arguments and executes the appropriate function
14
- */
15
- export async function PikkuCLI(args: string[]): Promise<void> {
16
- try {
17
- await executeCLI({
18
- programName: 'pikku',
19
- args: args || process.argv.slice(2),
20
- createConfig,
21
- createSingletonServices,
22
- createSessionServices,
23
- })
24
- } catch (error) {
25
- if (error instanceof CLIError) {
26
- process.exit(error.exitCode)
27
- }
28
- throw error
29
- }
30
- }
31
-
32
- // Export as default for easy importing
33
- export default PikkuCLI
34
-
35
- // For direct execution (if this file is run directly)
36
- if (import.meta.url === `file://${process.argv[1]}`) {
37
- PikkuCLI(process.argv.slice(2)).catch(error => {
38
- console.error('Fatal error:', error.message)
39
- process.exit(1)
40
- })
41
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,33 +0,0 @@
1
- /**
2
- * This file was generated by @pikku/cli@0.10.0
3
- */
4
- /**
5
- * WebSocket channel backend for 'pikku' CLI commands
6
- */
7
- import { wireChannel } from '../channel/pikku-channel-types.gen.js';
8
- import { all } from '../../src/functions/commands/all.js';
9
- import { pikkuSchemas } from '../../src/functions/wirings/functions/schemas.js';
10
- import { pikkuFetch } from '../../src/functions/wirings/fetch/index.js';
11
- import { pikkuWebSocketTyped } from '../../src/functions/wirings/channels/pikku-command-websocket-typed.js';
12
- import { pikkuRPCClient } from '../../src/functions/wirings/rpc/pikku-command-rpc-client.js';
13
- import { pikkuQueueService } from '../../src/functions/wirings/queue/pikku-command-queue-service.js';
14
- import { pikkuOpenAPI } from '../../src/functions/wirings/http/pikku-command-openapi.js';
15
- import { pikkuNext } from '../../src/functions/runtimes/nextjs/pikku-command-nextjs.js';
16
- wireChannel({
17
- name: 'pikku-cli',
18
- route: '/cli/pikku',
19
- auth: false,
20
- onMessageWiring: {
21
- command: {
22
- 'all': all,
23
- 'schemas': pikkuSchemas,
24
- 'fetch': pikkuFetch,
25
- 'websocket': pikkuWebSocketTyped,
26
- 'rpc': pikkuRPCClient,
27
- 'queue-service': pikkuQueueService,
28
- 'openapi': pikkuOpenAPI,
29
- 'nextjs': pikkuNext
30
- }
31
- },
32
- tags: ['cli', 'pikku']
33
- });
@@ -1,10 +0,0 @@
1
- /**
2
- * This file was generated by @pikku/cli@0.10.0
3
- */
4
- import '../pikku-bootstrap.gen.js';
5
- /**
6
- * Pikku CLI Client (via WebSocket Channel)
7
- * Executes CLI commands over a WebSocket connection
8
- */
9
- export declare function PikkuCLIClient(url: string, args?: string[]): Promise<void>;
10
- export default PikkuCLIClient;
@@ -1,34 +0,0 @@
1
- /**
2
- * This file was generated by @pikku/cli@0.10.0
3
- */
4
- import { executeCLIViaChannel } from '@pikku/core/cli/channel';
5
- import { CorePikkuWebsocket } from '@pikku/websocket';
6
- import '../pikku-bootstrap.gen.js';
7
- import { clientCLIRenderer } from '../../src/services.js';
8
- /**
9
- * Pikku CLI Client (via WebSocket Channel)
10
- * Executes CLI commands over a WebSocket connection
11
- */
12
- export async function PikkuCLIClient(url, args) {
13
- // Create WebSocket connection
14
- const pikkuWS = new CorePikkuWebsocket(url);
15
- // Register renderers for CLI commands
16
- const renderers = {};
17
- await executeCLIViaChannel({
18
- programName: 'pikku',
19
- pikkuWS,
20
- args,
21
- renderers,
22
- defaultRenderer: clientCLIRenderer,
23
- });
24
- }
25
- // Export as default for easy importing
26
- export default PikkuCLIClient;
27
- // For direct execution (if this file is run directly)
28
- if (import.meta.url === `file://${process.argv[1]}`) {
29
- const url = process.env.PIKKU_WS_URL || 'ws://localhost:3000/cli/pikku';
30
- PikkuCLIClient(url, process.argv.slice(2)).catch(error => {
31
- console.error('Fatal error:', error.message);
32
- process.exit(1);
33
- });
34
- }
@@ -1,10 +0,0 @@
1
- /**
2
- * This file was generated by @pikku/cli@0.10.0
3
- */
4
- import '../pikku-bootstrap.gen.js';
5
- /**
6
- * Pikku CLI function
7
- * Handles command line arguments and executes the appropriate function
8
- */
9
- export declare function PikkuCLI(args: string[]): Promise<void>;
10
- export default PikkuCLI;
@@ -1,38 +0,0 @@
1
- /**
2
- * This file was generated by @pikku/cli@0.10.0
3
- */
4
- import { executeCLI, CLIError } from '@pikku/core/cli';
5
- import { createConfig as createConfig } from '../../src/services.js';
6
- import { createSingletonServices as createSingletonServices } from '../../src/services.js';
7
- import { createSessionServices as createSessionServices } from '../../src/services.js';
8
- import '../pikku-bootstrap.gen.js';
9
- /**
10
- * Pikku CLI function
11
- * Handles command line arguments and executes the appropriate function
12
- */
13
- export async function PikkuCLI(args) {
14
- try {
15
- await executeCLI({
16
- programName: 'pikku',
17
- args: args || process.argv.slice(2),
18
- createConfig,
19
- createSingletonServices,
20
- createSessionServices,
21
- });
22
- }
23
- catch (error) {
24
- if (error instanceof CLIError) {
25
- process.exit(error.exitCode);
26
- }
27
- throw error;
28
- }
29
- }
30
- // Export as default for easy importing
31
- export default PikkuCLI;
32
- // For direct execution (if this file is run directly)
33
- if (import.meta.url === `file://${process.argv[1]}`) {
34
- PikkuCLI(process.argv.slice(2)).catch(error => {
35
- console.error('Fatal error:', error.message);
36
- process.exit(1);
37
- });
38
- }