A newer version of Hazelcast CLC is available.

View latest

Hazelcast Command-Line Client (CLC)

You can use the Hazelcast Command Line Client (CLC) to connect to and interact with clusters on Hazelcast Cloud and Hazelcast Platform, direct from the command line or through scripts.

The Hazelcast CLC simplifies the client setup process for Windows and Unix-like local environments. Within minutes of installation, you can start to perform common tasks on clusters.

Use Cases

Example use cases for the Hazelcast CLC.

Access Data for Debugging

Get direct access to map data for quick debugging of prototypes or production applications. Easily read or query data on a cluster using SQL queries.

Scripting for Automation

Work in non-interactive mode to script and execute repetitive administration, integration, or testing tasks.

Modes

The Hazelcast CLC works in two modes:

  • Non-interactive

  • Interactive

You can easily switch between modes to suit the context in which you’re working.

Non-Interactive Mode

This is the default mode for the Hazelcast CLC. You need to manually enter and execute commands at the command line. This mode is useful for scripting.

clc map -c dev --name myMap set myKey myValue

Interactive Mode

Interactive mode uses auto-completion to display matching commands, subcommands, and parameters. This mode is useful for exploring CLC commands, and for manual tasks.

To start the Hazelcast CLC in interactive mode, do the following:

clc

In the interactive mode, you can run SQL queries directly. Make sure to add a semicolumn (;) to the end of the query, otherwise it is assumed that you want to enter a multiline query.

CLC> select * from cities;
---------------------------------------------------------------------------------
      __key | country                   | city                      | population
---------------------------------------------------------------------------------
          1 | United Kingdom            | London                    |    9540576
          6 | Turkey                    | Istanbul                  |   15636243
          4 | United States             | Los Angeles               |    3985520
---------------------------------------------------------------------------------

In order to run CLC commands, prefix them with a backslash \:

CLC> \object list
------------------------------------
 Service Name | Object Name
------------------------------------
 executor     | hot-backup-executor
 map          | cities
 map          | currency
 map          | default
------------------------------------

To return to non-interactive mode, use either of the following methods:

  • Press Ctrl+D

  • Type \exit.

Limitations

  • Client authentication: The Hazelcast CLC supports only simple authentication (username and password) for Hazelcast Platform. The Hazelcast CLC does not currently support any other client authentication. If your Hazelcast Platform cluster uses other methods of client authentication, you cannot use Hazelcast CLC to connect to it.

Next Steps

Install, configure, and explore Hazelcast CLC: