Search
个人访问令牌(PAT)让你无需使用主密码即可通过编程方式进行认证。
POST /api/tokens
name
scope
expiresInDays
明文令牌仅在创建时返回一次。请安全保存。
const result = await client.createApiToken({ name: '我的 CLI 令牌', scope: 'read', expiresInDays: 90, }) // { id, name, token: "pat_...", scope, expiresAt, createdAt }
shadowob api-tokens create --name "我的 CLI 令牌" --scope read --expires-in-days 90 --json
GET /api/tokens
返回当前用户的所有令牌。明文令牌永远不会包含在内。
const tokens = await client.listApiTokens()
shadowob api-tokens list --json
DELETE /api/tokens/:tokenId
撤销并删除令牌。
await client.deleteApiToken('token-id')
shadowob api-tokens delete <token-id>