@@ -10,7 +10,6 @@ import type { SelectionChoice } from '../utils/selection-menu.js';
1010import { isModuleStep } from '../../workflows/templates/types.js' ;
1111import { resolvePackageRoot } from '../../shared/runtime/root.js' ;
1212import { getAllInstalledImports } from '../../shared/imports/index.js' ;
13- import { runInteractiveImport } from './import.command.js' ;
1413import { registerImportedAgents , clearImportedAgents } from '../../workflows/utils/config.js' ;
1514
1615const packageRoot = resolvePackageRoot ( import . meta. url , 'templates command' ) ;
@@ -176,6 +175,19 @@ export async function selectTemplateByNumber(templateNumber: number): Promise<vo
176175 }
177176}
178177
178+ export async function listTemplates ( ) : Promise < void > {
179+ const templates = await getAvailableTemplates ( ) ;
180+
181+ if ( templates . length === 0 ) {
182+ console . log ( 'No workflow templates found.' ) ;
183+ return ;
184+ }
185+
186+ for ( const t of templates ) {
187+ console . log ( t . title ) ;
188+ }
189+ }
190+
179191export async function runTemplatesCommand ( inSession : boolean = false ) : Promise < void > {
180192 try {
181193 const templates = await getAvailableTemplates ( ) ;
@@ -221,8 +233,13 @@ export async function runTemplatesCommand(inSession: boolean = false): Promise<v
221233}
222234
223235export function registerTemplatesCommand ( program : Command ) : void {
224- program
236+ const templates = program
225237 . command ( 'templates' )
226238 . description ( 'List and select workflow templates' )
227239 . action ( runTemplatesCommand ) ;
240+
241+ templates
242+ . command ( 'list' )
243+ . description ( 'List available template names' )
244+ . action ( listTemplates ) ;
228245}
0 commit comments