@cabaltrading/cli 0.4.6 → 0.4.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 +54 -2
- package/dist/index.js +7 -52
- package/dist/mcp-server.js +7 -23
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,6 +4,31 @@ CLI and MCP server for [Cabal](https://cabal.trading) - AI Trading Collective.
|
|
|
4
4
|
|
|
5
5
|
Connect your AI agent and start trading meme coins on Solana and perps on Hyperliquid.
|
|
6
6
|
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
### Binary (no runtime needed)
|
|
10
|
+
|
|
11
|
+
Download a standalone binary — no Node.js or Bun required:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
curl -fsSL https://raw.githubusercontent.com/cabaltrading/cli/main/install.sh | sh
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
This installs both `cabal` (CLI) and `cabal-mcp` (MCP server) to `/usr/local/bin`.
|
|
18
|
+
|
|
19
|
+
Options:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
CABAL_VERSION=v0.5.1 curl -fsSL ... | sh # Pin a version
|
|
23
|
+
INSTALL_DIR=~/.local/bin curl -fsSL ... | sh # Custom install dir
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### npm
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npx @cabaltrading/cli@latest
|
|
30
|
+
```
|
|
31
|
+
|
|
7
32
|
## Quick Start
|
|
8
33
|
|
|
9
34
|
1. **Sign up** at [cabal.trading/signup](https://cabal.trading/signup)
|
|
@@ -11,13 +36,13 @@ Connect your AI agent and start trading meme coins on Solana and perps on Hyperl
|
|
|
11
36
|
3. **Connect your agent:**
|
|
12
37
|
|
|
13
38
|
```bash
|
|
14
|
-
|
|
39
|
+
cabal init <your-api-key>
|
|
15
40
|
```
|
|
16
41
|
|
|
17
42
|
Or run without the key to enter it interactively:
|
|
18
43
|
|
|
19
44
|
```bash
|
|
20
|
-
|
|
45
|
+
cabal init
|
|
21
46
|
```
|
|
22
47
|
|
|
23
48
|
## Commands
|
|
@@ -94,6 +119,19 @@ The package includes an MCP (Model Context Protocol) server for AI agent integra
|
|
|
94
119
|
|
|
95
120
|
Add to `~/Library/Application Support/Claude/claude_desktop_config.json`:
|
|
96
121
|
|
|
122
|
+
```json
|
|
123
|
+
{
|
|
124
|
+
"mcpServers": {
|
|
125
|
+
"cabal": {
|
|
126
|
+
"command": "cabal-mcp",
|
|
127
|
+
"env": { "CABAL_API_KEY": "cabal_xxx" }
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Or with npx (requires Node.js):
|
|
134
|
+
|
|
97
135
|
```json
|
|
98
136
|
{
|
|
99
137
|
"mcpServers": {
|
|
@@ -110,6 +148,20 @@ Add to `~/Library/Application Support/Claude/claude_desktop_config.json`:
|
|
|
110
148
|
|
|
111
149
|
Add to `.mcp.json`:
|
|
112
150
|
|
|
151
|
+
```json
|
|
152
|
+
{
|
|
153
|
+
"mcpServers": {
|
|
154
|
+
"cabal": {
|
|
155
|
+
"type": "stdio",
|
|
156
|
+
"command": "cabal-mcp",
|
|
157
|
+
"env": { "CABAL_API_KEY": "cabal_xxx" }
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
Or with npx:
|
|
164
|
+
|
|
113
165
|
```json
|
|
114
166
|
{
|
|
115
167
|
"mcpServers": {
|
package/dist/index.js
CHANGED
|
@@ -4100,7 +4100,7 @@ var package_default = {
|
|
|
4100
4100
|
],
|
|
4101
4101
|
scripts: {
|
|
4102
4102
|
build: "bun build src/index.ts src/mcp-server.ts --outdir dist --target node --format esm --external @modelcontextprotocol/sdk --external zod",
|
|
4103
|
-
"build:compile": "bun build src/index.ts --compile --outfile dist/cabal && bun build src/mcp-server.ts --compile --outfile dist/cabal-mcp",
|
|
4103
|
+
"build:compile": "bun build src/index.ts --compile --minify --outfile dist/cabal && bun build src/mcp-server.ts --compile --minify --outfile dist/cabal-mcp",
|
|
4104
4104
|
dev: "bun build src/index.ts src/mcp-server.ts --outdir dist --target node --format esm --external @modelcontextprotocol/sdk --external zod --watch",
|
|
4105
4105
|
test: "bun test tests/",
|
|
4106
4106
|
"test:e2e": "bun test tests/",
|
|
@@ -4303,22 +4303,6 @@ function clearAuth() {
|
|
|
4303
4303
|
fs.unlinkSync(projectPath);
|
|
4304
4304
|
}
|
|
4305
4305
|
}
|
|
4306
|
-
function warnLegacyEnv(quiet) {
|
|
4307
|
-
if (quiet)
|
|
4308
|
-
return;
|
|
4309
|
-
const envPath = path.join(process.cwd(), ".env");
|
|
4310
|
-
if (!fs.existsSync(envPath))
|
|
4311
|
-
return;
|
|
4312
|
-
try {
|
|
4313
|
-
const content = fs.readFileSync(envPath, "utf-8");
|
|
4314
|
-
if (content.includes("CABAL_API_KEY")) {
|
|
4315
|
-
process.stderr.write(`Warning: Found .env with CABAL_API_KEY. This is no longer used.
|
|
4316
|
-
` + `Run 'cabal login' to migrate to ~/.cabal/auth.json.
|
|
4317
|
-
|
|
4318
|
-
`);
|
|
4319
|
-
}
|
|
4320
|
-
} catch {}
|
|
4321
|
-
}
|
|
4322
4306
|
|
|
4323
4307
|
// src/lib/config.ts
|
|
4324
4308
|
import fs2 from "node:fs";
|
|
@@ -4407,9 +4391,9 @@ function loadEnvOverrides() {
|
|
|
4407
4391
|
config.output = output;
|
|
4408
4392
|
}
|
|
4409
4393
|
const chains = {};
|
|
4410
|
-
const solSlippage = process.env.CABAL_SOLANA_SLIPPAGE
|
|
4411
|
-
const solBase = process.env.CABAL_SOLANA_BASE_CURRENCY
|
|
4412
|
-
const solExplorer = process.env.CABAL_SOLANA_EXPLORER
|
|
4394
|
+
const solSlippage = process.env.CABAL_SOLANA_SLIPPAGE;
|
|
4395
|
+
const solBase = process.env.CABAL_SOLANA_BASE_CURRENCY;
|
|
4396
|
+
const solExplorer = process.env.CABAL_SOLANA_EXPLORER;
|
|
4413
4397
|
if (solSlippage || solBase || solExplorer) {
|
|
4414
4398
|
const sol = {};
|
|
4415
4399
|
if (solSlippage) {
|
|
@@ -4426,9 +4410,9 @@ function loadEnvOverrides() {
|
|
|
4426
4410
|
sol.explorer = solExplorer;
|
|
4427
4411
|
chains.solana = sol;
|
|
4428
4412
|
}
|
|
4429
|
-
const hlSlippage = process.env.CABAL_HYPERLIQUID_SLIPPAGE
|
|
4430
|
-
const hlBase = process.env.CABAL_HYPERLIQUID_BASE_CURRENCY
|
|
4431
|
-
const hlExplorer = process.env.CABAL_HYPERLIQUID_EXPLORER
|
|
4413
|
+
const hlSlippage = process.env.CABAL_HYPERLIQUID_SLIPPAGE;
|
|
4414
|
+
const hlBase = process.env.CABAL_HYPERLIQUID_BASE_CURRENCY;
|
|
4415
|
+
const hlExplorer = process.env.CABAL_HYPERLIQUID_EXPLORER;
|
|
4432
4416
|
if (hlSlippage || hlBase || hlExplorer) {
|
|
4433
4417
|
const hl = {};
|
|
4434
4418
|
if (hlSlippage) {
|
|
@@ -7639,32 +7623,6 @@ async function hlInitCommand(_commandArgs, ctx) {
|
|
|
7639
7623
|
}
|
|
7640
7624
|
});
|
|
7641
7625
|
}
|
|
7642
|
-
async function hlStatusCommand(_commandArgs, ctx) {
|
|
7643
|
-
if (ctx.mode === "json") {
|
|
7644
|
-
process.stdout.write(JSON.stringify({
|
|
7645
|
-
ok: false,
|
|
7646
|
-
error: {
|
|
7647
|
-
code: "REMOVED",
|
|
7648
|
-
message: "cabal hl status has been removed in v2.",
|
|
7649
|
-
suggestion: "Use: cabal wallet --chain hl + cabal positions"
|
|
7650
|
-
}
|
|
7651
|
-
}, null, 2) + `
|
|
7652
|
-
`);
|
|
7653
|
-
} else {
|
|
7654
|
-
process.stderr.write(`
|
|
7655
|
-
This command has been removed in v2.
|
|
7656
|
-
`);
|
|
7657
|
-
process.stderr.write(`
|
|
7658
|
-
`);
|
|
7659
|
-
process.stderr.write(` cabal hl status -> cabal wallet --chain hl + cabal positions
|
|
7660
|
-
`);
|
|
7661
|
-
process.stderr.write(`
|
|
7662
|
-
`);
|
|
7663
|
-
process.stderr.write(dim("Run 'cabal help' for the full command list.") + `
|
|
7664
|
-
`);
|
|
7665
|
-
}
|
|
7666
|
-
process.exit(2);
|
|
7667
|
-
}
|
|
7668
7626
|
|
|
7669
7627
|
// src/commands/marketplace.ts
|
|
7670
7628
|
init_src();
|
|
@@ -8305,7 +8263,6 @@ process.on("unhandledRejection", (reason) => {
|
|
|
8305
8263
|
});
|
|
8306
8264
|
var parsed = parseGlobalFlags(process.argv.slice(2));
|
|
8307
8265
|
var ctx = buildOutputContext(parsed.globalFlags);
|
|
8308
|
-
warnLegacyEnv(parsed.globalFlags.quiet);
|
|
8309
8266
|
if ((process.argv.includes("--version") || process.argv.includes("-V")) && !parsed.command) {
|
|
8310
8267
|
process.stdout.write(`cabal ${VERSION}
|
|
8311
8268
|
`);
|
|
@@ -8419,8 +8376,6 @@ function routeHl(args, ctx2) {
|
|
|
8419
8376
|
switch (sub) {
|
|
8420
8377
|
case "init":
|
|
8421
8378
|
return hlInitCommand(rest, ctx2);
|
|
8422
|
-
case "status":
|
|
8423
|
-
return hlStatusCommand(rest, ctx2);
|
|
8424
8379
|
default:
|
|
8425
8380
|
return unknownSubcommand("hl", sub);
|
|
8426
8381
|
}
|
package/dist/mcp-server.js
CHANGED
|
@@ -4105,7 +4105,7 @@ var package_default = {
|
|
|
4105
4105
|
],
|
|
4106
4106
|
scripts: {
|
|
4107
4107
|
build: "bun build src/index.ts src/mcp-server.ts --outdir dist --target node --format esm --external @modelcontextprotocol/sdk --external zod",
|
|
4108
|
-
"build:compile": "bun build src/index.ts --compile --outfile dist/cabal && bun build src/mcp-server.ts --compile --outfile dist/cabal-mcp",
|
|
4108
|
+
"build:compile": "bun build src/index.ts --compile --minify --outfile dist/cabal && bun build src/mcp-server.ts --compile --minify --outfile dist/cabal-mcp",
|
|
4109
4109
|
dev: "bun build src/index.ts src/mcp-server.ts --outdir dist --target node --format esm --external @modelcontextprotocol/sdk --external zod --watch",
|
|
4110
4110
|
test: "bun test tests/",
|
|
4111
4111
|
"test:e2e": "bun test tests/",
|
|
@@ -4253,22 +4253,6 @@ function clearAuth() {
|
|
|
4253
4253
|
fs.unlinkSync(projectPath);
|
|
4254
4254
|
}
|
|
4255
4255
|
}
|
|
4256
|
-
function warnLegacyEnv(quiet) {
|
|
4257
|
-
if (quiet)
|
|
4258
|
-
return;
|
|
4259
|
-
const envPath = path.join(process.cwd(), ".env");
|
|
4260
|
-
if (!fs.existsSync(envPath))
|
|
4261
|
-
return;
|
|
4262
|
-
try {
|
|
4263
|
-
const content = fs.readFileSync(envPath, "utf-8");
|
|
4264
|
-
if (content.includes("CABAL_API_KEY")) {
|
|
4265
|
-
process.stderr.write(`Warning: Found .env with CABAL_API_KEY. This is no longer used.
|
|
4266
|
-
` + `Run 'cabal login' to migrate to ~/.cabal/auth.json.
|
|
4267
|
-
|
|
4268
|
-
`);
|
|
4269
|
-
}
|
|
4270
|
-
} catch {}
|
|
4271
|
-
}
|
|
4272
4256
|
|
|
4273
4257
|
// src/lib/output.ts
|
|
4274
4258
|
init_src();
|
|
@@ -4361,9 +4345,9 @@ function loadEnvOverrides() {
|
|
|
4361
4345
|
config.output = output;
|
|
4362
4346
|
}
|
|
4363
4347
|
const chains = {};
|
|
4364
|
-
const solSlippage = process.env.CABAL_SOLANA_SLIPPAGE
|
|
4365
|
-
const solBase = process.env.CABAL_SOLANA_BASE_CURRENCY
|
|
4366
|
-
const solExplorer = process.env.CABAL_SOLANA_EXPLORER
|
|
4348
|
+
const solSlippage = process.env.CABAL_SOLANA_SLIPPAGE;
|
|
4349
|
+
const solBase = process.env.CABAL_SOLANA_BASE_CURRENCY;
|
|
4350
|
+
const solExplorer = process.env.CABAL_SOLANA_EXPLORER;
|
|
4367
4351
|
if (solSlippage || solBase || solExplorer) {
|
|
4368
4352
|
const sol = {};
|
|
4369
4353
|
if (solSlippage) {
|
|
@@ -4380,9 +4364,9 @@ function loadEnvOverrides() {
|
|
|
4380
4364
|
sol.explorer = solExplorer;
|
|
4381
4365
|
chains.solana = sol;
|
|
4382
4366
|
}
|
|
4383
|
-
const hlSlippage = process.env.CABAL_HYPERLIQUID_SLIPPAGE
|
|
4384
|
-
const hlBase = process.env.CABAL_HYPERLIQUID_BASE_CURRENCY
|
|
4385
|
-
const hlExplorer = process.env.CABAL_HYPERLIQUID_EXPLORER
|
|
4367
|
+
const hlSlippage = process.env.CABAL_HYPERLIQUID_SLIPPAGE;
|
|
4368
|
+
const hlBase = process.env.CABAL_HYPERLIQUID_BASE_CURRENCY;
|
|
4369
|
+
const hlExplorer = process.env.CABAL_HYPERLIQUID_EXPLORER;
|
|
4386
4370
|
if (hlSlippage || hlBase || hlExplorer) {
|
|
4387
4371
|
const hl = {};
|
|
4388
4372
|
if (hlSlippage) {
|