Package Exports
- okx-trade-cli
- okx-trade-cli/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (okx-trade-cli) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
okx-trade-cli
English
Command line tool for OKX. Supports market data, account queries, spot and swap trading, and configuration management.
Install
npm install -g okx-trade-cliConfigure credentials
Create ~/.okx/config.toml:
default_profile = "demo"
[profiles.live]
api_key = "your-live-api-key"
secret_key = "your-live-secret-key"
passphrase = "your-live-passphrase"
[profiles.demo]
api_key = "your-demo-api-key"
secret_key = "your-demo-secret-key"
passphrase = "your-demo-passphrase"
demo = trueQuick usage
okx market ticker BTC-USDT
okx market orderbook BTC-USDT --sz 5
okx account balance
okx spot orders
okx swap positionsExamples
okx market candles BTC-USDT --bar 1H --limit 10
okx account balance BTC,ETH
okx spot place --instId BTC-USDT --side buy --ordType market --sz 100
okx swap leverage --instId BTC-USDT-SWAP --lever 10 --mgnMode crossFor more details, see the repository README.
中文
OKX 命令行工具,支持行情、账户查询、现货与合约交易,以及配置管理。
安装
npm install -g okx-trade-cli配置凭证
创建 ~/.okx/config.toml:
default_profile = "demo"
[profiles.live]
api_key = "your-live-api-key"
secret_key = "your-live-secret-key"
passphrase = "your-live-passphrase"
[profiles.demo]
api_key = "your-demo-api-key"
secret_key = "your-demo-secret-key"
passphrase = "your-demo-passphrase"
demo = true快速使用
okx market ticker BTC-USDT
okx market orderbook BTC-USDT --sz 5
okx account balance
okx spot orders
okx swap positions示例
okx market candles BTC-USDT --bar 1H --limit 10
okx account balance BTC,ETH
okx spot place --instId BTC-USDT --side buy --ordType market --sz 100
okx swap leverage --instId BTC-USDT-SWAP --lever 10 --mgnMode cross更多说明请参考仓库根目录 README。