@@ -8,13 +8,41 @@ use consensusmind::knowledge::embedding::{
88 build_or_update_index_from_metadata, HashingEmbedder , VectorIndex ,
99} ;
1010use consensusmind:: knowledge:: paper_parser:: PdfParser ;
11- use consensusmind:: llm:: LlmClient ;
1211use consensusmind:: utils:: { config:: Config , logger} ;
1312use tracing:: info;
1413
14+ fn print_usage ( ) {
15+ println ! ( "ConsensusMind" ) ;
16+ println ! ( ) ;
17+ println ! ( "Usage:" ) ;
18+ println ! ( " consensusmind run \" <query>\" " ) ;
19+ println ! ( " consensusmind hypothesize \" <query>\" " ) ;
20+ println ! ( " consensusmind experiment <hypothesis-id> [--seeds N] [--ticks T] [--nodes N]" ) ;
21+ println ! ( " consensusmind paper <hypothesis-id>" ) ;
22+ println ! ( " consensusmind index" ) ;
23+ println ! ( " consensusmind semantic-search \" <query>\" [top_k]" ) ;
24+ println ! ( " consensusmind simulate [rounds] [leader_failure_prob] [seed]" ) ;
25+ println ! ( " consensusmind raft-simulate [nodes] [ticks] [seed]" ) ;
26+ println ! ( " consensusmind help" ) ;
27+ println ! ( " consensusmind --version" ) ;
28+ }
29+
1530#[ tokio:: main]
1631async fn main ( ) -> Result < ( ) > {
1732 let args: Vec < String > = std:: env:: args ( ) . collect ( ) ;
33+
34+ if args. get ( 1 ) . map ( |s| s. as_str ( ) ) == Some ( "--version" ) {
35+ println ! ( "consensusmind {}" , env!( "CARGO_PKG_VERSION" ) ) ;
36+ return Ok ( ( ) ) ;
37+ }
38+ if matches ! (
39+ args. get( 1 ) . map( |s| s. as_str( ) ) ,
40+ None | Some ( "help" ) | Some ( "--help" ) | Some ( "-h" )
41+ ) {
42+ print_usage ( ) ;
43+ return Ok ( ( ) ) ;
44+ }
45+
1846 let config = Config :: load ( ) ?;
1947
2048 logger:: init_with_file ( & config. logging . file , & config. logging . level ) ?;
@@ -216,17 +244,9 @@ async fn main() -> Result<()> {
216244 ) ;
217245 return Ok ( ( ) ) ;
218246 }
219- _ => { }
247+ _ => {
248+ print_usage ( ) ;
249+ return Ok ( ( ) ) ;
250+ }
220251 }
221-
222- let _client = LlmClient :: new (
223- config. llm . endpoint . clone ( ) ,
224- config. llm . api_key . clone ( ) ,
225- config. llm . model . clone ( ) ,
226- ) ?;
227-
228- info ! ( "LLM client initialized successfully" ) ;
229- info ! ( "System ready" ) ;
230-
231- Ok ( ( ) )
232252}
0 commit comments