一键导入
chanjing-credentials-guard
Guide users to configure local Chanjing credentials safely via local commands only, and validate local token status when needed.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Guide users to configure local Chanjing credentials safely via local commands only, and validate local token status when needed.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Chanjing AI creation Open API client: submit image/video tasks, poll task status, list and get tasks, and optionally download outputs when the user runs download_result.py. Reads and writes local credentials.json; calls open-api.chanjing.cc.
Use Chanjing Avatar API for lip-syncing video generation (upload audio/video, create tasks, poll results).
Use Chanjing customised person APIs to create, inspect, list, poll, and delete custom digital humans from uploaded source videos.
用户输入选题或工作流,自动生成完整短视频成片(文案、分镜、数字人口播与 AI 画面混剪);调用 Chanjing Open API 与同仓库子技能脚本。
Use Chanjing text-to-digital-person APIs for AI portraits, talking videos, optional LoRA training, polling, and explicit downloads when requested.
Use Chanjing TTS API to convert text to speech (list voices, create tasks, poll, download from returned URLs).
| name | chanjing-credentials-guard |
| description | Guide users to configure local Chanjing credentials safely via local commands only, and validate local token status when needed. |
| credential | credentials.json (app_id/secret_key; access_token persisted on disk) |
| openclaw_primary_env | false |
| environment | CHANJING_OPENAPI_CREDENTIALS_DIR, CHANJING_OPENAPI_BASE_URL |
| legacy_environment | CHANJING_CONFIG_DIR, CHANJING_API_BASE |
| machine_readable | manifest.yaml |
| requires_ffmpeg | false |
| requires_ffprobe | false |
| notes | Do not request secrets in chat; use local scripts only. |
仅通过本地命令引导用户配置/校验蝉镜 AK/SK 与 Token,打开登录页;不在对话中索取密钥。可配合其它 Chanjing 技能使用。
scripts/chanjing_config.py、scripts/open_login_page.py、scripts/chanjing_get_token.py 等manifest.yaml(environment 段)及本文manifest.yamlclawhub run chanjing-credentials-guardpython skills/chanjing-credentials-guard/scripts/chanjing_config.py --statusThis skill is a local credential guide, not a cross-skill runtime dependency.
1. Check if local AK/SK exists
└─ No → Run open_login_page.py (open login in browser) → Ask user to run local config command
└─ Yes → Continue
2. Check if local Token exists and is not expired
└─ No → Call API to request/refresh Token → Save
└─ Yes → Continue
3. Prompt user to continue target action
AK/SK and Token are read from the same config file. Path and format follow the script scripts/chanjing_config.py in this skill.
~/.chanjing/credentials.json(目录由 CHANJING_OPENAPI_CREDENTIALS_DIR 覆盖,兼容 CHANJING_CONFIG_DIR){
"app_id": "Your Access Key",
"secret_key": "Your Secret Key",
"access_token": "Optional, auto-generated",
"expire_in": 1721289220
}
expire_in is a Unix timestamp. Token is valid for about 24 hours; refresh 5 minutes before expiry.
When local app_id or secret_key is missing:
open_login_page.py script to open the Chanjing sign-in page in the default browser (https://www.chanjing.cc/openapi/login).Commands to set AK/SK (use either):
python scripts/chanjing_config.py --ak <your_app_id> --sk <your_secret_key>
python skills/chanjing-credentials-guard/scripts/chanjing_config.py --ak <your_app_id> --sk <your_secret_key>
To open the login page manually: python skills/chanjing-credentials-guard/scripts/open_login_page.py
When the user clearly wants to generate chanjing keys, get keys, or configure AK/SK, follow this flow:
Check if local AK/SK already exists (read ~/.chanjing/credentials.json for non-empty app_id and secret_key, or run python skills/chanjing-credentials-guard/scripts/chanjing_config.py --status).
If already configured: ask whether user wants to overwrite local config.
If not configured: Run the “Guide steps” below directly.
open_login_page.py to open the Chanjing login page in the default browser.App ID and Secret Key with copy buttons.python skills/chanjing-credentials-guard/scripts/chanjing_config.py --ak <your_app_id> --sk <your_secret_key>
python skills/chanjing-credentials-guard/scripts/chanjing_config.py --statusPOST https://open-api.chanjing.cc/open/v1/access_token
Content-Type: application/json
Request body:
{
"app_id": "{{app_id}}",
"secret_key": "{{secret_key}}"
}
Response (success code: 0):
{
"code": 0,
"msg": "success",
"data": {
"access_token": "xxx",
"expire_in": 1721289220
}
}
expire_in: Unix timestamp for token expirycode !== 0, AK/SK is invalid or the request failedchanjing_config.py); ensure app_id and secret_key are non-empty.access_token exists and expire_in > current_time + 300 (refresh 5 minutes early).access_token and expire_in back to the file.Shortcut: Run python skills/chanjing-credentials-guard/scripts/chanjing_get_token.py; on success it prints access_token, on failure it prints guidance.
| Script | Description |
|---|---|
open_login_page.py | Opens the Chanjing login page and explains how new/existing users obtain AK/SK |
chanjing_config.py | Set or view AK/SK and Token status |
chanjing_get_token.py | Print a valid access_token to stdout (or guidance on failure) |
# Open login page (also runs automatically when AK/SK is missing)
python skills/chanjing-credentials-guard/scripts/open_login_page.py
# Set AK/SK manually
python skills/chanjing-credentials-guard/scripts/chanjing_config.py --ak <app_id> --sk <secret_key>
# View status
python skills/chanjing-credentials-guard/scripts/chanjing_config.py --status
/access_token, dto.OpenAccessTokenReq, dto.OpenAccessTokenResp