@tiny-fish/cli 0.1.8-next.71 → 0.1.8-next.72

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/README.md CHANGED
@@ -172,10 +172,18 @@ tinyfish vault connection remove <connectionId>
172
172
  # List credential items. If empty right after connecting, sync first.
173
173
  tinyfish vault item sync
174
174
  tinyfish vault item list
175
- # → each item has an `itemId` (e.g. cred:conn-123:Personal:item-abc123).
175
+ # → each item has an `itemId` (e.g. cred:conn-123:Personal:item-abc123) — that's
176
+ # what --credential-item-id takes below.
177
+
178
+ # Consume vault credentials in a run (uses all enabled items)
179
+ tinyfish agent run "log in and export the invoices" --url https://example.com --use-vault
180
+
181
+ # ...or scope to specific items by their itemId from `vault item list`
182
+ tinyfish agent run "..." --url https://example.com --use-vault \
183
+ --credential-item-id cred:conn-123:Personal:item-abc123
176
184
  ```
177
185
 
178
- Credential items are sourced from the connected provider — the CLI has no freeform credential create/edit (mirrors the API).
186
+ `--credential-item-id` requires `--use-vault`. Omit it to use all enabled items. The IDs are the `itemId` values from `tinyfish vault item list` (run `vault item sync` first if the list is empty after connecting). Credential items are sourced from the connected provider — the CLI has no freeform credential create/edit (mirrors the API).
179
187
 
180
188
  ### Output format
181
189
 
@@ -116,6 +116,8 @@ export function registerRun(agentCmd) {
116
116
  .option("--max-steps <n>", `Maximum tool-call steps before stopping (1-${MAX_STEPS_LIMIT})`)
117
117
  .option("--mode <mode>", "Agent behavior mode (default|strict)")
118
118
  .option("--session-id <uuid>", "Caller-provided UUID for idempotency / parallel-safe --sync")
119
+ .option("--use-vault", "Consume vault credentials in this run")
120
+ .option("--credential-item-id <id>", "Scope vault to a specific credential item ID (repeat for multiple; get IDs from `vault item list`; requires --use-vault)", (v, acc) => [...acc, v], [])
119
121
  .option("--pretty", "Human-readable output")
120
122
  .argument("[goal]", "Goal to automate")
121
123
  .addHelpText("after", "\nToken scope note:\n CLI runs use your personal API key. MCP runs use the MCP token.\n These are different namespaces; getting an MCP run ID with the CLI returns 404 by design.\n")
@@ -153,6 +155,12 @@ export function registerRun(agentCmd) {
153
155
  err({ error: 'Goal cannot be empty' });
154
156
  process.exit(1);
155
157
  }
158
+ // The server rejects credential_item_ids without use_vault (400); fail fast here.
159
+ const hasCredentialItemIds = opts.credentialItemId.length > 0;
160
+ if (hasCredentialItemIds && !opts.useVault) {
161
+ err({ error: "--credential-item-id requires --use-vault" });
162
+ process.exit(1);
163
+ }
156
164
  const outputSchema = await loadOutputSchema(opts);
157
165
  const browserProfile = parseChoice(opts.browserProfile, VALID_BROWSER_PROFILES, "--browser-profile");
158
166
  const mode = parseChoice(opts.mode, VALID_MODES, "--mode");
@@ -166,6 +174,8 @@ export function registerRun(agentCmd) {
166
174
  ...(browserProfile !== undefined ? { browser_profile: browserProfile } : {}),
167
175
  ...(mode !== undefined || maxSteps !== undefined ? { agent_config: { mode, max_steps: maxSteps } } : {}),
168
176
  ...(sessionId !== undefined ? { session_id: sessionId } : {}),
177
+ ...(opts.useVault ? { use_vault: true } : {}),
178
+ ...(hasCredentialItemIds ? { credential_item_ids: opts.credentialItemId } : {}),
169
179
  };
170
180
  if (opts.async) {
171
181
  let result;
@@ -141,7 +141,7 @@ export function registerVault(program) {
141
141
  itemCmd
142
142
  .command("list")
143
143
  .description("List vault credential items across all connections. Each item's `itemId` " +
144
- "is what you pass to `agent run --credential-item-ids`. If the list is empty " +
144
+ "is what you pass to `agent run --credential-item-id`. If the list is empty " +
145
145
  "after connecting, run `vault item sync` first.")
146
146
  .option("--pretty", "Human-readable output")
147
147
  .action(async (opts) => {
@@ -8,6 +8,8 @@ export interface CliAgentRunParams extends AgentRunParams {
8
8
  };
9
9
  browser_profile?: BrowserProfile;
10
10
  session_id?: string;
11
+ use_vault?: boolean;
12
+ credential_item_ids?: string[];
11
13
  }
12
14
  export type VaultProvider = "1password" | "bitwarden";
13
15
  export interface VaultConnection {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tiny-fish/cli",
3
- "version": "0.1.8-next.71",
3
+ "version": "0.1.8-next.72",
4
4
  "description": "TinyFish CLI — run web automations from your terminal",
5
5
  "type": "module",
6
6
  "bin": {