2026-08-11 11:22:55 -04:00
---
# Code generated by make gen. DO NOT EDIT.
title : tokens create
description : Create a token
---
2023-03-23 17:42:20 -05:00
<!-- DO NOT EDIT | GENERATED CONTENT -->
Create a token
## Usage
```console
coder tokens create [flags]
```
## Options
### --lifetime
| | |
2025-01-03 18:12:59 +05:00
|-------------|------------------------------------|
2024-10-16 17:02:56 +02:00
| Type | <code>string</code> |
2023-03-23 17:42:20 -05:00
| Environment | <code>$CODER_TOKEN_LIFETIME</code> |
2025-10-28 10:15:57 -05:00
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.
2023-03-23 17:42:20 -05:00
### -n, --name
| | |
2025-01-03 18:12:59 +05:00
|-------------|--------------------------------|
2023-03-23 17:42:20 -05:00
| Type | <code>string</code> |
| Environment | <code>$CODER_TOKEN_NAME</code> |
Specify a human-readable name.
2024-10-01 01:45:28 +05:30
### -u, --user
| | |
2025-01-03 18:12:59 +05:00
|-------------|--------------------------------|
2024-10-01 01:45:28 +05:30
| 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).
2025-10-27 17:07:25 +01:00
### --scope
| | |
|------|---------------------------|
| Type | <code>string-array</code> |
Repeatable scope to attach to the token (e.g. workspace:read).
### --allow
| | |
|------|-------------------------|
| Type | <code>allow-list</code> |
2026-07-14 13:39:58 -04:00
Repeatable allow-list entry (`<type>:<uuid>` , e.g. workspace:1234-...).