Skip to content

Commit 3bed945

Browse files
committed
docs(readme): Add detailed help command and interactive shell instructions
1 parent ae10007 commit 3bed945

File tree

2 files changed

+246
-1
lines changed

2 files changed

+246
-1
lines changed

README.md

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,128 @@ This library includes a powerful command-line interface (CLI) for interacting wi
166166
</tr>
167167
</table>
168168

169+
### Help Command
170+
171+
<details>
172+
<summary><b>1. Direct CLI</b></summary>
173+
174+
```bash
175+
usage: onvif [-h] --host HOST --port PORT [--username USERNAME] [--password PASSWORD] [--timeout TIMEOUT] [--https] [--no-verify] [--no-patch]
176+
[--interactive] [--debug] [--wsdl WSDL] [--cache {all,db,mem,none}]
177+
[service] [method] [params ...]
178+
179+
ONVIF Terminal Client —
180+
https://github.com/nirsimetri/onvif-python
181+
182+
positional arguments:
183+
service ONVIF service name (e.g., devicemgmt, media, ptz)
184+
method Service method name (e.g., GetCapabilities, GetProfiles)
185+
params Method parameters as Simple Parameter or JSON string
186+
187+
options:
188+
-h, --help show this help message and exit
189+
--host HOST, -H HOST ONVIF device IP address or hostname
190+
--port PORT, -P PORT ONVIF device port (default: 80)
191+
--username USERNAME, -u USERNAME
192+
Username for authentication
193+
--password PASSWORD, -p PASSWORD
194+
Password for authentication
195+
--timeout TIMEOUT Connection timeout in seconds (default: 10)
196+
--https Use HTTPS instead of HTTP
197+
--no-verify Disable SSL certificate verification
198+
--no-patch Disable ZeepPatcher
199+
--interactive, -i Start interactive mode
200+
--debug Enable debug mode with XML capture
201+
--wsdl WSDL Custom WSDL directory path
202+
--cache {all,db,mem,none}
203+
Caching mode for ONVIFClient (default: all). 'all': memory+disk, 'db': disk-only, 'mem': memory-only, 'none': disabled.
204+
205+
Examples:
206+
# Direct command execution
207+
onvif devicemgmt GetCapabilities Category=All --host 192.168.1.17 --port 8000 --username admin --password admin123
208+
onvif ptz ContinuousMove ProfileToken=Profile_1 Velocity={"PanTilt": {"x": -0.1, "y": 0}} --host 192.168.1.17 --port 8000 --username admin --password admin123
209+
210+
# Interactive mode
211+
onvif --host 192.168.1.17 --port 8000 --username admin --password admin123 --interactive
212+
213+
# Prompting for username and password
214+
# (if not provided)
215+
onvif -H 192.168.1.17 -P 8000 -i
216+
217+
# Using HTTPS
218+
onvif media GetProfiles --host camera.example.com --port 443 --username admin --password admin123 --https
219+
```
220+
221+
</details>
222+
223+
<details>
224+
<summary><b>2. Interactive Shell</b></summary>
225+
226+
```bash
227+
ONVIF Interactive Shell Commands -
228+
https://github.com/nirsimetri/onvif-python
229+
230+
Basic Commands:
231+
capabilities, caps - Show device capabilities
232+
services - Show available services with details
233+
info - Show connection and device information
234+
exit, quit - Exit the shell
235+
shortcuts - Show available shortcuts
236+
237+
Navigation Commands:
238+
<service> - Enter service mode (e.g., devicemgmt, media)
239+
cd <service> - Enter service mode (alias)
240+
ls - List commands/services/methods in grid format
241+
up - Exit current service mode (go up one level)
242+
pwd - Show current service context
243+
clear - Clear terminal screen
244+
desc <method> - Show method documentation in service mode
245+
246+
Method Execution:
247+
<method> - Execute method without parameters
248+
<method> {"param": "value"} - Execute method with JSON parameters
249+
<method> param=value - Execute method with simple parameters
250+
251+
Data Management:
252+
store <name> - Store last result with a name
253+
show <name> - Show stored data
254+
show <name>.attribute - Show specific attribute
255+
show - List all stored data
256+
rm <name> - Remove stored data by name
257+
cls - Clear all stored data
258+
259+
Using Stored Data in Methods:
260+
Use $variable syntax to reference stored data in method parameters:
261+
- $profiles[0].token - Access list element and attribute
262+
- $profiles[0].VideoSourceConfiguration.SourceToken
263+
264+
Example:
265+
GetProfiles - Get profiles
266+
store profiles - Store result
267+
show profiles[0].token - Show first profile token
268+
GetImagingSettings VideoSourceToken=$profiles[0].VideoSourceConfiguration.SourceToken
269+
270+
Debug Commands:
271+
debug - Show last SOAP request & response (if --debug enabled)
272+
273+
Tab Completion:
274+
Use TAB key for auto-completion of commands, services, and methods
275+
Type partial commands to see suggestions
276+
277+
Examples:
278+
192.168.1.17:8000 > caps # Show capabilities
279+
192.168.1.17:8000 > dev<TAB> # Completes to 'devicemgmt'
280+
192.168.1.17:8000 > cd devicemgmt # Enter device management
281+
192.168.1.17:8000/devicemgmt > Get<TAB> # Show methods starting with 'Get'
282+
192.168.1.17:8000/devicemgmt > GetServices {"IncludeCapability": true}
283+
192.168.1.17:8000/devicemgmt > GetServices IncludeCapability=True
284+
192.168.1.17:8000/devicemgmt > store services_info
285+
192.168.1.17:8000/devicemgmt > up # Exit service mode
286+
192.168.1.17:8000 > # Back to root context
287+
```
288+
289+
</details>
290+
169291
### Usage
170292

