# coder tokens create

Create a token

## Usage [#usage]

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

## Options [#options]

### --lifetime [#--lifetime]

|             |                                      |
| ----------- | ------------------------------------ |
| 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 [#-n---name]

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

Specify a human-readable name.

### -u, --user [#-u---user]

|             |                                  |
| ----------- | -------------------------------- |
| 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 [#--scope]

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

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

### --allow [#--allow]

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

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