Skip to content

ChatEnv Variables

ChatECNU registers the ChatEnv type ecnu. Portal access and campus-network access share the same ECNU username and password. Stable configuration is stored in ~/.chatarch/envs/ECNU/<profile>.env; dynamic portal Web/API session state, cookies, and CSRF payloads are stored in ChatEnv's runtime token store at ~/.chatarch/tokens/ECNU/<profile>.json.

Common Commands

chatenv list
chatenv init -t ecnu -I

-e/--env selects a ChatEnv profile for the current command without switching the global active profile. Explicit profile values take precedence to avoid cross-account leakage.

ecnu net install updates only ECNU_AUTH_CLIENT and ECNU_AUTH_SETTING_FILE through EnvStore, retaining every other stored value. Without -e, it updates the active envs/ECNU/.env; with ecnu -e campus net install, only envs/ECNU/campus.env changes and the active file stays untouched. Process credentials are not backfilled. --dry-run performs no profile writes. The hidden --env-file override is not accepted by the installer.

Variables

Variable Purpose Sensitive
ECNU_USERNAME Shared portal and network username No
ECNU_PASSWORD Shared portal and network password Yes
ECNU_BASE_URL Portal base URL No
ECNU_NETWORK_BASE_URL Network portal base URL; default https://login.ecnu.edu.cn No
ECNU_NETWORK_AC_ID Network AC ID; default 1 No
ECNU_NETWORK_BACKEND python (default) or explicit binary compatibility No
ECNU_AUTH_CLIENT Binary-backend executable override No
ECNU_AUTH_SETTING_FILE Binary backend setting file; ignored by default Python No
ECNU_VISITOR_PASSWORD1 First default visitor password Yes
ECNU_VISITOR_PASSWORD2 Second default visitor password Yes
ECNU_VISITOR_REMARK Default visitor remark No

Examples

ecnu -e default home status
chatenv token status -s ECNU -p default
chatenv token refresh ECNU default
ecnu -e default net check --json
ecnu -e default visitor default -I

chatenv token refresh ECNU <profile> runs one non-interactive OCR-backed auto-login using ECNU_USERNAME / ECNU_PASSWORD from the matching stable env profile, then lets ChatEnv write the runtime token-store record. It fails closed when the portal requires SMS verification or rejects all CAPTCHA candidates; use ecnu -e <profile> home login ... first for interactive login.