agentlaunch-cli 1.0.0
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 +359 -0
- package/dist/__tests__/config.test.d.ts +20 -0
- package/dist/__tests__/config.test.d.ts.map +1 -0
- package/dist/__tests__/config.test.js +155 -0
- package/dist/__tests__/config.test.js.map +1 -0
- package/dist/commands/config.d.ts +10 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +56 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/create.d.ts +22 -0
- package/dist/commands/create.d.ts.map +1 -0
- package/dist/commands/create.js +493 -0
- package/dist/commands/create.js.map +1 -0
- package/dist/commands/deploy.d.ts +18 -0
- package/dist/commands/deploy.d.ts.map +1 -0
- package/dist/commands/deploy.js +220 -0
- package/dist/commands/deploy.js.map +1 -0
- package/dist/commands/list.d.ts +10 -0
- package/dist/commands/list.d.ts.map +1 -0
- package/dist/commands/list.js +131 -0
- package/dist/commands/list.js.map +1 -0
- package/dist/commands/scaffold.d.ts +13 -0
- package/dist/commands/scaffold.d.ts.map +1 -0
- package/dist/commands/scaffold.js +633 -0
- package/dist/commands/scaffold.js.map +1 -0
- package/dist/commands/status.d.ts +10 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +116 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/tokenize.d.ts +16 -0
- package/dist/commands/tokenize.d.ts.map +1 -0
- package/dist/commands/tokenize.js +139 -0
- package/dist/commands/tokenize.js.map +1 -0
- package/dist/config.d.ts +35 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +68 -0
- package/dist/config.js.map +1 -0
- package/dist/http.d.ts +20 -0
- package/dist/http.d.ts.map +1 -0
- package/dist/http.js +69 -0
- package/dist/http.js.map +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +49 -0
- package/dist/index.js.map +1 -0
- package/package.json +43 -0
package/README.md
ADDED
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
# @agent-launch/cli
|
|
2
|
+
|
|
3
|
+
Command-line interface for [AgentLaunch](https://agent-launch.ai) — scaffold, deploy, and tokenize AI agents from your terminal or CI pipeline.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# Global install (recommended for interactive use)
|
|
9
|
+
npm install -g @agent-launch/cli
|
|
10
|
+
|
|
11
|
+
# Or run without installing
|
|
12
|
+
npx @agent-launch/cli <command>
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Requires Node.js >= 18.
|
|
16
|
+
|
|
17
|
+
## Configure
|
|
18
|
+
|
|
19
|
+
Get your API key from [agentverse.ai/profile/api-keys](https://agentverse.ai/profile/api-keys), then:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
agentlaunch config set-key YOUR_AGENTVERSE_API_KEY
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Check your configuration:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
agentlaunch config show
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Override the API base URL (self-hosted or staging):
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
agentlaunch config set-url https://your-instance.example.com/api
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Commands
|
|
38
|
+
|
|
39
|
+
### `agentlaunch create` — flagship one-command flow
|
|
40
|
+
|
|
41
|
+
Scaffold an agent, deploy it to Agentverse, and create a token record in one step.
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
# Interactive — prompts for name, ticker, template, and workflow steps
|
|
45
|
+
agentlaunch create
|
|
46
|
+
|
|
47
|
+
# Fully specified — no prompts
|
|
48
|
+
agentlaunch create \
|
|
49
|
+
--name "My Research Agent" \
|
|
50
|
+
--ticker RSRCH \
|
|
51
|
+
--template research \
|
|
52
|
+
--description "Delivers on-demand research reports" \
|
|
53
|
+
--chain 97 \
|
|
54
|
+
--deploy \
|
|
55
|
+
--tokenize
|
|
56
|
+
|
|
57
|
+
# Machine-readable output for AI agents (no prompts, JSON only)
|
|
58
|
+
agentlaunch create \
|
|
59
|
+
--name "My Agent" --ticker MYAG --template custom \
|
|
60
|
+
--deploy --tokenize --json
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
**Options:**
|
|
64
|
+
|
|
65
|
+
| Flag | Description | Default |
|
|
66
|
+
|------|-------------|---------|
|
|
67
|
+
| `--name <name>` | Agent name (max 32 chars) | prompted |
|
|
68
|
+
| `--ticker <ticker>` | Token ticker e.g. MYAG | prompted |
|
|
69
|
+
| `--template <t>` | custom, faucet, research, trading, data | prompted |
|
|
70
|
+
| `--description <desc>` | Token description (max 500 chars) | template default |
|
|
71
|
+
| `--chain <chainId>` | 97 = BSC Testnet, 56 = BSC Mainnet | 97 |
|
|
72
|
+
| `--deploy` | Deploy agent to Agentverse after scaffolding | false |
|
|
73
|
+
| `--tokenize` | Create token record after deploy | false |
|
|
74
|
+
| `--json` | Output only JSON (disables interactive prompts) | false |
|
|
75
|
+
|
|
76
|
+
**Flow:**
|
|
77
|
+
|
|
78
|
+
1. Scaffold — generates `agent.py`, `README.md`, `.env.example` in a new directory
|
|
79
|
+
2. Deploy (if `--deploy`) — uploads code to Agentverse, sets secrets, starts agent, polls until compiled
|
|
80
|
+
3. Tokenize (if `--tokenize`) — calls `POST /api/agents/tokenize`, prints handoff link
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
### `agentlaunch scaffold <name>`
|
|
85
|
+
|
|
86
|
+
Generate an agent project directory from a template.
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
agentlaunch scaffold my-agent --type research
|
|
90
|
+
|
|
91
|
+
# JSON output
|
|
92
|
+
agentlaunch scaffold my-agent --type faucet --json
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
**Options:**
|
|
96
|
+
|
|
97
|
+
| Flag | Description | Default |
|
|
98
|
+
|------|-------------|---------|
|
|
99
|
+
| `--type <type>` | faucet, research, trading, data | research |
|
|
100
|
+
| `--json` | Output only JSON | false |
|
|
101
|
+
|
|
102
|
+
Generated files:
|
|
103
|
+
- `agent.py` — ready-to-edit uAgents code with security, rate limiting, and AgentLaunch integration
|
|
104
|
+
- `README.md` — quickstart instructions
|
|
105
|
+
- `.env.example` — required environment variables
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
### `agentlaunch deploy`
|
|
110
|
+
|
|
111
|
+
Deploy `agent.py` to Agentverse.
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
agentlaunch deploy
|
|
115
|
+
|
|
116
|
+
# Custom file and name
|
|
117
|
+
agentlaunch deploy --file ./my-agent.py --name "My Research Agent"
|
|
118
|
+
|
|
119
|
+
# JSON output
|
|
120
|
+
agentlaunch deploy --json
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
**Options:**
|
|
124
|
+
|
|
125
|
+
| Flag | Description | Default |
|
|
126
|
+
|------|-------------|---------|
|
|
127
|
+
| `--file <path>` | Path to agent Python file | `./agent.py` |
|
|
128
|
+
| `--name <name>` | Display name on Agentverse | AgentLaunch Agent |
|
|
129
|
+
| `--json` | Output only JSON | false |
|
|
130
|
+
|
|
131
|
+
Steps performed:
|
|
132
|
+
1. Create agent on Agentverse
|
|
133
|
+
2. Upload code
|
|
134
|
+
3. Set `AGENTVERSE_API_KEY` and `AGENTLAUNCH_API_KEY` secrets
|
|
135
|
+
4. Start agent
|
|
136
|
+
5. Poll until compiled (up to 60 seconds)
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
### `agentlaunch tokenize`
|
|
141
|
+
|
|
142
|
+
Create a token record on AgentLaunch and receive a handoff link for on-chain deployment.
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
agentlaunch tokenize \
|
|
146
|
+
--agent agent1qXXXXXXXX \
|
|
147
|
+
--name "My Research Agent" \
|
|
148
|
+
--symbol RSRCH
|
|
149
|
+
|
|
150
|
+
# With optional fields
|
|
151
|
+
agentlaunch tokenize \
|
|
152
|
+
--agent agent1qXXXXXXXX \
|
|
153
|
+
--name "My Research Agent" \
|
|
154
|
+
--symbol RSRCH \
|
|
155
|
+
--description "Delivers on-demand research" \
|
|
156
|
+
--chain 97 \
|
|
157
|
+
--json
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
**Options:**
|
|
161
|
+
|
|
162
|
+
| Flag | Description | Default |
|
|
163
|
+
|------|-------------|---------|
|
|
164
|
+
| `--agent <address>` | Agentverse address (agent1q...) | required |
|
|
165
|
+
| `--name <name>` | Token name (max 32 chars) | required |
|
|
166
|
+
| `--symbol <symbol>` | Ticker (2-11 chars) | required |
|
|
167
|
+
| `--description <desc>` | Token description | - |
|
|
168
|
+
| `--image <url>` | Token logo URL | - |
|
|
169
|
+
| `--chain <chainId>` | 97 = BSC Testnet, 56 = BSC Mainnet | 97 |
|
|
170
|
+
| `--json` | Output only JSON | false |
|
|
171
|
+
|
|
172
|
+
The command returns a **handoff link** (e.g. `https://agent-launch.ai/deploy/123`). Share this with a human who connects their wallet and pays the deployment fee.
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
### `agentlaunch list`
|
|
177
|
+
|
|
178
|
+
List tokens on AgentLaunch.
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
agentlaunch list
|
|
182
|
+
|
|
183
|
+
# Custom options
|
|
184
|
+
agentlaunch list --limit 20 --sort market_cap
|
|
185
|
+
|
|
186
|
+
# JSON output for AI agents
|
|
187
|
+
agentlaunch list --limit 5 --json
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
**Options:**
|
|
191
|
+
|
|
192
|
+
| Flag | Description | Default |
|
|
193
|
+
|------|-------------|---------|
|
|
194
|
+
| `--limit <n>` | Number of tokens to show (1-100) | 10 |
|
|
195
|
+
| `--sort <by>` | trending, latest, market_cap | latest |
|
|
196
|
+
| `--json` | Output only JSON | false |
|
|
197
|
+
|
|
198
|
+
**Example table output:**
|
|
199
|
+
|
|
200
|
+
```
|
|
201
|
+
AgentLaunch Tokens (sort: trending, limit: 10)
|
|
202
|
+
|
|
203
|
+
──────────────────────────────────────────────────────────
|
|
204
|
+
Name Symbol Price (FET) Progress Status
|
|
205
|
+
──────────────────────────────────────────────────────────
|
|
206
|
+
FET Gifter GIFT 0.00004200 14.3% Active
|
|
207
|
+
Research Bot RSRCH 0.00001100 6.8% Active
|
|
208
|
+
...
|
|
209
|
+
──────────────────────────────────────────────────────────
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
---
|
|
213
|
+
|
|
214
|
+
### `agentlaunch status <address>`
|
|
215
|
+
|
|
216
|
+
Show detailed status of a token by its contract address.
|
|
217
|
+
|
|
218
|
+
```bash
|
|
219
|
+
agentlaunch status 0xAbCdEf...
|
|
220
|
+
|
|
221
|
+
# JSON output
|
|
222
|
+
agentlaunch status 0xAbCdEf... --json
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
**Options:**
|
|
226
|
+
|
|
227
|
+
| Flag | Description |
|
|
228
|
+
|------|-------------|
|
|
229
|
+
| `--json` | Output only JSON |
|
|
230
|
+
|
|
231
|
+
**Example output:**
|
|
232
|
+
|
|
233
|
+
```
|
|
234
|
+
==================================================
|
|
235
|
+
TOKEN STATUS
|
|
236
|
+
==================================================
|
|
237
|
+
Name: FET Gifter
|
|
238
|
+
Symbol: GIFT
|
|
239
|
+
Address: 0xAbCdEf...
|
|
240
|
+
Chain: BSC Testnet
|
|
241
|
+
Price: 0.00004200 FET
|
|
242
|
+
Market Cap: 12.60K FET
|
|
243
|
+
Holders: 47
|
|
244
|
+
Progress: 14.20%
|
|
245
|
+
Status: Bonding curve (14.20% to 30,000 FET target)
|
|
246
|
+
==================================================
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
---
|
|
250
|
+
|
|
251
|
+
### `agentlaunch config`
|
|
252
|
+
|
|
253
|
+
Manage CLI configuration.
|
|
254
|
+
|
|
255
|
+
```bash
|
|
256
|
+
agentlaunch config set-key <apiKey> # Store your API key
|
|
257
|
+
agentlaunch config show # Show current config
|
|
258
|
+
agentlaunch config set-url <url> # Set custom API base URL
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
---
|
|
262
|
+
|
|
263
|
+
## JSON Mode (Machine-Readable for AI Agents)
|
|
264
|
+
|
|
265
|
+
Every command supports `--json`. In JSON mode:
|
|
266
|
+
- All output is valid JSON to stdout
|
|
267
|
+
- No decorative text, tables, or prompts
|
|
268
|
+
- Interactive prompts are disabled (missing required flags cause an error JSON)
|
|
269
|
+
- Exit code 0 on success, 1 on error
|
|
270
|
+
|
|
271
|
+
**Example — AI agent creates a token programmatically:**
|
|
272
|
+
|
|
273
|
+
```bash
|
|
274
|
+
RESULT=$(agentlaunch create \
|
|
275
|
+
--name "Autonomous Analyst" \
|
|
276
|
+
--ticker ANLT \
|
|
277
|
+
--template research \
|
|
278
|
+
--deploy --tokenize --json)
|
|
279
|
+
|
|
280
|
+
HANDOFF=$(echo "$RESULT" | python3 -c "import sys,json; print(json.load(sys.stdin)['handoffLink'])")
|
|
281
|
+
echo "Share with human: $HANDOFF"
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
---
|
|
285
|
+
|
|
286
|
+
## Platform Constants
|
|
287
|
+
|
|
288
|
+
These values are enforced by the deployed smart contracts and cannot be changed by the CLI or platform:
|
|
289
|
+
|
|
290
|
+
| Constant | Value | Notes |
|
|
291
|
+
|----------|-------|-------|
|
|
292
|
+
| Token deployment fee | **120 FET** | Read dynamically from contract; may change via multi-sig governance |
|
|
293
|
+
| Graduation target | **30,000 FET** | Auto DEX listing when reached |
|
|
294
|
+
| Total buy supply | 800,000,000 tokens | Fixed bonding curve supply |
|
|
295
|
+
| Trading fee | **2%** | 100% to protocol treasury. **There is NO creator fee.** |
|
|
296
|
+
|
|
297
|
+
The 2% trading fee goes **entirely to the protocol treasury (REVENUE_ACCOUNT)**. There is no fee split to token creators.
|
|
298
|
+
|
|
299
|
+
---
|
|
300
|
+
|
|
301
|
+
## Templates
|
|
302
|
+
|
|
303
|
+
| Template | Use Case |
|
|
304
|
+
|----------|----------|
|
|
305
|
+
| `custom` | Blank slate — add your own business logic |
|
|
306
|
+
| `faucet` | Distributes testnet FET/BNB to developers |
|
|
307
|
+
| `research` | On-demand research reports and analysis |
|
|
308
|
+
| `trading` | Token price monitoring and trade alerts |
|
|
309
|
+
| `data` | Structured data feeds and query results |
|
|
310
|
+
|
|
311
|
+
---
|
|
312
|
+
|
|
313
|
+
## Workflow Examples
|
|
314
|
+
|
|
315
|
+
### One-command launch (interactive)
|
|
316
|
+
|
|
317
|
+
```bash
|
|
318
|
+
agentlaunch config set-key $MY_API_KEY
|
|
319
|
+
agentlaunch create
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
### Step-by-step
|
|
323
|
+
|
|
324
|
+
```bash
|
|
325
|
+
agentlaunch config set-key $MY_API_KEY
|
|
326
|
+
agentlaunch scaffold my-agent --type research
|
|
327
|
+
cd my-agent
|
|
328
|
+
cp .env.example .env # fill in values
|
|
329
|
+
# Edit agent.py to add your business logic
|
|
330
|
+
agentlaunch deploy
|
|
331
|
+
# Copy the agent address printed above
|
|
332
|
+
agentlaunch tokenize --agent agent1qXXX --name "My Agent" --symbol MYAG
|
|
333
|
+
# Share the handoff link with a human to complete on-chain deployment
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
### Headless CI pipeline
|
|
337
|
+
|
|
338
|
+
```bash
|
|
339
|
+
# All flags provided, JSON output — no interactive prompts
|
|
340
|
+
agentlaunch create \
|
|
341
|
+
--name "Price Oracle" \
|
|
342
|
+
--ticker PORC \
|
|
343
|
+
--template trading \
|
|
344
|
+
--chain 97 \
|
|
345
|
+
--deploy \
|
|
346
|
+
--tokenize \
|
|
347
|
+
--json | jq .handoffLink
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
---
|
|
351
|
+
|
|
352
|
+
## Resources
|
|
353
|
+
|
|
354
|
+
- [AgentLaunch Platform](https://agent-launch.ai)
|
|
355
|
+
- [API Documentation](https://agent-launch.ai/docs/openapi)
|
|
356
|
+
- [Agent Integration Guide](https://agent-launch.ai/docs/for-agents)
|
|
357
|
+
- [skill.md](https://agent-launch.ai/skill.md) — Machine-readable capability discovery
|
|
358
|
+
- [Agentverse](https://agentverse.ai)
|
|
359
|
+
- [Agentverse API Keys](https://agentverse.ai/profile/api-keys)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tests for CLI config module — CLI-001
|
|
3
|
+
*
|
|
4
|
+
* Verifies:
|
|
5
|
+
* - readConfig() returns empty object when config file does not exist
|
|
6
|
+
* - readConfig() returns empty object when config file contains invalid JSON
|
|
7
|
+
* - writeConfig() merges partial updates with existing config
|
|
8
|
+
* - writeConfig() creates the directory when it does not exist
|
|
9
|
+
* - getBaseUrl() returns DEFAULT_BASE_URL when no baseUrl is in config
|
|
10
|
+
* - getBaseUrl() returns the stored baseUrl when one is configured
|
|
11
|
+
* - maskKey() masks keys longer than 8 chars
|
|
12
|
+
* - maskKey() returns '****' for short keys
|
|
13
|
+
* - requireApiKey() throws a descriptive error when no apiKey is set
|
|
14
|
+
*
|
|
15
|
+
* Uses real filesystem operations against a temporary directory to avoid
|
|
16
|
+
* patching the module internals. The config path is redirected by overriding
|
|
17
|
+
* the HOME environment variable before the module is loaded.
|
|
18
|
+
*/
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=config.test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/config.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG"}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tests for CLI config module — CLI-001
|
|
3
|
+
*
|
|
4
|
+
* Verifies:
|
|
5
|
+
* - readConfig() returns empty object when config file does not exist
|
|
6
|
+
* - readConfig() returns empty object when config file contains invalid JSON
|
|
7
|
+
* - writeConfig() merges partial updates with existing config
|
|
8
|
+
* - writeConfig() creates the directory when it does not exist
|
|
9
|
+
* - getBaseUrl() returns DEFAULT_BASE_URL when no baseUrl is in config
|
|
10
|
+
* - getBaseUrl() returns the stored baseUrl when one is configured
|
|
11
|
+
* - maskKey() masks keys longer than 8 chars
|
|
12
|
+
* - maskKey() returns '****' for short keys
|
|
13
|
+
* - requireApiKey() throws a descriptive error when no apiKey is set
|
|
14
|
+
*
|
|
15
|
+
* Uses real filesystem operations against a temporary directory to avoid
|
|
16
|
+
* patching the module internals. The config path is redirected by overriding
|
|
17
|
+
* the HOME environment variable before the module is loaded.
|
|
18
|
+
*/
|
|
19
|
+
import { describe, it, before, after } from 'node:test';
|
|
20
|
+
import assert from 'node:assert/strict';
|
|
21
|
+
import fs from 'node:fs';
|
|
22
|
+
import os from 'node:os';
|
|
23
|
+
import path from 'node:path';
|
|
24
|
+
import { maskKey, DEFAULT_BASE_URL } from '../config.js';
|
|
25
|
+
// ---------------------------------------------------------------------------
|
|
26
|
+
// maskKey — pure function, no filesystem needed
|
|
27
|
+
// ---------------------------------------------------------------------------
|
|
28
|
+
describe('maskKey()', () => {
|
|
29
|
+
it('returns **** for keys of 8 chars or fewer', () => {
|
|
30
|
+
assert.equal(maskKey('short'), '****');
|
|
31
|
+
assert.equal(maskKey('12345678'), '****');
|
|
32
|
+
});
|
|
33
|
+
it('shows the first 8 characters followed by masked suffix for longer keys', () => {
|
|
34
|
+
const key = 'av-abcdefghijklmnop';
|
|
35
|
+
const masked = maskKey(key);
|
|
36
|
+
assert.ok(masked.startsWith('av-abcde'), `masked: ${masked}`);
|
|
37
|
+
assert.ok(masked.includes('...'), 'should include ellipsis');
|
|
38
|
+
assert.ok(masked.includes('masked'), 'should indicate masking');
|
|
39
|
+
});
|
|
40
|
+
it('does not expose more than the first 8 characters', () => {
|
|
41
|
+
const key = 'SECRETKEY_SHOULDNOTAPPEAR';
|
|
42
|
+
const masked = maskKey(key);
|
|
43
|
+
// Only first 8 chars are shown
|
|
44
|
+
assert.ok(!masked.includes('SHOULDNOTAPPEAR'), `masked: ${masked}`);
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
// ---------------------------------------------------------------------------
|
|
48
|
+
// DEFAULT_BASE_URL constant
|
|
49
|
+
// ---------------------------------------------------------------------------
|
|
50
|
+
describe('DEFAULT_BASE_URL', () => {
|
|
51
|
+
it('points to the agent-launch API endpoint', () => {
|
|
52
|
+
assert.equal(DEFAULT_BASE_URL, 'https://agent-launch.ai/api');
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
// ---------------------------------------------------------------------------
|
|
56
|
+
// readConfig / writeConfig / getBaseUrl — filesystem-based tests
|
|
57
|
+
// ---------------------------------------------------------------------------
|
|
58
|
+
describe('readConfig / writeConfig / getBaseUrl', () => {
|
|
59
|
+
let tmpDir;
|
|
60
|
+
let originalHome;
|
|
61
|
+
// We cannot easily redirect the CONFIG_DIR/CONFIG_FILE constants at runtime
|
|
62
|
+
// without re-importing the module, because they are computed at module load
|
|
63
|
+
// time. Instead, we test the behaviour through the real filesystem using
|
|
64
|
+
// the actual ~/.agentlaunch path — but we isolate by restoring the file
|
|
65
|
+
// after each test.
|
|
66
|
+
//
|
|
67
|
+
// Strategy: back up any existing config, run tests, restore.
|
|
68
|
+
const configDir = path.join(os.homedir(), '.agentlaunch');
|
|
69
|
+
const configFile = path.join(configDir, 'config.json');
|
|
70
|
+
let backupContent = null;
|
|
71
|
+
before(() => {
|
|
72
|
+
// Save existing config (if any) so tests are non-destructive
|
|
73
|
+
if (fs.existsSync(configFile)) {
|
|
74
|
+
backupContent = fs.readFileSync(configFile, 'utf8');
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
after(() => {
|
|
78
|
+
// Restore original config (or remove the file if it didn't exist before)
|
|
79
|
+
if (backupContent !== null) {
|
|
80
|
+
fs.mkdirSync(configDir, { recursive: true });
|
|
81
|
+
fs.writeFileSync(configFile, backupContent, { mode: 0o600 });
|
|
82
|
+
}
|
|
83
|
+
else if (fs.existsSync(configFile)) {
|
|
84
|
+
fs.unlinkSync(configFile);
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
it('readConfig() returns {} when config file does not exist', async () => {
|
|
88
|
+
// Remove config file if present
|
|
89
|
+
if (fs.existsSync(configFile))
|
|
90
|
+
fs.unlinkSync(configFile);
|
|
91
|
+
// Re-import to get a fresh module call
|
|
92
|
+
const { readConfig } = await import('../config.js');
|
|
93
|
+
const cfg = readConfig();
|
|
94
|
+
assert.deepEqual(cfg, {});
|
|
95
|
+
});
|
|
96
|
+
it('readConfig() returns {} when config file contains invalid JSON', async () => {
|
|
97
|
+
fs.mkdirSync(configDir, { recursive: true });
|
|
98
|
+
fs.writeFileSync(configFile, 'NOT_VALID_JSON', { mode: 0o600 });
|
|
99
|
+
const { readConfig } = await import('../config.js');
|
|
100
|
+
const cfg = readConfig();
|
|
101
|
+
assert.deepEqual(cfg, {});
|
|
102
|
+
});
|
|
103
|
+
it('writeConfig() persists apiKey to disk', async () => {
|
|
104
|
+
if (fs.existsSync(configFile))
|
|
105
|
+
fs.unlinkSync(configFile);
|
|
106
|
+
const { writeConfig, readConfig } = await import('../config.js');
|
|
107
|
+
writeConfig({ apiKey: 'av-testkey-123456' });
|
|
108
|
+
const cfg = readConfig();
|
|
109
|
+
assert.equal(cfg.apiKey, 'av-testkey-123456');
|
|
110
|
+
});
|
|
111
|
+
it('writeConfig() merges partial updates with existing values', async () => {
|
|
112
|
+
if (fs.existsSync(configFile))
|
|
113
|
+
fs.unlinkSync(configFile);
|
|
114
|
+
const { writeConfig, readConfig } = await import('../config.js');
|
|
115
|
+
// Write initial config with apiKey
|
|
116
|
+
writeConfig({ apiKey: 'av-initial-key' });
|
|
117
|
+
// Add baseUrl without overwriting apiKey
|
|
118
|
+
writeConfig({ baseUrl: 'https://custom.server.com/api' });
|
|
119
|
+
const cfg = readConfig();
|
|
120
|
+
assert.equal(cfg.apiKey, 'av-initial-key', 'apiKey should be preserved');
|
|
121
|
+
assert.equal(cfg.baseUrl, 'https://custom.server.com/api', 'baseUrl should be set');
|
|
122
|
+
});
|
|
123
|
+
it('getBaseUrl() returns DEFAULT_BASE_URL when no baseUrl is configured', async () => {
|
|
124
|
+
if (fs.existsSync(configFile))
|
|
125
|
+
fs.unlinkSync(configFile);
|
|
126
|
+
const { getBaseUrl } = await import('../config.js');
|
|
127
|
+
assert.equal(getBaseUrl(), DEFAULT_BASE_URL);
|
|
128
|
+
});
|
|
129
|
+
it('getBaseUrl() returns the configured baseUrl', async () => {
|
|
130
|
+
if (fs.existsSync(configFile))
|
|
131
|
+
fs.unlinkSync(configFile);
|
|
132
|
+
const { writeConfig, getBaseUrl } = await import('../config.js');
|
|
133
|
+
writeConfig({ baseUrl: 'https://staging.agent-launch.ai/api' });
|
|
134
|
+
assert.equal(getBaseUrl(), 'https://staging.agent-launch.ai/api');
|
|
135
|
+
});
|
|
136
|
+
it('requireApiKey() throws when no apiKey is configured', async () => {
|
|
137
|
+
if (fs.existsSync(configFile))
|
|
138
|
+
fs.unlinkSync(configFile);
|
|
139
|
+
const { requireApiKey } = await import('../config.js');
|
|
140
|
+
assert.throws(() => requireApiKey(), (err) => {
|
|
141
|
+
assert.ok(err instanceof Error);
|
|
142
|
+
assert.ok(err.message.includes('API key not configured'), `Error message: ${err.message}`);
|
|
143
|
+
return true;
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
it('requireApiKey() returns the stored apiKey', async () => {
|
|
147
|
+
if (fs.existsSync(configFile))
|
|
148
|
+
fs.unlinkSync(configFile);
|
|
149
|
+
const { writeConfig, requireApiKey } = await import('../config.js');
|
|
150
|
+
writeConfig({ apiKey: 'av-valid-key-abc' });
|
|
151
|
+
const key = requireApiKey();
|
|
152
|
+
assert.equal(key, 'av-valid-key-abc');
|
|
153
|
+
});
|
|
154
|
+
});
|
|
155
|
+
//# s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U,CAAC,UAAU,CAAC,CAAC;QAEzD,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,GAAG,MAAM,MAAM,CAAC,cAAc,CAAC,CAAC;QACpE,WAAW,CAAC,EAAE,MAAM,EAAE,kBAAkB,EAAE,CAAC,CAAC;QAE5C,MAAM,GAAG,GAAG,aAAa,EAAE,CAAC;QAC5B,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,kBAAkB,CAAC,CAAC;IACxC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI-001: config subcommands
|
|
3
|
+
*
|
|
4
|
+
* agentlaunch config set-key <apiKey> Store API key
|
|
5
|
+
* agentlaunch config show Print current config (masked key)
|
|
6
|
+
* agentlaunch config set-url <url> Set custom API base URL
|
|
7
|
+
*/
|
|
8
|
+
import { Command } from "commander";
|
|
9
|
+
export declare function registerConfigCommand(program: Command): void;
|
|
10
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/commands/config.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAQpC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAmD5D"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI-001: config subcommands
|
|
3
|
+
*
|
|
4
|
+
* agentlaunch config set-key <apiKey> Store API key
|
|
5
|
+
* agentlaunch config show Print current config (masked key)
|
|
6
|
+
* agentlaunch config set-url <url> Set custom API base URL
|
|
7
|
+
*/
|
|
8
|
+
import { DEFAULT_BASE_URL, maskKey, readConfig, writeConfig, } from "../config.js";
|
|
9
|
+
export function registerConfigCommand(program) {
|
|
10
|
+
const config = program
|
|
11
|
+
.command("config")
|
|
12
|
+
.description("Manage CLI configuration (API key, base URL)");
|
|
13
|
+
// agentlaunch config set-key <apiKey>
|
|
14
|
+
config
|
|
15
|
+
.command("set-key <apiKey>")
|
|
16
|
+
.description("Store your Agentverse API key in ~/.agentlaunch/config.json")
|
|
17
|
+
.action((apiKey) => {
|
|
18
|
+
if (!apiKey || apiKey.trim().length < 10) {
|
|
19
|
+
console.error("Error: API key appears invalid (too short).");
|
|
20
|
+
process.exit(1);
|
|
21
|
+
}
|
|
22
|
+
writeConfig({ apiKey: apiKey.trim() });
|
|
23
|
+
console.log("API key saved to ~/.agentlaunch/config.json");
|
|
24
|
+
console.log(`Key: ${maskKey(apiKey.trim())}`);
|
|
25
|
+
});
|
|
26
|
+
// agentlaunch config show
|
|
27
|
+
config
|
|
28
|
+
.command("show")
|
|
29
|
+
.description("Show current configuration")
|
|
30
|
+
.action(() => {
|
|
31
|
+
const cfg = readConfig();
|
|
32
|
+
const keyDisplay = cfg.apiKey ? maskKey(cfg.apiKey) : "(not set)";
|
|
33
|
+
const urlDisplay = cfg.baseUrl ?? `${DEFAULT_BASE_URL} (default)`;
|
|
34
|
+
console.log("Current configuration:");
|
|
35
|
+
console.log(` API Key: ${keyDisplay}`);
|
|
36
|
+
console.log(` Base URL: ${urlDisplay}`);
|
|
37
|
+
console.log(` Config: ~/.agentlaunch/config.json`);
|
|
38
|
+
});
|
|
39
|
+
// agentlaunch config set-url <url>
|
|
40
|
+
config
|
|
41
|
+
.command("set-url <url>")
|
|
42
|
+
.description("Set a custom API base URL (useful for self-hosted instances)")
|
|
43
|
+
.action((url) => {
|
|
44
|
+
try {
|
|
45
|
+
new URL(url); // validate format
|
|
46
|
+
}
|
|
47
|
+
catch {
|
|
48
|
+
console.error(`Error: "${url}" is not a valid URL.`);
|
|
49
|
+
process.exit(1);
|
|
50
|
+
}
|
|
51
|
+
const normalized = url.replace(/\/+$/, ""); // strip trailing slash
|
|
52
|
+
writeConfig({ baseUrl: normalized });
|
|
53
|
+
console.log(`Base URL set to: ${normalized}`);
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/commands/config.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EACL,gBAAgB,EAChB,OAAO,EACP,UAAU,EACV,WAAW,GACZ,MAAM,cAAc,CAAC;AAEtB,MAAM,UAAU,qBAAqB,CAAC,OAAgB;IACpD,MAAM,MAAM,GAAG,OAAO;SACnB,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,8CAA8C,CAAC,CAAC;IAE/D,sCAAsC;IACtC,MAAM;SACH,OAAO,CAAC,kBAAkB,CAAC;SAC3B,WAAW,CAAC,6DAA6D,CAAC;SAC1E,MAAM,CAAC,CAAC,MAAc,EAAE,EAAE;QACzB,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,EAAE,EAAE,CAAC;YACzC,OAAO,CAAC,KAAK,CAAC,6CAA6C,CAAC,CAAC;YAC7D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QACD,WAAW,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QACvC,OAAO,CAAC,GAAG,CAAC,6CAA6C,CAAC,CAAC;QAC3D,OAAO,CAAC,GAAG,CAAC,QAAQ,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;IAChD,CAAC,CAAC,CAAC;IAEL,0BAA0B;IAC1B,MAAM;SACH,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,4BAA4B,CAAC;SACzC,MAAM,CAAC,GAAG,EAAE;QACX,MAAM,GAAG,GAAG,UAAU,EAAE,CAAC;QACzB,MAAM,UAAU,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC;QAClE,MAAM,UAAU,GAAG,GAAG,CAAC,OAAO,IAAI,GAAG,gBAAgB,YAAY,CAAC;QAElE,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;QACtC,OAAO,CAAC,GAAG,CAAC,eAAe,UAAU,EAAE,CAAC,CAAC;QACzC,OAAO,CAAC,GAAG,CAAC,eAAe,UAAU,EAAE,CAAC,CAAC;QACzC,OAAO,CAAC,GAAG,CAAC,wCAAwC,CAAC,CAAC;IACxD,CAAC,CAAC,CAAC;IAEL,mCAAmC;IACnC,MAAM;SACH,OAAO,CAAC,eAAe,CAAC;SACxB,WAAW,CACV,8DAA8D,CAC/D;SACA,MAAM,CAAC,CAAC,GAAW,EAAE,EAAE;QACtB,IAAI,CAAC;YACH,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,kBAAkB;QAClC,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,CAAC,KAAK,CAAC,WAAW,GAAG,uBAAuB,CAAC,CAAC;YACrD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QACD,MAAM,UAAU,GAAG,GAAG,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC,uBAAuB;QACnE,WAAW,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC,CAAC;QACrC,OAAO,CAAC,GAAG,CAAC,oBAAoB,UAAU,EAAE,CAAC,CAAC;IAChD,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI-002 + CLI-006: create command
|
|
3
|
+
*
|
|
4
|
+
* agentlaunch create [--name "My Agent"] [--ticker MYAG] [--template custom]
|
|
5
|
+
* [--description "..."] [--chain 97] [--deploy] [--tokenize] [--json]
|
|
6
|
+
*
|
|
7
|
+
* Flagship one-command flow:
|
|
8
|
+
* 1. Scaffold agent project (always)
|
|
9
|
+
* 2. Deploy to Agentverse (if --deploy)
|
|
10
|
+
* 3. Tokenize on AgentLaunch (if --tokenize)
|
|
11
|
+
* 4. Print handoff link
|
|
12
|
+
*
|
|
13
|
+
* When name/ticker are omitted, uses readline for interactive prompts.
|
|
14
|
+
*
|
|
15
|
+
* Platform constants (source of truth: deployed smart contracts):
|
|
16
|
+
* - Deploy fee: 120 FET (read dynamically, can change via multi-sig)
|
|
17
|
+
* - Graduation target: 30,000 FET -> auto DEX listing
|
|
18
|
+
* - Trading fee: 2% -> 100% to protocol treasury (NO creator fee)
|
|
19
|
+
*/
|
|
20
|
+
import { Command } from "commander";
|
|
21
|
+
export declare function registerCreateCommand(program: Command): void;
|
|
22
|
+
//# sourceMappingURL=create.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/commands/create.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAMH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAyWpC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAiR5D"}
|