---
# Code generated by make gen. DO NOT EDIT.
title: "`coder tokens create`"
description: Create a token.
---
Create a token
## Usage
```console
coder tokens create [flags]
```
## Options
### --lifetime
| Property | Value |
|-------------|------------------------------------|
| Type | string |
| Environment | $CODER_TOKEN_LIFETIME |
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 | string |
| Environment | $CODER_TOKEN_NAME |
Specify a human-readable name.
### -u, --user
| Property | Value |
|-------------|--------------------------------|
| Type | string |
| Environment | $CODER_TOKEN_USER |
Specify the user to create the token for (Only works if logged in user is admin).
### --scope
| Property | Value |
|----------|---------------------------|
| Type | string-array |
Repeatable scope to attach to the token (e.g. workspace:read).
### --allow
| Property | Value |
|----------|-------------------------|
| Type | allow-list |
Repeatable allow-list entry (`:`, e.g. workspace:1234-...).
### -o, --output
| Property | Value |
|----------|-------------------------|
| Type | text\|json |
| Default | text |
Output format.