stelagent 0.0.2 → 0.0.4

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,87 +1,105 @@
1
- # @stelagent/cli
1
+ # Stelagent CLI
2
2
 
3
- Modular, agent-first CLI for Stellar — wallet, payments, markets, and DeFi.
3
+ Modular, agent-first CLI for Stellar — wallet, payments, markets, and monitoring.
4
4
 
5
- ## Quick Start
5
+ ## Quick start for AI agents
6
+
7
+ Paste this prompt into any AI agent (Claude Code, Cursor, OpenCode, OpenClaw, Hermes Agent, etc.) and chat naturally:
6
8
 
7
- ```bash
8
- npx @stelagent/cli wallet login -e you@example.com
9
+ ```
10
+ Read https://stelagent.noval.me/AGENTS.md, then set it up for me.
9
11
  ```
10
12
 
11
- Prompts for an OTP sent to your email, then creates or recovers your Stellar wallet.
13
+ The agent reads the skill definition, handles wallet creation, OTP verification, and every Stellar operation on your behalf.
12
14
 
13
- ## Usage
15
+ ### Install the skill
14
16
 
15
17
  ```bash
16
- stelagent <command> [options]
18
+ # Via flins (recommended)
19
+ npx flins@latest add stelagent.noval.me
20
+
21
+ # Via skills.sh
22
+ npx skills add stelagent.noval.me/stelagent-cli
17
23
  ```
18
24
 
19
- ### `wallet login`
25
+ Both commands download the skill into your project's skills directory and wire it into your agent's configuration automatically.
20
26
 
21
- Sign in with email to create or recover your wallet.
27
+ ## Install
22
28
 
23
29
  ```bash
24
- stelagent wallet login -e you@example.com
25
- stelagent wallet login -e you@example.com -n testnet
30
+ npx stelagent@latest <command>
31
+ # or
32
+ bunx stelagent@latest <command>
26
33
  ```
27
34
 
28
- | Flag | Description |
29
- | --------------- | ------------------------------------------ |
30
- | `-e, --email` | Your email address (required) |
31
- | `-n, --network` | `testnet` or `pubnet` (default: `testnet`) |
35
+ No install needed — `npx` always runs the latest published version.
32
36
 
33
- One email always maps to one wallet. Logging in from any device with the same email recovers the same wallet.
37
+ ## Commands
34
38
 
35
- ### `wallet address`
36
-
37
- Show the wallet public key.
39
+ ### Wallet
38
40
 
39
41
  ```bash
40
- stelagent wallet address
42
+ npx stelagent@latest wallet login -e you@example.com # Request OTP
43
+ npx stelagent@latest wallet verify -e you@example.com -o 123456 # Verify OTP
44
+ npx stelagent@latest wallet address # Show public key
45
+ npx stelagent@latest wallet balance # Check balances
46
+ npx stelagent@latest wallet transfer -t GDXXX... -a 10 # Send XLM
47
+ npx stelagent@latest wallet logout # Clear session
41
48
  ```
42
49
 
43
- ### `wallet balance`
44
-
45
- Show token balances.
50
+ ### Payments
46
51
 
47
52
  ```bash
48
- stelagent wallet balance
53
+ npx stelagent@latest send GDXXX... 100 -a USDC:GAXYZ... # Custom asset
54
+ npx stelagent@latest send GDXXX... 50 -a native --memo text:ref-99 # XLM with memo
55
+ npx stelagent@latest pay https://api.example.com/premium # x402 payment
49
56
  ```
50
57
 
51
- ### `wallet transfer`
52
-
53
- Send XLM to another Stellar address.
58
+ ### Account queries
54
59
 
55
60
  ```bash
56
- stelagent wallet transfer -t GDXXX... -a 10
61
+ npx stelagent@latest account details GDXXX... # Balances, signers, thresholds
62
+ npx stelagent@latest account transactions GDXXX... # Transaction history
63
+ npx stelagent@latest account payments GDXXX... # Payment history
64
+ npx stelagent@latest account effects GDXXX... # Effect history
57
65
  ```
58
66
 
59
- | Flag | Description |
60
- | -------------- | --------------------------------- |
61
- | `-t, --to` | Destination public key (required) |
62
- | `-a, --amount` | Amount in XLM (required) |
67
+ ### Assets & fees
63
68
 
64
- ### `wallet logout`
69
+ ```bash
70
+ npx stelagent@latest assets search --code USDC # Search assets
71
+ npx stelagent@latest assets orderbook --selling XLM --buying USDC:G... # Order book
72
+ npx stelagent@latest fee # Fee stats
73
+ ```
65
74
 
66
- Clear the local session.
75
+ ### Streaming
67
76
 
68
77
  ```bash
