cli

Use the cli command to configure the behavior of the command-line interface, including how long a session can be inactive before the system logs it out automatically, paging settings, terminal size and so on.

Most of the cli commands can be set for either the current session or as the new default for all sessions. The command-line mode required for each is different as follows:

Changing a cli session setting requires only Standard command-line mode.
Changing a cli default setting requires Configure command-line mode.

The cli command has the following syntax:

cli
   clear-history
   default
      auto-logout <number of minutes>
      init-resize
      paging enable
      progress enable
      prompt <confirm-reload | confirm-reset | confirm-unsaved | empty-password>   session
      auto-logout <number of minutes>
      paging enable
      progress enable
      terminal
         length <number of lines>
         resize
         type <ansi | console | dumb | linux | screen | vt52 | vt100 | vt102 | vt220 | xterm>
         width <number of characters>

The following table describes the arguments for the cli command:

Command

Description

clear-history

Clears the command history for the current user.

default auto-logout <number of minutes>session auto-logout <number of minutes>

Specifies how long a CLI session can remain inactive before it is automatically logged out by the system. Use the corresponding command to configure this either for the current session or as the new CLI default. For example:

(config) # cli session auto-logout 180

Use a value of 0 to specify that sessions never log out automatically due to inactivity. For example, to specify that the current CLI session never expires due to inactivity, use the following command:

(config) # cli session auto-logout 0

Note:  Commands that produce a lot of output such as show log continuous might timeout depending on the auto-logout configuration.

default init-resize

Directly reads terminal dimensions from the device on CLI startup.

default paging enable
session paging enable

Specifies whether paging is enabled for screen output that exceeds the current window size. When paging is enabled (the default), you can page through output using the same features as the Linux programs less and more. Press the h key to see paging options. Figure 1 Viewing Paging Options provides an example.

Use the corresponding command to configure this either for the current session or as the new CLI default.

default progress enable
session progress enable

Specifies whether the CLI should provide progress updates for operations that take a long time to complete. Use the corresponding command to configure this either for the current session or as the new CLI default.

prompt <confirm-reload |
confirm-reset | confirm-unsaved | empty-password>

Configures when the CLI should prompt you for input, as follows:

confirm-reload—Prompts for confirmation before rebooting.
confirm-reset—Prompts for confirmation before resetting to factory state.
confirm-unsaved—Confirms whether to save unsaved changes before rebooting.
empty-password—Prompts for a password if none is specified.

session terminal length <number of lines>

session terminal resize

session terminal type
<ansi | console | dumb | linux | screen | vt52 | vt100 | vt102 | vt220 | xterm>

session terminal width <number of characters>

Configures the terminal output to specified dimensions, as follows:

length—Overrides the autodetected length of the terminal. Specify the length in lines.
resize—Resets the terminal dimensions to the current window.
type—Sets the terminal dimensions to a specified terminal type.
width—Overrides the autodetected width of the terminal. Specify the width in characters.

Refer also to terminal.

Related Commands

The following table summarizes other commands related to the cli command:

Task

Command

Displays CLI options.

# show cli

Displays CLI command history.

# show cli history

Displays CLI command history for a specified number of lines.

# show cli history 10

Does not automatically log users out due to keyboard inactivity.

(config) # no cli default auto-logout

Does not read terminal dimensions from the device on CLI startup.

(config) # no cli default init-resize

Disables paging.

(config) # no cli default paging enable

Disables progress updates.

(config) # no cli default progress enable

Does not prompt for confirmation before rebooting.

(config) # no cli default prompt confirm-reload

Does not prompt for confirmation before resetting to factory state.

(config) # no cli default prompt confirm-reset

Does not save unsaved changes before rebooting.

(config) # no cli default prompt confirm-unsaved

Assumes there is no password if none is specified in a pseudo-URL for SCP.

(config) # no cli default prompt empty-password

Does not automatically log users out due to keyboard inactivity.

(config) # no cli session auto-logout

Disables paging.

(config) # no cli session paging enable

Disables progress updates.

(config) # no cli session progress enable

Clears the terminal type.

(config) # no cli session terminal type