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 is a single binary with no dependencies. Within minutes of installation, you can start to perform common tasks on clusters.
Use Cases
Example use cases for the Hazelcast CLC.
Run SQL Queries
Run SQL queries against your cluster and display the output as a table or in a variety of text formats, such as JSON and CSV.
Manage Cloud Clusters
Create and manage Cloud clusters, and the custom classes on those clusters.
Create Data Pipelines
Create and manage data pipelines using the Hazelcast CLC. Check out the Platform documentation for more information about data pipelines.
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 presents a shell to you. 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.
> 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 \
:
> \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.