clawcloud 1.0.1 ā 1.3.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 +118 -253
- package/bin/clawcloud.js +158 -0
- package/package.json +35 -18
- package/src/api/agents.js +22 -0
- package/src/api/vms.js +71 -0
- package/src/api/wallet.js +21 -0
- package/src/commands/balance.js +27 -0
- package/src/commands/buy.js +8 -0
- package/src/commands/configure.js +86 -0
- package/src/commands/export.js +203 -0
- package/src/commands/fund.js +13 -0
- package/src/commands/interactive.js +70 -0
- package/src/commands/list.js +90 -0
- package/src/commands/nfts.js +5 -0
- package/src/commands/register.js +72 -0
- package/src/commands/ssh.js +5 -0
- package/src/commands/status.js +5 -0
- package/src/commands/terminate.js +5 -0
- package/src/commands/transfer.js +5 -0
- package/src/utils/banner.js +9 -0
- package/src/utils/config.js +92 -0
- package/src/utils/help.js +85 -0
- package/src/utils/version.js +15 -0
- package/templates/SKILL.md +215 -0
- package/CLI_PUBLISHING_GUIDE.md +0 -325
- package/index.js +0 -559
package/README.md
CHANGED
|
@@ -1,313 +1,178 @@
|
|
|
1
|
-
#
|
|
1
|
+
# ClawCloud CLI
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
āļø **Cloud infrastructure AI agents can own**
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Command-line interface for managing ClawCloud - autonomous cloud VMs purchased with crypto, owned as NFTs.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
# Check available VM tiers
|
|
9
|
-
npx clawcloud tiers
|
|
10
|
-
|
|
11
|
-
# Purchase a VM
|
|
12
|
-
npx clawcloud purchase
|
|
7
|
+
## Quick Start
|
|
13
8
|
|
|
14
|
-
|
|
15
|
-
npx clawcloud
|
|
16
|
-
|
|
17
|
-
# Get VM credentials
|
|
18
|
-
npx clawcloud get <tokenId>
|
|
9
|
+
```bash
|
|
10
|
+
npx clawcloud
|
|
19
11
|
```
|
|
20
12
|
|
|
21
|
-
##
|
|
13
|
+
## Installation
|
|
22
14
|
|
|
23
|
-
###
|
|
24
|
-
```bash
|
|
25
|
-
npx clawcloud <command>
|
|
26
|
-
```
|
|
15
|
+
### Use with npx (recommended)
|
|
27
16
|
|
|
28
|
-
### Option 2: Global Install
|
|
29
17
|
```bash
|
|
30
|
-
|
|
31
|
-
clawcloud <command>
|
|
18
|
+
npx clawcloud register
|
|
32
19
|
```
|
|
33
20
|
|
|
34
|
-
|
|
21
|
+
### Install globally
|
|
35
22
|
|
|
36
|
-
- ā
Purchase VMs with USDC on Base
|
|
37
|
-
- ā
Ownership via ERC-721 NFTs
|
|
38
|
-
- ā
Automatic VM provisioning
|
|
39
|
-
- ā
SSH credential retrieval
|
|
40
|
-
- ā
Wallet management
|
|
41
|
-
- ā
Balance checking
|
|
42
|
-
|
|
43
|
-
## š Commands
|
|
44
|
-
|
|
45
|
-
### Purchase & Manage
|
|
46
23
|
```bash
|
|
47
|
-
|
|
48
|
-
clawcloud
|
|
49
|
-
clawcloud list # List your VMs
|
|
24
|
+
npm install -g clawcloud
|
|
25
|
+
clawcloud register
|
|
50
26
|
```
|
|
51
27
|
|
|
52
|
-
|
|
53
|
-
```bash
|
|
54
|
-
clawcloud tiers # Show available VM tiers
|
|
55
|
-
clawcloud balance # Check wallet balance
|
|
56
|
-
clawcloud info # Show contract/API info
|
|
57
|
-
```
|
|
28
|
+
## Getting Started
|
|
58
29
|
|
|
59
|
-
###
|
|
60
|
-
```bash
|
|
61
|
-
clawcloud wallet # View/setup wallet
|
|
62
|
-
```
|
|
30
|
+
### 1. Register Your Agent
|
|
63
31
|
|
|
64
|
-
### Help
|
|
65
32
|
```bash
|
|
66
|
-
clawcloud
|
|
33
|
+
npx clawcloud register
|
|
67
34
|
```
|
|
68
35
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
### First Time Setup
|
|
72
|
-
|
|
73
|
-
1. **Run any command** and the CLI will guide you through wallet setup:
|
|
74
|
-
```bash
|
|
75
|
-
npx clawcloud tiers
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
2. **Choose wallet option:**
|
|
79
|
-
- Import existing private key
|
|
80
|
-
- Generate new wallet
|
|
81
|
-
|
|
82
|
-
3. **Fund your wallet:**
|
|
83
|
-
- Get ETH on Base (for gas): https://bridge.base.org
|
|
84
|
-
- Get USDC (for purchases): https://app.uniswap.org/swap?chain=base
|
|
85
|
-
|
|
86
|
-
### Configuration
|
|
87
|
-
|
|
88
|
-
Config is stored in: `~/.clawcloud/config.json`
|
|
36
|
+
You'll get an Agent ID like `agent_1738445234_k9x2m`
|
|
89
37
|
|
|
90
|
-
|
|
38
|
+
### 2. Get Your Wallet (Telegram)
|
|
91
39
|
|
|
92
|
-
|
|
40
|
+
Open Telegram and message [@clawcloud_devbot](https://t.me/clawcloud_devbot):
|
|
93
41
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
| 1 | CPU-Standard-2vCPU-4GB | $1.00 | $30.00 |
|
|
98
|
-
| 2 | CPU-Performance-4vCPU-8GB | $2.00 | $60.00 |
|
|
99
|
-
| 3 | CPU-HighMem-8vCPU-16GB | $4.00 | $120.00 |
|
|
100
|
-
| 4 | GPU-T4-4vCPU-16GB | $8.00 | $240.00 |
|
|
101
|
-
| 5 | GPU-V100-8vCPU-32GB | $16.00 | $480.00 |
|
|
102
|
-
| 6 | GPU-A100-16vCPU-64GB | $32.00 | $960.00 |
|
|
103
|
-
| 7 | GPU-H100-32vCPU-128GB | $64.00 | $1,920.00 |
|
|
104
|
-
|
|
105
|
-
*Prices in USDC. Minimum 3-day purchase required.*
|
|
106
|
-
|
|
107
|
-
## š Security
|
|
108
|
-
|
|
109
|
-
- **Private keys are stored locally** in `~/.clawcloud/config.json`
|
|
110
|
-
- **Never share your private key** with anyone
|
|
111
|
-
- **Use a dedicated wallet** for ClawCloud operations
|
|
112
|
-
- **Backup your private key** securely
|
|
42
|
+
```
|
|
43
|
+
/start agent_1738445234_k9x2m
|
|
44
|
+
```
|
|
113
45
|
|
|
114
|
-
|
|
46
|
+
The bot will:
|
|
47
|
+
- Verify your agent ID
|
|
48
|
+
- Create a wallet
|
|
49
|
+
- Send you the private key
|
|
50
|
+
- Provide funding instructions
|
|
115
51
|
|
|
116
|
-
###
|
|
52
|
+
### 3. Configure CLI
|
|
117
53
|
|
|
118
54
|
```bash
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
š¦ Wallet: 0x1234...5678
|
|
122
|
-
š Available Tiers:
|
|
123
|
-
|
|
124
|
-
0. CPU-Basic-1vCPU-1GB - $0.50/day ($15.00/month)
|
|
125
|
-
1. CPU-Standard-2vCPU-4GB - $1.00/day ($30.00/month)
|
|
126
|
-
...
|
|
127
|
-
|
|
128
|
-
Choose tier (0-7): 4
|
|
129
|
-
Duration in days (3+ recommended): 7
|
|
130
|
-
|
|
131
|
-
š° Total cost: $56.00 USDC
|
|
132
|
-
Proceed with purchase? (y/n): y
|
|
133
|
-
|
|
134
|
-
ā
USDC balance: $100.00 ā
|
|
135
|
-
ā³ Approving USDC...
|
|
136
|
-
ā
USDC approved!
|
|
137
|
-
ā³ Purchasing VM...
|
|
138
|
-
ā
VM purchased successfully! š
|
|
139
|
-
|
|
140
|
-
Token ID: 42
|
|
141
|
-
Tier: 4
|
|
142
|
-
Duration: 7 days
|
|
143
|
-
|
|
144
|
-
ā³ VM is provisioning... This takes 2-3 minutes.
|
|
145
|
-
Get credentials: npx clawcloud get 42
|
|
55
|
+
npx clawcloud configure
|
|
146
56
|
```
|
|
147
57
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
```bash
|
|
151
|
-
$ npx clawcloud get 42
|
|
152
|
-
|
|
153
|
-
ā³ Fetching credentials for VM #42...
|
|
154
|
-
ā
VM credentials retrieved!
|
|
155
|
-
|
|
156
|
-
======================================================================
|
|
157
|
-
š„ļø VM #42 - GPU-EXTERNAL
|
|
158
|
-
======================================================================
|
|
159
|
-
Tier: 4
|
|
160
|
-
Host: rentals-xxxxx.ssh.deployments.targon.com
|
|
161
|
-
Username: root
|
|
162
|
-
Expires: Feb 9, 2026, 12:00:00 PM
|
|
58
|
+
Enter your Agent ID and private key from Telegram.
|
|
163
59
|
|
|
164
|
-
|
|
165
|
-
ssh rentals-xxxxx.ssh.deployments.targon.com
|
|
166
|
-
|
|
167
|
-
======================================================================
|
|
168
|
-
```
|
|
169
|
-
|
|
170
|
-
### List Your VMs
|
|
60
|
+
### 4. Make Your Agent Autonomous
|
|
171
61
|
|
|
172
62
|
```bash
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
ā³ Fetching VMs for 0x1234...5678...
|
|
176
|
-
ā
Found 2 VM(s)
|
|
177
|
-
|
|
178
|
-
==========================================================================================
|
|
179
|
-
Your VMs:
|
|
180
|
-
==========================================================================================
|
|
181
|
-
|
|
182
|
-
ā
VM #42
|
|
183
|
-
Tier: 4
|
|
184
|
-
Type: gpu-external
|
|
185
|
-
Host: rentals-xxxxx.ssh.deployments.targon.com
|
|
186
|
-
Status: running
|
|
187
|
-
Created: Feb 2, 2026, 10:30:00 AM
|
|
188
|
-
Expires: Feb 9, 2026, 10:30:00 AM
|
|
189
|
-
Access: npx clawcloud get 42
|
|
190
|
-
|
|
191
|
-
ā
VM #43
|
|
192
|
-
Tier: 1
|
|
193
|
-
Type: gcp
|
|
194
|
-
Host: 35.123.45.67
|
|
195
|
-
Status: running
|
|
196
|
-
Created: Feb 2, 2026, 11:00:00 AM
|
|
197
|
-
Expires: Feb 5, 2026, 11:00:00 AM
|
|
198
|
-
Access: npx clawcloud get 43
|
|
199
|
-
|
|
200
|
-
==========================================================================================
|
|
63
|
+
npx clawcloud export
|
|
201
64
|
```
|
|
202
65
|
|
|
203
|
-
|
|
66
|
+
Choose your framework:
|
|
67
|
+
- **OpenClaw / Clawd / Molt** - Installs skill automatically
|
|
68
|
+
- **Node.js SDK** - Exports config for custom agents
|
|
69
|
+
- **Python SDK** - Coming soon
|
|
70
|
+
- **Environment Variables** - For any language
|
|
204
71
|
|
|
205
|
-
|
|
206
|
-
$ npx clawcloud balance
|
|
72
|
+
## Commands
|
|
207
73
|
|
|
208
|
-
|
|
74
|
+
### Setup
|
|
75
|
+
- `npx clawcloud` - Interactive menu
|
|
76
|
+
- `npx clawcloud register` - Register new agent
|
|
77
|
+
- `npx clawcloud configure` - Link wallet after Telegram
|
|
78
|
+
- `npx clawcloud fund` - Show funding instructions
|
|
209
79
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
USDC: $100.00 USDC
|
|
214
|
-
```
|
|
80
|
+
### Autonomous Mode
|
|
81
|
+
- `npx clawcloud export` - Export for autonomous agents
|
|
82
|
+
- `npx clawcloud export --framework openclaw` - Install OpenClaw skill
|
|
215
83
|
|
|
216
|
-
|
|
84
|
+
### Wallet & Balance
|
|
85
|
+
- `npx clawcloud balance` - Check USDC balance
|
|
217
86
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
87
|
+
### VMs & NFTs
|
|
88
|
+
- `npx clawcloud list` - List your VMs and NFTs
|
|
89
|
+
- `npx clawcloud status <nft-id>` - View NFT/VM details
|
|
90
|
+
- `npx clawcloud ssh <nft-id>` - SSH into VM
|
|
91
|
+
- `npx clawcloud transfer <nft-id>` - Transfer NFT/VM ownership
|
|
92
|
+
- `npx clawcloud terminate <nft-id>` - Destroy VM & burn NFT
|
|
221
93
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
**Explorer:** https://basescan.org/address/0xF708741D37C420518852c6A15aB658066951c852
|
|
94
|
+
### Help
|
|
95
|
+
- `npx clawcloud help` - Detailed help
|
|
96
|
+
- `npx clawcloud docs` - Open documentation
|
|
227
97
|
|
|
228
|
-
##
|
|
98
|
+
## Autonomous Agent Example
|
|
229
99
|
|
|
230
|
-
|
|
100
|
+
After running `npx clawcloud export`, your agent can:
|
|
231
101
|
|
|
232
102
|
```javascript
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
const
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
103
|
+
import ClawCloud from '@clawcloud/sdk';
|
|
104
|
+
|
|
105
|
+
const cloud = new ClawCloud({
|
|
106
|
+
configPath: '~/.clawcloud/autonomous-config.json'
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
// Agent decides: "I need to run a backtest"
|
|
110
|
+
const balance = await cloud.wallet.balance();
|
|
111
|
+
|
|
112
|
+
if (balance > 10) {
|
|
113
|
+
// Purchase VM autonomously
|
|
114
|
+
const vm = await cloud.vms.purchase({
|
|
115
|
+
tier: 'SMALL',
|
|
116
|
+
months: 1
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
// Wait for provisioning
|
|
120
|
+
await vm.waitReady();
|
|
121
|
+
|
|
122
|
+
// Deploy code
|
|
123
|
+
await vm.deployCode('./my-strategy');
|
|
124
|
+
|
|
125
|
+
// Run task
|
|
126
|
+
await vm.execute('npm run backtest');
|
|
127
|
+
}
|
|
244
128
|
```
|
|
245
129
|
|
|
246
|
-
|
|
130
|
+
## NFTs
|
|
247
131
|
|
|
248
|
-
|
|
132
|
+
When you purchase a VM:
|
|
133
|
+
- An ERC-721 NFT is minted to your wallet
|
|
134
|
+
- NFT token ID = VM identifier
|
|
135
|
+
- Own the NFT = Own the VM
|
|
136
|
+
- Transfer NFT = Transfer VM ownership
|
|
249
137
|
|
|
250
|
-
|
|
251
|
-
# API Documentation
|
|
252
|
-
https://api.clawcloud.co/docs
|
|
253
|
-
|
|
254
|
-
# Get tiers
|
|
255
|
-
curl https://api.clawcloud.co/tiers
|
|
138
|
+
View your NFTs on [OpenSea](https://opensea.io) or [BaseScan](https://basescan.org).
|
|
256
139
|
|
|
257
|
-
|
|
258
|
-
curl -H "Authorization: Bearer $SIGNATURE" \
|
|
259
|
-
https://api.clawcloud.co/credentials/42
|
|
260
|
-
```
|
|
140
|
+
## Features
|
|
261
141
|
|
|
262
|
-
|
|
142
|
+
- š¤ **Autonomous**: Agents purchase VMs on their own
|
|
143
|
+
- šØ **NFT-Based**: VMs are owned as ERC-721 tokens
|
|
144
|
+
- āļø **Base Blockchain**: Fast, cheap transactions
|
|
145
|
+
- āļø **Multi-Cloud**: GCP, AWS, private servers
|
|
146
|
+
- š° **Pay-as-you-go**: Starting at $0.08/hour
|
|
147
|
+
- š **Non-Custodial**: You control your keys
|
|
263
148
|
|
|
264
|
-
|
|
265
|
-
- Buy USDC on Base: https://app.uniswap.org/swap?chain=base
|
|
266
|
-
- Bridge USDC to Base: https://bridge.base.org
|
|
267
|
-
|
|
268
|
-
### "Insufficient funds for gas" Error
|
|
269
|
-
- Bridge ETH to Base: https://bridge.base.org
|
|
270
|
-
- You need ~0.001 ETH for gas
|
|
271
|
-
|
|
272
|
-
### "VM still provisioning" Message
|
|
273
|
-
- Wait 2-3 minutes after purchase
|
|
274
|
-
- Try getting credentials again: `npx clawcloud get <tokenId>`
|
|
275
|
-
|
|
276
|
-
### "Invalid signature" Error
|
|
277
|
-
- Make sure you own the NFT for the token ID
|
|
278
|
-
- Check that you're using the correct wallet
|
|
279
|
-
|
|
280
|
-
### CLI Config Issues
|
|
281
|
-
```bash
|
|
282
|
-
# Remove config and start fresh
|
|
283
|
-
rm -rf ~/.clawcloud
|
|
284
|
-
npx clawcloud wallet
|
|
285
|
-
```
|
|
149
|
+
## Requirements
|
|
286
150
|
|
|
287
|
-
|
|
151
|
+
- Node.js >= 18.0.0
|
|
152
|
+
- USDC on Base blockchain
|
|
153
|
+
- Telegram account (for wallet setup)
|
|
288
154
|
|
|
289
|
-
|
|
290
|
-
- **Discord:** discord.gg/clawcloud
|
|
291
|
-
- **Twitter:** @ClawCloud
|
|
292
|
-
- **GitHub Issues:** https://github.com/clawcloud/clawcloud-cli/issues
|
|
155
|
+
## Configuration
|
|
293
156
|
|
|
294
|
-
|
|
157
|
+
Config stored in `~/.clawcloud/`:
|
|
158
|
+
- `agents.json` - Registered agents
|
|
159
|
+
- `wallet.json` - Wallet configuration (secure!)
|
|
160
|
+
- `config.json` - API endpoints and settings
|
|
295
161
|
|
|
296
|
-
|
|
162
|
+
## Links
|
|
297
163
|
|
|
298
|
-
|
|
164
|
+
- **Website**: https://clawcloud.co
|
|
165
|
+
- **Docs**: https://docs.clawcloud.co
|
|
166
|
+
- **Telegram**: https://t.me/clawcloud_devbot
|
|
167
|
+
- **GitHub**: https://github.com/clawcloud/clawcloud
|
|
168
|
+
- **Twitter**: https://twitter.com/clawcloudx
|
|
299
169
|
|
|
300
|
-
|
|
301
|
-
- [ ] VM management (restart, resize)
|
|
302
|
-
- [ ] Custom images/templates
|
|
303
|
-
- [ ] Team/organization accounts
|
|
304
|
-
- [ ] Volume attachments
|
|
305
|
-
- [ ] Networking configuration
|
|
306
|
-
- [ ] Monitoring & alerts
|
|
170
|
+
## Support
|
|
307
171
|
|
|
308
|
-
|
|
172
|
+
- š¬ Telegram: https://t.me/clawcloud
|
|
173
|
+
- š Issues: https://github.com/clawcloud/clawcloud/issues
|
|
174
|
+
- š§ Email: support@clawcloud.co
|
|
309
175
|
|
|
310
|
-
|
|
311
|
-
Powered by Base, Railway, and Targon
|
|
176
|
+
## License
|
|
312
177
|
|
|
313
|
-
|
|
178
|
+
MIT Ā© ClawCloud
|
package/bin/clawcloud.js
ADDED
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { program } from 'commander';
|
|
4
|
+
import chalk from 'chalk';
|
|
5
|
+
import { register } from '../src/commands/register.js';
|
|
6
|
+
import { configure } from '../src/commands/configure.js';
|
|
7
|
+
import { exportConfig } from '../src/commands/export.js';
|
|
8
|
+
import { balance } from '../src/commands/balance.js';
|
|
9
|
+
import { buy } from '../src/commands/buy.js';
|
|
10
|
+
import { list } from '../src/commands/list.js';
|
|
11
|
+
import { status } from '../src/commands/status.js';
|
|
12
|
+
import { ssh } from '../src/commands/ssh.js';
|
|
13
|
+
import { transfer } from '../src/commands/transfer.js';
|
|
14
|
+
import { terminate } from '../src/commands/terminate.js';
|
|
15
|
+
import { fund } from '../src/commands/fund.js';
|
|
16
|
+
import { nfts } from '../src/commands/nfts.js';
|
|
17
|
+
import { interactive } from '../src/commands/interactive.js';
|
|
18
|
+
import { displayHelp } from '../src/utils/help.js';
|
|
19
|
+
import { getVersion } from '../src/utils/version.js';
|
|
20
|
+
|
|
21
|
+
const version = getVersion();
|
|
22
|
+
|
|
23
|
+
program
|
|
24
|
+
.name('clawcloud')
|
|
25
|
+
.description('āļø Cloud infrastructure AI agents can own')
|
|
26
|
+
.version(version, '-v, --version', 'Output the current version');
|
|
27
|
+
|
|
28
|
+
// Interactive mode (default when no command)
|
|
29
|
+
program
|
|
30
|
+
.action(() => {
|
|
31
|
+
interactive();
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
// Registration & Setup
|
|
35
|
+
program
|
|
36
|
+
.command('register')
|
|
37
|
+
.description('Register a new AI agent')
|
|
38
|
+
.action(register);
|
|
39
|
+
|
|
40
|
+
program
|
|
41
|
+
.command('configure')
|
|
42
|
+
.description('Configure agent wallet after Telegram setup')
|
|
43
|
+
.action(configure);
|
|
44
|
+
|
|
45
|
+
program
|
|
46
|
+
.command('fund')
|
|
47
|
+
.description('Show funding instructions')
|
|
48
|
+
.action(fund);
|
|
49
|
+
|
|
50
|
+
// Autonomous Mode (Primary)
|
|
51
|
+
program
|
|
52
|
+
.command('export')
|
|
53
|
+
.description('Export configuration for autonomous agents')
|
|
54
|
+
.option('-f, --framework <type>', 'Agent framework (openclaw, nodejs, python, env)', 'openclaw')
|
|
55
|
+
.option('-o, --output <path>', 'Output path')
|
|
56
|
+
.action(exportConfig);
|
|
57
|
+
|
|
58
|
+
// Wallet & Balance
|
|
59
|
+
program
|
|
60
|
+
.command('balance')
|
|
61
|
+
.alias('bal')
|
|
62
|
+
.description('Check USDC balance')
|
|
63
|
+
.option('--json', 'Output as JSON')
|
|
64
|
+
.action(balance);
|
|
65
|
+
|
|
66
|
+
// NFT/VM Management
|
|
67
|
+
program
|
|
68
|
+
.command('list')
|
|
69
|
+
.alias('ls')
|
|
70
|
+
.description('List your VMs and NFTs')
|
|
71
|
+
.option('--json', 'Output as JSON')
|
|
72
|
+
.action(list);
|
|
73
|
+
|
|
74
|
+
program
|
|
75
|
+
.command('nfts')
|
|
76
|
+
.description('View your NFT collection')
|
|
77
|
+
.action(nfts);
|
|
78
|
+
|
|
79
|
+
program
|
|
80
|
+
.command('status <nft-id>')
|
|
81
|
+
.description('View NFT and VM details')
|
|
82
|
+
.option('--json', 'Output as JSON')
|
|
83
|
+
.action(status);
|
|
84
|
+
|
|
85
|
+
program
|
|
86
|
+
.command('buy')
|
|
87
|
+
.description('Purchase a VM (manual mode)')
|
|
88
|
+
.option('-t, --tier <tier>', 'VM tier (MICRO, SMALL, MEDIUM, LARGE, XLARGE)')
|
|
89
|
+
.option('-m, --months <months>', 'Duration in months (1-12)')
|
|
90
|
+
.option('-y, --yes', 'Skip confirmation')
|
|
91
|
+
.action(buy);
|
|
92
|
+
|
|
93
|
+
program
|
|
94
|
+
.command('renew <nft-id>')
|
|
95
|
+
.description('Renew/extend a VM')
|
|
96
|
+
.option('-m, --months <months>', 'Additional months')
|
|
97
|
+
.option('-y, --yes', 'Skip confirmation')
|
|
98
|
+
.action((nftId, options) => {
|
|
99
|
+
console.log(chalk.yellow('Renew feature coming soon!'));
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
program
|
|
103
|
+
.command('ssh <nft-id>')
|
|
104
|
+
.description('SSH into a VM')
|
|
105
|
+
.action(ssh);
|
|
106
|
+
|
|
107
|
+
program
|
|
108
|
+
.command('transfer <nft-id>')
|
|
109
|
+
.description('Transfer NFT/VM to another address')
|
|
110
|
+
.option('-t, --to <address>', 'Recipient address')
|
|
111
|
+
.option('-y, --yes', 'Skip confirmation')
|
|
112
|
+
.action(transfer);
|
|
113
|
+
|
|
114
|
+
program
|
|
115
|
+
.command('terminate <nft-id>')
|
|
116
|
+
.alias('destroy')
|
|
117
|
+
.description('Destroy VM and burn NFT')
|
|
118
|
+
.option('-y, --yes', 'Skip confirmation')
|
|
119
|
+
.action(terminate);
|
|
120
|
+
|
|
121
|
+
// Documentation & Help
|
|
122
|
+
program
|
|
123
|
+
.command('docs')
|
|
124
|
+
.description('Open documentation in browser')
|
|
125
|
+
.action(() => {
|
|
126
|
+
const { exec } = require('child_process');
|
|
127
|
+
exec('open https://docs.clawcloud.co');
|
|
128
|
+
console.log(chalk.blue('š Opening documentation...'));
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
program
|
|
132
|
+
.command('help')
|
|
133
|
+
.description('Display detailed help')
|
|
134
|
+
.action(displayHelp);
|
|
135
|
+
|
|
136
|
+
// Hidden dev commands
|
|
137
|
+
program
|
|
138
|
+
.command('contract')
|
|
139
|
+
.description('Show contract addresses')
|
|
140
|
+
.option('--testnet', 'Show testnet contracts')
|
|
141
|
+
.action((options) => {
|
|
142
|
+
const { getConfig } = require('../src/utils/config.js');
|
|
143
|
+
const config = getConfig();
|
|
144
|
+
console.log(chalk.cyan('\nš Contract Addresses:\n'));
|
|
145
|
+
if (options.testnet) {
|
|
146
|
+
console.log(chalk.gray('Base Sepolia:'), '0x...');
|
|
147
|
+
} else {
|
|
148
|
+
console.log(chalk.gray('Base Mainnet:'), config.CONTRACT_ADDRESS || 'Not configured');
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
// Parse arguments
|
|
153
|
+
program.parse(process.argv);
|
|
154
|
+
|
|
155
|
+
// Show help if no command provided
|
|
156
|
+
if (!process.argv.slice(2).length) {
|
|
157
|
+
interactive();
|
|
158
|
+
}
|
package/package.json
CHANGED
|
@@ -1,40 +1,57 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clawcloud",
|
|
3
|
-
"version": "1.0
|
|
4
|
-
"description": "
|
|
5
|
-
"main": "
|
|
3
|
+
"version": "1.3.0",
|
|
4
|
+
"description": "āļø Cloud infrastructure AI agents can own - CLI tool",
|
|
5
|
+
"main": "bin/clawcloud.js",
|
|
6
|
+
"type": "module",
|
|
6
7
|
"bin": {
|
|
7
|
-
"clawcloud": "./
|
|
8
|
+
"clawcloud": "./bin/clawcloud.js"
|
|
8
9
|
},
|
|
9
10
|
"scripts": {
|
|
10
|
-
"test": "echo \"
|
|
11
|
+
"test": "echo \"Tests coming soon\"",
|
|
12
|
+
"prepublishOnly": "chmod +x bin/clawcloud.js"
|
|
11
13
|
},
|
|
12
14
|
"keywords": [
|
|
13
|
-
"blockchain",
|
|
14
|
-
"base",
|
|
15
|
-
"cloud",
|
|
16
|
-
"vm",
|
|
17
15
|
"ai",
|
|
18
16
|
"agents",
|
|
19
|
-
"
|
|
17
|
+
"cloud",
|
|
18
|
+
"vm",
|
|
19
|
+
"infrastructure",
|
|
20
|
+
"autonomous",
|
|
21
|
+
"blockchain",
|
|
22
|
+
"base",
|
|
20
23
|
"nft",
|
|
21
|
-
"
|
|
22
|
-
"
|
|
24
|
+
"openclaw",
|
|
25
|
+
"depin"
|
|
23
26
|
],
|
|
24
27
|
"author": "ClawCloud",
|
|
25
28
|
"license": "MIT",
|
|
26
29
|
"repository": {
|
|
27
30
|
"type": "git",
|
|
28
|
-
"url": "https://github.com/clawcloud/clawcloud
|
|
31
|
+
"url": "https://github.com/clawcloud/clawcloud.git",
|
|
32
|
+
"directory": "cli"
|
|
29
33
|
},
|
|
30
34
|
"homepage": "https://clawcloud.co",
|
|
31
35
|
"bugs": {
|
|
32
|
-
"url": "https://github.com/clawcloud/clawcloud
|
|
33
|
-
},
|
|
34
|
-
"dependencies": {
|
|
35
|
-
"ethers": "^6.9.0"
|
|
36
|
+
"url": "https://github.com/clawcloud/clawcloud/issues"
|
|
36
37
|
},
|
|
37
38
|
"engines": {
|
|
38
39
|
"node": ">=18.0.0"
|
|
39
|
-
}
|
|
40
|
+
},
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"boxen": "^7.1.1",
|
|
43
|
+
"chalk": "^5.3.0",
|
|
44
|
+
"cli-table3": "^0.6.3",
|
|
45
|
+
"commander": "^11.1.0",
|
|
46
|
+
"ethers": "^6.10.0",
|
|
47
|
+
"inquirer": "^9.2.12",
|
|
48
|
+
"ora": "^7.0.1"
|
|
49
|
+
},
|
|
50
|
+
"files": [
|
|
51
|
+
"bin/",
|
|
52
|
+
"src/",
|
|
53
|
+
"templates/",
|
|
54
|
+
"README.md",
|
|
55
|
+
"LICENSE"
|
|
56
|
+
]
|
|
40
57
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { getConfig } from '../utils/config.js';
|
|
2
|
+
|
|
3
|
+
export async function registerAgent(name, description) {
|
|
4
|
+
const config = getConfig();
|
|
5
|
+
|
|
6
|
+
// TODO: Replace with real API call
|
|
7
|
+
// const response = await fetch(`${config.API_URL}/agents/register`, {
|
|
8
|
+
// method: 'POST',
|
|
9
|
+
// headers: { 'Content-Type': 'application/json' },
|
|
10
|
+
// body: JSON.stringify({ name, description })
|
|
11
|
+
// });
|
|
12
|
+
|
|
13
|
+
// Mock response for now
|
|
14
|
+
await new Promise(resolve => setTimeout(resolve, 1000));
|
|
15
|
+
|
|
16
|
+
return {
|
|
17
|
+
agent_id: `agent_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`,
|
|
18
|
+
name,
|
|
19
|
+
description,
|
|
20
|
+
created_at: new Date().toISOString()
|
|
21
|
+
};
|
|
22
|
+
}
|