﻿---
title: config context list cli command
description: List all contexts defined in the config file 
url: https://www.elastic.co/elastic/docs-builder/docs/4118/reference/elastic-cli/cli/config/context/list
applies_to:
  - Elastic Cloud Serverless: Preview
  - Elastic Stack: Preview
---

# config context list cli command
```bash
elastic config context list
```

List all contexts defined in the config file

## config Options

<definitions>
  <definition term="--config-file string">
    path to the config file to edit (defaults to ~/.elasticrc.yml)
  </definition>
  <definition term="--dry-run">
    validate all inputs and exit without performing any action (preview changes without applying them)
  </definition>
</definitions>


## Global Options

<definitions>
  <definition term="--json">
    output as JSON
  </definition>
</definitions>