Install
openclaw skills install zyt-credentials-guardGuide users to configure local Chanjing credentials safely via local commands only, and validate local token status when needed.
openclaw skills install zyt-credentials-guardThis skill is a local credential guide, not a runtime dependency for other skills. It does not require bundled helper scripts to be present.
1. Check if local AK/SK exists
└─ No → Open login page URL in browser → Ask user to configure local file
└─ Yes → Continue
2. Check if local Token exists and is not expired
└─ No → Call API to request/refresh Token → Save to local file
└─ Yes → Continue
3. Prompt user to continue target action
AK/SK and Token are read from the same local config file.
~/.chanjing/credentials.json (overridable by env 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:
https://www.chanjing.cc/openapi/login in the default browser.credentials.json file.Manual update example:
{
"app_id": "<your_app_id>",
"secret_key": "<your_secret_key>"
}
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).
If already configured: ask whether user wants to overwrite local config.
If not configured: Run the “Guide steps” below directly.
https://www.chanjing.cc/openapi/login in browser.App ID and Secret Key with copy buttons.~/.chanjing/credentials.json (or $CHANJING_CONFIG_DIR/credentials.json) with app_id and secret_key.app_id and secret_key.POST 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 failedapp_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./access_token, dto.OpenAccessTokenReq, dto.OpenAccessTokenResp