69
- stelagent wallet logout
78
+ npx stelagent@latest monitor transactions GDXXX... # Stream transactions
79
+ npx stelagent@latest monitor payments GDXXX... # Stream payments
80
+ npx stelagent@latest monitor effects GDXXX... # Stream effects
70
81
  ```
71
82
 
72
- ### `pay <url>`
73
-
74
- Make an x402 payment to access a paywalled resource.
83
+ ### MCP server
75
84
 
76
85
  ```bash
77
- stelagent pay https://api.example.com/premium
86
+ npx stelagent@latest mcp # Start MCP server on stdio
78
87
  ```
79
88
 
80
- If the URL returns HTTP 402, the CLI negotiates payment using the x402 protocol and retries with a signed payment header.
89
+ All commands accept `-n testnet|pubnet` (default: `testnet`) and `-f json|text`. Account and asset queries support `--limit`, `--cursor`, and `--order asc|desc`.
90
+
91
+ ## Authentication
92
+
93
+ Two-step OTP flow:
94
+
95
+ 1. **`wallet login -e <email>`** — sends a one-time code to your email
96
+ 2. **`wallet verify -e <email> -o <code>`** — verifies the code and creates (or recovers) your wallet
97
+
98
+ One email maps to one wallet, recoverable from any device.
81
99
 
82
100
  ## Output
83
101
 
84
- All commands output structured JSON:
102
+ All commands return structured JSON:
85
103
 
86
104
  ```json
87
105
  { "ok": true, "data": { ... } }
@@ -91,9 +109,11 @@ All commands output structured JSON:
91
109
  { "ok": false, "error": "..." }
92
110
  ```
93
111
 
112
+ Use `--format text` for human-readable output.
113
+
94
114
  ## Architecture
95
115
 
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.
116
+ 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 over HTTPS when needed and never written to disk.
97
117
 
98
118
  ## Development
99
119
 
package/dist/index.mjs CHANGED
@@ -201,7 +201,7 @@ function formatError(e) {
201
201
  if (e instanceof Error) return e.message;
202
202
  return String(e);
203
203
  }
204
- async function runApp(command, fn, format = "json") {
204
+ async function runApp(command, fn, format = "json", options) {
205
205
  const start = Date.now();
206
206
  try {
207
207
  const result = await fn();
@@ -210,6 +210,7 @@ async function runApp(command, fn, format = "json") {
210
210
  ok: true,
211
211
  durationMs: Date.now() - start
212
212
  });
213
+ if (!options?.silent) printResult(Result.ok(result), format);
213
214
  return result;
214
215
  } catch (e) {
215
216
  writeAuditEntry({
@@ -1666,7 +1667,7 @@ const monitorTransactions = defineCommand({
1666
1667
  error: `Stream error: ${message}`
1667
1668
  }));
1668
1669
  });
1669
- }, format);
1670
+ }, format, { silent: true });
1670
1671
  } catch (e) {
1671
1672
  const message = e instanceof Error ? e.message : String(e);
1672
1673
  printResult(Result.err(`Failed to stream transactions: ${message}`), "json");
@@ -1743,7 +1744,7 @@ const monitorPayments = defineCommand({
1743
1744
  error: `Stream error: ${message}`
1744
1745
  }));
1745
1746
  });
1746
- }, format);
1747
+ }, format, { silent: true });
1747
1748
  } catch (e) {
1748
1749
  const message = e instanceof Error ? e.message : String(e);
1749
1750
  printResult(Result.err(`Failed to stream payments: ${message}`), "json");
@@ -1830,7 +1831,7 @@ const monitorCommand = defineCommand({
1830
1831
  error: `Stream error: ${message}`
1831
1832
  }));
1832
1833
  });
1833
- }, format);
1834
+ }, format, { silent: true });
1834
1835
  } catch (e) {
1835
1836
  const message = e instanceof Error ? e.message : String(e);
1836
1837
  printResult(Result.err(`Failed to stream effects: ${message}`), "json");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stelagent",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "description": "Modular, agent-first CLI for Stellar — wallet, payments, markets, and DeFi",
5
5
  "license": "MIT",
6
6
  "bin": {