# coder tokens create

Create a token

## Usage

```console
coder tokens create [flags]
```

## Options

### --lifetime

| Property    | Value                                |
| ----------- | ------------------------------------ |
| Type        | <code>string</code>                  |
| Environment | <code>$CODER\_TOKEN\_LIFETIME</code> |

Duration for the token lifetime. Supports standard Go duration units (ns, us, ms, s, m, h) plus d (days) and y (years). Examples: 8h, 30d, 1y, 1d12h30m.

### -n, --name

| Property    | Value                            |
| ----------- | -------------------------------- |
| Type        | <code>string</code>              |
| Environment | <code>$CODER\_TOKEN\_NAME</code> |

Specify a human-readable name.

### -u, --user

| Property    | Value                            |
| ----------- | -------------------------------- |
| Type        | <code>string</code>              |
| Environment | <code>$CODER\_TOKEN\_USER</code> |

Specify the user to create the token for (Only works if logged in user is admin).

### --scope

| Property | Value                     |
| -------- | ------------------------- |
| Type     | <code>string-array</code> |

Repeatable scope to attach to the token (e.g. workspace:read).

### --allow

| Property | Value                   |
| -------- | ----------------------- |
| Type     | <code>allow-list</code> |

Repeatable allow-list entry (`<type>:<uuid>`, e.g. workspace:1234-...).

### -o, --output

| Property | Value                   |
| -------- | ----------------------- |
| Type     | <code>text\|json</code> |
| Default  | <code>text</code>       |

Output format.
