ccxt-cli
Skill này làm gì
Skill này chỉ cách dùng công cụ dòng lệnh ccxt để gọi các hàm của sàn giao dịch từ terminal, mà không cần viết mã. Nó dành cho người muốn truy cập nhanh dữ liệu hoặc thao tác của sàn.
Khi nào nên dùng
- ✓Khi bạn muốn kiểm tra giá hoặc sổ lệnh tiền mã hóa từ terminal.
- ✓Khi bạn muốn xem số dư sàn hoặc các lệnh đang mở.
- ✓Khi bạn muốn theo dõi trực tiếp ticker hoặc sổ lệnh trong terminal.
Liên kết skill
https://github.com/ccxt/ccxt/blob/master/.claude/skills/ccxt-cli/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Cho tôi xem ticker Bitcoin hiện tại trên Kraken từ terminal của tôi.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Bạn gõ một lệnh với tên sàn và phương thức, chẳng hạn tra cứu ticker. Công cụ gọi sàn và in kết quả ra.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
CCXT CLI
The CCXT CLI (ccxt-cli on npm) exposes the entire unified CCXT API as a terminal command. Anything you can call in code — fetchTicker, fetchOHLCV, createOrder, fetchBalance, withdraw, exchange-specific implicit methods — you can call as:
ccxt <exchangeId> <methodName> [args...] [options]
It supports 100+ exchanges, REST and WebSocket, public and private endpoints, live terminal dashboards, and interactive OHLCV charts.
Installation
npm install -g ccxt-cli # installs the `ccxt` command
ccxt --help
One-off use without installing (note -p ccxt-cli — the package name differs from the binary name):
npx -y -p ccxt-cli ccxt kraken fetchTicker BTC/USD
From a clone of the CCXT repository (contributor mode — uses the local source tree instead of the published package):
npm run cli.ts -- kraken fetchTicker BTC/USD # runs cli/ts/cli.ts against local ts/
Quick start
# Public data — no API keys needed
ccxt kraken fetchTicker BTC/USD
ccxt kraken fetchOrderBook ETH/BTC
ccxt bybit fetchOHLCV BTC/USDT 15m
ccxt okx fetchTrades BTC/USDT
# Private data — needs API keys (see Authentication)
ccxt kraken fetchBalance
ccxt binance fetchOpenOrders BTC/USDT
# Place an order (start with --sandbox and small amounts!)
ccxt binance createOrder BTC/USDT limit buy 0.001 60000 --sandbox
Every run prints the CCXT version, the resolved call (e.g. kraken.fetchTicker ("BTC/USD")), the result, and timing. Use --raw to suppress everything except the JSON result.
Discovering methods and arguments
ccxt --help # all options, commands, and the config path for your OS
ccxt methods kraken # every method the exchange supports (its `has` capabilities)
ccxt explain createOrder # required/optional arguments for any unified method
ccxt history # your previously executed commands
ccxt explain <method> output shows the argument order you must follow:
Method: createOrder
Usage:
binance createOrder <symbol> <type> <side> <amount> [price] [params]
Arguments:
- symbol (required) — Market symbol e.g., BTC/USDT
- type (required) — e.g., limit or market
- side (required) — order side e.g., buy or sell
- amount (required)
- price (optional) — Price per unit of asset e.g., 26000.50
- params (optional) — Extra parameters for the exchange
Argument rules (important)
Arguments are positional and must follow the method's signature order. The CLI auto-converts each argument:
| You type | The method receives |
|---|---|
BTC/USDT |
string 'BTC/USDT' |
0.001, 100 |
number |
undefined |
undefined (placeholder to skip an optional arg — the call echo displays it as null, which is expected) |
true / false / null |
boolean / null |
"2025-05-01T01:23:45Z" |
milliseconds timestamp (ISO8601 datetimes auto-convert; date-only strings like 2025-05-01 do NOT — include the time part) |
'{"recvWindow":5000}' |
object (JSON must be shell-quoted) |
'["BTC/USDT","ETH/USDT"]' |
array (shell-quoted) |
Rule 1 — pad skipped optionals with undefined. To pass limit without since:
ccxt binance fetchOHLCV BTC/USDT 1h undefined 10 # since=undefined, limit=10
Rule 2 — --param key=value appends to the trailing params object. Repeat it for multiple keys. Values are coerced the same way (true, false, null, numbers, strings):
ccxt binance createOrder BTC/USDT market buy 0.01 undefined --param test=true --param clientOrderId=myOrder
Rule 3 — when using --param, explicitly fill ALL earlier optional positionals with undefined. If you leave gaps, the CLI mis-assigns arguments (a known quirk — the params object can end up in the wrong position). Correct:
ccxt bybit fetchOHLCV BTC/USDT 15m undefined undefined --param until=1722161166530 # ✅
ccxt bybit fetchOHLCV BTC/USDT --param until=1722161166530 # ❌ args get scrambled
Authentication
Private methods (fetchBalance, createOrder, fetchMyTrades, ...) need credentials. Three sources:
1. Environment variables
Pattern: <EXCHANGEID>_<CREDENTIAL> upper-cased. The credential names come from each exchange's requiredCredentials (apiKey, secret, password, uid, walletAddress, privateKey, ...):
export BINANCE_APIKEY=your_api_key
export BINANCE_SECRET=your_s
Câu hỏi thường gặp
Tôi cài đặt công cụ này thế nào?
Skill nói cài gói ccxt-cli từ npm dạng toàn cục, để có lệnh ccxt.
Tôi có cần khóa API không?
Dữ liệu công khai không cần khóa, nhưng dữ liệu riêng tư như số dư thì cần khóa API.
Có cách nào an toàn để thử lệnh không?
Skill khuyên dùng tùy chọn sandbox và số tiền nhỏ khi đặt lệnh.
Chi tiết
Mô tả gốc của tác giả
CCXT command-line interface (ccxt-cli) for interacting with 100+ cryptocurrency exchanges directly from the terminal — no code required. Covers installing the CLI, calling any unified CCXT method (fetchTicker, fetchOHLCV, createOrder, fetchBalance), passing arguments and exchange-specific params, authenticating with API keys, sandbox/testnet mode, streaming live tickers and orderbooks over WebSocket, plotting OHLCV charts, and scripting with raw JSON output. Use when the user wants to query an exchange, test API credentials, place or inspect orders, or debug exchange requests from the command
repo: ccxt/ccxt
Độ phổ biến
- Sao GitHub
- 45k
- Vị trí xếp hạng
- #6379
- Giấy phép
- MIT
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
binance-agentic-wallet
45kCho agent của bạn quản lý ví Binance Web3 qua công cụ dòng lệnh baw, gồm đăng nhập, số dư, chuyển khoản, hoán đổi token và lệnh giới hạn.
binance-sports-ai-analyzer
45kGiúp agent của bạn tra cứu dự đoán trận đấu World Cup, phân tích AI và thông tin tin tức, rồi tính lại tỷ lệ thắng khi bạn điều chỉnh các tín hiệu.
binance-tokenized-securities-info
45kGiúp agent của bạn tra cứu cổ phiếu Mỹ token hóa Ondo trên Binance Web3: danh sách token, thông tin công ty, trạng thái giao dịch và giá on-chain.
binance
45kCho agent của bạn dùng Binance Spot, USD-M Futures và Convert qua công cụ binance-cli. Yêu cầu bạn thiết lập xác thực trước.
Skill tương tự
api-connector-builder
280kGiúp agent của bạn xây dựng kết nối API mới theo đúng mẫu đã có, dùng khi bạn cần thêm một tích hợp mà không tạo cách làm mới.
api-design
280kGiúp agent của bạn thiết kế REST API theo các thực hành tốt nhất, hữu ích để định nghĩa cách API giao tiếp, hiển thị lỗi và tổ chức dữ liệu.
backend-patterns
280kGiúp agent của bạn với các mẫu kiến trúc phía máy chủ và tối ưu cơ sở dữ liệu, hữu ích khi xây dựng hoặc rà soát code chạy trên máy chủ.