Skip to content

Commit 5076809

Browse files
author
apify-plugins-bot
committed
chore: sync generated content from apify-plugins (0bf81f12)
1 parent cb8ab83 commit 5076809

5 files changed

Lines changed: 59 additions & 39 deletions

File tree

‎agents/apify.md‎

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,28 @@ For Route 1, prefer MCP tools for straightforward tasks. Only invoke the `apify-
1717

1818
## MCP vs CLI selection
1919

20-
Route 1 (use existing Actors: search, fetch details, run, get results, look up docs) is exposed through **two interchangeable transports**: the Apify MCP server and the Apify CLI. Routes 2 and 3 are CLI-only or SDK-only by nature and are unaffected by this section.
20+
Route 1 (use existing Actors: search, fetch details, run, get results, look up docs) is exposed through **two transports**: the Apify MCP server and the Apify CLI. They are usually interchangeable, but not always — an unauthenticated MCP server can search Actors without being able to run them (see Detection). Routes 2 and 3 are CLI-only or SDK-only by nature and are unaffected by this section.
2121

2222
Detect available transports **once** at the start of the conversation and reuse the result for every Route 1 operation. Skills downstream (`apify-ultimate-scraper`, etc.) provide both MCP and CLI variants per step — they will not re-detect.
2323

2424
### Detection
2525

26-
1. **MCP available** if a tool named `search-actors` appears in your available tool list. (Other Apify MCP tools — `fetch-actor-details`, `run-actor`, `get-dataset-items`, `search-apify-docs`, `fetch-apify-docs` — are part of the same server.)
27-
2. **CLI available** if `apify --help` exits 0 in the shell.
26+
MCP state — judge by capability, not tool names:
27+
- **full**: run Actors and tasks, read datasets and key-value stores, search Actors, fetch Actor details, search and fetch docs
28+
- **discovery-only**: search Actors, fetch Actor details, search and fetch docs only (not authenticated)
29+
- **none**: no Apify MCP tools present
30+
31+
CLI: **installed** if `apify --help` exits 0; **usable** if `apify info 2>&1` also exits 0.
2832

2933
### Selection rule
3034

3135
| MCP | CLI | Use for Route 1 |
3236
|-----|-----|-----------------|
33-
| yes | yes | **MCP** (no shell, no install friction, OAuth handles auth) |
34-
| yes | no | MCP |
35-
| no | yes | CLI |
36-
| no | no | Offer to install the CLI (`npm install -g apify-cli`) or point the user to a host that ships the Apify MCP server (`https://mcp.apify.com`). Do not attempt Route 1 until one is available. |
37+
| full | any | **MCP** (no shell, no install friction, auth is handled by the host) |
38+
| discovery-only | usable | **MCP for discovery, CLI for runs and results** |
39+
| discovery-only | not usable | Discovery over MCP. For anything authenticated there is **no transport** — report that, and see Authentication for the fix |
40+
| none | usable | CLI |
41+
| none | not usable | Offer to install the CLI (`npm install -g apify-cli`) or point the user to a host that ships the Apify MCP server (`https://mcp.apify.com`). Do not attempt Route 1 until one is available. |
3742

3843
Route 2 always requires the CLI regardless of MCP availability — `apify init`, `apify run`, and `apify push` operate on the local filesystem and have no MCP equivalent. Route 3 uses the `apify-client` package over HTTPS and needs neither.
3944

