This document provides runtime context for AI agents and tools integrating with the cdcx CLI.
- Binary name:
cdcx - Version: Run
cdcx --versionto check (workspace version defined in root Cargo.toml) - Purpose: Agent-first CLI for Crypto.com Exchange API v1
cdcx [GLOBAL_FLAGS] [COMMAND] [SUBCOMMAND] [OPTIONS]All output is JSON by default. Use --output table for human-readable tables (TTY-only).
--output <FORMAT> Output format: json (default), table
--json-input Expect JSON from stdin
--env <ENV> Environment: production (default), uat
--profile <PROFILE> Config profile name
--dry-run Preview changes without executing
--yes Skip safety confirmations
--verbose Verbose logging
CDCX_API_KEYandCDCX_API_SECRETenvironment variables (preferred)- Fallback:
CDC_API_KEYandCDC_API_SECRET
- Fallback:
- Config file:
~/.config/cdcx/config.toml
[default]
api_key = "..."
api_secret = "..."
environment = "production"
[profiles.uat]
api_key = "..."
api_secret = "..."
environment = "uat"cdcx account info # Requires auth; tests credentialsDefault output is JSON (one object per line for streams, single object for commands):
{"status":"ok","result":{"order_id":"123"}}Errors use the standardized error envelope:
{
"status":"error",
"error":{
"category":"auth",
"code":10002,
"message":"Invalid API key",
"retryable":false
}
}Query endpoint schemas dynamically:
cdcx schema list # All endpoints
cdcx schema list --group market # Endpoints in a group
cdcx schema show public/get-tickers # Full schema for endpoint
cdcx schema catalog # Full catalog as JSON arrayEach command is marked with a safety tier controlling when confirmation is required:
| Tier | CLI Behavior | MCP Behavior | Examples |
|---|---|---|---|
read |
No prompt | Always allowed | Market data, account info |
sensitive_read |
No prompt | Always allowed | Balances, positions |
mutate |
Prompt in table mode | Requires acknowledged=true |
Orders, transfers |
dangerous |
Always prompts | Requires --allow-dangerous + acknowledged=true |
Cancel-all, withdrawals |
When using MCP server or --yes flag, provide acknowledged=true in parameters for mutate-tier commands.
Configure and start the MCP server:
cdcx mcp config --enable trade,account
cdcx mcp config --allow-dangerous
cdcx mcpDefault services: market (public endpoints only). Config stored in ~/.config/cdcx/mcp.toml.
See agents/AGENTS.md for full MCP integration guide.
market— Ticker, book, trades, candlesticks, instruments, valuations, announcements, risk params, settlement, insuranceaccount— Summary, info, subaccount balances, positions, leverage, settings, fee rates, networkstrade— Order, amend, cancel, close position, open orders, order detailadvanced— OCO, OTO, OTOCO orderswallet— Withdraw, networks, deposit/withdrawal addresses and historyfiat— Deposit/withdraw fiat, accounts, currencies, channelsstaking— Stake/unstake, positions, instruments, rewardsmargin— Transfer, leveragehistory— Orders, trades, transactionsstream— Ticker, book, trades, candlesticks, settlements, funding, mark, index, balance, orders, positions, user trades, account risk
- Agent Integration Guide: See
agents/AGENTS.mdfor authentication, error handling, rate limiting, safety flows, and example workflows - Skills: See
skills/for step-by-step example workflows - Tool Catalog: See
agents/tool-catalog.jsonfor full endpoint metadata - Error Categories: See
agents/error-catalog.jsonfor error handling guidance