A newer version of Hazelcast CLC is available.

View latest

User Defined Aliases

Alias commands enable you to add and list user defined shortcuts.

Alias commands can only be used in the interactive and scripting modes. In order to persist the aliases you need to add \alias add statements in the $CLC_HOME/shell.clc script. shell.clc script is sourced when CLC starts in the interactive mode.

Usage:

clc alias [command]

clc alias add

Add an alias with the given name and command.

Usage:

-- for command
\alias add {ALIAS-NAME} -- {\\COMMAND}

-- for SQL
\alias add {ALIAS-NAME} -- {SQL}

Parameters:

Parameter Required Description Default

name

Required

Name of the alias.

command

Required

Examples:

  • Adds an alias to list maps in the cluster:

clc alias add list-maps -- \\object list map
  • Adds an alias to query SQL:

clc alias add first-five-desserts -- select name from desserts order by name limit 5;

clc alias remove

Remove an alias with the given name.

Usage:

clc alias remove [name]

Parameters:

Parameter Required Description Default

name

Required

Name of the alias.

Example:

clc alias remove my-alias

clc alias list

List existing aliases.

Usage:

clc alias list

Example:

clc alias list

Alias Usage

Aliases can be used in interactive and scripting modes with @ prefix. Let’s assume an alias named my-alias already created. it can be used as @my-alias.