You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+14-3Lines changed: 14 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,20 @@ prop | description
19
19
`theme` | A string representing which `theme` to use (Terminal.Themes.LIGHT, Terminal.Themes.DARK)
20
20
`prefix` | The string used to prefix commands in history: defaults to `hacker@default`
21
21
22
+
### Currently supported commands and args
23
+
command | args/flags | description
24
+
------------ | args/flags | -----------
25
+
`help` | | lists all available commands
26
+
`clear` | | clears history
27
+
`ls` | path | lists all file and dirs at path or `cwd`
28
+
`cat` | path/file | prints out the contents of a file
29
+
`mkdir` | path/dir | makes a new dir at path
30
+
`cd` | path | change directory to relative path
31
+
`pwd` | | prints out the `cwd`
32
+
`echo` | any | prints out all args with env variables
33
+
`printenv` | | prints out env variables
34
+
`whoami` | | prints out current user's username
35
+
22
36
### Extending the command list
23
37
The `extension` prop is an easy way to extend the bash commands that can be parsed from the terminal input. In essence, each command is a state reducer returning a new terminal state. This provides a lot of flexibility. Each command has access to the `structure`, `history`, and `cwd`, and expects the object returned to be applied in `setState` of the React component. Note that each extension should keep the state immutable, otherwise the component will not update. If we were to extend the commands with and existing command like 'clear, here's how we could do it.
24
38
@@ -94,10 +108,7 @@ script | description
94
108
>✌⊂(✰‿✰)つ✌
95
109
96
110
**Some ideas for contributions:**
97
-
* Add `echo` command with environment variables?
98
111
* Add `grep` command that walks/searches the `structure`
99
-
* Add `whoami` command
100
-
* Add handles for the three circles at the top left of the terminal
101
112
* Add multiline support / text formatting for `cat`
0 commit comments