teardrop-cli 0.1.0__tar.gz → 0.2.0__tar.gz

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 (79) hide show
  1. teardrop_cli-0.2.0/PKG-INFO +297 -0
  2. teardrop_cli-0.2.0/README.md +237 -0
  3. teardrop_cli-0.2.0/docs/cli-json-schema.md +27 -0
  4. teardrop_cli-0.2.0/docs/cli-reference.md +417 -0
  5. {teardrop_cli-0.1.0 → teardrop_cli-0.2.0}/pyproject.toml +12 -3
  6. teardrop_cli-0.2.0/src/teardrop_cli/_fixtures.py +251 -0
  7. teardrop_cli-0.2.0/src/teardrop_cli/_templates.py +53 -0
  8. {teardrop_cli-0.1.0 → teardrop_cli-0.2.0}/src/teardrop_cli/cli.py +12 -5
  9. teardrop_cli-0.2.0/src/teardrop_cli/commands/agent_tools.py +90 -0
  10. teardrop_cli-0.2.0/src/teardrop_cli/commands/auth.py +716 -0
  11. teardrop_cli-0.2.0/src/teardrop_cli/commands/balance.py +202 -0
  12. teardrop_cli-0.2.0/src/teardrop_cli/commands/chat.py +177 -0
  13. teardrop_cli-0.2.0/src/teardrop_cli/commands/config_cmd.py +113 -0
  14. teardrop_cli-0.2.0/src/teardrop_cli/commands/earnings.py +300 -0
  15. {teardrop_cli-0.1.0 → teardrop_cli-0.2.0}/src/teardrop_cli/commands/llm_config.py +226 -106
  16. teardrop_cli-0.2.0/src/teardrop_cli/commands/marketplace.py +430 -0
  17. {teardrop_cli-0.1.0 → teardrop_cli-0.2.0}/src/teardrop_cli/commands/models.py +6 -4
  18. teardrop_cli-0.2.0/src/teardrop_cli/commands/quickstart.py +168 -0
  19. teardrop_cli-0.2.0/src/teardrop_cli/commands/run.py +373 -0
  20. teardrop_cli-0.2.0/src/teardrop_cli/commands/tools.py +700 -0
  21. teardrop_cli-0.2.0/src/teardrop_cli/commands/usage.py +51 -0
  22. teardrop_cli-0.2.0/src/teardrop_cli/config.py +488 -0
  23. teardrop_cli-0.2.0/src/teardrop_cli/formatting.py +527 -0
  24. teardrop_cli-0.2.0/src/teardrop_cli/pricing.py +266 -0
  25. {teardrop_cli-0.1.0 → teardrop_cli-0.2.0}/tests/conftest.py +122 -6
  26. teardrop_cli-0.2.0/tests/e2e/README.md +93 -0
  27. teardrop_cli-0.2.0/tests/e2e/__init__.py +0 -0
  28. teardrop_cli-0.2.0/tests/e2e/conftest.py +112 -0
  29. teardrop_cli-0.2.0/tests/e2e/test_auth_e2e.py +142 -0
  30. teardrop_cli-0.2.0/tests/e2e/test_billing_e2e.py +104 -0
  31. teardrop_cli-0.2.0/tests/e2e/test_marketplace_e2e.py +89 -0
  32. teardrop_cli-0.2.0/tests/e2e/test_run_e2e.py +78 -0
  33. teardrop_cli-0.2.0/tests/e2e/test_signup_e2e.py +75 -0
  34. teardrop_cli-0.2.0/tests/e2e/test_siwe_login_e2e.py +65 -0
  35. teardrop_cli-0.2.0/tests/smoke/__init__.py +0 -0
  36. teardrop_cli-0.2.0/tests/smoke/conftest.py +67 -0
  37. teardrop_cli-0.2.0/tests/smoke/test_config_persistence.py +48 -0
  38. teardrop_cli-0.2.0/tests/smoke/test_keyring_integration.py +30 -0
  39. teardrop_cli-0.2.0/tests/smoke/test_perf_lazygroup.py +91 -0
  40. teardrop_cli-0.2.0/tests/smoke/test_siwe_signing.py +58 -0
  41. {teardrop_cli-0.1.0 → teardrop_cli-0.2.0}/tests/test_auth.py +115 -78
  42. teardrop_cli-0.2.0/tests/test_billing.py +78 -0
  43. teardrop_cli-0.2.0/tests/test_chat.py +237 -0
  44. teardrop_cli-0.2.0/tests/test_config_cmd.py +58 -0
  45. teardrop_cli-0.2.0/tests/test_credential_priority.py +156 -0
  46. teardrop_cli-0.2.0/tests/test_earnings.py +41 -0
  47. teardrop_cli-0.2.0/tests/test_init_and_byok.py +170 -0
  48. teardrop_cli-0.2.0/tests/test_llm_config.py +59 -0
  49. teardrop_cli-0.2.0/tests/test_marketplace.py +159 -0
  50. {teardrop_cli-0.1.0 → teardrop_cli-0.2.0}/tests/test_models.py +9 -6
  51. teardrop_cli-0.2.0/tests/test_quickstart.py +224 -0
  52. teardrop_cli-0.2.0/tests/test_run.py +416 -0
  53. teardrop_cli-0.2.0/tests/test_signup.py +277 -0
  54. teardrop_cli-0.2.0/tests/test_token_expiry_fallback.py +123 -0
  55. teardrop_cli-0.2.0/tests/test_tools.py +288 -0
  56. teardrop_cli-0.1.0/PKG-INFO +0 -384
  57. teardrop_cli-0.1.0/README.md +0 -327
  58. teardrop_cli-0.1.0/src/teardrop_cli/_fixtures.py +0 -132
  59. teardrop_cli-0.1.0/src/teardrop_cli/commands/agent.py +0 -190
  60. teardrop_cli-0.1.0/src/teardrop_cli/commands/auth.py +0 -270
  61. teardrop_cli-0.1.0/src/teardrop_cli/commands/billing.py +0 -58
  62. teardrop_cli-0.1.0/src/teardrop_cli/commands/marketplace.py +0 -192
  63. teardrop_cli-0.1.0/src/teardrop_cli/commands/tools.py +0 -207
  64. teardrop_cli-0.1.0/src/teardrop_cli/config.py +0 -240
  65. teardrop_cli-0.1.0/src/teardrop_cli/formatting.py +0 -243
  66. teardrop_cli-0.1.0/tests/test_agent.py +0 -68
  67. teardrop_cli-0.1.0/tests/test_llm_config.py +0 -387
  68. teardrop_cli-0.1.0/tests/test_marketplace.py +0 -102
  69. teardrop_cli-0.1.0/tests/test_tools.py +0 -88
  70. {teardrop_cli-0.1.0 → teardrop_cli-0.2.0}/.github/workflows/publish.yml +0 -0
  71. {teardrop_cli-0.1.0 → teardrop_cli-0.2.0}/.github/workflows/test.yml +0 -0
  72. {teardrop_cli-0.1.0 → teardrop_cli-0.2.0}/.gitignore +0 -0
  73. {teardrop_cli-0.1.0 → teardrop_cli-0.2.0}/.vscode/settings.json +0 -0
  74. {teardrop_cli-0.1.0 → teardrop_cli-0.2.0}/LICENSE +0 -0
  75. {teardrop_cli-0.1.0 → teardrop_cli-0.2.0}/src/teardrop_cli/__init__.py +0 -0
  76. {teardrop_cli-0.1.0 → teardrop_cli-0.2.0}/src/teardrop_cli/_lazy.py +0 -0
  77. {teardrop_cli-0.1.0 → teardrop_cli-0.2.0}/src/teardrop_cli/commands/__init__.py +0 -0
  78. {teardrop_cli-0.1.0 → teardrop_cli-0.2.0}/src/teardrop_cli/commands/mcp.py +0 -0
  79. {teardrop_cli-0.1.0 → teardrop_cli-0.2.0}/tests/test_mcp.py +0 -0
