
Okx How To Play
Install and refresh the OKX OnchainOS CLI before any onchainos skill runs so solo builders do not hit stale or missing binaries mid-session.
Overview
OKX how-to-play is an agent skill for the Build phase that ensures the OnchainOS CLI is on the latest stable release before any onchainos command runs in the session.
Install
npx skills add https://github.com/okx/onchainos-skills --skill okx-how-to-playWhat is this skill?
- Resolves latest stable tag via GitHub releases API before the first onchainos command each session
- Installs or updates onchainos when missing or when ~/.onchainos/last_check is older than 12 hours
- Downloads install.sh plus checksum from tagged releases on macOS/Linux (Windows paths documented)
- Degrades gracefully when API fails but a local binary already exists
- Stops with clear network/manual-install guidance when CLI is absent and release fetch fails
- 12-hour cache window on ~/.onchainos/last_check
Adoption & trust: 1.1k installs on skills.sh; 284 GitHub stars; 2/3 security scanners passed (skills.sh audits).
What problem does it solve?
You want to run OKX OnchainOS skills but the CLI is missing, outdated, or you are unsure whether the agent will silently use a broken binary.
Who is it for?
Solo builders chaining multiple OKX onchain skills in one agent session who need reliable CLI versioning without hand-maintaining installs.
Skip if: Builders who only read static docs and never invoke onchainos commands, or teams that centrally manage the binary outside the agent.
When should I use this skill?
Before the first onchainos command each agent session when using any skill from okx/onchainos-skills.
What do I get? / Deliverables
After pre-flight, onchainos is installed or verified current so other OnchainOS skills can run without blocking on setup errors.
- Verified or updated onchainos CLI ready for downstream commands
Recommended Skills
Journey fit
Canonical shelf is Build because OnchainOS is agent tooling wired into the product before you execute onchain workflows. Integrations fits CLI install, GitHub release resolution, and session pre-flight that gates every other onchainos skill.
How it compares
Use as a session gate skill—not a substitute for individual OKX domain playbooks that assume onchainos is already callable.
Common Questions / FAQ
Who is okx-how-to-play for?
Indie developers and agent users working through the OKX OnchainOS skill pack who need automated install and update checks before onchain operations.
When should I use okx-how-to-play?
At the start of any session before the first onchainos command, and again when installs fail or the 12-hour last_check cache expires during Build integrations work.
Is okx-how-to-play safe to install?
It pulls installers from the official okx/onchainos-skills GitHub releases; review the Security Audits panel on this Prism page and verify checksums before running downloaded scripts.
SKILL.md
READMESKILL.md - Okx How To Play
# Shared Pre-flight Checks > This file is shared across all onchainos skills. Follow these steps before the first `onchainos` command each session. Every time before running any `onchainos` command, always follow these steps in order. Do not echo routine command output to the user; only provide a brief status update when installing, updating, or handling a failure. 1. **Resolve latest stable version**: Fetch the latest stable release tag from the GitHub API: ``` curl -sSL "https://api.github.com/repos/okx/onchainos-skills/releases/latest" ``` Extract the `tag_name` field (e.g., `v1.0.5`) into `LATEST_TAG`. If the API call fails and `onchainos` is already installed locally, skip steps 2-3 and continue with step 4 (the user may be offline or rate-limited; a stale binary is better than blocking). If `onchainos` is **not** installed, **stop** and tell the user to check their network connection or install manually from https://github.com/okx/onchainos-skills. 2. **Install or update**: If `onchainos` is not found, or if the cache at `~/.onchainos/last_check` (`$env:USERPROFILE\.onchainos\last_check` on Windows) is older than 12 hours: - Download the installer and its checksum file from the latest release tag: - **macOS/Linux**: `curl -sSL "https://raw.githubusercontent.com/okx/onchainos-skills/${LATEST_TAG}/install.sh" -o /tmp/onchainos-install.sh` `curl -sSL "https://github.com/okx/onchainos-skills/releases/download/${LATEST_TAG}/installer-checksums.txt" -o /tmp/installer-checksums.txt` - **Windows**: `Invoke-WebRequest -Uri "https://raw.githubusercontent.com/okx/onchainos-skills/${LATEST_TAG}/install.ps1" -OutFile "$env:TEMP\onchainos-install.ps1"` `Invoke-WebRequest -Uri "https://github.com/okx/onchainos-skills/releases/download/${LATEST_TAG}/installer-checksums.txt" -OutFile "$env:TEMP\installer-checksums.txt"` - Verify the installer's SHA256 against `installer-checksums.txt`. On mismatch, **stop** and warn — the installer may have been tampered with. - Execute: `sh /tmp/onchainos-install.sh` (or `& "$env:TEMP\onchainos-install.ps1"` on Windows). The installer handles version comparison internally and only downloads the binary if needed. - On other failures, point to https://github.com/okx/onchainos-skills. 3. **Verify binary integrity** (once per session): Run `onchainos --version` to get the installed version (e.g., `1.0.5` or `2.0.0-beta.0`). Construct the installed tag as `v<version>`. Download `checksums.txt` for the **installed version's tag** (not necessarily LATEST_TAG): `curl -sSL "https://github.com/okx/onchainos-skills/releases/download/v<version>/checksums.txt" -o /tmp/onchainos-checksums.txt` Look up the platform target and compare the installed binary's SHA256 against the checksum. On mismatch, reinstall (step 2) and re-verify. If still mismatched, **stop** and warn. - Platform targets — macOS: `arm64`->`aarch64-apple-darwin`, `x86_64`->`x86_64-apple-darwin`; Linux: `x86_64`->`x86_64-unknown-linux-gnu`, `aarch64`->`aarch64-unknown-linux-gnu`, `i686`->`i686-unknown-linux-gnu`, `armv7l`->`armv7-unknown-linux-gnueabihf`; Windows: `AMD64`->`x86_64-pc-windows-msvc`, `x86`->`i686-pc-windows-msvc`, `ARM64`->`aarch64-pc-windows-msvc` - Hash command — macOS/Linux: `shasum -a 256 ~/.local/bin/onchainos`; Windows: `(Get-FileHash "$env:USERPROFILE\.local\bin\onchainos.exe" -Algorithm SHA256).Hash.ToLower()` 4. **Version drift check** — REQUIRED, run even if steps 1-3 were skipped. - Run `onchainos --version` → CLI version (e.g., `2.2.9`) - Read `version` field from the active skill's YAML frontmatter (e.g., `version: "2.0.0"` at the top of SKILL.md) - If CLI version > skill version → warn the user and offer to refresh skills: **"⚠️ Skill outdated (skill vX.Y.Z < CLI vA.B.C). Run `onchainos upgrade` to refresh both the CLI and any locally cloned skill checkouts (`~/.codex/onchainos-skills`, `~/.openclaw/onc