elastic / elastic/cli

CAT indices prints [object Object] for an empty Serverless project

Open
#623 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
41
Forks
24
Avg merge
1d 3h
Merged PRs (30d)
56

Description

### Description

In a newly created Elastic Cloud Serverless project with no indices, the default output of `es cat indices` is `[object Object]` followed immediately by the shell prompt:

```console
$ elastic --use-context serverless es cat indices
[object Object]%
```

When the same command is run with `--json`, it returns an empty array:

```console
$ elastic --use-context serverless es cat indices --json
[]
```

After creating an index, both output modes work as expected. For example:

```console
$ elastic --use-context serverless --json es cat indices
[{"health":"green","status":"open","index":"my-index","uuid":"...","pri":"1","rep":"1","docs.count":"1","docs.deleted":"0","store.size":"8.6kb","pri.store.size":"8.6kb","dataset.size":"227b"}]
```

Could you evaluate whether the default output for the empty response is correct? Even if an empty project is expected to return no rows, exposing `[object Object]` does not appear intentional.

### Environment

- Elastic CLI 0.4.0
- Elastic Cloud Serverless Elasticsearch project

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.