Working in the TNSR CLI¶
Command Prompt¶
The TNSR CLI command prompt has a several components:
<hostname> tnsr<(mode)># <user input>
These components are:
- hostname:
The fully qualified hostname of the router.
- mode:
This section of the prompt changes depending on the current mode to indicate that a different subset of commands is available.
See also
For a list of modes and prompt strings, see Mode List.
- user input:
This area is where a user enters commands and other input.
In this brief example, the router hostname is router
, and the mode section
of the prompt is shown changing when a command enters or exits a mode.
router tnsr# configure
router tnsr(config)# interface GigabitEthernet3/0/0
router tnsr(config-interface)# description Management
router tnsr(config-interface)# exit
router tnsr(config)# exit
router tnsr#
Command History¶
The TNSR CLI stores the last 300
commands across sessions. This command
history is kept in ~/.tnsr_history
.
The command history is accessed by pressing Ctrl-P
(previous command),
Ctrl-N
(next command), or by using the up and down arrow keys.
The number of commands stored by TNSR can be controlled by the cli
history-config lines <count>
command. To restore the default value, use no
cli history-config lines
.
This behavior may also be disabled by the cli history-config disable
or
no cli history-config enable
commands. Use cli history-config enable
to
turn it back on.
Autocomplete¶
The TNSR CLI supports case-sensitive tab expansion and prediction for input to speed up interactive work. For example, the first few letters of a command or entity may be typed, depending on context, and then pressing the tab key will complete a portion or all of the remaining input where possible. Additionally, in cases when there is an existing entry or only one possible choice, pressing tab will automatically insert the entire entry. Commands or entities may also be shortened provided the input is not ambiguous.
Tip
Press ?
to show possible completions of the current command when in the
middle of a word, or press it between words to show the next available
parameter (Finding Help).
Keyboard Shortcuts¶
The TNSR CLI supports several CLI navigation and editing key combinations, including:
Command |
Keys |
---|---|
Previous History Command |
|
Next History Command |
|
Erase Character |
Backspace or |
Erase Word |
|
Cursor to Start of Line |
|
Cursor to End of Line |
|
Clear and Redraw Screen |
|
Exit the CLI |
|
Context-Sensitive Help |
|