@picahq/cli 1.9.4 → 1.11.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.
Files changed (3) hide show
  1. package/README.md +196 -51
  2. package/dist/index.js +2278 -127
  3. package/package.json +3 -3
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
- # Pica CLI
1
+ # One CLI
2
2
 
3
3
  One CLI to connect AI agents to every API on the internet.
4
4
 
5
- Pica gives your AI agent authenticated access to 200+ platforms — Gmail, Slack, Shopify, HubSpot, Stripe, Notion, and everything else — through a single interface. No API keys to juggle, no OAuth flows to build, no request formats to memorize. Connect a platform once, and your agent can search for actions, read the docs, and execute API calls in seconds.
5
+ One gives your AI agent authenticated access to 200+ platforms — Gmail, Slack, Shopify, HubSpot, Stripe, Notion, and everything else — through a single interface. No API keys to juggle, no OAuth flows to build, no request formats to memorize. Connect a platform once, and your agent can search for actions, read the docs, and execute API calls in seconds.
6
6
 
7
7
  ## Install
8
8
 
@@ -14,10 +14,10 @@ Or install globally:
14
14
 
15
15
  ```bash
16
16
  npm install -g @picahq/cli
17
- pica init
17
+ one init
18
18
  ```
19
19
 
20
- `pica init` walks you through setup: enter your [API key](https://app.picaos.com/settings/api-keys), pick your AI agents, and you're done. The MCP server gets installed automatically.
20
+ `one init` walks you through setup: enter your [API key](https://app.withone.ai/settings/api-keys), pick your AI agents, and you're done. The MCP server gets installed automatically.
21
21
 
22
22
  Requires Node.js 18+.
23
23
 
@@ -25,51 +25,86 @@ Requires Node.js 18+.
25
25
 
26
26
  ```bash
27
27
  # Connect a platform
28
- pica add gmail
28
+ one add gmail
29
29
 
30
30
  # See what you're connected to
31
- pica list
31
+ one list
32
32
 
33
33
  # Search for actions you can take
34
- pica actions search gmail "send email" -t execute
34
+ one actions search gmail "send email" -t execute
35
35
 
36
36
  # Read the docs for an action
37
- pica actions knowledge gmail <actionId>
37
+ one actions knowledge gmail <actionId>
38
38
 
39
39
  # Execute it
40
- pica actions execute gmail <actionId> <connectionKey> \
40
+ one actions execute gmail <actionId> <connectionKey> \
41
41
  -d '{"to": "jane@example.com", "subject": "Hello", "body": "Sent from my AI agent"}'
42
42
  ```
43
43
 
44
44
  That's it. Five commands to go from zero to sending an email through Gmail's API — fully authenticated, correctly formatted, without touching a single OAuth token.
45
45
 
46
+ ### Multi-step flows
47
+
48
+ Chain actions across platforms into reusable workflows:
49
+
50
+ ```bash
51
+ # Create a flow that looks up a Stripe customer and sends a Gmail welcome email
52
+ one flow create welcome-customer --definition '{
53
+ "key": "welcome-customer",
54
+ "name": "Welcome New Customer",
55
+ "version": "1",
56
+ "inputs": {
57
+ "stripeKey": { "type": "string", "required": true, "connection": { "platform": "stripe" } },
58
+ "gmailKey": { "type": "string", "required": true, "connection": { "platform": "gmail" } },
59
+ "email": { "type": "string", "required": true }
60
+ },
61
+ "steps": [
62
+ { "id": "find", "name": "Find customer", "type": "action",
63
+ "action": { "platform": "stripe", "actionId": "<actionId>", "connectionKey": "$.input.stripeKey",
64
+ "data": { "query": "email:'\''{{$.input.email}}'\''" } } },
65
+ { "id": "send", "name": "Send email", "type": "action",
66
+ "if": "$.steps.find.response.data.length > 0",
67
+ "action": { "platform": "gmail", "actionId": "<actionId>", "connectionKey": "$.input.gmailKey",
68
+ "data": { "to": "{{$.input.email}}", "subject": "Welcome!", "body": "Thanks for joining." } } }
69
+ ]
70
+ }'
71
+
72
+ # Validate it
73
+ one flow validate welcome-customer
74
+
75
+ # Run it — connection keys auto-resolve if you have one connection per platform
76
+ one flow execute welcome-customer -i email=jane@example.com
77
+ ```
78
+
79
+ Flows are stored as JSON at `.one/flows/<key>.flow.json` and support conditions, loops, parallel steps, transforms, and more. Run `one guide flows` for the full reference.
80
+
46
81
  ## How it works
47
82
 
48
83
  ```
49
84
  Your AI Agent
50
85
 
51
- Pica CLI
86
+ One CLI
52
87
 
53
- Pica API (api.picaos.com/v1/passthrough)
88
+ One API (api.withone.ai/v1/passthrough)
54
89
 
55
90
  Gmail / Slack / Shopify / HubSpot / Stripe / ...
56
91
  ```
57
92
 
58
- Every API call routes through Pica's passthrough proxy. Pica injects the right credentials, handles rate limiting, and normalizes responses. You never see or manage raw OAuth tokens — your connection key is all you need.
93
+ Every API call routes through One's passthrough proxy. One injects the right credentials, handles rate limiting, and normalizes responses. You never see or manage raw OAuth tokens — your connection key is all you need.
59
94
 
60
95
  ## Commands
61
96
 
62
- ### `pica init`
97
+ ### `one init`
63
98
 
64
99
  Set up your API key and install the MCP server into your AI agents.
65
100
 
66
101
  ```bash
67
- pica init
102
+ one init
68
103
  ```
69
104
 
70
105
  Supports Claude Code, Claude Desktop, Cursor, Windsurf, Codex, and Kiro. Installs globally by default, or per-project with `-p` so your team can share configs (each person uses their own API key).
71
106
 
72
- If you've already set up, `pica init` shows your current status and lets you update your key, install to more agents, or reconfigure.
107
+ If you've already set up, `one init` shows your current status and lets you update your key, install to more agents, or reconfigure.
73
108
 
74
109
  | Flag | What it does |
75
110
  |------|-------------|
@@ -77,24 +112,24 @@ If you've already set up, `pica init` shows your current status and lets you upd
77
112
  | `-g` | Install globally (default) |
78
113
  | `-p` | Install for current project only |
79
114
 
80
- ### `pica add <platform>`
115
+ ### `one add <platform>`
81
116
 
82
117
  Connect a new platform via OAuth.
83
118
 
84
119
  ```bash
85
- pica add shopify
86
- pica add hub-spot
87
- pica add gmail
120
+ one add shopify
121
+ one add hub-spot
122
+ one add gmail
88
123
  ```
89
124
 
90
- Opens your browser, you authorize, done. The CLI polls until the connection is live. Platform names are kebab-case — run `pica platforms` to see them all.
125
+ Opens your browser, you authorize, done. The CLI polls until the connection is live. Platform names are kebab-case — run `one platforms` to see them all.
91
126
 
92
- ### `pica list`
127
+ ### `one list`
93
128
 
94
129
  List your active connections with their status and connection keys.
95
130
 
96
131
  ```bash
97
- pica list
132
+ one list
98
133
  ```
99
134
 
100
135
  ```
@@ -105,56 +140,56 @@ pica list
105
140
 
106
141
  You need the connection key (rightmost column) when executing actions.
107
142
 
108
- ### `pica platforms`
143
+ ### `one platforms`
109
144
 
110
145
  Browse all 200+ available platforms.
111
146
 
112
147
  ```bash
113
- pica platforms # all platforms
114
- pica platforms -c "CRM" # filter by category
115
- pica platforms --json # machine-readable output
148
+ one platforms # all platforms
149
+ one platforms -c "CRM" # filter by category
150
+ one platforms --json # machine-readable output
116
151
  ```
117
152
 
118
- ### `pica actions search <platform> <query>`
153
+ ### `one actions search <platform> <query>`
119
154
 
120
155
  Search for API actions on a connected platform using natural language.
121
156
 
122
157
  ```bash
123
- pica actions search shopify "list products"
124
- pica actions search hub-spot "create contact" -t execute
125
- pica actions search gmail "send email"
158
+ one actions search shopify "list products"
159
+ one actions search hub-spot "create contact" -t execute
160
+ one actions search gmail "send email"
126
161
  ```
127
162
 
128
163
  Returns the top 5 matching actions with their action IDs, HTTP methods, and paths. Use `-t execute` when you intend to run the action, or `-t knowledge` (default) when you want to learn about it or write code against it.
129
164
 
130
- ### `pica actions knowledge <platform> <actionId>`
165
+ ### `one actions knowledge <platform> <actionId>`
131
166
 
132
167
  Get the full documentation for an action — parameters, validation rules, request/response structure, examples, and the exact API request format.
133
168
 
134
169
  ```bash
135
- pica actions knowledge shopify 67890abcdef
170
+ one actions knowledge shopify 67890abcdef
136
171
  ```
137
172
 
138
173
  Always read the knowledge before executing. It tells you exactly what parameters are required, what format they need, and any platform-specific quirks.
139
174
 
140
- ### `pica actions execute <platform> <actionId> <connectionKey>`
175
+ ### `one actions execute <platform> <actionId> <connectionKey>`
141
176
 
142
177
  Execute an API action on a connected platform.
143
178
 
144
179
  ```bash
145
180
  # Simple GET
146
- pica actions execute shopify <actionId> <connectionKey>
181
+ one actions execute shopify <actionId> <connectionKey>
147
182
 
148
183
  # POST with data
149
- pica actions execute hub-spot <actionId> <connectionKey> \
184
+ one actions execute hub-spot <actionId> <connectionKey> \
150
185
  -d '{"properties": {"email": "jane@example.com", "firstname": "Jane"}}'
151
186
 
152
187
  # With path variables
153
- pica actions execute shopify <actionId> <connectionKey> \
188
+ one actions execute shopify <actionId> <connectionKey> \
154
189
  --path-vars '{"order_id": "12345"}'
155
190
 
156
191
  # With query params
157
- pica actions execute stripe <actionId> <connectionKey> \
192
+ one actions execute stripe <actionId> <connectionKey> \
158
193
  --query-params '{"limit": "10"}'
159
194
  ```
160
195
 
@@ -167,12 +202,109 @@ pica actions execute stripe <actionId> <connectionKey> \
167
202
  | `--form-data` | Send as multipart/form-data |
168
203
  | `--form-url-encoded` | Send as application/x-www-form-urlencoded |
169
204
 
170
- ### `pica config`
205
+ ### `one guide [topic]`
206
+
207
+ Get the full CLI usage guide, designed for AI agents that only have the binary (no MCP, no IDE skills).
208
+
209
+ ```bash
210
+ one guide # full guide (all topics)
211
+ one guide overview # setup, --agent flag, discovery workflow
212
+ one guide actions # search, knowledge, execute workflow
213
+ one guide flows # multi-step API workflows
214
+
215
+ one --agent guide # full guide as structured JSON
216
+ one --agent guide flows # single topic as JSON
217
+ ```
218
+
219
+ Topics: `overview`, `actions`, `flows`, `all` (default).
220
+
221
+ In agent mode (`--agent`), the JSON response includes the guide content and an `availableTopics` array so agents can discover what sections exist.
222
+
223
+ ### `one flow create [key]`
224
+
225
+ Create a flow from a JSON definition. Flows are saved to `.one/flows/<key>.flow.json`.
226
+
227
+ ```bash
228
+ # From a --definition flag
229
+ one flow create welcome-customer --definition '{"key":"welcome-customer","name":"Welcome","version":"1","inputs":{},"steps":[]}'
230
+
231
+ # From stdin
232
+ cat flow.json | one flow create
233
+
234
+ # Custom output path
235
+ one flow create my-flow --definition '...' -o ./custom/path.json
236
+ ```
237
+
238
+ | Option | What it does |
239
+ |--------|-------------|
240
+ | `--definition <json>` | Flow definition as a JSON string |
241
+ | `-o, --output <path>` | Custom output path (default: `.one/flows/<key>.flow.json`) |
242
+
243
+ ### `one flow execute <key>`
244
+
245
+ Execute a flow by key or file path. Pass inputs with repeatable `-i` flags.
246
+
247
+ ```bash
248
+ # Execute with inputs
249
+ one flow execute welcome-customer \
250
+ -i customerEmail=jane@example.com
251
+
252
+ # Dry run — validate and show plan without executing
253
+ one flow execute welcome-customer --dry-run -i customerEmail=jane@example.com
254
+
255
+ # Verbose — show each step as it runs
256
+ one flow execute welcome-customer -v -i customerEmail=jane@example.com
257
+ ```
258
+
259
+ Connection inputs with a `connection` field in the flow definition are auto-resolved when the user has exactly one connection for that platform.
260
+
261
+ Press Ctrl+C during execution to pause — the run can be resumed later with `one flow resume <runId>`.
262
+
263
+ | Option | What it does |
264
+ |--------|-------------|
265
+ | `-i, --input <name=value>` | Input parameter (repeatable) |
266
+ | `--dry-run` | Validate and show execution plan without running |
267
+ | `-v, --verbose` | Show full request/response for each step |
268
+
269
+ ### `one flow list`
270
+
271
+ List all flows saved in `.one/flows/`.
272
+
273
+ ```bash
274
+ one flow list
275
+ ```
276
+
277
+ ### `one flow validate <key>`
278
+
279
+ Validate a flow JSON file against the schema.
280
+
281
+ ```bash
282
+ one flow validate welcome-customer
283
+ ```
284
+
285
+ ### `one flow resume <runId>`
286
+
287
+ Resume a paused or failed flow run from where it left off.
288
+
289
+ ```bash
290
+ one flow resume abc123
291
+ ```
292
+
293
+ ### `one flow runs [flowKey]`
294
+
295
+ List flow runs, optionally filtered by flow key.
296
+
297
+ ```bash
298
+ one flow runs # all runs
299
+ one flow runs welcome-customer # runs for a specific flow
300
+ ```
301
+
302
+ ### `one config`
171
303
 
172
304
  Configure access control for the MCP server. Optional — full access is the default.
173
305
 
174
306
  ```bash
175
- pica config
307
+ one config
176
308
  ```
177
309
 
178
310
  | Setting | Options | Default |
@@ -186,33 +318,46 @@ Settings propagate automatically to all installed agent configs.
186
318
 
187
319
  ## The workflow
188
320
 
189
- The power of Pica is in the workflow. Every interaction follows the same pattern:
321
+ The power of One is in the workflow. Every interaction follows the same pattern:
190
322
 
191
323
  ```
192
- pica list → What am I connected to?
193
- pica actions search → What can I do?
194
- pica actions knowledge → How do I do it?
195
- pica actions execute → Do it.
324
+ one list → What am I connected to?
325
+ one actions search → What can I do?
326
+ one actions knowledge → How do I do it?
327
+ one actions execute → Do it.
196
328
  ```
197
329
 
198
330
  This is the same workflow whether you're sending emails, creating CRM contacts, processing payments, managing inventory, or posting to Slack. One pattern, any platform.
199
331
 
332
+ For multi-step workflows that chain actions across platforms, use **flows**:
333
+
334
+ ```
335
+ one actions knowledge → Learn each action's schema
336
+ one flow create → Define the workflow as JSON
337
+ one flow validate → Check it
338
+ one flow execute → Run it
339
+ ```
340
+
341
+ Flows support conditions, loops, parallel execution, transforms, code steps, and file I/O. Run `one guide flows` for the full schema reference and examples.
342
+
200
343
  ## For AI agents
201
344
 
202
- If you're an AI agent using the Pica MCP server, the tools map directly:
345
+ If you're an AI agent with only the `one` binary (no MCP server or IDE skills), start with `one --agent guide` to get the full usage guide as structured JSON. This teaches you the complete workflow, JSON schemas, selector syntax, and more — everything you need to bootstrap yourself.
346
+
347
+ If you're an AI agent using the One MCP server, the tools map directly:
203
348
 
204
349
  | MCP Tool | CLI Command |
205
350
  |----------|------------|
206
- | `list_pica_integrations` | `pica list` + `pica platforms` |
207
- | `search_pica_platform_actions` | `pica actions search` |
208
- | `get_pica_action_knowledge` | `pica actions knowledge` |
209
- | `execute_pica_action` | `pica actions execute` |
351
+ | `list_one_integrations` | `one list` + `one platforms` |
352
+ | `search_one_platform_actions` | `one actions search` |
353
+ | `get_one_action_knowledge` | `one actions knowledge` |
354
+ | `execute_one_action` | `one actions execute` |
210
355
 
211
356
  The workflow is the same: list → search → knowledge → execute. Never skip the knowledge step — it contains required parameter info and platform-specific details that are critical for building correct requests.
212
357
 
213
358
  ## MCP server installation
214
359
 
215
- `pica init` handles this automatically. Here's where configs go:
360
+ `one init` handles this automatically. Here's where configs go:
216
361
 
217
362
  | Agent | Global | Project |
218
363
  |-------|--------|---------|
@@ -223,7 +368,7 @@ The workflow is the same: list → search → knowledge → execute. Never skip
223
368
  | Codex | `~/.codex/config.toml` | `.codex/config.toml` |
224
369
  | Kiro | `~/.kiro/settings/mcp.json` | `.kiro/settings/mcp.json` |
225
370
 
226
- Project configs can be committed to your repo. Each team member runs `pica init` with their own API key.
371
+ Project configs can be committed to your repo. Each team member runs `one init` with their own API key.
227
372
 
228
373
  ## Development
229
374