Install
openclaw skills install @baijian/ctexcel-usage-skillCheck remaining CTExcel (UK) data, voice, and SMS allowances for an eSIM or physical SIM using the local ctexcel-usage CLI. Use when the user asks how much data is left, when a bundle expires, or wants a periodic balance summary. The CLI logs in with an SMS verification code and stores only the session cookie; this skill guides the code hand-off, interprets the JSON output, and explains what to do when the session expires.
openclaw skills install @baijian/ctexcel-usage-skillUse the ctexcel-usage CLI to read the same bundle data shown on the CTExcel
personal-home page. The CLI is a separate public binary; this skill does not
install or update it.
ctexcel-usage is on PATH, or the user has given its absolute path.ctexcel-usage version --output json before the first query.07****84).5 when it is still active.login --request-sms automatically from a scheduled task. Login
always requires the user's phone and the code they received.usage is the default
heartbeat. Only if an idle timeout is actually observed later should a
status keepalive be discussed, with the interval chosen from the observed
timeout.status never sends SMS; it only validates the stored session.Check the stored session:
ctexcel-usage status --output json
0 and "session_valid": true: continue to step 3.3, or no session yet (exit 2): continue to step 2.Log in with an SMS code. Ask the user for the phone number first, then:
ctexcel-usage login --account <phone> --request-sms
Tell the user a code was sent, that the request is valid for 10 minutes, and that a new code must not be requested within 10 minutes. The carrier's visible countdown is about 180 seconds, but the local cooldown is stricter on purpose. Ask for the code, then:
ctexcel-usage login --account <phone> --code <code>
Do not store the code anywhere. If the user does not receive it, wait for the cooldown before requesting again.
Query allowances:
ctexcel-usage usage --output json
If several accounts are stored, pass --account <phone>. Use
--sim-type physical only when the user says the line is a physical SIM;
the default is eSIM.
Summarize for the user:
valid_until).remaining_percent.{
"account": "07****84",
"sim_type": "esim",
"fetched_at": "2026-11-06T23:17:01+08:00",
"balance": 0.03,
"bundles": [
{
"name": "回国套餐",
"code": "CN15GB_365DAYS",
"valid_until": "2027-10-26 23:00:00",
"resources": [
{
"key": "china_data",
"name": "中国流量",
"unit": "GB",
"total": 15,
"remaining": 14.5,
"remaining_percent": 96.67
}
]
}
]
}
Resource keys: china_data, europe_data, local_data, global_data,
uk_cn_data, bonus_data. Values are already converted to GB. A missing
resource means the plan does not include it, not that it is zero.
| Code | Meaning | Action |
|---|---|---|
0 | Success | Use the output |
2 | Invalid arguments or no stored session | Ask for the account and log in |
3 | Session expired | Ask for a new SMS code and log in again |
4 | Network or CTExcel API error | Check proxy/connectivity, retry once |
5 | SMS cooldown still active | Tell the user the remaining wait; do not retry |
The CLI honours HTTPS_PROXY and HTTP_PROXY; it does not read the macOS
system proxy. If the request fails with a network error and the user is behind
a local proxy, pass it explicitly:
ctexcel-usage usage --proxy http://127.0.0.1:6518 --output json
The --proxy flag applies to every subcommand, including login and status.
The equivalent environment variable form also works. Do not bake a proxy
address into scripts or notes.
The session is a server-controlled cookie. The CLI validates it on every run
and records login_at, last_valid_at, last_checked_at, and
first_invalid_at. It does not assume a fixed lifetime.
See references/session.md for the full lifecycle and references/api.md for endpoint details.
A daily scheduled query is safe: it reads the stored session, validates it, and
exits with code 3 when the user must log in again. On exit 3, notify the
user instead of attempting an unattended login.
No dedicated keepalive is scheduled by default. A daily usage is enough. If
an idle timeout is observed later, discuss an interval with the user based on
that observation. Never schedule --request-sms. Do not create a scheduler
unless the user asks for one.