@withone/cli 1.57.1 → 2.1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@withone/cli",
3
- "version": "1.57.1",
3
+ "version": "2.1.0",
4
4
  "description": "CLI for managing One",
5
5
  "type": "module",
6
6
  "files": [
@@ -6,7 +6,7 @@ description: |
6
6
  TRIGGER when:
7
7
  - Interact with ANY 3rd-party platform or external service (e.g., "send an email", "create a Shopify order", "find a HubSpot contact", "post to Slack")
8
8
  - List their connected platforms or check available ones
9
- - Search for available actions (e.g., "what can I do with Gmail")
9
+ - Find the actions a task needs (e.g., "how do I send a Slack message", "what can I do with Gmail")
10
10
  - Execute API calls with a connected platform
11
11
  - Set up webhook-driven automations between platforms (e.g., "when a Stripe payment comes in, notify Slack")
12
12
  - Build multi-step workflows that chain actions across platforms (e.g., "fetch Stripe customers and email each one")
@@ -37,7 +37,7 @@ The consent page asks which harness will use the key (Claude Code, Codex, Cursor
37
37
 
38
38
  **Onboarding a user with no prompts:** run `one init --auth browser` — it opens a login window (the user authenticates there), saves the key, and auto-installs this skill, all without blocking on stdin. Add `-g`/`-p` for scope (default global). For CI/CD or headless environments, use `one init --auth manual --api-key sk_live_...`.
39
39
 
40
- ## Core Workflow: search -> knowledge -> execute
40
+ ## Core Workflow: find -> execute
41
41
 
42
42
  Always follow this sequence when the user wants to do something on a connected platform:
43
43
 
@@ -47,7 +47,7 @@ Always follow this sequence when the user wants to do something on a connected p
47
47
  one --agent connection list
48
48
  ```
49
49
 
50
- Returns connected platforms with their connection keys (needed for execution), platform names in kebab-case (needed for searching), and an `access` field per connection telling you what you may run there.
50
+ Returns connected platforms with their connection keys (needed for execution), platform names in kebab-case (needed for finding actions), and an `access` field per connection telling you what you may run there.
51
51
 
52
52
  **Read `access` before you plan a workflow** — it saves you from discovering a restriction as a 403 halfway through:
53
53
 
@@ -55,13 +55,13 @@ Returns connected platforms with their connection keys (needed for execution), p
55
55
  |----------|---------------|
56
56
  | `{"policy": "full"}` | Every action on this connection is available |
57
57
  | `{"policy": "methods", "methods": ["GET"]}` | Only actions with these HTTP methods will execute — don't propose writes |
58
- | `{"policy": "actions", "actions": [...]}` | Only these exact actions may run. Each has `actionId`, `title`, `method` — **use them directly and skip `actions search`** |
58
+ | `{"policy": "actions", "actions": [...]}` | Only these exact actions may run. Each has `actionId`, `title`, `method` — **use them directly**: `actions load <actionId>` reads their docs, no find needed |
59
59
 
60
60
  Two more fields appear only when relevant:
61
- - `"knowledgeOnly": true` — `actions execute` is disabled. Read knowledge and write integration code instead of executing.
61
+ - `"knowledgeOnly": true` — `actions execute` is disabled. `actions find` returns each action's whole document with how to call it from code; write integration code instead of executing.
62
62
  - `"unresolvedActionIds": [...]` — allowlisted ids that couldn't be looked up; treat them as unavailable and tell the user.
63
63
 
64
- An empty `actions` array means the allowlist grants nothing on that connection — say so rather than searching for alternatives.
64
+ An empty `actions` array means the allowlist grants nothing on that connection — say so rather than looking for alternatives.
65
65
 
66
66
  ### 1b. Delete a connection
67
67
 
@@ -71,43 +71,44 @@ one --agent connection delete <connection-key>
71
71
 
72
72
  Removes a connection. Returns `{"deleted": true, "platform": "...", "key": "..."}` on success. Use the connection key from `one --agent connection list`.
73
73
 
74
- ### 2. Search for the right action
74
+ ### 2. Find every action the task needs, with its docs (READ them before executing)
75
75
 
76
76
  ```bash
77
- one --agent actions search <platform> "<query>" -t execute
77
+ one --agent actions find <platform> "<intent>" [<platform> "<intent>" ...] --task "<the job, in general terms>"
78
78
  ```
79
79
 
80
- - Platform names are lowercase; multi-word names use dashes: `gmail`, `hubspot`, `ship-station`, `google-calendar`
81
- - Use `-t execute` when performing actions, `-t knowledge` when researching or writing code
82
- - If no results, broaden the query (e.g., `"list"` instead of `"list active premium customers"`)
80
+ **One call for the whole task**: one platform and intent pair per operation, on any platforms (up to 10). One's decision model picks the action for each and returns it **with its documentation**: exactly what parameters are required, how to structure the request, and where each value goes. Never execute without reading it — without it you'll guess wrong on parameters.
83
81
 
84
- ### 3. Get the action's knowledge (REQUIRED before executing)
82
+ - **`intent` names the operation alone**, in a few words: `"send a message to a channel"`, not `"post 'deploy done' in #eng"`. IDs, names, and message text in the intent make the search miss.
83
+ - **`--task`** (optional) is the whole job in one line, **in general terms**: `"email a weather report to a contact"`, without names, addresses, IDs, or message text. It helps choose between similar actions.
84
+ - **`-t knowledge`** searches the catalog for writing code and building flows and relays (it includes the platform's own passthrough endpoints); the default, `-t execute`, is the catalog for running actions now.
85
+ - **`--ai-model`** (optional): the model you are running as (e.g. `claude-sonnet-5`), used to tune documentation per model.
86
+ - **`--no-knowledge`** (optional): list the chosen actions without their documentation, when you only need the actionIds. Load the documentation with `actions load` before executing.
87
+ - Platform names are lowercase; multi-word names use dashes: `gmail`, `hubspot`, `ship-station`, `google-calendar`.
85
88
 
86
- ```bash
87
- one --agent actions knowledge <platform> <actionId>
88
- ```
89
+ Each entry of `answers[]` carries:
89
90
 
90
- This tells you exactly what parameters are required, how to structure the request, and which flags to use. Never skip this step — without it you'll guess wrong on parameters.
91
+ - `selected[]` — **the action(s) to use**, each with `actionId`, `title`, `method`, `path`, and `knowledge` (its docs). More than one means the intent needs them together (look up, then update).
92
+ - `alsoSelected[]` — also needed, listed rather than documented to keep the answer small: `actions load` them.
93
+ - `runnerUp` — only when the model was unsure: a **substitute** for the pick. Use **one or the other, never both**.
94
+ - `alternatives[]` — other candidates, undocumented.
95
+ - `status` — why: a confidence; *no action fits* (rephrase the intent by outcome, or check the platform); *the decision model was unavailable* (the top search result — check it fits); *not allowed by this CLI* (the next allowed candidate stood in); or *allow none of them* (the access settings block the operation — tell the user, rephrasing won't help).
91
96
 
92
- **You get a digest, not always the whole document.** Large docs are trimmed to the request-building sections (method/URL, headers, description, rules, required + optional parameters, sample request, gotchas, error handling). The response tells you what was left out:
97
+ `guide` (once, at the end) says how to execute any of them.
93
98
 
94
- - `truncated: true` — some sections are omitted. `truncated: false` — you have everything (and no `sections` list is sent).
95
- - `sections[]` — the omitted sections only, each with `id`, `heading`, `chars`, and `included` (`false` / `"partial"`). Included sections are the headings you can see in the markdown.
96
- - The markdown itself ends with a notice naming the omitted sections and the exact commands to load them.
99
+ **Large docs come back as a digest** (`truncated: true`): the request-building sections (method/URL, headers, description, rules, required + optional parameters, sample request, gotchas, error handling), then a notice naming what it left out with the exact command to load it. Sections named `(appendix)` are appended reference chunks or companion endpoints, not the action doc itself.
97
100
 
98
- Load more only when you need it (response shapes, response fields, worked examples). Served from the local cache, no network:
101
+ ### 3. Load more of a document (only when you need it)
99
102
 
100
103
  ```bash
101
- one --agent actions knowledge <platform> <actionId> --section "Response Fields" # by heading
102
- one --agent actions knowledge <platform> <actionId> --section response,optional # by alias, several at once
103
- one --agent actions knowledge <platform> <actionId> --full # whole document
104
+ one --agent actions load <actionId> --section "Response Fields" # by heading
105
+ one --agent actions load <actionId> --section response,optional # by alias, several at once
106
+ one --agent actions load <actionId> --full # whole document
107
+ one --agent actions load <actionId> --toc # every heading, no text
108
+ one --agent actions load <actionId> # an alternative's digest
104
109
  ```
105
110
 
106
- Aliases: `response`, `fields`, `optional`, `required`, `examples`, `errors`, `success`, `body`, `query`, `path`, `notes`, `behavior`, `gotchas`. An unknown name returns an error listing every available section — retry with one of those ids.
107
-
108
- - A `--section` response has `truncated: false` (you got the whole section) and `resolved` (which ids your names matched). It does not repeat the table of contents.
109
- - If the digest says `sectionsCollapsed: true`, the doc has hundreds of headings and `sections` shows only the top omitted levels (`children` = hidden count). `--toc` lists every heading without the document.
110
- - Sections named `(appendix)` in the notice are appended reference chunks or companion endpoints, not the action doc itself.
111
+ Served from the local cache once a doc is cached. Aliases: `response`, `fields`, `optional`, `required`, `examples`, `errors`, `success`, `body`, `query`, `path`, `notes`, `behavior`, `gotchas`. An unknown name returns the list of available sections — retry with one of those ids. Up to 10 action ids per call.
111
112
 
112
113
  ### 4. Execute
113
114
 
@@ -170,21 +171,21 @@ All errors return JSON: `{"error": "message"}`. Parse output as JSON and check f
170
171
 
171
172
  - Always use `--agent` flag for structured JSON output
172
173
  - Platform names are lowercase; multi-word names use dashes (`hubspot` not `HubSpot`, `google-calendar` not `googleCalendar`)
173
- - Always use the exact action ID from search results — never guess or construct them
174
- - Always read knowledge before executing — it has required params, validation rules, and caveats
174
+ - Always use the exact action ID from a find answer — never guess or construct them
175
+ - Always read the action's docs (from `actions find`) before executing — they have required params, validation rules, and caveats
175
176
  - JSON values passed to `-d`, `--path-vars`, `--query-params` must be valid JSON (use single quotes around JSON to avoid shell escaping)
176
177
  - Do NOT pass path or query parameters inside the `-d` body flag
177
178
 
178
179
  ## Caching
179
180
 
180
- Knowledge and search responses are cached locally (`~/.one/cache/`). Subsequent calls for the same action serve instantly from disk. `actions execute` reuses the cached action details for its preflight lookup, so after a knowledge call (or a prior execute of the same action) it makes a single API call — the action itself.
181
+ Action documentation is cached locally (`~/.one/cache/`). `actions find` and `actions load` read it through the cache, and `actions execute` reuses the cached action details for its preflight lookup, so after a find (or a prior execute of the same action) it makes a single API call — the action itself. Find's picks are not cached: the decision model answers every call.
181
182
 
182
183
  - Cache is automatic — no setup required
183
184
  - Default TTL: 1 hour (configurable via `ONE_CACHE_TTL` env var)
184
- - In `--agent` mode, responses include a `_cache` field: `{"hit": true, "age": 1423, "fresh": true}`; execute responses include `"_preflight": {"cache": "hit"|"miss"}`
185
- - Use `--no-cache` to force a fresh fetch: works on `knowledge`, `search`, and `execute` (refreshes execute's action-details lookup)
186
- - Use `--cache-status` to check cache state without fetching
187
- - `knowledge --section <name>` and `--full` read from the cached document — no extra API call once the doc is cached
185
+ - In `--agent` mode, execute responses include `"_preflight": {"cache": "hit"|"miss"}`
186
+ - Use `--no-cache` to force a fresh fetch: works on `find`, `load`, and `execute` (refreshes execute's action-details lookup)
187
+ - Use `actions load <actionId> --cache-status` to check cache state without fetching
188
+ - `load --section <name>` and `--full` read from the cached document — no extra API call once the doc is cached
188
189
  - Manage cache: `one cache list`, `one cache clear`, `one cache update-all`
189
190
  - Execution responses are NEVER cached — the action always runs live; only action metadata (docs, method, path, schema) is cached
190
191
 
@@ -296,7 +297,7 @@ one --agent sync init attio attioPeople --config '{
296
297
  ]
297
298
  }
298
299
  }'
299
- # Skip the "pick paths by reading knowledge" step — let the CLI rank them from a live sample
300
+ # Skip the "pick paths by reading the docs" step — let the CLI rank them from a live sample
300
301
  one --agent sync suggest-searchable attio/attioPeople
301
302
  # → { suggestions: [{path, score, hitRate, avgLength, noiseFraction, sampleValue}], configPatch: {...paste-ready...} }
302
303
 
@@ -39,7 +39,7 @@ Before touching CLI commands:
39
39
  3. Identify where AI analysis is needed (summarization, scoring, classification)
40
40
  4. Write the step sequence as a plain list before constructing JSON
41
41
 
42
- Common mistake: jumping straight to `actions search` and building a raw data pipe. Design first.
42
+ Common mistake: jumping straight to `actions find` and building a raw data pipe. Design first.
43
43
 
44
44
  ### Step 1: Discover connections
45
45
 
@@ -47,14 +47,14 @@ Common mistake: jumping straight to `actions search` and building a raw data pip
47
47
  one --agent connection list
48
48
  ```
49
49
 
50
- ### Step 2: Get knowledge for EACH action
50
+ ### Step 2: Find EVERY action, with its docs, in one call
51
51
 
52
52
  ```bash
53
- one --agent actions search <platform> "<query>" -t execute
54
- one --agent actions knowledge <platform> <actionId>
53
+ one --agent actions find <platform> "<intent>" [<platform> "<intent>" ...] --task "<what the flow does, in general terms>" -t knowledge
54
+ one --agent actions load <actionId> --section "<name>" # a section a digest left out, or --full
55
55
  ```
56
56
 
57
- You MUST call knowledge for every action in the workflow — it tells you the exact body structure, required fields, and path variables.
57
+ You MUST read the docs of every action in the workflow — they tell you the exact body structure, required fields, and path variables. `-t knowledge` searches the catalog that includes the platform's own (passthrough) endpoints, which flows should prefer.
58
58
 
59
59
  ### Step 3: Build the workflow JSON
60
60
 
@@ -705,9 +705,9 @@ Three tools that turn "re-run the whole 40-step flow to debug step 30" into near
705
705
 
706
706
  ## Important Notes
707
707
 
708
- - **Prefer passthrough actions over custom actions.** Custom actions add server-side fan-out that causes timeouts at scale. The flow runner handles pagination, retries, and rate limiting locally. Search with `-t knowledge` to find passthrough endpoints (e.g. GET `/gmail/v1/users/{userId}/threads` instead of POST `/gmail/get-threads`)
708
+ - **Prefer passthrough actions over custom actions.** Custom actions add server-side fan-out that causes timeouts at scale. The flow runner handles pagination, retries, and rate limiting locally. Find with `-t knowledge` to reach passthrough endpoints (e.g. GET `/gmail/v1/users/{userId}/threads` instead of POST `/gmail/get-threads`)
709
709
  - Connection keys are inputs, not hardcoded — makes workflows portable
710
- - Action IDs in examples are placeholders — always use `actions search` to find real IDs
710
+ - Action IDs in examples are placeholders — always use `actions find` to find real IDs
711
711
  - Code steps support `require('crypto')`, `require('buffer')`, `require('url')`, `require('path')` — `fs`, `http`, `child_process` are blocked
712
712
  - Bash steps require `--allow-bash` flag
713
713
  - Action steps validate required params before executing — pass `--skip-validation` to bypass
@@ -30,23 +30,17 @@ This returns `[{ "platform": "<name>", "eventTypeCount": <n> }, ...]` for every
30
30
  one --agent relay event-types <source-platform>
31
31
  ```
32
32
 
33
- ### Step 3: Get source knowledge (understand the incoming payload)
33
+ ### Step 3: Find the source and destination actions with their docs, in one call
34
34
 
35
35
  ```bash
36
- one --agent actions search <source-platform> "<event description>" -t knowledge
37
- one --agent actions knowledge <source-platform> <actionId>
36
+ one --agent actions find <source-platform> "<event description>" <dest-platform> "<what you want to do>" -t knowledge
38
37
  ```
39
38
 
40
- The knowledge tells you the webhook payload structure — these fields become `{{payload.*}}` in your templates.
39
+ The source action's docs tell you the webhook payload structure — these fields become `{{payload.*}}` in your templates.
41
40
 
42
- ### Step 4: Get destination knowledge (understand the outgoing API)
41
+ ### Step 4: Read the destination action's docs (understand the outgoing API)
43
42
 
44
- ```bash
45
- one --agent actions search <dest-platform> "<what you want to do>" -t execute
46
- one --agent actions knowledge <dest-platform> <actionId>
47
- ```
48
-
49
- The knowledge tells you required body fields — these become the keys in your passthrough action's `body`.
43
+ The destination action's docs, from the same find answer, tell you required body fields — these become the keys in your passthrough action's `body`.
50
44
 
51
45
  ### Step 5: Create the relay endpoint
52
46
 
@@ -157,9 +151,8 @@ one --agent connection list
157
151
  # 2. Get event types
158
152
  one --agent relay event-types stripe
159
153
 
160
- # 3. Get Slack send message action
161
- one --agent actions search slack "send message" -t execute
162
- one --agent actions knowledge slack <actionId>
154
+ # 3. Find the Slack send-message action, with its docs
155
+ one --agent actions find slack "send a message to a channel" -t knowledge
163
156
 
164
157
  # 4. Create relay
165
158
  one --agent relay create \