@t2000/cli 0.2.5 → 0.2.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 +61 -21
- package/package.json +13 -13
- package/LICENSE +0 -21
package/README.md
CHANGED
|
@@ -43,11 +43,13 @@ npm install -g @t2000/cli
|
|
|
43
43
|
npm install -g @t2000/cli
|
|
44
44
|
|
|
45
45
|
t2000 balance check for funds
|
|
46
|
-
t2000 save all
|
|
46
|
+
t2000 save all start earning yield
|
|
47
47
|
t2000 address show address again
|
|
48
48
|
|
|
49
49
|
❯ t2000 send 10 USDC to 0x8b3e...d412
|
|
50
50
|
✓ Sent $10.00 USDC → 0x8b3e...d412
|
|
51
|
+
Gas: 0.0042 SUI (self-funded)
|
|
52
|
+
Balance: $90.00 USDC
|
|
51
53
|
Tx: https://suiscan.xyz/mainnet/tx/0xa1b2...
|
|
52
54
|
|
|
53
55
|
❯ t2000 save 80 USDC
|
|
@@ -62,8 +64,8 @@ npm install -g @t2000/cli
|
|
|
62
64
|
Health Factor: 3.39
|
|
63
65
|
Tx: https://suiscan.xyz/mainnet/tx/0xb3c4...
|
|
64
66
|
|
|
65
|
-
❯ t2000 swap 5 USDC
|
|
66
|
-
✓ Swapped 5 USDC → 5.
|
|
67
|
+
❯ t2000 swap 5 USDC SUI
|
|
68
|
+
✓ Swapped 5 USDC → 5.8300 SUI
|
|
67
69
|
Tx: https://suiscan.xyz/mainnet/tx/0xd5e6...
|
|
68
70
|
|
|
69
71
|
❯ t2000 pay https://data.api.com/prices
|
|
@@ -100,6 +102,7 @@ npm install -g @t2000/cli
|
|
|
100
102
|
| `t2000 init` | Create a new agent bank account (Ed25519 keypair, AES-256-GCM encrypted) |
|
|
101
103
|
| `t2000 lock` | Clear saved session (require PIN on next command) |
|
|
102
104
|
| `t2000 balance` | Show available USDC + savings + gas reserve |
|
|
105
|
+
| `t2000 balance --show-limits` | Include maxWithdraw, maxBorrow, and health factor |
|
|
103
106
|
| `t2000 address` | Show wallet address |
|
|
104
107
|
| `t2000 deposit` | Show funding instructions |
|
|
105
108
|
| `t2000 import` | Import an existing bank account from private key |
|
|
@@ -110,16 +113,17 @@ npm install -g @t2000/cli
|
|
|
110
113
|
|
|
111
114
|
| Command | Description |
|
|
112
115
|
|---------|-------------|
|
|
113
|
-
| `t2000 send <amount> USDC to <address>` | Send USDC to any Sui address |
|
|
116
|
+
| `t2000 send <amount> USDC to <address>` | Send USDC to any Sui address (the `to` keyword is optional) |
|
|
114
117
|
|
|
115
118
|
### Savings & DeFi
|
|
116
119
|
|
|
117
120
|
| Command | Description |
|
|
118
121
|
|---------|-------------|
|
|
119
|
-
| `t2000 save <amount>
|
|
120
|
-
| `t2000
|
|
121
|
-
| `t2000
|
|
122
|
-
| `t2000
|
|
122
|
+
| `t2000 save <amount> [asset]` | Deposit to NAVI Protocol (earn ~4–8% APY). Asset defaults to USDC. |
|
|
123
|
+
| `t2000 save all` | Deposit all available USDC |
|
|
124
|
+
| `t2000 withdraw <amount> [asset]` | Withdraw from savings |
|
|
125
|
+
| `t2000 borrow <amount> [asset]` | Borrow against savings collateral |
|
|
126
|
+
| `t2000 repay <amount> [asset]` | Repay outstanding borrows. Use `repay all` for full repayment. |
|
|
123
127
|
| `t2000 swap <amount> <from> <to>` | Swap via Cetus DEX (e.g. `swap 5 USDC SUI`) |
|
|
124
128
|
| `t2000 health` | Check savings health factor |
|
|
125
129
|
| `t2000 rates` | Current NAVI save/borrow APYs |
|
|
@@ -134,12 +138,24 @@ npm install -g @t2000/cli
|
|
|
134
138
|
| `t2000 pay <url>` | Pay for an x402-protected API resource |
|
|
135
139
|
| `t2000 pay <url> --max-price 0.10` | Set max USDC per request (default: $1.00) |
|
|
136
140
|
| `t2000 pay <url> --method POST --data '{...}'` | POST with JSON body |
|
|
141
|
+
| `t2000 pay <url> --header 'key=value'` | Add custom HTTP headers (repeatable) |
|
|
142
|
+
| `t2000 pay <url> --timeout 60` | Request timeout in seconds (default: 30) |
|
|
143
|
+
| `t2000 pay <url> --dry-run` | Show what would be paid without paying |
|
|
144
|
+
|
|
145
|
+
### Sentinel (Earn Bounties)
|
|
146
|
+
|
|
147
|
+
| Command | Description |
|
|
148
|
+
|---------|-------------|
|
|
149
|
+
| `t2000 sentinel list` | List active sentinels with prize pools and fees |
|
|
150
|
+
| `t2000 sentinel info <id>` | Show details for a specific sentinel |
|
|
151
|
+
| `t2000 sentinel attack <id> [prompt]` | Attack a sentinel with an adversarial prompt (costs SUI) |
|
|
152
|
+
| `t2000 sentinel attack <id> [prompt] --fee 0.5` | Override attack fee (default: sentinel's min fee) |
|
|
137
153
|
|
|
138
154
|
### Configuration
|
|
139
155
|
|
|
140
156
|
| Command | Description |
|
|
141
157
|
|---------|-------------|
|
|
142
|
-
| `t2000 config get
|
|
158
|
+
| `t2000 config get [key]` | Show a config value (omit key for all) |
|
|
143
159
|
| `t2000 config set <key> <value>` | Set a config value |
|
|
144
160
|
|
|
145
161
|
### HTTP API Server
|
|
@@ -155,14 +171,27 @@ curl -X POST -H "Authorization: Bearer t2k_..." \
|
|
|
155
171
|
http://localhost:3001/v1/send
|
|
156
172
|
```
|
|
157
173
|
|
|
158
|
-
|
|
174
|
+
| Option | Description | Default |
|
|
175
|
+
|--------|-------------|---------|
|
|
176
|
+
| `--port <port>` | Port number | `3001` |
|
|
177
|
+
| `--rate-limit <rps>` | Max requests per second | `10` |
|
|
178
|
+
|
|
179
|
+
## Global Flags
|
|
159
180
|
|
|
160
181
|
| Flag | Description |
|
|
161
182
|
|------|-------------|
|
|
162
183
|
| `--json` | Structured JSON output (for automation) |
|
|
163
184
|
| `--yes` | Skip confirmation prompts |
|
|
164
|
-
|
|
165
|
-
|
|
185
|
+
|
|
186
|
+
## Per-Command Options
|
|
187
|
+
|
|
188
|
+
| Command | Option | Description | Default |
|
|
189
|
+
|---------|--------|-------------|---------|
|
|
190
|
+
| `init` | `--name <name>` | Agent name | — |
|
|
191
|
+
| `init` | `--no-sponsor` | Skip gas sponsorship | — |
|
|
192
|
+
| `swap` | `--slippage <percent>` | Max slippage % | `3` |
|
|
193
|
+
| `history` | `--limit <n>` | Number of transactions | `20` |
|
|
194
|
+
| Most commands | `--key <path>` | Custom key file path | `~/.t2000/wallet.key` |
|
|
166
195
|
|
|
167
196
|
## Configuration
|
|
168
197
|
|
|
@@ -178,19 +207,30 @@ Config is stored at `~/.t2000/config.json`.
|
|
|
178
207
|
| Variable | Description |
|
|
179
208
|
|----------|-------------|
|
|
180
209
|
| `T2000_PIN` | Bank account PIN (skip interactive prompt) |
|
|
181
|
-
| `
|
|
182
|
-
| `T2000_KEY_PATH` | Custom key file path |
|
|
210
|
+
| `T2000_PRIVATE_KEY` | Private key for `t2000 import` (skip interactive prompt) |
|
|
183
211
|
|
|
184
212
|
## Gas Handling
|
|
185
213
|
|
|
186
214
|
Gas is fully automated:
|
|
187
215
|
|
|
188
|
-
1. **
|
|
189
|
-
2. **
|
|
190
|
-
3. **
|
|
216
|
+
1. **Self-funded** — uses SUI balance when reserve ≥ 0.05 SUI
|
|
217
|
+
2. **Auto-topup** — swaps $1 USDC → SUI when gas reserve is low
|
|
218
|
+
3. **Sponsored** — Gas Station sponsors the transaction as a fallback
|
|
191
219
|
|
|
192
220
|
You never need to manually acquire SUI for gas.
|
|
193
221
|
|
|
222
|
+
## Protocol Fees
|
|
223
|
+
|
|
224
|
+
| Operation | Fee |
|
|
225
|
+
|-----------|-----|
|
|
226
|
+
| Save | 0.1% |
|
|
227
|
+
| Borrow | 0.05% |
|
|
228
|
+
| Swap | **Free** |
|
|
229
|
+
| Withdraw | Free |
|
|
230
|
+
| Repay | Free |
|
|
231
|
+
| Send | Free |
|
|
232
|
+
| Pay (x402) | Free |
|
|
233
|
+
|
|
194
234
|
## File Locations
|
|
195
235
|
|
|
196
236
|
| File | Path | Description |
|
|
@@ -203,13 +243,13 @@ You never need to manually acquire SUI for gas.
|
|
|
203
243
|
```bash
|
|
204
244
|
# Full DeFi cycle
|
|
205
245
|
t2000 save all USDC # Deposit all available USDC
|
|
206
|
-
t2000 borrow 40 USDC
|
|
207
|
-
t2000 repay 40 USDC
|
|
208
|
-
t2000 withdraw all USDC
|
|
246
|
+
t2000 borrow 40 USDC # Borrow against it
|
|
247
|
+
t2000 repay 40 USDC # Pay it back
|
|
248
|
+
t2000 withdraw all USDC # Get everything out
|
|
209
249
|
|
|
210
250
|
# Automation-friendly (no prompts, JSON output)
|
|
211
251
|
t2000 balance --json
|
|
212
|
-
t2000
|
|
252
|
+
t2000 save 10 USDC --yes --json
|
|
213
253
|
|
|
214
254
|
# Use with AI coding agents
|
|
215
255
|
export T2000_PIN="agent-secret"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@t2000/cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.7",
|
|
4
4
|
"description": "CLI bank account for AI agents on Sui — send, save, swap, borrow from your terminal",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -30,15 +30,22 @@
|
|
|
30
30
|
"directory": "packages/cli"
|
|
31
31
|
},
|
|
32
32
|
"homepage": "https://t2000.ai",
|
|
33
|
+
"scripts": {
|
|
34
|
+
"build": "tsup",
|
|
35
|
+
"dev": "tsup --watch",
|
|
36
|
+
"typecheck": "tsc --noEmit",
|
|
37
|
+
"lint": "eslint src/",
|
|
38
|
+
"clean": "rm -rf dist"
|
|
39
|
+
},
|
|
33
40
|
"dependencies": {
|
|
34
41
|
"@hono/node-server": "^1",
|
|
35
42
|
"@inquirer/prompts": "^7",
|
|
36
43
|
"@mysten/sui": "^1.45.2",
|
|
44
|
+
"@t2000/sdk": "workspace:*",
|
|
45
|
+
"@t2000/x402": "workspace:*",
|
|
37
46
|
"commander": "^13",
|
|
38
47
|
"hono": "^4",
|
|
39
|
-
"picocolors": "^1"
|
|
40
|
-
"@t2000/sdk": "0.2.5",
|
|
41
|
-
"@t2000/x402": "0.2.4"
|
|
48
|
+
"picocolors": "^1"
|
|
42
49
|
},
|
|
43
50
|
"devDependencies": {
|
|
44
51
|
"@types/node": "^22",
|
|
@@ -46,12 +53,5 @@
|
|
|
46
53
|
"tsup": "^8",
|
|
47
54
|
"typescript": "^5"
|
|
48
55
|
},
|
|
49
|
-
"license": "MIT"
|
|
50
|
-
|
|
51
|
-
"build": "tsup",
|
|
52
|
-
"dev": "tsup --watch",
|
|
53
|
-
"typecheck": "tsc --noEmit",
|
|
54
|
-
"lint": "eslint src/",
|
|
55
|
-
"clean": "rm -rf dist"
|
|
56
|
-
}
|
|
57
|
-
}
|
|
56
|
+
"license": "MIT"
|
|
57
|
+
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 t2000
|
|
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.
|