stelagent 0.0.1

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.
Files changed (3) hide show
  1. package/README.md +104 -0
  2. package/dist/index.mjs +1927 -0
  3. package/package.json +43 -0
package/README.md ADDED
@@ -0,0 +1,104 @@
1
+ # @stelagent/cli
2
+
3
+ Modular, agent-first CLI for Stellar — wallet, payments, markets, and DeFi.
4
+
5
+ ## Quick Start
6
+
7
+ ```bash
8
+ npx @stelagent/cli wallet login -e you@example.com
9
+ ```
10
+
11
+ Prompts for an OTP sent to your email, then creates or recovers your Stellar wallet.
12
+
13
+ ## Usage
14
+
15
+ ```bash
16
+ stelagent <command> [options]
17
+ ```
18
+
19
+ ### `wallet login`
20
+
21
+ Sign in with email to create or recover your wallet.
22
+
23
+ ```bash
24
+ stelagent wallet login -e you@example.com
25
+ stelagent wallet login -e you@example.com -n testnet
26
+ ```
27
+
28
+ | Flag | Description |
29
+ | --------------- | ------------------------------------------ |
30
+ | `-e, --email` | Your email address (required) |
31
+ | `-n, --network` | `testnet` or `pubnet` (default: `testnet`) |
32
+
33
+ One email always maps to one wallet. Logging in from any device with the same email recovers the same wallet.
34
+
35
+ ### `wallet address`
36
+
37
+ Show the wallet public key.
38
+
39
+ ```bash
40
+ stelagent wallet address
41
+ ```
42
+
43
+ ### `wallet balance`
44
+
45
+ Show token balances.
46
+
47
+ ```bash
48
+ stelagent wallet balance
49
+ ```
50
+
51
+ ### `wallet transfer`
52
+
53
+ Send XLM to another Stellar address.
54
+
55
+ ```bash
56
+ stelagent wallet transfer -t GDXXX... -a 10
57
+ ```
58
+
59
+ | Flag | Description |
60
+ | -------------- | --------------------------------- |
61
+ | `-t, --to` | Destination public key (required) |
62
+ | `-a, --amount` | Amount in XLM (required) |
63
+
64
+ ### `wallet logout`
65
+
66
+ Clear the local session.
67
+
68
+ ```bash
69
+ stelagent wallet logout
70
+ ```
71
+
72
+ ### `pay <url>`
73
+
74
+ Make an x402 payment to access a paywalled resource.
75
+
76
+ ```bash
77
+ stelagent pay https://api.example.com/premium
78
+ ```
79
+
80
+ If the URL returns HTTP 402, the CLI negotiates payment using the x402 protocol and retries with a signed payment header.
81
+
82
+ ## Output
83
+
84
+ All commands output structured JSON:
85
+
86
+ ```json
87
+ { "ok": true, "data": { ... } }
88
+ ```
89
+
90
+ ```json
91
+ { "ok": false, "error": "..." }
92
+ ```
93
+
94
+ ## Architecture
95
+
96
+ Wallets are stored server-side — one wallet per email, recoverable from any device. The CLI only holds a session token locally (`~/.stelagent/session.json`). Secret keys are fetched from the server over HTTPS on each command invocation and never persisted to disk.
97
+
98
+ ## Development
99
+
100
+ ```bash
101
+ bun install
102
+ vp run @stelagent/cli#build
103
+ bun packages/cli/src/index.ts --help
104
+ ```