/cdcx-cli:recipe-emergency-flattenfrom cdcx-cli
Cancels all open orders and closes every open position at market. Use when markets turn against you or API credentials may be compromised.
Ships in cdcx-cli. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
This is a destructive workflow. Only run when the user asks for it explicitly.
CDCX_API_KEY / CDCX_API_SECRET, or a profile)--allow-dangerous (this workflow uses tier-dangerous commands)--yes to skip prompts, or acknowledge each prompt# 1. Cancel every open order (dangerous)
cdcx trade cancel-all --yes -o json
# 2. Confirm no open orders remain
cdcx trade open-orders -o json
# 3. List every open position
cdcx account positions -o json
# 4. Close each position at market
# Run this per row returned in step 3
cdcx trade close-position <INSTRUMENT_NAME> --type MARKET --yes -o json
# 5. Verify positions are flat
cdcx account positions -o json
# 6. Also sweep advanced (OTO/OTOCO) orders — they live in a separate namespace
cdcx advanced cancel-all --yes -o json
cdcx advanced open-orders -o json
# 7. Final wallet check
cdcx account summary -o json
cdcx trade cancel-all --yes && \
cdcx advanced cancel-all --yes && \
cdcx account positions -o json | \
jq -r '.data[].instrument_name' | \
while read i; do cdcx trade close-position "$i" --type MARKET --yes; done && \
cdcx account positions -o json
cancel-all without an instrument cancels every open order across the accountclose-position is asynchronous — it returns an ack, not a fill. The position may remain open for a moment; step 5 confirmscdcx trade cancel-all — sweep them separately with cdcx advanced cancel-allcdcx account positions and cdcx trade open-orders until both are emptyWhat SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub crypto-com/cdcx-cli --plugin cdcx-cli13 skills in this plugin
/cdcx-advancedAdvanced contingency orders — OCO, OTO, OTOCO. Triggered orders with linked cancellation logic./cdcx-auth-setupCredential and profile management — configure API keys via the setup wizard, environment variables, or config file. Resolution order and troubleshooting./cdcx-autonomy-levelsProgressive agent autonomy — from read-only to fully autonomous. Pick the lowest level that gets the job done./cdcx-check-balanceVerify credentials and inspect account balance — the first action an agent takes before trading./cdcx-executionOrder placement and management — place, amend, cancel, close-position. Safety-first with dry-run and preflight checks./cdcx-isolated-marginTrade instruments that require isolated margin (e.g. RWA/equity perpetuals like SPYUSD-PERP). Covers the create-order flag, funding transfers, leverage adjustment, and the TUI M toggle.Other plugins' skills for the same job