creatibi/cli · Archived

cbi-shared

CreatiBI CLI ?

First seen Apr 25, 2026

Installation

$ npx skills add creatibi/cli --skill cbi-shared

Stronger alternatives

This repository is archived — consider an actively maintained alternative.

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from creatibi/cli.

npx skills add creatibi/cli

Browse all from creatibi/cli

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 6
Default branch main
Open issues 3
Status Archived

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 5,302 B
  • docs SUMMARY.md 241 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 44 installs

SKILL.md

CreatiBI CLI 基础配置与认证

CreatiBI 命令行工具的初始化与认证模块。

安装

# npm 全局安装
npm install -g @creatibi/cbi-cli@latest

支持平台:macOS (amd64/arm64)、Linux (amd64/arm64)、Windows (amd64/arm64)


快速开始

# 1. 初始化配置(首次使用)
cbi config init

# 2. OAuth 登录
cbi auth login

# 3. 确认登录成功
cbi auth whoami

常用命令速查

场景 命令
初始化配置 cbi config init
强制重新初始化 cbi config init --new
设备码模式初始化 cbi config init --device
查看配置 cbi config show
登录授权 cbi auth login
设备码登录 cbi auth login --device
查看身份 cbi auth whoami
退出登录 cbi auth logout

配置模块 (config)

初始化配置

首次使用需要初始化应用凭证配置:

# 初始化配置(交互式选择模式)
cbi config init

# 强制重新初始化(覆盖已有配置)
cbi config init --new

# 直接使用设备码模式(适用于 VPS/服务器)
cbi config init --device

支持两种初始化模式:

模式 适用场景 说明
回调模式 桌面环境 本地浏览器创建凭证,自动回传
设备码模式 VPS/服务器 远程浏览器创建凭证,轮询获取

回调模式流程:

  1. CLI 启动本地回调服务器(端口 8080)
  2. 自动打开浏览器访问开放平台
  3. 用户在开放平台创建/选择应用
  4. 凭证自动回传到 CLI
  5. 配置写入 ~/.cbi/config.json

设备码模式流程:

  1. CLI 向平台请求设备码
  2. CLI 显示验证 URL 和验证码(如 550e-8400)
  3. 用户在任意浏览器访问验证 URL 并确认授权
  4. CLI 轮询等待授权(15 分钟有效期)
  5. 授权成功后获取 appid/appsecret
  6. 配置写入 ~/.cbi/config.json

前提条件: 在 CreatiBI 开放平台创建应用,获取 clientid 和 clientsecret

显示当前配置

cbi config show              # 显示配置(敏感字段脱敏)
cbi config show -v           # 详细模式(显示登录凭证)
cbi config show --format json   # JSON 格式输出

认证模块 (auth)

OAuth 登录

cbi auth login

前提条件: 已执行 cbi config init 配置应用凭证

支持两种登录模式:

模式 适用场景 说明
授权码模式 桌面环境 本地浏览器授权,自动回调
设备码模式 VPS/服务器 远程浏览器授权,手动输入验证码

授权码模式流程:

  1. CLI 启动本地回调服务器(端口 8080)
  2. 自动打开浏览器访问授权页面
  3. 用户在浏览器中完成授权
  4. 服务端回调到 CLI 并返回授权码
  5. CLI 用授权码换取 access_token
  6. Token 存储在 ~/.cbi/config.json

设备码模式流程:

  1. CLI 向服务端请求设备码
  2. CLI 显示验证 URL 和验证码(如 550e-8400)
  3. 用户在任意浏览器访问验证 URL 并输入验证码
  4. CLI 轮询等待用户授权
  5. 授权成功后获取 access_token
# 直接使用设备码模式
cbi auth login --device

# 或通过环境变量设置
export CBI_LOGIN_MODE=device
cbi auth login

查看当前身份

cbi auth whoami      # 查看当前登录身份
cbi auth whoami -v   # 详细模式(显示 token 信息)

退出登录

cbi auth logout

错误处理

权限不足/未登录

当遇到 permission denied 或 auth required 错误时:

# 1. 检查配置是否存在
cbi config show

# 2. 如果配置不存在,先初始化
cbi config init

# 3. 登录授权
cbi auth login

# 4. 确认登录成功
cbi auth whoami

Token 过期

当遇到 expired access token 错误时:

cbi auth login   # 重新登录

配置文件问题

cbi config init --new   # 强制重新初始化配置
cbi auth login          # 重新登录

配置文件位置

配置存储在 ~/.cbi/config.json:

{
  "base_url": "https://open.creatibi.cn",
  "client_id": "YOUR_CLIENT_ID",
  "client_secret": "YOUR_CLIENT_SECRET",
  "api_key": "YOUR_ACCESS_TOKEN",
  "refresh_token": "YOUR_REFRESH_TOKEN",
  "token_expires_at": "2026-04-24T00:28:54Z"
}

通用参数

参数 说明
--config <path> 配置文件路径(默认 ~/.cbi/config.json)
-f, --format 输出格式:json / table
-v, --verbose 显示详细信息