Description
The purpose of this request for comments (RFC) is to introduce our plans to provide a unified command line tool (cli) for users to interact with OpenSearch. This RFC is meant to cover how we plan to integrate the SQL, PerfTop, and OpenSearch cli into one. We do not cover implementation details and architecture. We would like to collect feedback and discuss our plans with anyone interested.
Problem Statement
OpenSearch and its plugins adopted REST based mechanism for interaction. With more than 10 different and continuously evolving OpenSearch plugins, we think it is important to provide a unified command line interface to help people use these plugins from a single tool. Today, we have three different kind of command line interfaces, namely opensearch-cli
, opensearchsql-cli
and perftop-cli
. These command line interfaces are hosted, built, released and distributed independently. As OpenSearch user, I have to download those three command line interface from three different place, update those CLI whenever new version is released individually and configure my preferences in multiple places.
Proposed Solution
We are planning to integrate all three cli into one universal cli, since, OpenSearch and its plugins are distributed together, it makes sense to integrate all three different command line interface and provide one binary artifact for our users to download and update at one place to get latest features.
These three different CLIs are meant for three different personas and they are carefully implemented by selecting the best framework choice for their users. Hence, we want to keep the essentials of individual CLI and provide one package/artifact for end user to download and use it.
We are proposing that different cli artifacts will be developed separately but shipped together as a part of one binary. Later, these different CLI will be invoked based on the wake word/sub command from opensearch-cli.
What does this look like for opensearchsql
users?
$ opensearch-cli sql --profile foobar [enter]
____ _____ __
/ __ \____ ___ ____ / ___/___ ____ ___________/ /_
/ / / / __ \/ _ \/ __ \\__ \/ _ \/ __ `/ ___/ ___/ __ \
/ /_/ / /_/ / __/ / / /__/ / __/ /_/ / / / /__/ / / /
\____/ .___/\___/_/ /_/____/\___/\__,_/_/ \___/_/ /_/
/_/
Server: OpenSearch 1.0.0
CLI Version: 1.9.0.0
Endpoint: https://localhost:9200
`opensearchsql`> select * FROM
What does this look like for perftop
users?
$ opensearch-cli perftop --profile foobar [enter]
This solution works well for following reasons
- Users only need to download one CLI to use all of the functionality.
- Some features like config files/configure cluster details can be shared.
- With this approach it will take less development effort to merge these different CLI. This is because we will just be invoking existing artifacts without much code changes.
Providing Feedback
If you have comments or feedback on our plans for OpenSearch Command Line Interface, please add it here to discuss. Some other questions we’re seeking feedback include
- Do you use package managers to install CLIs that you use? If so, which ones?
- How would you expect versioning of our CLI line up with OpenSearch’s versioning? (it could be coupled or decoupled). We lean towards decoupling to keep things independent.