@@ -0,0 +1,297 @@
1
+ Metadata-Version: 2.4
2
+ Name: teardrop-cli
3
+ Version: 0.2.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: httpx>=0.27
45
+ Requires-Dist: keyring>=25.0
46
+ Requires-Dist: platformdirs>=4.0
47
+ Requires-Dist: rich>=13.0
48
+ Requires-Dist: teardrop-sdk>=0.1.8
49
+ Requires-Dist: tomli-w>=1.0
50
+ Requires-Dist: typer>=0.12
51
+ Provides-Extra: dev
52
+ Requires-Dist: hatch>=1.12; extra == 'dev'
53
+ Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
54
+ Requires-Dist: pytest-mock>=3.14; extra == 'dev'
55
+ Requires-Dist: pytest>=8.0; extra == 'dev'
56
+ Requires-Dist: ruff>=0.4; extra == 'dev'
57
+ Provides-Extra: e2e
58
+ Requires-Dist: pytest-timeout>=2.3; extra == 'e2e'
59
+ Description-Content-Type: text/markdown
60
+
61
+ # teardrop-cli
62
+
63
+ The fastest way to **publish a tool, run an agent, and earn USDC** — straight from your terminal.
64
+
65
+ [Teardrop](https://teardrop.dev) is the crypto-native AI agent platform. Tool authors publish webhooks, get paid per call in USDC, and never touch a dashboard. Agent users run prompts that automatically discover and pay for the right tools.
66
+
67
+ ```bash
68
+ pip install teardrop-cli
69
+ teardrop quickstart # 60-second guided onboarding
70
+ ```
71
+
72
+ > Already onboarded? Jump to [Run an Agent](#run-an-agent) or [Publish a Tool](#publish-a-tool).
73
+
74
+ ---
75
+
76
+ ## Install
77
+
78
+ ```bash
79
+ pip install teardrop-cli
80
+ teardrop --version
81
+ ```
82
+
83
+ Requires Python ≥ 3.11.
84
+
85
+ ---
86
+
87
+ ## 60-Second Quickstart
88
+
89
+ The wizard walks you through sign-in, BYOK LLM setup, and your first agent run or scaffolded tool:
90
+
91
+ ```bash
92
+ teardrop quickstart
93
+ ```
94
+
95
+ Prefer the manual path? Pick a sign-in method:
96
+
97
+ ```bash
98
+ # Wallet-first (no email needed) — generates a wallet on first run if you don't have one
99
+ teardrop auth login --siwe --generate-wallet
100
+
101
+ # Email + password
102
+ teardrop auth signup --email you@example.com --org-name acme
103
+
104
+ # Already have an account
105
+ teardrop auth login --email you@example.com
106
+ ```
107
+
108
+ Then run your first agent:
109
+
110
+ ```bash
111
+ teardrop run "Summarize the latest ETH gas trends"
112
+ ```
113
+
114
+ ---
115
+
116
+ ## Sign In
117
+
118
+ | Goal | Command |
119
+ |------|---------|
120
+ | Create account & org | `teardrop auth signup` |
121
+ | Generate a new wallet & sign in | `teardrop auth login --siwe --generate-wallet [--save-key]` |
122
+ | Sign in with wallet (existing key) | `teardrop auth login --siwe --key-file wallet.key [--save-key]` |
123
+ | Email + password | `teardrop auth login --email you@example.com` |
124
+ | Pre-issued JWT | `teardrop auth login --token <jwt>` |
125
+ | Invite a team member | `teardrop auth invite colleague@example.com` |
126
+ | Show identity | `teardrop auth status` |
127
+ | Sign out | `teardrop auth logout` |
128
+
129
+ Private keys are never persisted by the CLI unless you pass ``--save-key``.
130
+ When saved, the key is stored in your OS keyring (never in a config file)
131
+ and can be used for automatic re-authentication when the session token
132
+ expires. An encrypted keyring backend is required — plaintext fallbacks
133
+ are refused.
134
+
135
+ For machine-to-machine credentials, env-var precedence, and CI patterns, see [docs/cli-reference.md](docs/cli-reference.md#authentication).
136
+
137
+ ---
138
+
139
+ ## Publish a Tool
140
+
141
+ Scaffold a starter spec, edit it, and publish:
142
+
143
+ ```bash
144
+ teardrop tools init my_scraper # writes ./tool.json
145
+ $EDITOR tool.json # set webhook_url, schema, price
146
+ teardrop tools probe my_scraper # test webhook health before publishing
147
+ teardrop tools publish --from-file tool.json \
148
+ --settlement-wallet 0xYourChecksumAddress
149
+ ```
150
+
151
+ Or run the interactive wizard:
152
+
153
+ ```bash
154
+ teardrop tools publish
155
+ ```
156
+
157
+ Tool name rules: `^[a-z][a-z0-9_]*$`, ≤ 64 chars. Prices are in atomic USDC (6 decimals): `5000` = **$0.005** per call. Settlement wallet is required once before your first payout.
158
+
159
+ Test your webhook before publishing with `teardrop tools probe <tool-name>`. Optionally pass `--auth-header-name` and `--auth-header-value` if your webhook requires auth, or use `--method` and `--payload` to customize the probe request.
160
+
161
+ Manage existing tools: `teardrop tools list | info | update | pause | delete | probe`. Full reference: [docs/cli-reference.md](docs/cli-reference.md#tool-management).
162
+
163
+ ---
164
+
165
+ ## Earn
166
+
167
+ ```bash
168
+ teardrop earnings balance # marketplace balance
169
+ teardrop earnings history # per-call history
170
+ teardrop earnings withdraw 10.00 # to your settlement wallet
171
+ teardrop earnings withdrawals # past payouts
172
+ ```
173
+
174
+ On-chain withdrawals typically settle in 1–5 minutes.
175
+
176
+ ---
177
+
178
+ ## Run an Agent
179
+
180
+ ```bash
181
+ teardrop run "What is the current ETH gas price?"
182
+
183
+ # Continue a thread
184
+ teardrop run "Follow up" --thread <thread-id>
185
+
186
+ # Pass structured context
187
+ teardrop run "Process this order" --context '{"order_id":"ord_123"}'
188
+
189
+ # Exclude specific tools
190
+ teardrop run "Summarize news" --exclude platform/web_search
191
+
192
+ # Estimate cost based on current pricing & config (no run performed)
193
+ teardrop run "Analyze this data" --estimate-cost
194
+
195
+ # Apply a tool policy from a file
196
+ teardrop run "Execute workflow" --policy-file policy.json
197
+
198
+ # Machine-readable output
199
+ teardrop run "..." --json --no-stream
200
+
201
+ # Include UI component data for dashboard export (adds ~60s overhead)
202
+ teardrop run "..." --json --with-ui
203
+ ```
204
+
205
+ Streaming output renders Markdown live with inline tool calls and structured UI components. A token + cost summary prints at the end. By default, CLI output is optimized for scripting and automation (`emit_ui=false`); use `--with-ui` only if you need structured UI component data in the JSON output.
206
+
207
+ ---
208
+
209
+ ## Chat with an Agent
210
+
211
+ A stateful chat mode that automatically continues the same thread across invocations:
212
+
213
+ ```bash
214
+ teardrop chat "What is the current ETH gas price?" # auto-creates a thread
215
+ teardrop chat "Follow up on that" # continues the same thread
216
+ teardrop chat "Start fresh" --new # starts a new conversation
217
+ teardrop chat "Specific thread" --thread thr_abc123 # explicit thread by id
218
+ teardrop chat "..." --json # machine-readable output
219
+ ```
220
+
221
+ The active thread id is stored in `~/.teardrop/config.toml` and reused on your next `teardrop chat` call. The thread id is printed after every turn for copy/paste. All run flags (`--context`, `--exclude`, `--policy-file`, `--estimate-cost`, `--with-ui`, `--no-stream`) are supported.
222
+
223
+ Use `teardrop run` for one-shot, script-friendly calls — use `teardrop chat` for conversational interaction.
224
+
225
+ ---
226
+
227
+ If a run fails on credit, check your balance and history:
228
+
229
+ ```bash
230
+ teardrop balance # current credits
231
+ teardrop balance credit-history # past charges and top-ups
232
+ ```
233
+
234
+ To add credits, visit [teardrop.dev](https://teardrop.dev).
235
+
236
+ ---
237
+
238
+ ## Agent Tools
239
+
240
+ List all tools visible to your agent (platform, marketplace subscriptions, and your own tools):
241
+
242
+ ```bash
243
+ teardrop agent-tools list
244
+ ```
245
+
246
+ ---
247
+
248
+ ## Configure Your LLM
249
+
250
+ One-shot bring-your-own-key wizard:
251
+
252
+ ```bash
253
+ teardrop llm-config byok
254
+ ```
255
+
256
+ Or set explicitly:
257
+
258
+ ```bash
259
+ # Quality tier (default)
260
+ teardrop llm-config set --provider anthropic --model claude-sonnet-4-6 --routing quality
261
+
262
+ # Cost tier
263
+ teardrop llm-config set --provider openrouter --model deepseek-chat --routing cost
264
+
265
+ # Speed tier
266
+ teardrop llm-config set --provider google --model gemini-3-flash --routing speed
267
+ ```
268
+
269
+ Pipe a key from stdin to keep it out of shell history: `--byok-key -`. See [docs/cli-reference.md](docs/cli-reference.md#llm-configuration) for advanced tuning, BYOK details, and benchmarks.
270
+
271
+ ---
272
+
273
+ ## Browse the Marketplace
274
+
275
+ ```bash
276
+ teardrop marketplace list
277
+ teardrop marketplace search "weather"
278
+ teardrop marketplace info acme/weather
279
+ teardrop marketplace subscribe acme/weather
280
+ teardrop marketplace subscriptions
281
+ ```
282
+
283
+ Browsing requires no authentication. Subscribed tools become immediately available to your agents.
284
+
285
+ ---
286
+
287
+ ## Where to Go Next
288
+
289
+ - **[Full CLI reference](docs/cli-reference.md)** — every flag, env-var precedence, exit codes, M2M auth, MCP servers, models benchmarks, config file, development.
290
+ - **[End-to-end test guide](tests/e2e/README.md)** — running tests against a live API.
291
+ - **[teardrop.dev](https://teardrop.dev)** — platform docs and dashboard.
292
+
293
+ ---
294
+
295
+ ## License
296
+
297
+ MIT. See [LICENSE](LICENSE).
@@ -0,0 +1,237 @@
1
+ # teardrop-cli
2
+
3
+ The fastest way to **publish a tool, run an agent, and earn USDC** — straight from your terminal.
4
+
5
+ [Teardrop](https://teardrop.dev) is the crypto-native AI agent platform. Tool authors publish webhooks, get paid per call in USDC, and never touch a dashboard. Agent users run prompts that automatically discover and pay for the right tools.
6
+
7
+ ```bash
8
+ pip install teardrop-cli
9
+ teardrop quickstart # 60-second guided onboarding
10
+ ```
11
+
12
+ > Already onboarded? Jump to [Run an Agent](#run-an-agent) or [Publish a Tool](#publish-a-tool).
13
+
14
+ ---
15
+
16
+ ## Install
17
+
18
+ ```bash
19
+ pip install teardrop-cli
20
+ teardrop --version
21
+ ```
22
+
23
+ Requires Python ≥ 3.11.
24
+
25
+ ---
26
+
27
+ ## 60-Second Quickstart
28
+
29
+ The wizard walks you through sign-in, BYOK LLM setup, and your first agent run or scaffolded tool:
30
+
31
+ ```bash
32
+ teardrop quickstart
33
+ ```
34
+
35
+ Prefer the manual path? Pick a sign-in method:
36
+
37
+ ```bash
38
+ # Wallet-first (no email needed) — generates a wallet on first run if you don't have one
39
+ teardrop auth login --siwe --generate-wallet
40
+
41
+ # Email + password
42
+ teardrop auth signup --email you@example.com --org-name acme
43
+
44
+ # Already have an account
45
+ teardrop auth login --email you@example.com
46
+ ```
47
+
48
+ Then run your first agent:
49
+
50
+ ```bash
51
+ teardrop run "Summarize the latest ETH gas trends"
52
+ ```
53
+
54
+ ---
55
+
56
+ ## Sign In
57
+
58
+ | Goal | Command |
59
+ |------|---------|
60
+ | Create account & org | `teardrop auth signup` |
61
+ | Generate a new wallet & sign in | `teardrop auth login --siwe --generate-wallet [--save-key]` |
62
+ | Sign in with wallet (existing key) | `teardrop auth login --siwe --key-file wallet.key [--save-key]` |
63
+ | Email + password | `teardrop auth login --email you@example.com` |
64
+ | Pre-issued JWT | `teardrop auth login --token <jwt>` |
65
+ | Invite a team member | `teardrop auth invite colleague@example.com` |
66
+ | Show identity | `teardrop auth status` |
67
+ | Sign out | `teardrop auth logout` |
68
+
69
+ Private keys are never persisted by the CLI unless you pass ``--save-key``.
70
+ When saved, the key is stored in your OS keyring (never in a config file)
71
+ and can be used for automatic re-authentication when the session token
72
+ expires. An encrypted keyring backend is required — plaintext fallbacks
73
+ are refused.
74
+
75
+ For machine-to-machine credentials, env-var precedence, and CI patterns, see [docs/cli-reference.md](docs/cli-reference.md#authentication).
76
+
77
+ ---
78
+
79
+ ## Publish a Tool
80
+
81
+ Scaffold a starter spec, edit it, and publish:
82
+
83
+ ```bash
84
+ teardrop tools init my_scraper # writes ./tool.json
85
+ $EDITOR tool.json # set webhook_url, schema, price
86
+ teardrop tools probe my_scraper # test webhook health before publishing
87
+ teardrop tools publish --from-file tool.json \
88
+ --settlement-wallet 0xYourChecksumAddress
89
+ ```
90
+
91
+ Or run the interactive wizard:
92
+
93
+ ```bash
94
+ teardrop tools publish
95
+ ```
96
+
97
+ Tool name rules: `^[a-z][a-z0-9_]*$`, ≤ 64 chars. Prices are in atomic USDC (6 decimals): `5000` = **$0.005** per call. Settlement wallet is required once before your first payout.
98
+
99
+ Test your webhook before publishing with `teardrop tools probe <tool-name>`. Optionally pass `--auth-header-name` and `--auth-header-value` if your webhook requires auth, or use `--method` and `--payload` to customize the probe request.
100
+
101
+ Manage existing tools: `teardrop tools list | info | update | pause | delete | probe`. Full reference: [docs/cli-reference.md](docs/cli-reference.md#tool-management).
102
+
103
+ ---
104
+
105
+ ## Earn
106
+
107
+ ```bash
108
+ teardrop earnings balance # marketplace balance
109
+ teardrop earnings history # per-call history
110
+ teardrop earnings withdraw 10.00 # to your settlement wallet
111
+ teardrop earnings withdrawals # past payouts
112
+ ```
113
+
114
+ On-chain withdrawals typically settle in 1–5 minutes.
115
+
116
+ ---
117
+
118
+ ## Run an Agent
119
+
120
+ ```bash
121
+ teardrop run "What is the current ETH gas price?"
122
+
123
+ # Continue a thread
124
+ teardrop run "Follow up" --thread <thread-id>
125
+
126
+ # Pass structured context
127
+ teardrop run "Process this order" --context '{"order_id":"ord_123"}'
128
+
129
+ # Exclude specific tools
130
+ teardrop run "Summarize news" --exclude platform/web_search
131
+
132
+ # Estimate cost based on current pricing & config (no run performed)
133
+ teardrop run "Analyze this data" --estimate-cost
134
+
135
+ # Apply a tool policy from a file
136
+ teardrop run "Execute workflow" --policy-file policy.json
137
+
138
+ # Machine-readable output
139
+ teardrop run "..." --json --no-stream
140
+
141
+ # Include UI component data for dashboard export (adds ~60s overhead)
142
+ teardrop run "..." --json --with-ui
143
+ ```
144
+
145
+ Streaming output renders Markdown live with inline tool calls and structured UI components. A token + cost summary prints at the end. By default, CLI output is optimized for scripting and automation (`emit_ui=false`); use `--with-ui` only if you need structured UI component data in the JSON output.
146
+
147
+ ---
148
+
149
+ ## Chat with an Agent
150
+
151
+ A stateful chat mode that automatically continues the same thread across invocations:
152
+
153
+ ```bash
154
+ teardrop chat "What is the current ETH gas price?" # auto-creates a thread
155
+ teardrop chat "Follow up on that" # continues the same thread
156
+ teardrop chat "Start fresh" --new # starts a new conversation
157
+ teardrop chat "Specific thread" --thread thr_abc123 # explicit thread by id
158
+ teardrop chat "..." --json # machine-readable output
159
+ ```
160
+
161
+ The active thread id is stored in `~/.teardrop/config.toml` and reused on your next `teardrop chat` call. The thread id is printed after every turn for copy/paste. All run flags (`--context`, `--exclude`, `--policy-file`, `--estimate-cost`, `--with-ui`, `--no-stream`) are supported.
162
+
163
+ Use `teardrop run` for one-shot, script-friendly calls — use `teardrop chat` for conversational interaction.
164
+
165
+ ---
166
+
167
+ If a run fails on credit, check your balance and history:
168
+
169
+ ```bash
170
+ teardrop balance # current credits
171
+ teardrop balance credit-history # past charges and top-ups
172
+ ```
173
+
174
+ To add credits, visit [teardrop.dev](https://teardrop.dev).
175
+
176
+ ---
177
+
178
+ ## Agent Tools
179
+
180
+ List all tools visible to your agent (platform, marketplace subscriptions, and your own tools):
181
+
182
+ ```bash
183
+ teardrop agent-tools list
184
+ ```
185
+
186
+ ---
187
+
188
+ ## Configure Your LLM
189
+
190
+ One-shot bring-your-own-key wizard:
191
+
192
+ ```bash
193
+ teardrop llm-config byok
194
+ ```
195
+
196
+ Or set explicitly:
197
+
198
+ ```bash
199
+ # Quality tier (default)
200
+ teardrop llm-config set --provider anthropic --model claude-sonnet-4-6 --routing quality
201
+
202
+ # Cost tier
203
+ teardrop llm-config set --provider openrouter --model deepseek-chat --routing cost
204
+
205
+ # Speed tier
206
+ teardrop llm-config set --provider google --model gemini-3-flash --routing speed
207
+ ```
208
+
209
+ Pipe a key from stdin to keep it out of shell history: `--byok-key -`. See [docs/cli-reference.md](docs/cli-reference.md#llm-configuration) for advanced tuning, BYOK details, and benchmarks.
210
+
211
+ ---
212
+
213
+ ## Browse the Marketplace
214
+
215
+ ```bash
216
+ teardrop marketplace list
217
+ teardrop marketplace search "weather"
218
+ teardrop marketplace info acme/weather
219
+ teardrop marketplace subscribe acme/weather
220
+ teardrop marketplace subscriptions
221
+ ```
222
+
223
+ Browsing requires no authentication. Subscribed tools become immediately available to your agents.
224
+
225
+ ---
226
+
227
+ ## Where to Go Next
228
+
229
+ - **[Full CLI reference](docs/cli-reference.md)** — every flag, env-var precedence, exit codes, M2M auth, MCP servers, models benchmarks, config file, development.
230
+ - **[End-to-end test guide](tests/e2e/README.md)** — running tests against a live API.
231
+ - **[teardrop.dev](https://teardrop.dev)** — platform docs and dashboard.
232
+
233
+ ---
234
+
235
+ ## License
236
+
237
+ MIT. See [LICENSE](LICENSE).
@@ -0,0 +1,27 @@
1
+ # Teardrop CLI Agent Run JSON Schema
2
+
3
+ When running `teardrop run "..." --json` or `teardrop chat "..." --json`,
4
+ the output is a single JSON object (implies `--no-stream`).
5
+
6
+ ## Schema Details
7
+
8
+ The JSON object contains the following fields:
9
+
10
+ - `text` (string): The final text response from the agent.
11
+ - `thread_id` (string | null): The ID of the thread used for the run. This can be used with the `--thread` flag in future runs (or `teardrop chat`) to continue the conversation.
12
+
13
+ ## Example Output
14
+
15
+ ```json
16
+ {
17
+ "text": "The price of ETH is currently $2,450.32.",
18
+ "thread_id": "thr_abc123"
19
+ }
20
+ ```
21
+
22
+ ## Usage
23
+ To capture specific fields, use `jq`:
24
+ ```bash
25
+ teardrop run "ETH price" --json | jq -r .text
26
+ teardrop chat "ETH price" --json | jq -r .thread_id
27
+ ```