﻿---
title: config current-context set cli command
description: Change the current context 
url: https://www.elastic.co/elastic/docs-builder/docs/4120/reference/elastic-cli/cli/config/current-context/set
applies_to:
  - Elastic Cloud Serverless: Preview
  - Elastic Stack: Preview
---

# config current-context set cli command
```bash
elastic config current-context set <name>
```

Change the current context

## Arguments

<definitions>
  <definition term="<name> string required">
    context name
  </definition>
</definitions>


## 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>