# shb-cli auth token-import / auth logout

## 命令

```bash
# 导入 token
shb-cli auth token-import --token <token>

# 退出登录
shb-cli auth logout
```

## token-import 响应

```json
{
  "profile": "default",
  "token_masked": "tok***abc"
}
```

## token-import 流程

1. `shb-cli config` 确认当前认证状态
2. `shb-cli auth token-import --token <token>`
3. `shb-cli config` 验证 `authenticated: true` 且 `valid: true`

如果 `valid: false`，通常是 token 过期或环境不匹配，执行：

```bash
shb-cli version --json   # 确认 build_env
shb-cli config           # 确认 environment / base_url
shb-cli auth login [--env ...]  # 重新登录
```

## auth logout 响应

```json
{
  "profile": "default",
  "status": "logged_out"
}
```

## 注意

- 禁止把 token 明文输出到终端日志或仓库文件
