@@ -29,7 +29,7 @@ const packageDirs = [
2929 "packages/sdk-angular" ,
3030] ;
3131
32- const options = parseArgs ( process . argv . slice ( 2 ) ) ;
32+ const options = parseArgsOrExit ( process . argv . slice ( 2 ) ) ;
3333const workDir = resolve (
3434 options . workDir || ( await mkdtemp ( join ( tmpdir ( ) , "zitadel-cli-journey-local-" ) ) ) ,
3535) ;
@@ -150,7 +150,7 @@ try {
150150} catch ( error ) {
151151 await collectDiagnostics ( ) ;
152152 console . error ( "" ) ;
153- console . error ( `[journey-local] failed: ${ error . message } ` ) ;
153+ console . error ( `[journey-local] failed: ${ errorMessage ( error ) } ` ) ;
154154 console . error ( `[journey-local] diagnostics preserved in ${ workDir } ` ) ;
155155 process . exitCode = 1 ;
156156} finally {
@@ -164,6 +164,15 @@ try {
164164
165165process . exit ( process . exitCode ?? 0 ) ;
166166
167+ function parseArgsOrExit ( args ) {
168+ try {
169+ return parseArgs ( args ) ;
170+ } catch ( error ) {
171+ console . error ( `[journey-local] ${ errorMessage ( error ) } ` ) ;
172+ process . exit ( 1 ) ;
173+ }
174+ }
175+
167176function parseArgs ( args ) {
168177 const parsed = {
169178 image : "" ,
@@ -175,11 +184,14 @@ function parseArgs(args) {
175184 const arg = args [ index ] ;
176185 switch ( arg ) {
177186 case "--backend" : {
178- const backend = readValue ( args , ++ index , arg ) ;
179- if ( ! [ "source" , "image" ] . includes ( backend ) ) {
180- throw new Error ( `--backend must be "source" or "image", got ${ backend } ` ) ;
181- }
182- break ;
187+ readValue ( args , ++ index , arg ) ;
188+ throw new Error (
189+ [
190+ "--backend was removed from the journey runner." ,
191+ "The journey now always exercises `npx @zitadel/cli@alpha start`." ,
192+ "Remove `--backend`, or pass `--image <docker-tag>` / set ZITADEL_LOCAL_IMAGE to choose the local runtime image." ,
193+ ] . join ( " " ) ,
194+ ) ;
183195 }
184196 case "--image" : {
185197 parsed . image = readValue ( args , ++ index , arg ) ;
@@ -501,7 +513,7 @@ function runCapture(command, args, optionsForRun = {}) {
501513}
502514
503515function commandErrorDetail ( error ) {
504- const message = error instanceof Error ? error . message : String ( error ) ;
516+ const message = errorMessage ( error ) ;
505517 const lines = message
506518 . split ( / \r ? \n / )
507519 . map ( ( line ) => line . trim ( ) )
@@ -541,7 +553,7 @@ async function collectDiagnostics() {
541553 ) ;
542554 await writeFile ( composeLogPath , `${ result . stdout } ${ result . stderr } ` ) ;
543555 } catch ( error ) {
544- await writeFile ( composeLogPath , `failed to collect compose logs: ${ error . message } \n` ) ;
556+ await writeFile ( composeLogPath , `failed to collect compose logs: ${ errorMessage ( error ) } \n` ) ;
545557 }
546558 }
547559
@@ -594,7 +606,7 @@ async function collectLocalRuntimeLogs() {
594606 } catch ( error ) {
595607 await writeFile (
596608 join ( diagnosticsDir , "logs.stderr.log" ) ,
597- `failed to collect local runtime logs: ${ error . message } \n` ,
609+ `failed to collect local runtime logs: ${ errorMessage ( error ) } \n` ,
598610 ) ;
599611 }
600612}
@@ -623,7 +635,7 @@ async function cleanup() {
623635 try {
624636 await run ( "docker" , composeArgs ( [ "down" , "-v" , "--remove-orphans" ] ) ) ;
625637 } catch ( error ) {
626- console . error ( `[journey-local] docker compose cleanup failed: ${ error . message } ` ) ;
638+ console . error ( `[journey-local] docker compose cleanup failed: ${ errorMessage ( error ) } ` ) ;
627639 }
628640 }
629641}
@@ -636,7 +648,7 @@ async function resetLocalRuntime() {
636648 { cwd : appDir , env : npxEnv ( ) } ,
637649 ) ;
638650 } catch ( error ) {
639- console . error ( `[journey-local] local runtime reset failed: ${ error . message } ` ) ;
651+ console . error ( `[journey-local] local runtime reset failed: ${ errorMessage ( error ) } ` ) ;
640652 }
641653}
642654
@@ -702,3 +714,7 @@ function npxEnv() {
702714function log ( message ) {
703715 console . log ( `[journey-local] ${ message } ` ) ;
704716}
717+
718+ function errorMessage ( error ) {
719+ return error instanceof Error ? error . message : String ( error ) ;
720+ }
0 commit comments