teardrop-cli 0.1.0__py3-none-any.whl

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.
@@ -0,0 +1,384 @@
1
+ Metadata-Version: 2.4
2
+ Name: teardrop-cli
3
+ Version: 0.1.0
4
+ Summary: Command-line interface for the Teardrop AI agent platform
5
+ Project-URL: Homepage, https://github.com/teardrop-ai/teardrop-cli
6
+ Project-URL: Repository, https://github.com/teardrop-ai/teardrop-cli
7
+ Project-URL: Issues, https://github.com/teardrop-ai/teardrop-cli/issues
8
+ Author: teardrop-ai
9
+ License: MIT License
10
+
11
+ Copyright (c) 2026 teardrop-ai
12
+
13
+ Permission is hereby granted, free of charge, to any person obtaining a copy
14
+ of this software and associated documentation files (the "Software"), to deal
15
+ in the Software without restriction, including without limitation the rights
16
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17
+ copies of the Software, and to permit persons to whom the Software is
18
+ furnished to do so, subject to the following conditions:
19
+
20
+ The above copyright notice and this permission notice shall be included in all
21
+ copies or substantial portions of the Software.
22
+
23
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
29
+ SOFTWARE.
30
+ License-File: LICENSE
31
+ Keywords: agent,ai,cli,crypto,teardrop
32
+ Classifier: Development Status :: 3 - Alpha
33
+ Classifier: Environment :: Console
34
+ Classifier: Intended Audience :: Developers
35
+ Classifier: License :: OSI Approved :: MIT License
36
+ Classifier: Operating System :: OS Independent
37
+ Classifier: Programming Language :: Python :: 3
38
+ Classifier: Programming Language :: Python :: 3.11
39
+ Classifier: Programming Language :: Python :: 3.12
40
+ Classifier: Programming Language :: Python :: 3.13
41
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
42
+ Requires-Python: >=3.11
43
+ Requires-Dist: eth-account>=0.13
44
+ Requires-Dist: keyring>=25.0
45
+ Requires-Dist: platformdirs>=4.0
46
+ Requires-Dist: rich>=13.0
47
+ Requires-Dist: teardrop-sdk>=0.1.3
48
+ Requires-Dist: tomli-w>=1.0
49
+ Requires-Dist: typer>=0.12
50
+ Provides-Extra: dev
51
+ Requires-Dist: hatch>=1.12; extra == 'dev'
52
+ Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
53
+ Requires-Dist: pytest-mock>=3.14; extra == 'dev'
54
+ Requires-Dist: pytest>=8.0; extra == 'dev'
55
+ Requires-Dist: ruff>=0.4; extra == 'dev'
56
+ Description-Content-Type: text/markdown
57
+
58
+ # teardrop-cli
59
+
60
+ Command-line interface for the [Teardrop](https://teardrop.dev) crypto-native AI agent platform. Authenticate, run prompts against agents, manage marketplace earnings, configure MCP servers, and inspect organization tools.
61
+
62
+ ---
63
+
64
+ ## Requirements
65
+
66
+ - Python ≥ 3.11
67
+ - A Teardrop account (email/password, M2M client credentials, Ethereum wallet, or pre-issued JWT)
68
+
69
+ ---
70
+
71
+ ## Installation
72
+
73
+ ```bash
74
+ pip install teardrop-cli
75
+ ```
76
+
77
+ Verify the installation:
78
+
79
+ ```bash
80
+ teardrop --version
81
+ ```
82
+
83
+ ---
84
+
85
+ ## Authentication
86
+
87
+ Credentials are resolved in this priority order at runtime:
88
+
89
+ | Priority | Source |
90
+ |----------|--------|
91
+ | 1 | `TEARDROP_TOKEN` env var (static JWT) |
92
+ | 2 | `TEARDROP_EMAIL` + `TEARDROP_SECRET` env vars |
93
+ | 3 | `TEARDROP_CLIENT_ID` + `TEARDROP_CLIENT_SECRET` env vars |
94
+ | 4 | System keyring |
95
+ | 5 | Config file (`~/.config/teardrop/config.toml`) |
96
+
97
+ ### Login flows
98
+
99
+ ```bash
100
+ # Email + password (interactive prompts if flags omitted)
101
+ teardrop auth login --email user@example.com --secret ••••
102
+
103
+ # Machine-to-machine (client credentials)
104
+ teardrop auth login --client-id <id> --client-secret <secret>
105
+
106
+ # Sign-In With Ethereum (EIP-4361)
107
+ # On macOS/Linux:
108
+ export TEARDROP_SIWE_PRIVATE_KEY=0x<private-key>
109
+ # On Windows (PowerShell):
110
+ $env:TEARDROP_SIWE_PRIVATE_KEY = "0x<private-key>"
111
+ # Then:
112
+ teardrop auth login --siwe
113
+
114
+ # Pre-issued JWT
115
+ teardrop auth login --token <jwt>
116
+ ```
117
+
118
+ ```bash
119
+ teardrop auth whoami # show current identity
120
+ teardrop auth whoami --json # as JSON
121
+ teardrop auth logout # clear all stored credentials
122
+ ```
123
+
124
+ Override the API endpoint for any command with `--base-url <url>` (hidden flag).
125
+
126
+ ---
127
+
128
+ ## Billing
129
+
130
+ ```bash
131
+ # Check account balance
132
+ teardrop billing balance
133
+ teardrop billing balance --json
134
+ ```
135
+
136
+ Account balance is used to run agents. When it reaches zero, you'll get `PaymentRequiredError` (exit code 2).
137
+
138
+ ---
139
+
140
+ ## Agent
141
+
142
+ ### Run a prompt
143
+
144
+ ```bash
145
+ teardrop agent run "Summarize the latest ETH gas trends"
146
+
147
+ # Continue an existing thread
148
+ teardrop agent run "Follow up on that" --thread-id <id>
149
+
150
+ # Override model
151
+ teardrop agent run "..." --model gpt-4o
152
+
153
+ # Machine-readable: one JSON object per line (SSE event passthrough)
154
+ teardrop agent run "..." --json
155
+ ```
156
+
157
+ Streaming output renders Markdown live in the terminal. Tool calls are shown inline as they execute. A usage summary (input/output tokens + cost) is printed at the end.
158
+
159
+ **Exit codes:**
160
+
161
+ | Code | Meaning |
162
+ |------|---------|
163
+ | 0 | Success |
164
+ | 2 | Insufficient account balance (`PaymentRequiredError`) — use `teardrop billing balance` to check |
165
+ | 3 | Rate limited (`RateLimitError`) |
166
+ | 5 | Agent stream error |
167
+ | 130 | Interrupted (`Ctrl-C`) |
168
+
169
+ ---
170
+
171
+ ## Marketplace
172
+
173
+ ```bash
174
+ # Current balance
175
+ teardrop marketplace balance
176
+ teardrop marketplace balance --json
177
+
178
+ # Earnings history
179
+ teardrop marketplace earnings
180
+ teardrop marketplace earnings --limit 50 --cursor <cursor>
181
+
182
+ # Withdraw USDC
183
+ teardrop marketplace withdraw --amount-usdc 100 --payout-address 0x...
184
+ teardrop marketplace withdraw --amount-usdc 100 --payout-address 0x... --yes # skip confirm
185
+
186
+ # Register payout address for marketplace listings
187
+ teardrop marketplace publish --payout-address 0x...
188
+ ```
189
+
190
+ ---
191
+
192
+ ## MCP Servers
193
+
194
+ Manage Model Context Protocol servers attached to your organization.
195
+
196
+ ```bash
197
+ # List registered servers
198
+ teardrop mcp list
199
+
200
+ # Add a server
201
+ teardrop mcp add --name "my-server" --url https://mcp.example.com
202
+ teardrop mcp add --name "secure" --url https://mcp.example.com \
203
+ --auth-type bearer --auth-token <token>
204
+
205
+ # Discover tools exposed by a server
206
+ teardrop mcp discover <server-id>
207
+
208
+ # Remove a server
209
+ teardrop mcp remove <server-id>
210
+ teardrop mcp remove <server-id> --yes # skip confirm
211
+ ```
212
+
213
+ ---
214
+
215
+ ## Tools
216
+
217
+ Inspect and dry-run validate organization tools.
218
+
219
+ ```bash
220
+ # List all tools
221
+ teardrop tools list
222
+ teardrop tools list --json
223
+
224
+ # Show a tool's schema and optionally validate input
225
+ teardrop tools test <tool-id>
226
+ teardrop tools test <tool-id> --input '{"param": "value"}'
227
+ ```
228
+
229
+ `--input` performs local validation: checks required fields are present and types match the schema before any network call.
230
+
231
+ ---
232
+
233
+ ## LLM Configuration
234
+
235
+ Configure organization-level LLM settings, including model selection, routing preference, and bring-your-own-key (BYOK) support.
236
+
237
+ ```bash
238
+ # Get current config
239
+ teardrop llm-config get org-1
240
+ teardrop llm-config get org-1 --json
241
+
242
+ # Set config with provider and model
243
+ teardrop llm-config set org-1 \
244
+ --provider anthropic \
245
+ --model claude-haiku-4-5-20251001
246
+
247
+ # Set with routing preference
248
+ teardrop llm-config set org-1 \
249
+ --provider anthropic \
250
+ --model claude-haiku-4-5-20251001 \
251
+ --routing cost
252
+
253
+ # Set advanced options
254
+ teardrop llm-config set org-1 \
255
+ --provider openai \
256
+ --model gpt-4o \
257
+ --max-tokens 8000 \
258
+ --temperature 0.7 \
259
+ --timeout-seconds 60
260
+
261
+ # Bring-your-own-key (BYOK)
262
+ teardrop llm-config set org-1 \
263
+ --provider openai \
264
+ --model gpt-4o \
265
+ --byok-key $OPENAI_API_KEY
266
+
267
+ # Read key from stdin (more secure)
268
+ cat $key_file | teardrop llm-config set org-1 \
269
+ --provider openai \
270
+ --model gpt-4o \
271
+ --byok-key -
272
+
273
+ # Self-hosted model
274
+ teardrop llm-config set org-1 \
275
+ --provider openai \
276
+ --model llama2-70b \
277
+ --api-base https://gpu-cluster.internal.example.com:8000/v1 \
278
+ --byok-key $LOCAL_TOKEN
279
+
280
+ # Rotate API key
281
+ teardrop llm-config set org-1 \
282
+ --provider anthropic \
283
+ --model claude-sonnet-4-20250514 \
284
+ --rotate-key
285
+
286
+ # Delete custom config (revert to global defaults)
287
+ teardrop llm-config delete org-1
288
+ teardrop llm-config delete org-1 --yes # skip confirm
289
+ ```
290
+
291
+ **Supported providers:** `anthropic`, `openai`, `google`, `openrouter`
292
+
293
+ **Routing preferences:** `default`, `cost`, `speed`, `quality`
294
+
295
+ **Validation:**
296
+ - Temperature: 0.0–2.0
297
+ - Max tokens: 1–200,000
298
+ - Timeout: ≥ 1 second
299
+ - API key handling: keys sent only over TLS; warnings shown for insecure practices
300
+
301
+ **Caching:**
302
+ - Config is cached locally for 5 minutes; use `--no-cache` to force refresh
303
+
304
+ ---
305
+
306
+ ## Models & Benchmarks
307
+
308
+ View the model catalogue with performance metrics and discover your organization's actual usage.
309
+
310
+ ```bash
311
+ # Public model benchmarks (no auth required)
312
+ teardrop models benchmarks
313
+ teardrop models benchmarks --json
314
+
315
+ # Organization-scoped metrics (auth required)
316
+ teardrop models benchmarks --org org-1
317
+ teardrop models benchmarks --org org-1 --json
318
+
319
+ # Bypass cache
320
+ teardrop models benchmarks --no-cache
321
+ teardrop models benchmarks --org org-1 --force-refresh
322
+ ```
323
+
324
+ The public benchmark table shows:
325
+ - Model identifiers and display names
326
+ - Quality tier (1–3)
327
+ - P95 latency (ms)
328
+ - Pricing (cost per 1k tokens in/out)
329
+ - 7-day usage stats (total runs)
330
+
331
+ Organization-scoped metrics show your org's actual performance:
332
+ - Number of runs
333
+ - Average latency
334
+ - Average cost per run
335
+ - Total cost (7-day sum)
336
+ - Tokens per second
337
+
338
+ **Caching:**
339
+ - Public benchmarks: 10 minutes local cache
340
+ - Organization benchmarks: always fresh (no cache)
341
+
342
+ ---
343
+
344
+ ## Configuration
345
+
346
+ The config file lives at the platform-appropriate path (e.g., `~/.config/teardrop/config.toml` on Linux/macOS). It is created automatically on first login and restricted to owner-read (`0o600` on POSIX).
347
+
348
+ Sensitive secrets (passwords, tokens) are stored in the **system keyring**; only non-secret fields (email, client_id) are written to the config file.
349
+
350
+ ```toml
351
+ # ~/.config/teardrop/config.toml
352
+ base_url = "https://api.teardrop.dev" # optional override
353
+ ```
354
+
355
+ ---
356
+
357
+ ## Development
358
+
359
+ To contribute to `teardrop-cli`, clone the repository and install in editable mode with dev dependencies:
360
+
361
+ ```bash
362
+ git clone https://github.com/teardrop-ai/teardrop-cli
363
+ cd teardrop-cli
364
+ pip install -e ".[dev]"
365
+ ```
366
+
367
+ Run tests:
368
+
369
+ ```bash
370
+ pytest
371
+ ```
372
+
373
+ Lint and format:
374
+
375
+ ```bash
376
+ ruff check src tests
377
+ ruff format src tests
378
+ ```
379
+
380
+ **Testing utilities** in `src/teardrop_cli/_fixtures.py`:
381
+ - `make_jwt_payload(sub, org, role)` — mock JWT payload
382
+ - `make_sse_events(text)` — mock SSE event sequence (text chunk → usage → done)
383
+
384
+ All async tests use `asyncio_mode = "auto"` (configured in `pyproject.toml`).
@@ -0,0 +1,20 @@
1
+ teardrop_cli/__init__.py,sha256=kUR5RAFc7HCeiqdlX36dZOHkUI5wI6V_43RpEcD8b-0,22
2
+ teardrop_cli/_fixtures.py,sha256=7k--fmvYIKv5Dads4C97unHobDsqHrKu7anI06_28s0,3765
3
+ teardrop_cli/_lazy.py,sha256=ioeNbKdICjs3fmBf_1XX-4HU6Jp8_9SRZom9KnSlclQ,2127
4
+ teardrop_cli/cli.py,sha256=M5bVFx3uhluNWWuWQIdHibaMBKyy5v0R_L9xVjUmELI,1334
5
+ teardrop_cli/config.py,sha256=jqZvgyNlTnxWvA8mvE9_pdBlUA8suy6vHnPLXfLD3wM,7948
6
+ teardrop_cli/formatting.py,sha256=_gfO2hcn0RUiMxFQmKj4r-JtyOO9Q3b73T1YbSC1CpI,7862
7
+ teardrop_cli/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
+ teardrop_cli/commands/agent.py,sha256=XE96d1JiBgnd_rnzOFl5KN6OXH-J4YvutReV6t202u4,6145
9
+ teardrop_cli/commands/auth.py,sha256=8XnrNDewOJZQ4ASU-6Mu3wB0s41qYTPViUsodg_a9do,9109
10
+ teardrop_cli/commands/billing.py,sha256=9_bQAnOQef_V5IDbTcXPXPR_ME3N-ld0D-KgIZnu0pQ,1441
11
+ teardrop_cli/commands/llm_config.py,sha256=EH3c01HRvDQufWzPxX7UeXq-mIDwOFXzcnAEQPAboD4,12982
12
+ teardrop_cli/commands/marketplace.py,sha256=iQmzjs20yqGlqkhyMvzl3xbszZQfKuTlRY2XZi5kLiM,6084
13
+ teardrop_cli/commands/mcp.py,sha256=RJzCELbeuMbBdAod9ChnXvChMJaEyZHCbgK8U782PNM,6189
14
+ teardrop_cli/commands/models.py,sha256=Juwlv8-DDH-ThHivLly7AydVrRFVTeIdh72AuHzliow,6149
15
+ teardrop_cli/commands/tools.py,sha256=TiEwbzzJBRUmjmjgBSHJWKwf11-9_CgqVgW_yhRJU44,6005
16
+ teardrop_cli-0.1.0.dist-info/METADATA,sha256=Hyb4wG0vifiPVhiVRyygAnhCRZoBJAkUyKnRmivs7aA,10665
17
+ teardrop_cli-0.1.0.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
18
+ teardrop_cli-0.1.0.dist-info/entry_points.txt,sha256=qsy4xScMDnM_fR4J_KxGrsRCesrz8t-lpCmMkWR5XDc,50
19
+ teardrop_cli-0.1.0.dist-info/licenses/LICENSE,sha256=QQTEU1DIf_IFEVVGnv3ET-CkGg6-tPOtj4lSwkSCwO8,1068
20
+ teardrop_cli-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.29.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ teardrop = teardrop_cli.cli:app
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 teardrop-ai
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.