@@ -137,11 +137,11 @@ export function discoverCommands(
137137 *
138138 * Handles:
139139 * - Module resolution (local .commando/ or npm package)
140- * - Symlink rewriting for correct forge instance
140+ * - Symlink rewriting for correct commando instance
141141 * - Command discovery via discoverCommands()
142142 *
143143 * @param modulePath - Module path (relative, absolute, or package name)
144- * @param commandoDir - Forge directory for resolution
144+ * @param commandoDir - Commando directory for resolution
145145 * @returns Object with groupName, description, and discovered commands
146146 */
147147export async function loadModule (
@@ -160,7 +160,7 @@ export async function loadModule(
160160 log . debug ( { durationMs : resolveDuration , fullPath } , 'Module path resolved' ) ;
161161
162162 // Rewrite path to go through symlink in node_modules
163- // This ensures user commands import forge from the correct instance
163+ // This ensures user commands import commando from the correct instance
164164 // Requires bun --preserve-symlinks
165165 const symlinkStart = Date . now ( ) ;
166166 const symlinkPath = await rewriteModulePath ( fullPath , commandoDir ) ;
@@ -190,9 +190,9 @@ export async function loadModule(
190190// ============================================================================
191191
192192/**
193- * Main forge runner
193+ * Main commando runner
194194 */
195- export class Forge {
195+ export class Commando {
196196 public config : CommandoConfig ; // Public so commands can access
197197 private log : Logger ;
198198
@@ -209,7 +209,7 @@ export class Forge {
209209 public globalOptions : Record < string , any > ;
210210
211211 constructor ( config : CommandoConfig ) {
212- this . log = createLogger ( 'forge ' ) ;
212+ this . log = createLogger ( 'commando ' ) ;
213213 this . log . debug ( { config } ) ;
214214
215215 this . config = config ;
@@ -264,7 +264,7 @@ export class Forge {
264264 }
265265
266266 /**
267- * Initialize Forge instance
267+ * Initialize Commando instance
268268 *
269269 * Handles:
270270 * - Loading builtin commands (always)
@@ -275,7 +275,7 @@ export class Forge {
275275 * @throws ExitNotification if restart needed after dependency installation
276276 */
277277 async initialize ( ) : Promise < void > {
278- log . debug ( 'Starting Forge initialization' ) ;
278+ log . debug ( 'Starting Commando initialization' ) ;
279279
280280 // 1. Always load builtins (available everywhere)
281281 log . debug ( 'Phase 1: Loading builtins' ) ;
@@ -372,12 +372,12 @@ export class Forge {
372372 const groupDetails = Object . fromEntries (
373373 Object . entries ( this . commandGroups ) . map ( ( [ group , data ] ) => [ group , Object . keys ( data . commands ) ] )
374374 ) ;
375- log . debug ( { topLevel, groups, groupDetails } , 'Forge initialization complete' ) ;
375+ log . debug ( { topLevel, groups, groupDetails } , 'Commando initialization complete' ) ;
376376 }
377377
378378 /**
379379 * Register all discovered commands with Commander program
380- * This is the bridge between Forge and Commander
380+ * This is the bridge between Commando and Commander
381381 */
382382 async registerCommands ( program : Command ) : Promise < void > {
383383 log . debug (
@@ -386,8 +386,8 @@ export class Forge {
386386 ) ;
387387
388388 // Register top-level commands first
389- for ( const [ cmdName , forgeCmd ] of Object . entries ( this . topLevelCommands ) ) {
390- const cmd = this . buildCommanderCommand ( cmdName , forgeCmd ) ;
389+ for ( const [ cmdName , commandoCmd ] of Object . entries ( this . topLevelCommands ) ) {
390+ const cmd = this . buildCommanderCommand ( cmdName , commandoCmd ) ;
391391 cmd . copyInheritedSettings ( program ) ; // Copy inherited settings from program
392392 program . addCommand ( cmd ) ;
393393 log . debug ( { cmdName } , 'Registered top-level command' ) ;
@@ -405,8 +405,8 @@ export class Forge {
405405 }
406406
407407 // Add each command to the group
408- for ( const [ cmdName , forgeCmd ] of Object . entries ( group . commands ) ) {
409- const cmd = this . buildCommanderCommand ( cmdName , forgeCmd , groupName ) ;
408+ for ( const [ cmdName , commandoCmd ] of Object . entries ( group . commands ) ) {
409+ const cmd = this . buildCommanderCommand ( cmdName , commandoCmd , groupName ) ;
410410 cmd . copyInheritedSettings ( groupCmd ) ; // Copy from group command
411411 groupCmd . addCommand ( cmd ) ;
412412 }
@@ -420,25 +420,25 @@ export class Forge {
420420
421421 /**
422422 * Build a Commander Command from a CommandoCommand definition
423- * Internal method - bridges Forge commands to Commander
423+ * Internal method - bridges Commando commands to Commander
424424 */
425425 private buildCommanderCommand (
426426 name : string ,
427- forgeCmd : CommandoCommand ,
427+ commandoCmd : CommandoCommand ,
428428 groupName ?: string
429429 ) : Command {
430430 // 1. Create Commander Command
431431 const cmd = new Command ( name ) ;
432- cmd . description ( forgeCmd . description ) ;
432+ cmd . description ( commandoCmd . description ) ;
433433
434434 // 2. Let command customize Commander Command (if defined)
435- if ( forgeCmd . defineCommand ) {
436- forgeCmd . defineCommand ( cmd ) ;
435+ if ( commandoCmd . defineCommand ) {
436+ commandoCmd . defineCommand ( cmd ) ;
437437 } else {
438438 // No defineCommand - use simple model: usage string + allowUnknown
439- if ( forgeCmd . usage ) {
439+ if ( commandoCmd . usage ) {
440440 // Add usage as argument definition (e.g., '<text...>' or '[options]')
441- cmd . argument ( forgeCmd . usage , '' ) ;
441+ cmd . argument ( commandoCmd . usage , '' ) ;
442442 } else {
443443 // No usage specified - allow any arguments
444444 cmd . allowUnknownOption ( true ) ;
@@ -476,7 +476,7 @@ export class Forge {
476476 } ;
477477
478478 try {
479- await forgeCmd . execute ( options , positionalArgs , context ) ;
479+ await commandoCmd . execute ( options , positionalArgs , context ) ;
480480 } catch ( err ) {
481481 die ( `Command failed: ${ name } \n${ err } ` ) ;
482482 }
0 commit comments