@@ -47,16 +52,19 @@ State the chosen transport once when you start a Route 1 task ("Using MCP for th
4752

4853
Three auth flows exist. Use the correct one based on the route:
4954

50-
- **Route 1 (MCP):** OAuth. No setup needed. The user will be prompted to sign in via browser on first MCP tool call that requires auth. Do not ask for an API token.
51-
- **Route 1 (CLI fallback) and Route 2 (CLI):** The CLI **ignores** the `APIFY_TOKEN` env var. Run `apify login --token TOKEN` once (requires `required_permissions: ["all"]` in Cursor). Credentials are stored in `~/.apify/auth.json` and reused automatically. Token from: https://console.apify.com/settings/integrations
55+
- **Route 1 (MCP):** If your Apify MCP tools already cover authenticated operations, auth is working — say nothing. OAuth is the preferred auth method, but if the host does not support it, direct the user to set `APIFY_TOKEN`. Token from: https://console.apify.com/settings/integrations
56+
- **Route 1 (CLI fallback) and Route 2 (CLI):** Prefer `apify login` (opens browser) — credentials persist in `~/.apify/auth.json`. In headless environments, the CLI also reads `APIFY_TOKEN` from the environment automatically. Token from: https://console.apify.com/settings/integrations
5257
- **Route 3 (SDK):** Requires `APIFY_TOKEN` environment variable. Direct the user to **Console > Settings > Integrations** at https://console.apify.com/settings/integrations to create one. If they don't have an account, point them to https://console.apify.com/sign-up (free, no credit card).
5358

5459
### Apify CLI instructions:
55-
- Before using the CLI, always check if it is installed (always check first, with short `block_until_ms` to avoid blocking the conversation):
60+
**Rule: pass `--user-agent apify-opencode-plugin/apify` only on actor start and actor run commands (`apify actors start`, `apify actors call`). Do not add it to login, info, or other CLI commands.**
61+
62+
- Before using the CLI, always check if it is installed. Keep the timeout short so the check cannot stall the conversation:
5663
```bash
5764
apify --help
65+
apify --version # The flag needs Apify CLI 1.5.0 or newer
5866
```
59-
- If the CLI is installed, check if it is logged in (always check, with short `block_until_ms` to avoid blocking the conversation):
67+
- If the CLI is installed, check if it is logged in. Keep the timeout short so the check cannot stall the conversation:
6068
```bash
6169
# Auth check — do NOT pipe to /dev/null, you need to see errors
6270
apify info 2>&1
@@ -65,15 +73,15 @@ Three auth flows exist. Use the correct one based on the route:
6573
```bash
6674
apify login --token TOKEN
6775
```
68-
- All of the APify commands needs to be run with the all permissions (depends on Agent sandbox)
69-
- Apify commands blocks with **zero output** until the run completes. Set `block_until_ms` to at least **60000** (60s).
76+
- Authenticated Apify CLI commands need file access to `~/.apify/`, where the CLI keeps its credentials. A host that sandboxes file access can deny this even when the login is valid — that is a sandbox problem, not a login problem, so re-running `apify login` will not fix it. Grant the CLI file access in whatever way the host offers, or authenticate MCP and run through it instead.
77+
- Apify commands block with **zero output** until the run completes, so allow at least **60 seconds** before treating one as stuck. If your shell tool takes a timeout, raise it accordingly.
7078
- For long/unknown runs, use the async pattern instead:
7179
```bash
72-
apify actors start "ACTOR_ID" -i 'JSON_INPUT' --json 2>/dev/null
80+
apify actors start "ACTOR_ID" -i 'JSON_INPUT' --user-agent apify-opencode-plugin/apify --json 2>/dev/null
7381
```
74-
Then poll with `apify info`:
82+
Then poll with `apify runs info`:
7583
```bash
76-
apify info actor-runs/RUN_ID --json
84+
apify runs info RUN_ID --json
7785
```
7886
Check `.status` for `SUCCEEDED` or `FAILED`.
7987
## Resources

‎instructions/apify-routing.md‎

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Do **not**:
1010

1111
- Call any `apify-*` skill directly from the slash menu without going through the `apify` subagent.
1212
- Guess between `apify-actor-development` vs `apify-actorization` vs `apify-sdk-integration` yourself — the subagent owns that decision (the `apify` SDK package and the `apify-client` package are easy to confuse and picking wrong breaks the user's project).
13-
- Skip the subagent for "quick" Apify questions. Even MCP tool calls (`search-actors`, `run-actor`, etc.) are routed through the subagent.
13+
- Skip the subagent for "quick" Apify questions. Even direct Apify MCP tool calls are routed through the subagent.
1414

1515
If the user types a slash command for an Apify skill explicitly, still hand off to the `apify` subagent so the routing matrix and authentication guidance are applied.
1616

@@ -19,9 +19,12 @@ If the user types a slash command for an Apify skill explicitly, still hand off
1919
Apify exposes three very different products through its plugin: (1) using existing Actors via MCP, (2) building and deploying custom Actors with the SDK + CLI, and (3) calling Actors from an existing application via `apify-client`. Each path requires a different skill, a different authentication flow, and a different npm package. The `apify` subagent is the only place where the routing matrix and the package-naming trap are documented, so every Apify request must pass through it.
2020

2121
### Apify CLI instructions:
22-
- Before using the CLI, always check if it is installed:
22+
**Rule: pass `--user-agent apify-opencode-plugin/apify-routing` only on actor start and actor run commands (`apify actors start`, `apify actors call`). Do not add it to login, info, or other CLI commands.**
23+
24+
- Before using the CLI, always check if it is installed and new enough for the user-agent flag:
2325
```bash
2426
apify --help
27+
apify --version # The flag needs Apify CLI 1.5.0 or newer
2528
```
2629
- If the CLI is installed, check if it is logged in:
2730
```bash
@@ -32,14 +35,15 @@ Apify exposes three very different products through its plugin: (1) using existi
3235
```bash
3336
apify login --token TOKEN
3437
```
35-
- All of the APify commands needs to be run with the all permissions (depends on Agent sandbox)
36-
- Apify commands blocks with **zero output** until the run completes. Set `block_until_ms` to at least **60000** (60s).
38+
- In headless environments where browser login is unavailable, the CLI also reads `APIFY_TOKEN` from the environment automatically — no explicit login needed.
39+
- Authenticated Apify CLI commands need file access to `~/.apify/`, where the CLI keeps its credentials. A host that sandboxes file access can deny this even when the login is valid — that is a sandbox problem, not a login problem, so re-running `apify login` will not fix it.
40+
- Apify commands block with **zero output** until the run completes, so allow at least **60 seconds** before treating one as stuck. If your shell tool takes a timeout, raise it accordingly.
3741
- For long/unknown runs, use the async pattern instead:
3842
```bash
39-
apify actors start "ACTOR_ID" -i 'JSON_INPUT' --json 2>/dev/null
43+
apify actors start "ACTOR_ID" -i 'JSON_INPUT' --user-agent apify-opencode-plugin/apify-routing --json 2>/dev/null
4044
```
41-
Then poll with `apify info`:
45+
Then poll with `apify runs info`:
4246
```bash
43-
apify info actor-runs/RUN_ID --json
47+
apify runs info RUN_ID --json
4448
```
4549
Check `.status` for `SUCCEEDED` or `FAILED`.

‎skills/apify-actor-development/SKILL.md‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ Actors are serverless programs inspired by the UNIX philosophy - programs that d
2222

2323
Before creating or modifying actors, verify that `apify` CLI is installed `apify --help`.
2424

25+
**Rule: pass `--user-agent apify-opencode-plugin/apify-actor-development` only on actor run commands (`apify run`). Do not add it to login, info, push, or other CLI commands.**
26+
2527
If it is not installed, use one of these methods (listed in order of preference):
2628

2729
```bash
@@ -131,10 +133,10 @@ Check `usesStandbyMode` in `.actor/actor.json` - only implement if set to `true`
131133
## Commands
132134

133135
```bash
134-
apify run # Run Actor locally
135-
apify login # Authenticate account
136-
apify push # Deploy to Apify platform (uses name from .actor/actor.json)
137-
apify help # List all commands
136+
apify run --user-agent apify-opencode-plugin/apify-actor-development # Run Actor locally
137+
apify login # Authenticate account
138+
apify push # Deploy to Apify platform (uses name from .actor/actor.json)
139+
apify help # List all commands
138140
```
139141

140142
**IMPORTANT:** Always use `apify run` to test actors locally. Do not use `npm run start`, `npm start`, `yarn start`, or other package manager commands - these will not properly configure the Apify environment and storage.

‎skills/apify-actorization/SKILL.md‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,13 @@ Actorization converts existing software into reusable serverless applications co
2424

2525
## Prerequisites
2626

27-
Verify `apify` CLI is installed:
27+
**Rule: pass `--user-agent apify-opencode-plugin/apify-actorization` only on actor run commands (`apify run`). Do not add it to login, info, init, push, or other CLI commands.**
28+
29+
Verify `apify` CLI is installed and new enough for the user-agent flag:
2830

2931
```bash
3032
apify --help
33+
apify --version # The flag needs Apify CLI 1.5.0 or newer
3134
```
3235

3336
If not installed, use one of these methods (listed in order of preference):
@@ -139,13 +142,13 @@ See the Actor README guidelines at `skills/apify-actor-development/references/ac
139142
Run the actor with inline input (for JS/TS and Python actors):
140143

141144
```bash
142-
apify run --input '{"startUrl": "https://example.com", "maxItems": 10}'
145+
apify run --user-agent apify-opencode-plugin/apify-actorization --input '{"startUrl": "https://example.com", "maxItems": 10}'
143146
```
144147

145148
Or use an input file:
146149

147150
```bash
148-
apify run --input-file ./test-input.json
151+
apify run --user-agent apify-opencode-plugin/apify-actorization --input-file ./test-input.json
149152
```
150153

151154
**Important:** Always use `apify run`, not `npm start` or `python main.py`. The CLI sets up the proper environment and storage.

‎skills/apify-ultimate-scraper/SKILL.md‎

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ This rule does **not** apply to status/auth commands (`apify info`, `apify --ver
1313

1414
**Exception:** if `--input` returns no data, re-run with `2>&1` to confirm whether the cause is a missing schema vs. a network/auth error.
1515

16+
**Rule: pass `--user-agent apify-opencode-plugin/apify-ultimate-scraper` only on actor start and actor run commands (`apify actors start`, `apify actors call`). Do not add it to login, info, search, or other CLI commands.**
17+
1618
## Prerequisites
1719

18-
- Apify CLI v1.4.0+ (`npm install -g apify-cli`)
20+
- Apify CLI v1.5.0+ (`npm install -g apify-cli`) — older versions reject the user-agent flag
1921
- Authenticated session (see below)
2022

2123
## Authentication
@@ -34,9 +36,10 @@ Generate token: https://console.apify.com/settings/integrations
3436

3537
Before using the Apify CLI, always verify the local environment:
3638

37-
1. Check that the CLI is installed:
39+
1. Check that the CLI is installed and is v1.5.0 or newer:
3840
```bash
3941
apify --help
42+
apify --version
4043
```
4144
If this fails, install the CLI first:
4245
```bash
@@ -54,20 +57,20 @@ If this fails, install the CLI first:
5457
apify login --token TOKEN
5558
```
5659

57-
3. Run Apify CLI commands with `all` permissions when needed by the agent sandbox.
60+
3. Authenticated Apify CLI commands need file access to `~/.apify/`, where the CLI keeps its credentials. A host that sandboxes file access can deny this even when the login is valid; that is a sandbox problem, not a login problem.
5861

59-
4. Assume many Apify commands block with zero output until completion. For blocking runs, set `block_until_ms` to at least `60000`.
62+
4. Assume many Apify commands block with zero output until completion, so allow at least 60 seconds before treating one as stuck. If your shell tool takes a timeout, raise it accordingly.
6063

6164
5. For long or unknown-duration runs, prefer the async pattern:
6265

6366
```bash
64-
apify actors start "ACTOR_ID" -i 'JSON_INPUT' --json 2>/dev/null
67+
apify actors start "ACTOR_ID" -i 'JSON_INPUT' --user-agent apify-opencode-plugin/apify-ultimate-scraper --json 2>/dev/null
6568
```
6669

6770
Then poll the run status:
6871

6972
```bash
70-
apify info actor-runs/RUN_ID --json
73+
apify runs info RUN_ID --json
7174
```
7275

7376
Check `.status` for `SUCCEEDED` or `FAILED`.
@@ -143,7 +146,7 @@ Before starting the run, double-check whether the task is short enough for a blo
143146

144147
**Standard run (blocking):**
145148
```bash
146-
apify actors call "ACTOR_ID" -i 'JSON_INPUT' --json 2>/dev/null
149+
apify actors call "ACTOR_ID" -i 'JSON_INPUT' --user-agent apify-opencode-plugin/apify-ultimate-scraper --json 2>/dev/null
147150
```
148151
From output: `.id` (run ID), `.status`, `.defaultDatasetId`, `.stats.durationMillis`
149152

@@ -159,9 +162,9 @@ For CSV: `apify datasets get-items DATASET_ID --format csv`
159162

160163
**Large/long-running scrapes:**
161164
```bash
162-
apify actors start "ACTOR_ID" -i 'JSON_INPUT' --json 2>/dev/null
165+
apify actors start "ACTOR_ID" -i 'JSON_INPUT' --user-agent apify-opencode-plugin/apify-ultimate-scraper --json 2>/dev/null
163166
```
164-
Poll: `apify info actor-runs/RUN_ID --json` (check `.status` for `SUCCEEDED` or `FAILED`).
167+
Poll: `apify runs info RUN_ID --json` (check `.status` for `SUCCEEDED` or `FAILED`).
165168

166169
### Step 4: Deliver results
167170

0 commit comments

Comments
 (0)