171293
**1. Interactive Mode**

README_ID.md

Lines changed: 124 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ Pustaka ini menyertakan antarmuka baris perintah (CLI) yang kuat untuk berintera
141141
- **Manajemen Data:** Simpan hasil dari perintah dan gunakan sebagai parameter dalam perintah berikutnya.
142142
- **Lintas Platform:** Bekerja di Windows, macOS, Linux, dan Raspberry Pi.
143143

144-
### Screenshoot
144+
### Tangkapan layar
145145

146146
<table>
147147
<tr>
@@ -166,6 +166,129 @@ Pustaka ini menyertakan antarmuka baris perintah (CLI) yang kuat untuk berintera
166166
</tr>
167167
</table>
168168

169+
### Perintah Bantuan
170+
171+
<details>
172+
<summary><b>1. CLI Langsung</b></summary>
173+
174+
```bash
175+
usage: onvif [-h] --host HOST --port PORT [--username USERNAME] [--password PASSWORD] [--timeout TIMEOUT] [--https] [--no-verify] [--no-patch]
176+
[--interactive] [--debug] [--wsdl WSDL] [--cache {all,db,mem,none}]
177+
[service] [method] [params ...]
178+
179+
ONVIF Terminal Client —
180+
https://github.com/nirsimetri/onvif-python
181+
182+
positional arguments:
183+
service ONVIF service name (e.g., devicemgmt, media, ptz)
184+
method Service method name (e.g., GetCapabilities, GetProfiles)
185+
params Method parameters as Simple Parameter or JSON string
186+
187+
options:
188+
-h, --help show this help message and exit
189+
--host HOST, -H HOST ONVIF device IP address or hostname
190+
--port PORT, -P PORT ONVIF device port (default: 80)
191+
--username USERNAME, -u USERNAME
192+
Username for authentication
193+
--password PASSWORD, -p PASSWORD
194+
Password for authentication
195+
--timeout TIMEOUT Connection timeout in seconds (default: 10)
196+
--https Use HTTPS instead of HTTP
197+
--no-verify Disable SSL certificate verification
198+
--no-patch Disable ZeepPatcher
199+
--interactive, -i Start interactive mode
200+
--debug Enable debug mode with XML capture
201+
--wsdl WSDL Custom WSDL directory path
202+
--cache {all,db,mem,none}
203+
Caching mode for ONVIFClient (default: all). 'all': memory+disk, 'db': disk-only, 'mem': memory-only, 'none': disabled.
204+
205+
Examples:
206+
# Direct command execution
207+
onvif devicemgmt GetCapabilities Category=All --host 192.168.1.17 --port 8000 --username admin --password admin123
208+
onvif ptz ContinuousMove ProfileToken=Profile_1 Velocity={"PanTilt": {"x": -0.1, "y": 0}} --host 192.168.1.17 --port 8000 --username admin --password admin123
209+
210+
# Interactive mode
211+
onvif --host 192.168.1.17 --port 8000 --username admin --password admin123 --interactive
212+
213+
# Prompting for username and password
214+
# (if not provided)
215+
onvif -H 192.168.1.17 -P 8000 -i
216+
217+
# Using HTTPS
218+
onvif media GetProfiles --host camera.example.com --port 443 --username admin --password admin123 --https
219+
```
220+
221+
</details>
222+
223+
<details>
224+
<summary><b>2. Shell Interaktif</b></summary>
225+
226+
227+
```bash
228+
ONVIF Interactive Shell Commands -
229+
https://github.com/nirsimetri/onvif-python
230+
231+
Basic Commands:
232+
capabilities, caps - Show device capabilities
233+
services - Show available services with details
234+
info - Show connection and device information
235+
exit, quit - Exit the shell
236+
shortcuts - Show available shortcuts
237+
238+
Navigation Commands:
239+
<service> - Enter service mode (e.g., devicemgmt, media)
240+
cd <service> - Enter service mode (alias)
241+
ls - List commands/services/methods in grid format
242+
up - Exit current service mode (go up one level)
243+
pwd - Show current service context
244+
clear - Clear terminal screen
245+
desc <method> - Show method documentation in service mode
246+
247+
Method Execution:
248+
<method> - Execute method without parameters
249+
<method> {"param": "value"} - Execute method with JSON parameters
250+
<method> param=value - Execute method with simple parameters
251+
252+
Data Management:
253+
store <name> - Store last result with a name
254+
show <name> - Show stored data
255+
show <name>.attribute - Show specific attribute
256+
show - List all stored data
257+
rm <name> - Remove stored data by name
258+
cls - Clear all stored data
259+
260+
Using Stored Data in Methods:
261+
Use $variable syntax to reference stored data in method parameters:
262+
- $profiles[0].token - Access list element and attribute
263+
- $profiles[0].VideoSourceConfiguration.SourceToken
264+
265+
Example:
266+
GetProfiles - Get profiles
267+
store profiles - Store result
268+
show profiles[0].token - Show first profile token
269+
GetImagingSettings VideoSourceToken=$profiles[0].VideoSourceConfiguration.SourceToken
270+
271+
Debug Commands:
272+
debug - Show last SOAP request & response (if --debug enabled)
273+
274+
Tab Completion:
275+
Use TAB key for auto-completion of commands, services, and methods
276+
Type partial commands to see suggestions
277+
278+
Examples:
279+
192.168.1.17:8000 > caps # Show capabilities
280+
192.168.1.17:8000 > dev<TAB> # Completes to 'devicemgmt'
281+
192.168.1.17:8000 > cd devicemgmt # Enter device management
282+
192.168.1.17:8000/devicemgmt > Get<TAB> # Show methods starting with 'Get'
283+
192.168.1.17:8000/devicemgmt > GetServices {"IncludeCapability": true}
284+
192.168.1.17:8000/devicemgmt > GetServices IncludeCapability=True
285+
192.168.1.17:8000/devicemgmt > store services_info
286+
192.168.1.17:8000/devicemgmt > up # Exit service mode
287+
192.168.1.17:8000 > # Back to root context
288+
```
289+
290+
</details>
291+
169292
### Penggunaan
170293

171294
**1. Mode Interaktif**

0 commit comments

Comments
 (0)