Apply Upstream code (2021-03-15)
[platform/upstream/connectedhomeip.git] / examples / shell / README.md
1 # CHIP Shell Reference
2
3 The `chip-shell` firmware exposes configuration and management APIs via a
4 command line interface (CLI). Use the shell CLI to experiment with CHIP
5 interactively, which can also be used with additional application code. The CHIP
6 functional test scripts use the shell CLI to execute test cases.
7
8 ## Separator and escaping characters
9
10 The whitespace character (`' '`) is used to delimit the command name and the
11 different arguments, together with tab (`'\t'`) and new line characters (`'\r'`,
12 `'\n'`).
13
14 Some arguments might require to accept whitespaces on them. For those cases the
15 backslash character (`'\'`) can be used to escape separators or the backslash
16 itself.
17
18 Example:
19
20 ```bash
21 > networkname Test\ Network
22 Done
23 > networkname
24 Test Network
25 Done
26 >
27 ```
28
29 ## CHIP Shell Command List
30
31 -   [base64](#base64-decode-b64_string)
32 -   [device](README_DEVICE.md)
33 -   [echo](#echo-string)
34 -   [exit](#exit)
35 -   [help](#help)
36 -   [otcli](README_OTCLI.md)
37 -   [ping](#ping)
38 -   [rand](#rand)
39 -   [version](#version)
40
41 ## CHIP Shell Command Details
42
43 ### help
44
45 Display a list of all top-level commands supported and a brief description.
46
47 ```bash
48 > help
49   echo            Echo back provided inputs
50   log             Logging utilities
51   rand            Random number utilities
52   base64          Base64 encode / decode utilities
53   device          Device Layer commands
54   otcli           Dispatch OpenThread CLI command
55   ping            Using Echo Protocol to measure packet loss across network paths
56   exit            Exit the shell application
57   help            List out all top level commands
58   version         Output the software version
59 Done
60 ```
61
62 ### base64 decode \<b64_string\>
63
64 Decode the given base64 string into hex.
65
66 ```bash
67 > base64 decode EjQ=
68 1234
69 Done
70 ```
71
72 ### base64 encode \<hex_string\>
73
74 Decode the given hex string into base64.
75
76 ```bash
77 > base64 encode 1234
78 EjQ=
79 Done
80 ```
81
82 ### echo \<string\>
83
84 Echo back the provided string to the terminal.
85
86 ```bash
87 > echo hello
88 hello
89 Done
90 ```
91
92 ### exit
93
94 Exit the shell terminal. On an embedded system this may trigger a watchdog
95 reset.
96
97 ```bash
98 > exit
99 Goodbye
100 ```
101
102 ### rand
103
104 Output a single byte random number.
105
106 ```bash
107 > rand
108 103
109 Done
110 ```
111
112 ### version
113
114 Output the version of the CHIP stack.
115
116 ```bash
117 > version
118 CHIP 0.0.g54591338-dirty
119 Done
120 ```