@@ -15,12 +15,7 @@ import { Command } from 'commander';
1515import { studyList , studyStatus , studyValidate , studyStart } from './commands/study' ;
1616import { resultsShow , resultsExport } from './commands/results' ;
1717import { init } from './commands/init' ;
18- import { train } from './commands/train' ;
19- import {
20- coordinatorStartRound ,
21- coordinatorStatus ,
22- coordinatorAggregate ,
23- } from './commands/coordinator' ;
18+
2419import { causalCommand } from './commands/causal' ;
2520
2621const program = new Command ( ) ;
@@ -46,61 +41,7 @@ program
4641 . option ( '-i, --interactive' , 'Interactive mode' , false )
4742 . action ( init ) ;
4843
49- // ============================================================================
50- // TRAIN COMMAND (Sites - New file-based workflow)
51- // ============================================================================
5244
53- program
54- . command ( 'train' )
55- . description ( 'Train for one round (file-based)' )
56- . option ( '--study-id <id>' , 'Study identifier (required)' )
57- . option ( '--round <n>' , 'Round number (required)' )
58- . option ( '--site-id <id>' , 'Site identifier (required)' )
59- . option ( '--repo-path <path>' , 'Repository path' , process . cwd ( ) )
60- . option ( '--db-type <type>' , 'Database type (postgresql, sqlserver)' , 'postgresql' )
61- . option ( '--db-host <host>' , 'Database host' , 'localhost' )
62- . option ( '--db-port <port>' , 'Database port' )
63- . option ( '--db-name <name>' , 'Database name' )
64- . option ( '--db-user <user>' , 'Database user' )
65- . option ( '--db-password <password>' , 'Database password' )
66- . option ( '--encryption-key <key>' , 'Encryption key (hex)' )
67- . action ( train ) ;
68-
69- // ============================================================================
70- // COORDINATOR COMMANDS (New file-based workflow)
71- // ============================================================================
72-
73- const coordinatorCommand = program
74- . command ( 'coordinator' )
75- . description ( 'Coordinator commands (file-based)' ) ;
76-
77- coordinatorCommand
78- . command ( 'start-round' )
79- . description ( 'Start a new round' )
80- . option ( '--study-id <id>' , 'Study identifier (required)' )
81- . option ( '--round <n>' , 'Round number (required)' )
82- . option ( '--repo-path <path>' , 'Repository path' , process . cwd ( ) )
83- . action ( coordinatorStartRound ) ;
84-
85- coordinatorCommand
86- . command ( 'status' )
87- . description ( 'Check round status' )
88- . option ( '--study-id <id>' , 'Study identifier (required)' )
89- . option ( '--round <n>' , 'Round number (required)' )
90- . option ( '--repo-path <path>' , 'Repository path' , process . cwd ( ) )
91- . option ( '--format <format>' , 'Output format (table, json)' , 'table' )
92- . action ( coordinatorStatus ) ;
93-
94- coordinatorCommand
95- . command ( 'aggregate' )
96- . description ( 'Aggregate updates' )
97- . option ( '--study-id <id>' , 'Study identifier (required)' )
98- . option ( '--round <n>' , 'Round number (required)' )
99- . option ( '--repo-path <path>' , 'Repository path' , process . cwd ( ) )
100- . option ( '--min-participants <n>' , 'Minimum participants' , '2' )
101- . option ( '--strategy <strategy>' , 'Aggregation strategy (weighted, uniform)' , 'weighted' )
102- . option ( '--encryption-key <key>' , 'Encryption key (hex)' )
103- . action ( coordinatorAggregate ) ;
10445
10546// ============================================================================
10647// STUDY COMMANDS (Coordinators)
@@ -176,12 +117,7 @@ program.parse(process.argv);
176117if ( ! process . argv . slice ( 2 ) . length ) {
177118 console . log ( '🔬 Harmonia - Privacy-Preserving Federated Learning\n' ) ;
178119 program . outputHelp ( ) ;
179- console . log ( '\n✨ File-Based Workflow Commands:' ) ;
180- console . log ( ' harmonia init Initialize study (coordinator)' ) ;
181- console . log ( ' harmonia train Train for one round (sites)' ) ;
182- console . log ( ' harmonia coordinator start-round Start a round (coordinator)' ) ;
183- console . log ( ' harmonia coordinator status Check status (coordinator)' ) ;
184- console . log ( ' harmonia coordinator aggregate Aggregate updates (coordinator)' ) ;
120+
185121 console . log ( '\n🔬 Causal Inference Commands:' ) ;
186122 console . log ( ' harmonia causal generate-data Generate synthetic data' ) ;
187123 console . log ( ' harmonia causal compute-bounds Compute partial ID bounds' ) ;
@@ -195,8 +131,6 @@ if (!process.argv.slice(2).length) {
195131 console . log ( ' harmonia study start Start training from config' ) ;
196132 console . log ( ' harmonia results show View results' ) ;
197133 console . log ( '\nFor more help:' ) ;
198- console . log ( ' harmonia init --help' ) ;
199- console . log ( ' harmonia train --help' ) ;
200- console . log ( ' harmonia coordinator --help' ) ;
134+ console . log ( ' harmonia causal --help' ) ;
201135 console . log ( '\nDocumentation: https://github.com/watilde/Harmonia/docs/' ) ;
202136}
0 commit comments