@@ -46,62 +46,85 @@ jetkvm_control = "0.1.0"  # or use a git dependency / local path during developm
46463. **Running the Project** 
4747    After setting up your configuration, you can build and run the project with Cargo: 
4848     ```bash 
49-      cargo run 
49+      cargo run -- -H 192.168.1.100 lua-examples/windows-notepad-helloworld.lua  
5050     ``` 
5151
52-     This will compile the project and start  the demo application which:  
52+     This will compile the project and execute  the window-notepad-helloworld.lua example.  
5353   
54-         - Connects to the JetKVM service, 
55-         - Opens a WebRTC DataChannel, 
56-         - Sends RPC calls to perform actions (e.g., keyboard events, mouse clicks). 
54+ ## About the cmdline client 
5755
58- ## What's  the cmdline client look like 
56+ The client (cargo run/jetkvm_control) is a simple ping if you don't have  the `lua` feature enabled. 
5957
60- Right now  the client doesn't do anything put ping and display some additional debug .
58+ If you enable  the lua feature; jetkvm_control will expect a lua file to execute .
6159
6260``` 
6361A control client for JetKVM over WebRTC.
6462
65- Usage: jetkvm_control [ OPTIONS] 
63+ Usage: jetkvm_control [ OPTIONS]  <LUA_SCRIPT>
64+ 
65+ Arguments:
66+   <LUA_SCRIPT>  Path to the Lua script to execute
6667
6768Options:
6869  -H, --host <HOST >          The host address to connect to
6970  -p, --port <PORT >          The port number to use
7071  -a, --api <API >            The API endpoint
7172  -P, --password <PASSWORD >  The password for authentication
73+   -v, --verbose              Enable verbose logging (include logs from webrtc_sctp)
7274  -h, --help                 Print help
7375  -V, --version              Print version
7476``` 
7577
7678## What's the code look like 
7779
78-    ```rust 
79-     let config = JetKvmConfig::load()?; 
80-     let mut client = JetKvmRpcClient::new(config); 
81- 
82-     if let Err(err) = client.connect().await { 
83-         error!("Failed to connect to RPC server: {:?}", err); 
84-         std::process::exit(1); 
85-     } 
86-     // open notepad and say Hello World, copy and paste. 
87-     send_windows_key(&client).await.ok(); 
88-     sleep(Duration::from_millis(100)).await; 
89-     rpc_sendtext(&client, "notepad").await.ok(); 
90-     sleep(Duration::from_millis(100)).await; 
91-     send_return(&client).await.ok(); 
92-     sleep(Duration::from_millis(100)).await; 
93-     rpc_sendtext(&client, "Hello World").await.ok(); 
94-     sleep(Duration::from_millis(100)).await; 
95-     send_ctrl_a(&client).await.ok(); 
96-     sleep(Duration::from_millis(100)).await; 
97-     send_ctrl_x(&client).await.ok(); 
98-     sleep(Duration::from_millis(100)).await; 
99-     send_ctrl_v(&client).await.ok(); 
100-     sleep(Duration::from_millis(100)).await; 
101-     send_return(&client).await.ok(); 
102-     sleep(Duration::from_millis(100)).await; 
103-     send_ctrl_v(&client).await.ok(); 
104- ``` 
80+ The api is subject to change. 
81+ 
82+ example code for rust: 
83+ ```rust 
84+ let config = JetKvmConfig::load()?; 
85+ let mut client = JetKvmRpcClient::new(config); 
86+ 
87+ if let Err(err) = client.connect().await { 
88+     error!("Failed to connect to RPC server: {:?}", err); 
89+     std::process::exit(1); 
90+ } 
91+ // open notepad and say Hello World, copy and paste. 
92+ send_windows_key(&client).await.ok(); 
93+ sleep(Duration::from_millis(100)).await; 
94+ rpc_sendtext(&client, "notepad").await.ok(); 
95+ sleep(Duration::from_millis(100)).await; 
96+ send_return(&client).await.ok(); 
97+ sleep(Duration::from_millis(100)).await; 
98+ rpc_sendtext(&client, "Hello World").await.ok(); 
99+ sleep(Duration::from_millis(100)).await; 
100+ send_ctrl_a(&client).await.ok(); 
101+ sleep(Duration::from_millis(100)).await; 
102+ send_ctrl_x(&client).await.ok(); 
103+ sleep(Duration::from_millis(100)).await; 
104+ send_ctrl_v(&client).await.ok(); 
105+ sleep(Duration::from_millis(100)).await; 
106+ send_return(&client).await.ok(); 
107+ sleep(Duration::from_millis(100)).await; 
108+ send_ctrl_v(&client).await.ok(); 
109+ ``` 
110+ 
111+ example code in lua:
112+ ``` lua 
113+ print (" Executing Lua script..." 
114+ send_windows_key ()
115+ delay (550 )
116+ send_text (" notepad" 
117+ send_return ()
118+ delay (250 )
119+ delay (250 )
120+ send_text (" Hello World!" 
121+ send_ctrl_a ()
122+ send_ctrl_c ()
123+ delay (250 )
124+ send_ctrl_v ()
125+ delay (250 )
126+ send_ctrl_v ()
127+ ``` 
105128
106129Check out the examples folder for additional detail.
107130
@@ -135,9 +158,8 @@ JetKVM **relies heavily on WebRTC** for real-time communication, but we encounte
135158-  The Cargo.toml points to the patched https://github.com/davehorner/webrtc/tree/jetkvm_16_bit_patch 
136159
137160## Note  
138-   -  Password-based authentication is  functional.
161+   -  Password-less and Password- based local  authentication have been tested  functional.
139162  -  Cloud integration and ICE/STUN support are not implemented yet.
140-   -  Password-less authentication has not been tested.
141163  -  Contributions for these features are welcome!
142164
143165## License  
0 commit comments