---
layout: "docs"
page_title: "Commands: Namespace"
sidebar_current: "docs-commands-namespace"
description: >
  The namespace command provides management of Consul Enterprise namespaces.
---

<%= enterprise_alert :consul %>

# Consul Namespace 

Command: `consul namespace`


The `namespace` command provides management of Consul Enterprise namespaces. This was added in Consul Enterprise 1.7.0.

If ACLs are enabled then a token with operator privileges may be required in order to use this command. Write 
requests are forwarded to the leader in the primary datacenter. Therefore these commands can be run against
any agent in any datacenter.

## Usage

Usage: `consul namespace <subcommand>`

For the exact documentation for your Consul version, run `consul namespace -h` to view the complete list of subcommands.

```text
Usage: consul namespace <subcommand> [options] [args]

  This command has subcommands for interacting with Consul Enterprise
  Namespaces. Here are some simple examples. More detailed
  examples are available in the subcommands or the documentation.

  ...

Subcommands:
    delete    Delete a Namespace
    list      List all Namespaces
    read      Read a Namespace
    write     Create or update a Namespace
```

For more information, examples, and usage about a subcommand, click on the name 
of the subcommand in the sidebar.

## Basic Examples

Create or update a Namespace:

```sh
$ consul namespace write ns1.hcl
```

Read a Namespace:

```sh
$ consul namespace read ns1
```

List all Namespaces:

```sh
$ consul namespace list
```

Delete a Namespace:

```sh
$ consul namespace delete ns1
```
