Skip to content

Commit 79556f2

Browse files
Update CLI docs (#322)
* Update CLI docs * fix md error * typo * minor edit
1 parent 212b7c1 commit 79556f2

File tree

9 files changed

+170
-143
lines changed

9 files changed

+170
-143
lines changed

docs/Reference/CLI/CLI-Syntax.md

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,40 +4,50 @@ description: Teku command line interface reference
44

55
# Teku command line
66

7-
This reference describes the syntax of the Teku Command Line Interface (CLI) options and subcommands.
7+
This reference describes the syntax of the Teku command line interface (CLI) options.
88

99
!!! important
10-
The command line interface options are currently under development and may change.
10+
11+
The CLI options are currently under development and may change.
1112

1213
## Specifying options
1314

14-
Teku options can be specified:
15+
You can specify Teku options:
16+
17+
* On the command line.
18+
19+
```bash
20+
teku [OPTIONS] [COMMAND]
21+
```
22+
23+
* As an environment variable.
24+
For each command line option, the equivalent environment variable is:
25+
26+
* Uppercase.
27+
* `-` is replaced by `_`.
28+
* Has a `TEKU_` prefix.
1529

16-
* On the command line
17-
* As an [environment variable](#teku-environment-variables)
1830
* In a [YAML configuration file](../../HowTo/Configure/Use-Configuration-File.md).
1931

2032
If an option is specified in multiple places, the order of priority is command line, environment variable,
2133
configuration file.
2234

23-
### Teku environment variables
24-
25-
For each command line option, the equivalent environment variable is:
35+
## Using autocomplete
2636

27-
* Upper-case
28-
* `-` is replaced by `_`
29-
* Has a `TEKU_` prefix
37+
If using Bash or Z shell, you can enable autocomplete support by navigating to the `build` folder and running:
3038

31-
For example, set `--p2p-port` using the `TEKU_P2P_PORT` environment variable.
32-
33-
## Options
39+
```bash
40+
source teku.autocomplete.sh
41+
```
3442

35-
To start a Teku beacon chain client and validator run:
43+
Autocomplete allows you to view option suggestions by entering `--` and pressing the Tab key twice.
3644

3745
```bash
38-
teku [OPTIONS] [COMMAND]
46+
teku --Tab+Tab
3947
```
4048

49+
## Options
50+
4151
### config-file
4252

4353
=== "Syntax"

docs/Reference/CLI/Subcommands/Admin.md

Lines changed: 17 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,7 @@ title: Subcommand options
44

55
# `admin`
66

7-
Used to perform administrative tasks. To use the `admin` subcommand run:
8-
9-
```bash
10-
teku admin [subcommand] [subcommand] [options]
11-
```
12-
13-
You can also supply the subcommand options using [environment variables or a configuration file].
7+
Used to perform administrative tasks.
148

159
## `weak-subjectivity`
1610

@@ -20,7 +14,7 @@ Display or clear weak subjectivity configuration.
2014

2115
Clears the stored weak subjectivity configuration.
2216

23-
#### config-file
17+
#### `config-file`
2418

2519
=== "Syntax"
2620

@@ -43,7 +37,7 @@ Clears the stored weak subjectivity configuration.
4337
Path to the YAML configuration file.
4438
The default is `none`.
4539

46-
#### data-base-path, data-path
40+
#### `data-base-path`, `data-path`
4741

4842
=== "Syntax"
4943

@@ -77,7 +71,7 @@ Path to the Teku data directory. The default directory is OS-dependent:
7771

7872
The default Docker image location is `/root/.local/share/teku`.
7973

80-
#### data-beacon-path
74+
#### `data-beacon-path`
8175

8276
=== "Syntax"
8377

@@ -106,7 +100,7 @@ The default Docker image location is `/root/.local/share/teku`.
106100
Path to the beacon chain client data. The default is `<data-base-path>/beacon` where `<data-base-path>`
107101
is specified using [`--data-base-path`](#data-base-path-data-path).
108102

109-
#### data-storage-archive-frequency
103+
#### `data-storage-archive-frequency`
110104

111105
=== "Syntax"
112106

@@ -147,7 +141,7 @@ This option is ignored if [`--data-storage-mode`](#data-storage-mode) is set to
147141
`--data-storage-archive-frequency=2048` uses less disk space, but may need to regenerate the
148142
state because every 2048th slot state is saved.
149143

150-
#### data-storage-mode
144+
#### `data-storage-mode`
151145

152146
=== "Syntax"
153147

@@ -176,7 +170,7 @@ This option is ignored if [`--data-storage-mode`](#data-storage-mode) is set to
176170
Set the strategy for handling historical chain data. Valid options are `prune` and `archive`.
177171
The default is `prune`.
178172

179-
#### data-validator-path
173+
#### `data-validator-path`
180174

181175
=== "Syntax"
182176

@@ -205,7 +199,7 @@ The default is `prune`.
205199
Path to the validator client data. The default is `<data-base-path>/validator` where `<data-base-path>`
206200
is specified using [`--data-base-path`](#data-base-path-data-path).
207201

208-
#### eth1-deposit-contract-address
202+
#### `eth1-deposit-contract-address`
209203

210204
=== "Syntax"
211205

@@ -233,7 +227,7 @@ is specified using [`--data-base-path`](#data-base-path-data-path).
233227

234228
Ethereum 1.0 address of the deposit contract. Only required when creating a custom network.
235229

236-
#### network
230+
#### `network`
237231

238232
=== "Syntax"
239233

@@ -278,7 +272,7 @@ bootnodes, and the address of the Ethereum 1.0 deposit contract.
278272

279273
Displays the stored weak subjectivity configuration.
280274

281-
#### config-file
275+
#### `config-file`
282276

283277
=== "Syntax"
284278

@@ -301,7 +295,7 @@ Displays the stored weak subjectivity configuration.
301295
Path to the YAML configuration file.
302296
The default is `none`.
303297

304-
#### data-base-path, data-path
298+
#### `data-base-path`, `data-path`
305299

306300
=== "Syntax"
307301

@@ -335,7 +329,7 @@ Path to the Teku data directory. The default directory is OS-dependent:
335329

336330
The default Docker image location is `/root/.local/share/teku`.
337331

338-
#### data-beacon-path
332+
#### `data-beacon-path`
339333

340334
=== "Syntax"
341335

@@ -364,7 +358,7 @@ The default Docker image location is `/root/.local/share/teku`.
364358
Path to the beacon chain client data. The default is `<data-base-path>/beacon` where `<data-base-path>`
365359
is specified using [`--data-base-path`](#data-base-path-data-path).
366360

367-
#### data-storage-archive-frequency
361+
#### `data-storage-archive-frequency`
368362

369363
=== "Syntax"
370364

@@ -405,7 +399,7 @@ This option is ignored if [`--data-storage-mode`](#data-storage-mode) is set to
405399
`--data-storage-archive-frequency=2048` uses less disk space, but may need to regenerate the
406400
state because every 2048th slot state is saved.
407401

408-
#### data-storage-mode
402+
#### `data-storage-mode`
409403

410404
=== "Syntax"
411405

@@ -434,7 +428,7 @@ This option is ignored if [`--data-storage-mode`](#data-storage-mode) is set to
434428
Set the strategy for handling historical chain data. Valid options are `prune` and `archive`.
435429
The default is `prune`.
436430

437-
#### data-validator-path
431+
#### `data-validator-path`
438432

439433
=== "Syntax"
440434

@@ -463,7 +457,7 @@ The default is `prune`.
463457
Path to the validator client data. The default is `<data-base-path>/validator` where `<data-base-path>`
464458
is specified using [`--data-base-path`](#data-base-path-data-path).
465459

466-
#### eth1-deposit-contract-address
460+
#### `eth1-deposit-contract-address`
467461

468462
=== "Syntax"
469463

@@ -491,7 +485,7 @@ is specified using [`--data-base-path`](#data-base-path-data-path).
491485

492486
Ethereum 1.0 address of the deposit contract. Only required when creating a custom network.
493487

494-
#### network
488+
#### `network`
495489

496490
=== "Syntax"
497491

@@ -530,6 +524,3 @@ Possible values are:
530524

531525
Predefined networks can provide defaults such the initial state of the network,
532526
bootnodes, and the address of the Ethereum 1.0 deposit contract.
533-
534-
<!-- link -->
535-
[environment variables or a configuration file]: ../CLI-Syntax.md#specifying-options

docs/Reference/CLI/Subcommands/Development.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,26 @@ The following subcommands are used for development and testing purposes.
1010

1111
Manually run state transitions for blocks or slots for debugging.
1212

13+
```bash
14+
teku transtion
15+
```
16+
1317
## `peer`
1418

15-
Commands to generate a list of peer IDs, including the private key, public key, and peer ID.
19+
Generate a list of peer IDs, including the private key, public key, and peer ID.
20+
21+
```bash
22+
teku peer
23+
```
1624

1725
## `genesis`
1826

1927
Generate a genesis state for a network.
2028

29+
```bash
30+
teku genesis
31+
```
32+
2133
<!-- links -->
2234
[environment variables]: CLI-Syntax.md##teku-environment-variables
2335
[configuration file]: ../../HowTo/Configure/Use-Configuration-File.md

docs/Reference/CLI/Subcommands/Migrate-Database.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,18 @@ title: Database migration subcommand options
1111
As of v21.5.0, new Teku installations use a LevelDB2 database. Previous Teku versions use
1212
RocksDB which continue to be supported.
1313

14-
## config-file
14+
## `config-file`
1515

1616
=== "Syntax"
1717

1818
```bash
19-
--config-file=<FILE>
19+
teku migrate-database --config-file=<FILE>
2020
```
2121

2222
=== "Example"
2323

2424
```bash
25-
--config-file=/home/me/me_node/config.yaml
25+
teku migrate-database --config-file=/home/me/me_node/config.yaml
2626
```
2727

2828
=== "Environment variable"
@@ -34,18 +34,18 @@ title: Database migration subcommand options
3434
Path to the [YAML configuration file](../../../HowTo/Configure/Use-Configuration-File.md).
3535
The default is `none`.
3636

37-
## data-base-path, data-path
37+
## `data-base-path`, `data-path`
3838

3939
=== "Syntax"
4040

4141
```bash
42-
--data-base-path=<PATH>
42+
teku migrate-database --data-base-path=<PATH>
4343
```
4444

4545
=== "Example"
4646

4747
```bash
48-
--data-base-path=/home/me/me_node
48+
teku migrate-database --data-base-path=/home/me/me_node
4949
```
5050

5151
=== "Environment variable"
@@ -68,18 +68,18 @@ Path to the Teku data directory. The default directory is OS-dependent:
6868

6969
The default Docker image location is `/root/.local/share/teku`.
7070

71-
## data-beacon-path
71+
## `data-beacon-path`
7272

7373
=== "Syntax"
7474

7575
```bash
76-
--data-beacon-path=<PATH>
76+
teku migrate-database --data-beacon-path=<PATH>
7777
```
7878

7979
=== "Example"
8080

8181
```bash
82-
--data-beacon-path=/home/me/me_node
82+
teku migrate-database --data-beacon-path=/home/me/me_node
8383
```
8484

8585
=== "Environment variable"
@@ -97,18 +97,18 @@ The default Docker image location is `/root/.local/share/teku`.
9797
Path to the beacon chain client data. The default is `<data-base-path>/beacon` where `<data-base-path>`
9898
is specified using [`--data-base-path`](#data-base-path-data-path).
9999

100-
## network
100+
## `network`
101101

102102
=== "Syntax"
103103

104104
```bash
105-
--network=<NETWORK>
105+
teku migrate-database --network=<NETWORK>
106106
```
107107

108108
=== "Example"
109109

110110
```bash
111-
--network=mainnet
111+
teku migrate-database --network=mainnet
112112
```
113113

114114
=== "Environment variable"

0 commit comments

Comments
 (0)