botparty 0.0.40 → 0.0.42

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 +168 -39
  2. package/dist/index.js +140 -104
  3. package/package.json +3 -2
package/README.md CHANGED
@@ -1,6 +1,33 @@
1
1
  # botparty
2
2
 
3
- CLI for [BotParty](https://botparty.club) — federated bot identity, authentication, and payments.
3
+ The agent-era CLI for services, APIs, and credentials.
4
+
5
+ BotParty lets any machine interact with hundreds of services without human interaction, and with all other APIs without ever touching credentials.
6
+
7
+ ## What BotParty gives you
8
+
9
+ **1. BotParty services** — Managed infrastructure with no account creation.
10
+ Create databases, deploy apps, register domains, provision servers — all from the CLI. Your machine gets its own namespace and authenticates with a keypair. No signups, no dashboards, no humans needed.
11
+
12
+ ```bash
13
+ botparty services mongo databases.create --slug my-db
14
+ botparty mongo databases.list # shorthand works too
15
+ ```
16
+
17
+ **2. Pay-as-you-go APIs** — Hundreds of APIs including all x402-compatible servers. No crypto wallet on your machine, no API keys to manage. BotParty handles payment and auth through its credit system.
18
+
19
+ ```bash
20
+ botparty curl https://api.example.com/generate -X POST -d '{"prompt":"hello"}'
21
+ ```
22
+
23
+ **3. Any other API in the world** — BotParty proxies the call through Keychains, which handles credentials so your machine never sees them. Need OAuth tokens? API keys? A human gets a secure link to enter credentials once, and your machine uses them forever.
24
+
25
+ ```bash
26
+ botparty curl https://api.github.com/user/repos
27
+ # → If credentials are needed, you get a URL for a human to authorize
28
+ ```
29
+
30
+ ---
4
31
 
5
32
  ## Install
6
33
 
@@ -11,54 +38,150 @@ npm install -g botparty
11
38
  ## Quick Start
12
39
 
13
40
  ```bash
14
- # Just run it — no setup needed
41
+ # Just use it — no setup needed
15
42
  botparty curl https://api.example.com/data
43
+
44
+ # Create a MongoDB database
45
+ botparty mongo databases.create --slug my-db
46
+
47
+ # Deploy a website
48
+ botparty services deploy projects.deploy --projectName my-site --file ./dist/
16
49
  ```
17
50
 
18
- That's it. On first run, BotParty automatically:
51
+ On first run, BotParty automatically generates an Ed25519 keypair, registers a namespace (like `brave-fox-a3f2`), signs a JWT, and sends the authenticated request. No configuration required.
19
52
 
20
- 1. Generates an Ed25519 keypair
21
- 2. Registers a namespace like `brave-fox-a3f2`
22
- 3. Signs a JWT and sends the authenticated request
53
+ ---
54
+
55
+ ## How Auth Works
56
+
57
+ Each machine gets a **self-assigned namespace**, authenticated by an Ed25519 keypair stored at `~/.botparty/`.
23
58
 
24
- ### How it works
59
+ **Key rotation protects against theft.** Keys must be rotated before a TTL expires. If two machines try to rotate the same key, the namespace locks automatically — an attacker who steals your key can't silently use it because rotation will trigger a conflict. A locked namespace requires human intervention to unlock.
60
+
61
+ **Namespace linking** connects a machine to a human account. Run `botparty link` to generate a URL — give it to your human, they click it, and your namespace is linked to their account. This enables billing, permissions, and human-in-the-loop approval flows.
25
62
 
26
63
  ```
27
- botparty curl <url>
28
-
29
- ├── Not registered? auto-register namespace + keypair
30
- ├── Key going stale? → auto-rotate
31
- ├── Sign JWT → send request with Authorization: Bearer <jwt>
32
-
33
- └── Error? → typed output with action URLs
34
- ├── 423: "Namespace locked — unlock at: https://..."
35
- ├── 402: "Payment required — top up at: https://..."
36
- └── 403: "Missing scopes" or "Link a human account at: https://..."
64
+ ~/.botparty/
65
+ ├── identity.json Namespace, key ID, algorithm, rotation info
66
+ └── private.pem Ed25519 private key (mode 0600)
37
67
  ```
38
68
 
39
69
  ---
40
70
 
41
- ## Commands
71
+ ## `botparty curl`
42
72
 
43
- ### Identity
73
+ A curl replacement that handles auth automatically. If the server you're calling uses BotParty for auth, the request goes directly to the server with a signed JWT. Otherwise, BotParty proxies the call through Keychains, which handles credentials (OAuth, API keys, pay-as-you-go billing) on your behalf.
44
74
 
45
75
  ```bash
46
- botparty init [namespace] # Register (auto-generates name if omitted)
47
- botparty init my-bot --ttl 30 # Custom namespace, 30min key rotation
48
- botparty whoami # Show current identity
49
- botparty info [namespace] # Show namespace info from server
50
- botparty link # Generate URL for a human to claim ownership
51
- botparty reset # Clear local state
52
- botparty destroy --yes # Destroy namespace (irreversible)
76
+ botparty curl <url> [options]
53
77
  ```
54
78
 
55
- ### Authenticated Requests
79
+ Your machine never touches third-party credentials. If the target API requires credentials you haven't set up yet, you'll get a URL for a human to authorize access in a secure environment.
80
+
81
+ ### Options
82
+
83
+ All standard curl flags are supported (`-X`, `-H`, `-d`, `-F`, `-o`, `-v`, `-i`, `-s`, `-L`, etc).
84
+
85
+ BotParty-specific options:
86
+
87
+ | Flag | Description |
88
+ |------|-------------|
89
+ | `--wait-on-authlink` | If credentials are needed, wait for human approval then retry |
90
+ | `--wait-timeout <s>` | Max seconds to wait for approval |
91
+
92
+ ### Examples
56
93
 
57
94
  ```bash
95
+ # Simple GET
58
96
  botparty curl https://api.example.com/data
59
- botparty curl https://api.example.com -X POST -d '{"key":"val"}'
97
+
98
+ # POST with JSON
99
+ botparty curl https://api.example.com/items -X POST --json '{"name":"widget"}'
100
+
101
+ # With custom headers
60
102
  botparty curl https://api.example.com -H "X-Custom: value"
103
+
104
+ # Wait for human approval if credentials are needed
105
+ botparty curl https://api.stripe.com/v1/charges --wait-on-authlink
106
+
107
+ # Generate a raw JWT token (for use in scripts)
108
+ botparty token
109
+ ```
110
+
111
+ ---
112
+
113
+ ## `botparty services`
114
+
115
+ Discover and invoke actions on any BotParty-compatible service. Services publish a manifest at `/.well-known/botparty/services.json` describing their available actions, parameters, and payment requirements.
116
+
117
+ ```bash
118
+ botparty services <domain> [action] [--params]
119
+ ```
120
+
121
+ Use a shorthand like `mongo` (resolves to `mongo.botparty.club`) or any full domain. Omit the action to list everything the service offers.
122
+
123
+ ### Available services
124
+
125
+ | Shorthand | Domain | What it does |
126
+ |-----------|--------|-------------|
127
+ | `mongo` | `mongo.botparty.club` | MongoDB databases — create, manage credentials, backups |
128
+ | `git` | `git.botparty.club` | Git repositories — create, push/pull, token management |
129
+ | `s3` | `s3.botparty.club` | S3 storage — buckets, presigned URLs, IAM credentials |
130
+ | `deploy` | `deploy.botparty.club` | Deployments — deploy to Vercel with no account needed |
131
+ | `domains` | `domains.botparty.club` | Domains — register domains, configure DNS records |
132
+ | `upstash` | `upstash.botparty.club` | Upstash — Redis, Vector indices, QStash queues |
133
+ | `vps` | `vps.botparty.club` | VPS — bare-metal servers, SSH sessions, command exec |
134
+ | `vms` | `vms.botparty.club` | VMs — Docker containers with persistent storage |
135
+
136
+ ### Root-level shortcuts
137
+
138
+ You can skip `services` entirely. If BotParty doesn't recognize a command, it checks whether `<command>.botparty.club` is a valid service:
139
+
140
+ ```bash
141
+ botparty mongo databases.list # same as: botparty services mongo databases.list
142
+ botparty deploy projects.deploy --projectName my-site --file ./dist/
143
+ ```
144
+
145
+ ### Examples
146
+
147
+ ```bash
148
+ # Discover all actions on a service
149
+ botparty services mongo
150
+
151
+ # List your databases
152
+ botparty services mongo databases.list
153
+
154
+ # Create a database
155
+ botparty services mongo databases.create --slug my-db
156
+
157
+ # Create and push to a git repo
158
+ botparty services git repos.create --name my-project
159
+
160
+ # Deploy a website
161
+ botparty services deploy projects.deploy --projectName my-site --file ./dist/
162
+
163
+ # Register a domain
164
+ botparty services domains domains.check --domain example.com
165
+
166
+ # Use any BotParty-compatible service
167
+ botparty services custom-service.example.com
168
+ ```
169
+
170
+ ---
171
+
172
+ ## Commands Reference
173
+
174
+ ### Identity
175
+
176
+ ```bash
177
+ botparty init [namespace] # Register (auto-generates name if omitted)
178
+ botparty init my-bot --ttl 30 # Custom namespace, 30min key rotation
179
+ botparty whoami # Show current identity
180
+ botparty info [namespace] # Show namespace info from server
181
+ botparty link # Generate URL for a human to claim ownership
61
182
  botparty token # Print a signed JWT to stdout
183
+ botparty reset # Clear local state
184
+ botparty destroy --yes # Destroy namespace (irreversible)
62
185
  ```
63
186
 
64
187
  ### Key Management
@@ -75,6 +198,22 @@ botparty keys delete <keyId> --yes
75
198
  botparty keys invalidate <keyId> --yes # Panic button — locks namespace
76
199
  ```
77
200
 
201
+ ### Invites and Dependents
202
+
203
+ ```bash
204
+ botparty invites create --scopes "read,write" --expires 24h
205
+ botparty invites list
206
+ botparty dependents list
207
+ botparty dependents revoke <tokenId> --yes
208
+ ```
209
+
210
+ ### Connections
211
+
212
+ ```bash
213
+ botparty connections list # List credential connections
214
+ botparty connections delete <id> --yes # Remove a connection
215
+ ```
216
+
78
217
  ---
79
218
 
80
219
  ## Global Options
@@ -83,21 +222,11 @@ botparty keys invalidate <keyId> --yes # Panic button — locks namespace
83
222
  |------|-------------|---------|-------------|
84
223
  | `--server <url>` | `BOTPARTY_SERVER_URL` | `https://id.botparty.club` | BotParty server URL |
85
224
  | `--state-dir <path>` | `BOTPARTY_STATE_DIR` | `~/.botparty` | Local state directory |
225
+ | `--proxy-url <url>` | `BOTPARTY_PROXY_URL` | `https://keychains.dev` | Credential proxy URL |
86
226
  | `--json` | — | — | Machine-readable JSON output |
87
227
 
88
228
  ---
89
229
 
90
- ## Local Storage
91
-
92
- All state is stored in `~/.botparty/`:
93
-
94
- | File | Contents |
95
- |------|----------|
96
- | `identity.json` | Namespace, key ID, algorithm, rotation info |
97
- | `private.pem` | Ed25519 private key (mode 0600) |
98
-
99
- ---
100
-
101
230
  ## License
102
231
 
103
232
  MIT