okx-trade-cli 1.0.4 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,104 +1,58 @@
1
1
  # okx-trade-cli
2
2
 
3
- ## English
3
+ > `@okx_retail/okx-trade-cli` 的无 scope alias 包。
4
4
 
5
- Command line tool for OKX. Supports market data, account queries, spot and swap
6
- trading, and configuration management.
7
-
8
- ### Install
5
+ ## 安装
9
6
 
10
7
  ```bash
11
- npm install -g okx-trade-cli
12
- ```
13
-
14
- ### Configure credentials
15
-
16
- Create `~/.okx/config.toml`:
17
-
18
- ```toml
19
- default_profile = "demo"
20
-
21
- [profiles.live]
22
- api_key = "your-live-api-key"
23
- secret_key = "your-live-secret-key"
24
- passphrase = "your-live-passphrase"
8
+ # scope(更简洁)
9
+ npm install okx-trade-cli
25
10
 
26
- [profiles.demo]
27
- api_key = "your-demo-api-key"
28
- secret_key = "your-demo-secret-key"
29
- passphrase = "your-demo-passphrase"
30
- demo = true
11
+ # 带 scope(官方标准写法)
12
+ npm install @okx_retail/okx-trade-cli
31
13
  ```
32
14
 
33
- ### Quick usage
15
+ 两种方式完全等价,安装后暴露相同的可执行命令。
34
16
 
35
- ```bash
36
- okx market ticker BTC-USDT
37
- okx market orderbook BTC-USDT --sz 5
38
- okx account balance
39
- okx spot orders
40
- okx swap positions
41
- ```
42
-
43
- ### Examples
17
+ ## 提供的命令
44
18
 
45
- ```bash
46
- okx market candles BTC-USDT --bar 1H --limit 10
47
- okx account balance BTC,ETH
48
- okx spot place --instId BTC-USDT --side buy --ordType market --sz 100
49
- okx swap leverage --instId BTC-USDT-SWAP --lever 10 --mgnMode cross
50
- ```
19
+ | 命令 | 对应原包 | 用途 |
20
+ |------|---------|------|
21
+ | `okx` | `@okx_retail/okx-trade-cli` | OKX CLI 工具 |
51
22
 
52
- For more details, see the repository README.
53
-
54
- ---
55
-
56
- ## 中文
57
-
58
- OKX 命令行工具,支持行情、账户查询、现货与合约交易,以及配置管理。
59
-
60
- ### 安装
23
+ ## 使用示例
61
24
 
62
25
  ```bash
63
- npm install -g okx-trade-cli
26
+ npx okx market ticker BTC-USDT
27
+ npx okx account balance
28
+ npx okx swap positions
29
+ npx okx --help
64
30
  ```
65
31
 
66
- ### 配置凭证
32
+ 所有功能、参数、行为均来自主包,本包不含任何独立逻辑。
67
33
 
68
- 创建 `~/.okx/config.toml`:
34
+ ---
69
35
 
70
- ```toml
71
- default_profile = "demo"
36
+ ## 版本同步策略
72
37
 
73
- [profiles.live]
74
- api_key = "your-live-api-key"
75
- secret_key = "your-live-secret-key"
76
- passphrase = "your-live-passphrase"
38
+ | 事件 | 操作 |
39
+ |------|------|
40
+ | 主包发布新 patch/minor | 更新本包 `package.json` 中的依赖版本,打 tag 自动发布 |
41
+ | 主包发布新 major | 同上,同时更新本包 major 版本号保持一致 |
77
42
 
78
- [profiles.demo]
79
- api_key = "your-demo-api-key"
80
- secret_key = "your-demo-secret-key"
81
- passphrase = "your-demo-passphrase"
82
- demo = true
83
- ```
43
+ ---
84
44
 
85
- ### 快速使用
45
+ ## 发布流程
86
46
 
87
47
  ```bash
88
- okx market ticker BTC-USDT
89
- okx market orderbook BTC-USDT --sz 5
90
- okx account balance
91
- okx spot orders
92
- okx swap positions
93
- ```
48
+ # 1. 更新依赖版本号
49
+ # "dependencies": { "@okx_retail/okx-trade-cli": "^x.x.x" }
94
50
 
95
- ### 示例
51
+ # 2. 同步本包版本号
52
+ npm version patch # 或 minor / major
96
53
 
97
- ```bash
98
- okx market candles BTC-USDT --bar 1H --limit 10
99
- okx account balance BTC,ETH
100
- okx spot place --instId BTC-USDT --side buy --ordType market --sz 100
101
- okx swap leverage --instId BTC-USDT-SWAP --lever 10 --mgnMode cross
54
+ # 3. 打 tag,CI 自动发布
55
+ git push --follow-tags
102
56
  ```
103
57
 
104
- 更多说明请参考仓库根目录 README。
58
+ > 需要在 GitHub repo Settings → Secrets 中配置 `NPM_TOKEN`。
package/bin/okx.mjs ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import '@okx_retail/okx-trade-cli';
package/package.json CHANGED
@@ -1,40 +1,18 @@
1
1
  {
2
2
  "name": "okx-trade-cli",
3
- "version": "1.0.4",
4
- "description": "OKX CLI - Command line tool for OKX exchange",
5
- "type": "module",
6
- "license": "MIT",
7
- "main": "dist/index.js",
3
+ "version": "1.0.7",
4
+ "description": "Alias package for @okx_retail/okx-trade-cli supports both install methods",
8
5
  "bin": {
9
- "okx": "dist/index.js"
10
- },
11
- "files": [
12
- "dist",
13
- "README.md"
14
- ],
15
- "publishConfig": {
16
- "access": "public"
6
+ "okx": "bin/okx.mjs"
17
7
  },
18
- "engines": {
19
- "node": ">=18"
8
+ "files": ["bin"],
9
+ "scripts": {
10
+ "prepublishOnly": "node -e \"require('fs').chmodSync('bin/okx.mjs',0o755)\""
20
11
  },
21
- "keywords": [
22
- "okx",
23
- "cli",
24
- "trading"
25
- ],
12
+ "engines": { "node": ">=18" },
13
+ "keywords": ["okx", "cli", "trading", "alias"],
14
+ "license": "MIT",
26
15
  "dependencies": {
27
- "smol-toml": "^1.3.4"
28
- },
29
- "devDependencies": {
30
- "@types/node": "^25.2.2",
31
- "tsup": "^8.5.1",
32
- "typescript": "^5.9.3",
33
- "@okx-hub/core": "1.0.0"
34
- },
35
- "scripts": {
36
- "build": "tsup",
37
- "typecheck": "tsc --noEmit",
38
- "clean": "rm -rf dist"
16
+ "@okx_retail/okx-trade-cli": "^1.0.7"
39
17
  }
40
- }
18
+ }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 okx-hub
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.