@@ -6,7 +6,7 @@ import {BUILT_IN_ENVIRONMENTS, LLM_OUTPUT_DIR} from './configuration/constants.j
66import { UserFacingError } from './utils/errors.js' ;
77import { existsSync , rmSync } from 'fs' ;
88import { readFile , readdir } from 'fs/promises' ;
9- import { join } from 'path' ;
9+ import { join , resolve } from 'path' ;
1010import { glob } from 'tinyglobby' ;
1111import { LlmResponseFile } from './shared-interfaces.js' ;
1212import { setupProjectStructure , writeResponseFiles } from './orchestration/file-system.js' ;
@@ -26,6 +26,7 @@ export const RunModule = {
2626interface Options {
2727 environment : string ;
2828 prompt : string ;
29+ reportsDirectory ?: string ;
2930}
3031
3132function builder ( argv : Argv ) : Argv < Options > {
@@ -41,6 +42,11 @@ function builder(argv: Argv): Argv<Options> {
4142 default : '' ,
4243 description : 'ID of the prompt within the environment that should be run' ,
4344 } )
45+ . option ( 'reports-directory' , {
46+ type : 'string' ,
47+ description : 'Path from which to read local reports' ,
48+ demandOption : false ,
49+ } )
4450 . version ( false )
4551 . help ( ) ;
4652}
@@ -129,7 +135,7 @@ async function resolveConfig(options: Options) {
129135 BUILT_IN_ENVIRONMENTS . get ( options . environment ) || options . environment ,
130136 'genkit' ,
131137 ) ;
132- const environmentDir = join ( LLM_OUTPUT_DIR , environment . id ) ;
138+ const environmentDir = resolve ( options . reportsDirectory ?? LLM_OUTPUT_DIR , environment . id ) ;
133139
134140 if ( ! existsSync ( environmentDir ) ) {
135141 throw new UserFacingError (
0 commit comments