@pikku/cli 0.10.1 → 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.
- package/.pikku/channel/pikku-channel-types.gen.ts +4 -3
- package/.pikku/channel/pikku-channels-map.gen.d.ts +2 -2
- package/.pikku/channel/pikku-channels-meta.gen.ts +1 -1
- package/.pikku/channel/pikku-channels.gen.ts +1 -1
- package/.pikku/cli/pikku-cli-types.gen.ts +23 -1
- package/.pikku/cli/pikku-cli-wirings-meta.gen.ts +4 -115
- package/.pikku/cli/pikku-cli-wirings.gen.ts +2 -3
- package/.pikku/function/pikku-function-types.gen.ts +1 -1
- package/.pikku/function/pikku-functions-meta.gen.ts +156 -138
- package/.pikku/function/pikku-functions-meta.min.gen.ts +37 -32
- package/.pikku/function/pikku-functions.gen.ts +1 -1
- package/.pikku/http/pikku-http-types.gen.ts +1 -1
- package/.pikku/http/pikku-http-wirings-map.gen.d.ts +2 -2
- package/.pikku/http/pikku-http-wirings-meta.gen.ts +1 -1
- package/.pikku/http/pikku-http-wirings.gen.ts +1 -1
- package/.pikku/mcp/pikku-mcp-types.gen.ts +1 -1
- package/.pikku/mcp/pikku-mcp-wirings-meta.gen.ts +1 -1
- package/.pikku/mcp/pikku-mcp-wirings.gen.ts +1 -1
- package/.pikku/pikku-bootstrap.gen.ts +1 -1
- package/.pikku/pikku-services.gen.ts +16 -12
- package/.pikku/pikku-types.gen.ts +1 -1
- package/.pikku/pikku-websocket.gen.ts +15 -1
- package/.pikku/queue/pikku-queue-types.gen.ts +1 -1
- package/.pikku/queue/pikku-queue-workers-wirings-map.gen.d.ts +2 -2
- package/.pikku/queue/pikku-queue-workers-wirings-meta.gen.ts +1 -1
- package/.pikku/queue/pikku-queue-workers-wirings.gen.ts +1 -1
- package/.pikku/rpc/pikku-rpc-wirings-map.gen.d.ts +2 -2
- package/.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts +10 -9
- package/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.ts +9 -8
- package/.pikku/scheduler/pikku-scheduler-types.gen.ts +1 -1
- package/.pikku/scheduler/pikku-schedulers-wirings-meta.gen.ts +1 -1
- package/.pikku/scheduler/pikku-schedulers-wirings.gen.ts +1 -1
- package/.pikku/schemas/register.gen.ts +5 -5
- package/.pikku/schemas/schemas/PikkuCLIConfig.schema.json +1 -1
- package/.pikku/schemas/schemas/PikkuChannelsOutput.schema.json +1 -1
- package/.pikku/schemas/schemas/PikkuSchemasOutput.schema.json +1 -1
- package/CHANGELOG.md +49 -0
- package/bin/pikku.ts +30 -21
- package/cli.schema.json +1 -1
- package/dist/.pikku/channel/pikku-channel-types.gen.d.ts +4 -3
- package/dist/.pikku/channel/pikku-channel-types.gen.js +1 -1
- package/dist/.pikku/channel/pikku-channels-meta.gen.js +1 -1
- package/dist/.pikku/channel/pikku-channels.gen.d.ts +1 -1
- package/dist/.pikku/channel/pikku-channels.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli-types.gen.d.ts +18 -1
- package/dist/.pikku/cli/pikku-cli-types.gen.js +20 -1
- package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.js +4 -115
- package/dist/.pikku/cli/pikku-cli-wirings.gen.d.ts +1 -2
- package/dist/.pikku/cli/pikku-cli-wirings.gen.js +1 -2
- package/dist/.pikku/function/pikku-function-types.gen.d.ts +1 -1
- package/dist/.pikku/function/pikku-function-types.gen.js +1 -1
- package/dist/.pikku/function/pikku-functions-meta.gen.js +156 -138
- package/dist/.pikku/function/pikku-functions-meta.min.gen.js +37 -32
- package/dist/.pikku/function/pikku-functions.gen.js +1 -1
- package/dist/.pikku/http/pikku-http-types.gen.d.ts +1 -1
- package/dist/.pikku/http/pikku-http-types.gen.js +1 -1
- package/dist/.pikku/http/pikku-http-wirings-meta.gen.js +1 -1
- package/dist/.pikku/http/pikku-http-wirings.gen.d.ts +1 -1
- package/dist/.pikku/http/pikku-http-wirings.gen.js +1 -1
- package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts +1 -1
- package/dist/.pikku/mcp/pikku-mcp-types.gen.js +1 -1
- package/dist/.pikku/mcp/pikku-mcp-wirings-meta.gen.js +1 -1
- package/dist/.pikku/mcp/pikku-mcp-wirings.gen.d.ts +1 -1
- package/dist/.pikku/mcp/pikku-mcp-wirings.gen.js +1 -1
- package/dist/.pikku/pikku-bootstrap.gen.d.ts +1 -1
- package/dist/.pikku/pikku-bootstrap.gen.js +1 -1
- package/dist/.pikku/pikku-services.gen.d.ts +9 -6
- package/dist/.pikku/pikku-services.gen.js +8 -2
- package/dist/.pikku/pikku-types.gen.d.ts +1 -1
- package/dist/.pikku/pikku-types.gen.js +1 -1
- package/dist/.pikku/pikku-websocket.gen.d.ts +15 -1
- package/dist/.pikku/pikku-websocket.gen.js +15 -1
- package/dist/.pikku/queue/pikku-queue-types.gen.d.ts +1 -1
- package/dist/.pikku/queue/pikku-queue-types.gen.js +1 -1
- package/dist/.pikku/queue/pikku-queue-workers-wirings-meta.gen.js +1 -1
- package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.d.ts +1 -1
- package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.js +1 -1
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js +9 -8
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts +1 -1
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js +1 -1
- package/dist/.pikku/scheduler/pikku-schedulers-wirings-meta.gen.js +1 -1
- package/dist/.pikku/scheduler/pikku-schedulers-wirings.gen.d.ts +1 -1
- package/dist/.pikku/scheduler/pikku-schedulers-wirings.gen.js +1 -1
- package/dist/.pikku/schemas/register.gen.js +3 -3
- package/dist/.pikku/schemas/schemas/PikkuCLIConfig.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/PikkuChannelsOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/PikkuSchemasOutput.schema.json +1 -1
- package/dist/bin/pikku.js +24 -19
- package/dist/src/cli.wiring.js +107 -99
- package/dist/src/functions/commands/all.js +31 -2
- package/dist/src/functions/commands/bootstrap.d.ts +1 -0
- package/dist/src/functions/commands/bootstrap.js +23 -0
- package/dist/src/functions/runtimes/nextjs/serialize-nextjs-backend-wrapper.js +46 -2
- package/dist/src/functions/wirings/channels/serialize-channel-types.js +3 -2
- package/dist/src/functions/wirings/channels/serialize-websocket-wrapper.js +14 -0
- package/dist/src/functions/wirings/cli/pikku-command-cli-entry.js +4 -4
- package/dist/src/functions/wirings/cli/serialize-channel-cli-client.js +24 -4
- package/dist/src/functions/wirings/cli/serialize-channel-cli.js +32 -7
- package/dist/src/functions/wirings/cli/serialize-cli-types.js +22 -0
- package/dist/src/functions/wirings/functions/pikku-command-services.d.ts +1 -1
- package/dist/src/functions/wirings/functions/pikku-command-services.js +54 -26
- package/dist/src/functions/wirings/functions/schemas.js +2 -2
- package/dist/src/functions/wirings/http/pikku-command-openapi.js +1 -1
- package/dist/src/functions/wirings/middleware/pikku-command-middleware.js +3 -10
- package/dist/src/middleware/log-command-info-and-time.d.ts +1 -1
- package/dist/src/middleware/log-command-info-and-time.js +8 -5
- package/dist/src/services/cli-logger.service.d.ts +7 -2
- package/dist/src/services/cli-logger.service.js +16 -4
- package/dist/src/services.js +77 -12
- package/dist/src/utils/command-summary.d.ts +43 -0
- package/dist/src/utils/command-summary.js +73 -0
- package/dist/src/utils/file-writer.js +2 -2
- package/dist/src/utils/pikku-cli-config.js +28 -0
- package/dist/src/utils/schema-generator.d.ts +2 -2
- package/dist/src/utils/schema-generator.js +3 -3
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -4
- package/pikku.config.json +5 -2
- package/src/cli.wiring.ts +106 -101
- package/src/functions/commands/all.ts +38 -2
- package/src/functions/commands/bootstrap.ts +27 -0
- package/src/functions/runtimes/nextjs/serialize-nextjs-backend-wrapper.ts +46 -2
- package/src/functions/wirings/channels/serialize-channel-types.ts +3 -2
- package/src/functions/wirings/channels/serialize-websocket-wrapper.ts +14 -0
- package/src/functions/wirings/cli/pikku-command-cli-entry.ts +4 -4
- package/src/functions/wirings/cli/serialize-channel-cli-client.ts +24 -4
- package/src/functions/wirings/cli/serialize-channel-cli.ts +40 -8
- package/src/functions/wirings/cli/serialize-cli-types.ts +22 -0
- package/src/functions/wirings/functions/pikku-command-services.ts +57 -28
- package/src/functions/wirings/functions/schemas.ts +4 -3
- package/src/functions/wirings/http/pikku-command-openapi.ts +2 -1
- package/src/functions/wirings/middleware/pikku-command-middleware.ts +11 -22
- package/src/middleware/log-command-info-and-time.ts +8 -5
- package/src/services/cli-logger.service.ts +20 -5
- package/src/services.ts +86 -11
- package/src/utils/command-summary.ts +101 -0
- package/src/utils/file-writer.ts +2 -2
- package/src/utils/pikku-cli-config.ts +28 -0
- package/src/utils/schema-generator.ts +5 -4
- package/types/application-types.d.ts +5 -1
- package/types/config.d.ts +16 -6
- package/.pikku/cli/pikku-cli-channel.gen.ts +0 -34
- package/.pikku/cli/pikku-cli-client.gen.ts +0 -43
- package/.pikku/cli/pikku-cli.gen.ts +0 -41
- package/dist/.pikku/cli/pikku-cli-channel.gen.d.ts +0 -1
- package/dist/.pikku/cli/pikku-cli-channel.gen.js +0 -33
- package/dist/.pikku/cli/pikku-cli-client.gen.d.ts +0 -10
- package/dist/.pikku/cli/pikku-cli-client.gen.js +0 -34
- package/dist/.pikku/cli/pikku-cli.gen.d.ts +0 -10
- package/dist/.pikku/cli/pikku-cli.gen.js +0 -38
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: '
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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.1
|
|
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.1
|
|
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.1
|
|
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.1
|
|
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.1
|
|
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.1
|
|
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.1
|
|
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.1
|
|
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
|
-
}
|