> ## Documentation Index
> Fetch the complete documentation index at: https://docs.coconut.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# nut auth

> Manage authentication for Coconut

# Authentication Commands

Manage authentication settings and user access for your Coconut instance.

## `nut auth init`

Initialize the authentication system.

```bash theme={null}
nut auth init [options]
```

This command sets up authentication for your Coconut instance, allowing you to control who can access it.

**Example:**

```bash theme={null}
nut auth init
```

<Tip>
  After initializing authentication, you'll need to add users to the whitelist before they can access your Coconut instance.
</Tip>

***

## `nut auth add-user`

Add a user to the authentication whitelist.

```bash theme={null}
nut auth add-user [options]
```

This command prompts you to enter user information to grant access to your Coconut instance.

**Example:**

```bash theme={null}
nut auth add-user
```

***

## `nut auth list-users`

List all whitelisted users.

```bash theme={null}
nut auth list-users
```

This displays a table of all users who have been granted access to your Coconut instance.

**Example:**

```bash theme={null}
nut auth list-users
```

***

## `nut auth toggle`

Enable or disable authentication.

```bash theme={null}
nut auth toggle
```

This command toggles the authentication system on or off. When disabled, anyone can access your Coconut instance.

**Example:**

```bash theme={null}
nut auth toggle
```

<Note>
  Disabling authentication removes access control. Only do this in trusted, private environments.
</Note>

## Authentication Workflow

<Steps>
  <Step title="Initialize authentication">
    Run `nut auth init` to set up the authentication system.
  </Step>

  <Step title="Add users">
    Use `nut auth add-user` to whitelist users who should have access.
  </Step>

  <Step title="Verify users">
    Check the user list with `nut auth list-users` to ensure all authorized users are added.
  </Step>

  <Step title="Toggle as needed">
    Use `nut auth toggle` to enable or disable authentication when required.
  </Step>
</Steps>
