Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@ elastic --help
## Configuration

The CLI looks for a config file in your home directory. The following file names
are recognised (checked in this order):
are checked (in this order):

1. `.elasticrc`
2. `.elasticrc.json`
3. `.elasticrc.yaml`
4. `.elasticrc.yml`

You can also point to a config file explicitly with `--config-file <path>` or
the `ELASTIC_CLI_CONFIG_FILE` environment variable. Precedence:
`--config-file` > `ELASTIC_CLI_CONFIG_FILE` > home directory discovery.
Place your config at `~/.elasticrc.yml` (recommended).

JavaScript and TypeScript config files are not supported for security reasons.
To use a config file in a different location, pass `--config-file <path>` or set
the `ELASTIC_CLI_CONFIG_FILE` environment variable. The flag takes precedence
over the environment variable.

```yaml
current_context: local
Expand Down Expand Up @@ -119,7 +119,7 @@ elasticsearch:

| Option | Description |
|---|---|
| `--config-file <path>` | Path to a config file, bypassing automatic discovery |
| `--config-file <path>` | Path to a config file (default: `~/.elasticrc.yml`) |
| `--use-context <name>` | Override the active context from the config file |
| `--json` | Output results as JSON |

Expand Down
177 changes: 2 additions & 175 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
"@elastic/transport": "^9.3.5",
"cli-table3": "^0.6.5",
"commander": "^14.0.3",
"cosmiconfig": "^9.0.1",
"yaml": "^2.8.3",
"zod": "^4.3.6"
},
Expand Down
2 changes: 1 addition & 1 deletion src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const program = new Command()
program
.name('elastic')
.description('Interface with Elasticsearch, Elastic Serverless and Elastic Cloud APIs from the command line.')
.option('--config-file <path>', 'path to a config file, bypassing cosmiconfig discovery')
.option('--config-file <path>', 'path to a config file (default: ~/.elasticrc.yml)')
.option('--use-context <name>', 'override the active context from the config file')
.option('--json', 'output as JSON')

Expand Down
Loading