Agent skill · software engineering · okx
okx-cex-auth
Use this skill when the user wants to 'login/log in/sign in', 'authenticate', 'authorize', 'connect OKX account', 'set up credentials', 'first time setup', 'configure okx', '登录', '授权', '认证', '连接账户', '首次配置'. Also when any OKX CLI command fails with an auth error: 'Run okx auth login first', 'Session expired', 'not authenticated', 'requires_auth', '401 Unauthorized', 'token expired/not found', 'StorageNotFoundError', '会话过期', '未认证', '需要登录'. Also when the user asks about login status or the login was interrupted. Also when the user wants to install/update/check/remove the okx-auth binary — 'install/update/remove auth', 'download okx-auth', '安装/更新/卸载认证', 'auth binary status', 'Failed to spawn okx-auth'. Also use before using okx-cex-trade/portfolio/earn/bot for the first time. Do NOT use for market data queries (use okx-cex-market).
Why this skill is useful
Provides specific commands and workflows for authenticating with the OKX CLI that are not widely known or documented.
What it needs
Requires npm installed locally. Requires okx account access. About 11k tokens when loaded. Last updated 2026-07-22. 160 stars on the source repository.
What this skill does
OKX CEX Authentication OAuth 2.0 device flow authentication for OKX CLI. Guides first-time setup, re-authentication after session expiry, and logout. Supported Sites Site Region URL -------- ----------------------- --------------- global Global www.okx.com eea EEA my.okx.com us US app.okx.com tr TR tr.okx.com Site is a separate dimension from auth method. Both API-key and OAuth paths require a site. Once selected, a site is persisted: API-key users: profile.site in ~/.okx/config.toml (written by okx config init). OAuth users: saved inside the okx-auth binary state the first time okx auth login --site <X> succeeds, and returned by okx auth status --json as the site field. There is no okx config set-site command — site cannot be persisted independently of an auth attempt. For OAuth flows, the agent must remember the user's choice within the conversation and pass --site <X> on okx auth login. Prerequisites Install okx CLI if not already installed: Step 0: Pre-flight Check (MANDATORY) Unconditional rule — do NOT skip Step 0 under any circumstances. Even if a prior skill (preflight, okx-cex-portfolio, etc.) already ran auth status and passed you a conclusion like "user is notloggedin, go log in" — you MUST re-run the two commands below yourself and walk Steps 0.1 → 0.2 → 0.3 in order. Upstream tool output does not substitute for your own pre-flight. The single most common failure mode for this skill is an agent that reads an upstream "not authenticated" signal, skips Step 0.1 site selection, and calls okx auth login with a silently-defaulted site. Run both in parallel: Then apply the following three checks in strict order — each step short-circuits the rest. Step 0.1 — Site check (independent of auth mode) A site is considered already selected if either is true: config show --json has any profile with a non-empty site field, OR auth status --json returns a non-empty site field AND status is loggedin or pending. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills okx/okx-cex-auth