apify-cli 1.6.3-beta.9 → 1.6.4-beta.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/README.md +32 -5
- package/dist/{_register-LutQbOAI.js → _register-CV_qnnnx.js} +92 -82
- package/dist/_register-CV_qnnnx.js.map +1 -0
- package/dist/actor.js +1 -1
- package/dist/apify.js +1 -1
- package/package.json +7 -6
- package/skills/apify/SKILL.md +112 -0
- package/dist/_register-LutQbOAI.js.map +0 -1
package/dist/actor.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{i as e,r as t,t as n}from"./_register-
|
|
2
|
+
import{i as e,r as t,t as n}from"./_register-CV_qnnnx.js";t(`Actor`);for(let e of n)e.registerCommand(`actor`);await e(`actor`);export{};
|
|
3
3
|
//# sourceMappingURL=actor.js.map
|
package/dist/apify.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{i as e,n as t,r as n}from"./_register-
|
|
2
|
+
import{i as e,n as t,r as n}from"./_register-CV_qnnnx.js";n(`Apify`);for(let e of t)e.registerCommand(`apify`);await e(`apify`);export{};
|
|
3
3
|
//# sourceMappingURL=apify.js.map
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "apify-cli",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.4-beta.0",
|
|
4
4
|
"description": "Apify command-line interface (CLI) helps you manage the Apify cloud platform and develop, build, and deploy Apify Actors.",
|
|
5
5
|
"exports": "./dist/index.js",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"files": [
|
|
8
|
-
"dist"
|
|
8
|
+
"dist",
|
|
9
|
+
"skills"
|
|
9
10
|
],
|
|
10
11
|
"bin": {
|
|
11
12
|
"actor": "./dist/actor.js",
|
|
@@ -76,6 +77,7 @@
|
|
|
76
77
|
"escape-string-regexp": "~5.0.0",
|
|
77
78
|
"execa": "^9.6.1",
|
|
78
79
|
"express": "~5.2.1",
|
|
80
|
+
"giget": "^3.3.0",
|
|
79
81
|
"handlebars": "~4.7.9",
|
|
80
82
|
"ignore": "^7.0.5",
|
|
81
83
|
"indent-string": "^5.0.0",
|
|
@@ -90,7 +92,6 @@
|
|
|
90
92
|
"semver": "~7.8.0",
|
|
91
93
|
"string-width": "^8.2.0",
|
|
92
94
|
"strip-ansi": "^7.2.0",
|
|
93
|
-
"tiged": "~2.12.7",
|
|
94
95
|
"tinyglobby": "^0.2.15",
|
|
95
96
|
"which": "^7.0.0",
|
|
96
97
|
"widest-line": "^6.0.0",
|
|
@@ -117,8 +118,8 @@
|
|
|
117
118
|
"husky": "^9.1.7",
|
|
118
119
|
"lint-staged": "^17.0.0",
|
|
119
120
|
"mock-stdin": "^1.0.0",
|
|
120
|
-
"oxfmt": "0.
|
|
121
|
-
"oxlint": "1.
|
|
121
|
+
"oxfmt": "0.56.0",
|
|
122
|
+
"oxlint": "1.71.0",
|
|
122
123
|
"oxlint-tsgolint": "0.22.1",
|
|
123
124
|
"tsdown": "^0.22.0",
|
|
124
125
|
"tsx": "^4.21.0",
|
|
@@ -126,7 +127,7 @@
|
|
|
126
127
|
"vitest": "^4.1.8"
|
|
127
128
|
},
|
|
128
129
|
"volta": {
|
|
129
|
-
"node": "24.
|
|
130
|
+
"node": "24.18.0",
|
|
130
131
|
"pnpm": "11.8.0"
|
|
131
132
|
},
|
|
132
133
|
"devEngines": {
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: apify-cli
|
|
3
|
+
description: Patterns for invoking the Apify CLI (`apify`) from agents. Covers authentication, creating/running/pushing Actors, calling Actors in the cloud, and reading results from datasets and key-value stores.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Start here
|
|
7
|
+
|
|
8
|
+
Run `apify -h` first to see the available commands and global options, then `apify <command> -h` (e.g. `apify call -h`) for the args and flags of a specific command. This is the source of truth — prefer it over assumptions.
|
|
9
|
+
|
|
10
|
+
## Non-interactive use
|
|
11
|
+
|
|
12
|
+
Many commands prompt when run interactively. To run without prompts, pass every required argument and flag explicitly:
|
|
13
|
+
|
|
14
|
+
- `apify create <name> --template <template>` — skip the create wizard.
|
|
15
|
+
- `apify init <name>` — skip the init prompt.
|
|
16
|
+
- `-y` / `--yes` on destructive commands (`apify actors rm`, etc.) — auto-confirm.
|
|
17
|
+
- `apify login --token <token>` — log in without the interactive token prompt.
|
|
18
|
+
|
|
19
|
+
If a command's help shows an "interactive note", it lists exactly which flags make it non-interactive.
|
|
20
|
+
|
|
21
|
+
## Auth
|
|
22
|
+
|
|
23
|
+
See https://apify.com/auth.md for how to authenticate. Do not assume `APIFY_TOKEN` is already set in the environment and use it implicitly — confirm with the user first.
|
|
24
|
+
|
|
25
|
+
- Persist a session explicitly: `apify login --token <token>`.
|
|
26
|
+
- Verify auth: `apify info` (prints the logged-in user; non-zero exit / error if not authenticated).
|
|
27
|
+
- Print the stored token: `apify auth token`.
|
|
28
|
+
|
|
29
|
+
## Structured output
|
|
30
|
+
|
|
31
|
+
- `--json` is supported on most list/info commands (`apify actors ls --json`, `apify actors info <id> --json`, `apify datasets info <id> --json`, `apify runs ls --json`, etc.). Use it and parse with `jq`; don't scrape the human table.
|
|
32
|
+
- List commands paginate — control with `--limit` / `--offset` (and `--desc`).
|
|
33
|
+
- Dataset items: `apify datasets get-items <datasetId> --format json`. Use `--limit` / `--offset`.
|
|
34
|
+
|
|
35
|
+
## Core workflows
|
|
36
|
+
|
|
37
|
+
**Discover Actors in the Apify Store**
|
|
38
|
+
|
|
39
|
+
Before assuming an Actor name or scripting a raw Store query, search for an existing Actor:
|
|
40
|
+
|
|
41
|
+
```sh
|
|
42
|
+
apify actors search "jobs scraper" --json # no auth required
|
|
43
|
+
apify actors search "ai" --pricing-model FREE --sort-by popularity --limit 5
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Run `apify actors search -h` to see the available filters (pricing model, category, username, sort order, pagination) and their accepted values.
|
|
47
|
+
|
|
48
|
+
Pricing matters, but weigh it alongside popularity, rating, and how well-maintained the Actor is — don't pick a `FREE` Actor over a well-supported, popular, highly-rated one just because it's free. Check an Actor's pricing before running it with `apify actors info <actor> --json` (look at `currentPricingInfo`).
|
|
49
|
+
|
|
50
|
+
**Develop and deploy a local Actor**
|
|
51
|
+
|
|
52
|
+
```sh
|
|
53
|
+
apify create my-actor --template <template> # or run `apify create` and pick interactively
|
|
54
|
+
# template names: https://raw.githubusercontent.com/apify/actor-templates/master/templates/manifest.json
|
|
55
|
+
cd my-actor
|
|
56
|
+
apify run # run locally; --input / --input-file - for input
|
|
57
|
+
apify push # build & deploy to the platform
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
**Run an Actor in the cloud and get results**
|
|
61
|
+
|
|
62
|
+
```sh
|
|
63
|
+
apify call apify/website-content-crawler -i '{"startUrls":[{"url":"https://example.com"}]}' --json
|
|
64
|
+
# or non-blocking: apify actors start <actor> --json (returns run details immediately)
|
|
65
|
+
# inspect input schema first: apify actors info <actor> --input
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Non-obvious `apify call` flags: `-f -` reads input from stdin; `-o`/`--output-dataset` prints the result dataset. Run `apify call -h` for the full list.
|
|
69
|
+
|
|
70
|
+
**Wait for and inspect runs/builds**
|
|
71
|
+
|
|
72
|
+
```sh
|
|
73
|
+
apify runs ls --json
|
|
74
|
+
apify runs info <runId> --json
|
|
75
|
+
apify runs wait <runId> # block until finished
|
|
76
|
+
apify runs log <runId>
|
|
77
|
+
apify builds wait <buildId>
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
**Storage**
|
|
81
|
+
|
|
82
|
+
```sh
|
|
83
|
+
apify datasets get-items <datasetId> --format json
|
|
84
|
+
apify key-value-stores get-value <storeId> <key>
|
|
85
|
+
apify key-value-stores set-value <storeId> <key> <value>
|
|
86
|
+
apify key-value-stores keys <storeId> --json
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Scheduling and recurring runs
|
|
90
|
+
|
|
91
|
+
For anything recurring or unattended (e.g. "run every 15 minutes"), use the Apify platform — **not** local `cron`, a `while` loop, or GitHub Actions. Apify Schedules run in the cloud, so they keep firing after your laptop, terminal, or agent session is shut down.
|
|
92
|
+
|
|
93
|
+
- Save a reusable input config as a **task**, then run it: `apify task run <taskId>`.
|
|
94
|
+
- There is no dedicated `apify schedules` command yet — manage schedules via `apify api` against the `schedules` endpoint, or in the Console (https://console.apify.com/schedules):
|
|
95
|
+
|
|
96
|
+
```sh
|
|
97
|
+
apify api GET schedules
|
|
98
|
+
apify api POST schedules -d '{"name":"jobs-every-15m","cronExpression":"*/15 * * * *","isEnabled":true,"actions":[{"type":"RUN_ACTOR","actorId":"<actorId>","runInput":{"body":"<json>","contentType":"application/json"}}]}'
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Escape hatch: `apify api`
|
|
102
|
+
|
|
103
|
+
Any platform capability without a dedicated command is reachable via the authenticated API wrapper (use this instead of hand-rolling `curl` against `api.apify.com` — it injects auth for you):
|
|
104
|
+
|
|
105
|
+
```sh
|
|
106
|
+
apify api --list-endpoints # discover endpoints (filter with -s "<tokens>")
|
|
107
|
+
apify api --describe "actor-runs/{runId}" # methods, summary, path params for an endpoint
|
|
108
|
+
apify api GET /v2/users/me # GET is the default method
|
|
109
|
+
apify api POST acts -d '<json>' -p '{"limit":1}' # -d body (use - for stdin), -p query params
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
The `v2/` prefix and leading slash are optional.
|