Skip to content

Commit 60b2569

Browse files
Updates CLI to use entropy tui.
1 parent 0e96df4 commit 60b2569

File tree

5 files changed

+161
-145
lines changed

5 files changed

+161
-145
lines changed

content/basics/quickstart.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ The command-line interface (CLI) is the most straightforward way to interact wit
3333
npm install --global @entropyxyz/cli
3434
```
3535

36-
1. Run the CLI using `entropy`:
36+
1. Run the CLI using `entropy tui`:
3737

3838
```shell
39-
entropy
39+
entropy tui
4040
```
4141

4242
```output

content/guides/deploy-a-program.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Next, you can move on to starting the CLI and deploying your program.
1919

2020
### Deploy the program
2121

22-
1. Start the CLI by running `entropy`.
22+
1. Start the CLI by running `entropy tui`.
2323
1. At the main menu within the CLI, select **Deploy Program**:
2424

2525
```output
@@ -50,7 +50,7 @@ You can now interact with your program using the program pointer.
5050
5151
If you've lost your program pointer, you can list it by running the following:
5252
53-
1. Start the CLI by running `entropy`.
53+
1. Start the CLI by running `entropy tui`.
5454
1. At the main menu within the CLI, select **Deploy Program**:
5555
5656
```output

content/guides/manage-accounts.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ You need to have the Entropy CLI installed. [Take a look at the CLI page for det
1111

1212
### Create an account
1313

14-
1. Start the CLI by running `entropy`.
14+
1. Start the CLI by running `entropy tui`.
1515
1. Select **Manage Accounts**.
1616
1. Select **New**.
1717
1. Type `n` and press `ENTER` when asked _Would you like to import a key?_:
@@ -36,7 +36,7 @@ You need to have the Entropy CLI installed. [Take a look at the CLI page for det
3636

3737
You can import an account by the `seed` for the account. Most Substrate-based wallets allow you to export your account information.
3838

39-
1. Start the CLI by running `entropy`.
39+
1. Start the CLI by running `entropy tui`.
4040
1. Select **Manage Accounts**.
4141
1. Select **New**.
4242
1. Type `y` and press `ENTER` when asked _Would you like to import a key?_:

content/guides/register-an-account.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ lead: "Registering an account is a feature unique to Entropy. Without going into
77

88
Here is the process for registering an address using the Entropy CLI's interactive text-based user interface (TUI).
99

10-
1. Start the CLI by running `entropy`.
10+
1. Start the CLI by running `entropy tui`.
1111
1. Back at the main menu within the CLI, select **Register**:
1212

1313
```output

content/reference/command-line-interface.md

Lines changed: 154 additions & 138 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,26 @@
22
title: "Command-line interface"
33
lead: "The command-line interface (CLI) is a straightforward way to experiment with the Entropy network and explore common workflows."
44
aliases:
5-
- "url"
5+
- "cli"
66
---
77

88
{{< cards cols=2 >}}
99

10-
{{< card
11-
link="#interactive-cli"
12-
title="Interactive CLI"
13-
image="/images/entropy-tui-terminal.png"
14-
subtitle="Use the text-based user interface (TUI) to interact with the CLI tool."
15-
>}}
16-
1710
{{< card
1811
link="#programmatic-cli"
1912
title="Programmatic CLI"
2013
image="/images/entropy-cli-terminal.png"
2114
subtitle="Pass arguments directly to the CLI as single-line terminal commands."
2215
>}}
2316

24-
{{< /cards >}}
17+
{{< card
18+
link="#interactive-cli"
19+
title="Interactive CLI"
20+
image="/images/entropy-tui-terminal.png"
21+
subtitle="Use the text-based user interface (TUI) to interact with the CLI tool."
22+
>}}
2523

26-
After installing, running `entropy` without any arguments will take you to the text-based user interface. If you pass any arguments, however, the CLI will assume you want to run the CLI as a single command.
24+
{{< /cards >}}
2725

2826
## Install
2927

@@ -49,31 +47,12 @@ Follow these steps to install Entropy globally using NPM:
4947
npm install --global @entropyxyz/cli
5048
```
5149

52-
1. You can now run the text-based interface anywhere using `entropy`:
50+
1. You can now run the CLI from anywhere using `entropy`:
5351

5452
```shell
5553
entropy
5654
```
5755

58-
```output
59-
? Select Action (Use arrow keys)
60-
61-
❯ Manage Accounts
62-
Balance
63-
Register
64-
Sign
65-
Transfer
66-
Deploy Program
67-
User Programs
68-
Exit
69-
```
70-
71-
1. You can also interact with the CLI through one-line commands by adding any of the arguments listed in the help section:
72-
73-
```shell
74-
entropy --help
75-
```
76-
7756
```output
7857
Usage: entropy [options] [command]
7958
@@ -100,119 +79,25 @@ Follow these steps to install Entropy globally using NPM:
10079
a signature (string)
10180
```
10281

103-
## Interactive CLI
104-
105-
The following functions are available within the CLI using the text-based user interface (TUI). To start the TUI, simply enter `entropy` without any arguments into your terminal:
106-
107-
### Manage Accounts
108-
109-
Create a new Entropy account to store locally. List all Entropy accounts stored locally. Import an account into the CLI using a seed.
110-
111-
```output
112-
> Create/Import Account
113-
Select Account
114-
List Accounts
115-
```
116-
117-
#### Create or Import Account
118-
119-
Create a new Entropy account or import an existing account using a seed.
120-
121-
#### Select Account
122-
123-
Select an account to use within other functions. This is relevant if you have multiple accounts.
12482

125-
For example, assume you have three accounts, and you want to check the balance of `account 2`. You would:
83+
1. You can also interact with the CLI through the TUI by adding `tui`:
12684

127-
1. Start the CLI.
128-
1. Navigate to **Manage Accounts**.
129-
1. Navigate to **Select Account**.
130-
1. Choose the account that you would like to select and use within other functions:
131-
132-
```output
133-
? Choose account: (Use arrow keys)
134-
> Gael (5CrFp9txcb5UECpNKsD6DTBsG4cj1z58DA43YikSVeeJqXJR)
135-
Argo (5Dcps2RdXPQfiJBxxDnrF8iDzDHcnZC8rb5mcJ3xicqzhYbv)
136-
Lapp (5G92hBs4UfZpVFYtBmmN3UqPTzGgotq7PSA3XfBMALfvWDUb)
85+
```shell
86+
entropy tui
13787
```
13888

139-
1. The account you select is what the CLI will use when running other functions.
140-
141-
#### List Accounts
142-
143-
Show all the locally stored accounts. This function shows secret details such as `seed` in plaintext.
144-
145-
### Balance
146-
147-
Get the balance of an account. You can select any of the accounts stored locally or enter an Entropy address.
148-
149-
```output
150-
? Select Action Balance
151-
Address 5Dcps2RdXPQfiJBxxDnrF8iDzDHcnZC8rb5mcJ3xicqzhYbv has a balance of: 382000000000000 bits
152-
? Return to main menu? (Y/n)
153-
```
154-
155-
### Register
156-
157-
Register a locally stored account with the Entropy network.
158-
159-
```output
160-
Attempting to register the address: 5Dcps2RdXPQfiJBxxDnrF8iDzDHcnZC8rb5mcJ3xicqzhYbv
161-
Your address 5Dcps2RdXPQfiJBxxDnrF8iDzDHcnZC8rb5mcJ3xicqzhYbv has been successfully registered.
162-
```
163-
164-
The selected account must have available funds. Each registration costs about `400000000` bits.
165-
166-
### Transfer
167-
168-
Transfer funds from a locally stored account to any other valid Entropy address.
169-
170-
```output
171-
? Select Action Transfer
172-
? Input amount to transfer: 12345
173-
? Input recipient's address: 5G92hBs4UfZpVFYtBmmN3UqPTzGgotq7PSA3XfBMALfvWDUb
174-
Transferring Funds |++++___________________| 22%
175-
```
176-
177-
The `amount to transfer` value is in whole units, not bits. So transferring `1` would equal `10000000000` bits.
178-
179-
### Sign
180-
181-
Sign a message using a registered account.
182-
183-
```output
184-
? Choose account: (Use arrow keys)
185-
aragon (5FTwtSAjnKFybzkAKvyEo7owikXcHXmwzN7MzjwDNKEbjkub)
186-
> charlie (5Ck5SLSHYac6WFt5UZRSsdJjwmpSZq85fd5TRNAdZQVzEAPT)
187-
Other
188-
```
189-
190-
### Deploy Program
191-
192-
Deploy a program from a locally stored account.
193-
194-
```output
195-
? Select Action Deploy Program
196-
? Select your action: (Use arrow keys)
197-
> Deploy
198-
Get Program Pointers
199-
200-
Exit
201-
```
202-
203-
### User Programs
204-
205-
View all programs deployed to the network from locally stored accounts.
89+
```output
90+
? Select Action (Use arrow keys)
20691
207-
```output
208-
? Select Action User Programs
209-
? What would you like to do? (Use arrow keys)
210-
> View My Programs
211-
Add a Program to My List
212-
Remove a Program from My List
213-
Check if Program Exists
214-
Exit to Main Menu
215-
```
92+
❯ Manage Accounts
93+
Balance
94+
Register
95+
Sign
96+
Transfer
97+
Deploy Program
98+
User Programs
99+
Exit
100+
```
216101

217102
## Programmatic CLI
218103

@@ -360,6 +245,137 @@ Sign a message using the Entropy network. Output is a signature as a string.
360245
entropy sign '5DSUAf2DwxW2ebZq15Pm6Z3SJ69Ur8fGd8ytWvgxvNjYtr7c' 'Pickle Pee, Pump-a-Rum!'
361246
```
362247

248+
## Text-based user interface
249+
250+
The following functions are available within the CLI using the text-based user interface (TUI). To start the TUI, simply enter `entropy tui` without any arguments into your terminal:
251+
252+
```shell
253+
entropy tui
254+
```
255+
256+
```output
257+
? Select Action (Use arrow keys)
258+
259+
❯ Manage Accounts
260+
Balance
261+
Register
262+
Sign
263+
Transfer
264+
Deploy Program
265+
User Programs
266+
Exit
267+
```
268+
269+
### Manage Accounts
270+
271+
Create a new Entropy account to store locally. List all Entropy accounts stored locally. Import an account into the CLI using a seed.
272+
273+
```output
274+
> Create/Import Account
275+
Select Account
276+
List Accounts
277+
```
278+
279+
#### Create or Import Account
280+
281+
Create a new Entropy account or import an existing account using a seed.
282+
283+
#### Select Account
284+
285+
Select an account to use within other functions. This is relevant if you have multiple accounts.
286+
287+
For example, assume you have three accounts, and you want to check the balance of `account 2`. You would:
288+
289+
1. Start the CLI.
290+
1. Navigate to **Manage Accounts**.
291+
1. Navigate to **Select Account**.
292+
1. Choose the account that you would like to select and use within other functions:
293+
294+
```output
295+
? Choose account: (Use arrow keys)
296+
> Gael (5CrFp9txcb5UECpNKsD6DTBsG4cj1z58DA43YikSVeeJqXJR)
297+
Argo (5Dcps2RdXPQfiJBxxDnrF8iDzDHcnZC8rb5mcJ3xicqzhYbv)
298+
Lapp (5G92hBs4UfZpVFYtBmmN3UqPTzGgotq7PSA3XfBMALfvWDUb)
299+
```
300+
301+
1. The account you select is what the CLI will use when running other functions.
302+
303+
#### List Accounts
304+
305+
Show all the locally stored accounts. This function shows secret details such as `seed` in plaintext.
306+
307+
### Balance
308+
309+
Get the balance of an account. You can select any of the accounts stored locally or enter an Entropy address.
310+
311+
```output
312+
? Select Action Balance
313+
Address 5Dcps2RdXPQfiJBxxDnrF8iDzDHcnZC8rb5mcJ3xicqzhYbv has a balance of: 382000000000000 bits
314+
? Return to main menu? (Y/n)
315+
```
316+
317+
### Register
318+
319+
Register a locally stored account with the Entropy network.
320+
321+
```output
322+
Attempting to register the address: 5Dcps2RdXPQfiJBxxDnrF8iDzDHcnZC8rb5mcJ3xicqzhYbv
323+
Your address 5Dcps2RdXPQfiJBxxDnrF8iDzDHcnZC8rb5mcJ3xicqzhYbv has been successfully registered.
324+
```
325+
326+
The selected account must have available funds. Each registration costs about `400000000` bits.
327+
328+
### Transfer
329+
330+
Transfer funds from a locally stored account to any other valid Entropy address.
331+
332+
```output
333+
? Select Action Transfer
334+
? Input amount to transfer: 12345
335+
? Input recipient's address: 5G92hBs4UfZpVFYtBmmN3UqPTzGgotq7PSA3XfBMALfvWDUb
336+
Transferring Funds |++++___________________| 22%
337+
```
338+
339+
The `amount to transfer` value is in whole units, not bits. So transferring `1` would equal `10000000000` bits.
340+
341+
### Sign
342+
343+
Sign a message using a registered account.
344+
345+
```output
346+
? Choose account: (Use arrow keys)
347+
aragon (5FTwtSAjnKFybzkAKvyEo7owikXcHXmwzN7MzjwDNKEbjkub)
348+
> charlie (5Ck5SLSHYac6WFt5UZRSsdJjwmpSZq85fd5TRNAdZQVzEAPT)
349+
Other
350+
```
351+
352+
### Deploy Program
353+
354+
Deploy a program from a locally stored account.
355+
356+
```output
357+
? Select Action Deploy Program
358+
? Select your action: (Use arrow keys)
359+
> Deploy
360+
Get Program Pointers
361+
362+
Exit
363+
```
364+
365+
### User Programs
366+
367+
View all programs deployed to the network from locally stored accounts.
368+
369+
```output
370+
? Select Action User Programs
371+
? What would you like to do? (Use arrow keys)
372+
> View My Programs
373+
Add a Program to My List
374+
Remove a Program from My List
375+
Check if Program Exists
376+
Exit to Main Menu
377+
```
378+
363379
## Configuration
364380
365381
The CLI uses a configuration file to set and store basic information. This CLI uses [env-paths](https://www.npmjs.com/package/env-paths) to determine where configurations files should be stored:

0 commit comments

Comments
 (0)