apify-cli 1.4.1 → 1.4.2-beta.1
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/CHANGELOG.md +14 -0
- package/README.md +74 -228
- package/dist/.tsbuildinfo +1 -1
- package/dist/actor.js +1 -1
- package/dist/apify.js +1 -1
- package/dist/{chunk-VP7ZLBZX.js → chunk-N5CS6BYT.js} +146 -146
- package/dist/chunk-N5CS6BYT.js.map +1 -0
- package/package.json +8 -7
- package/dist/chunk-VP7ZLBZX.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
<!-- git-cliff-unreleased-start -->
|
|
6
|
+
|
|
7
|
+
## 1.4.2 - **not yet released**
|
|
8
|
+
|
|
9
|
+
### 🚀 Features
|
|
10
|
+
|
|
11
|
+
- Add execution context to telemetry events ([#1074](https://github.com/apify/apify-cli/pull/1074)) ([9288ff8](https://github.com/apify/apify-cli/commit/9288ff886864acd78b5e06b5ff13096774bd81f6)) by [@patrikbraborec](https://github.com/patrikbraborec)
|
|
12
|
+
|
|
13
|
+
<!-- git-cliff-unreleased-end -->
|
|
14
|
+
|
|
5
15
|
## [1.4.1](https://github.com/apify/apify-cli/releases/tag/v1.4.1) (2026-04-02)
|
|
6
16
|
|
|
7
17
|
### 🐛 Bug Fixes
|
|
@@ -46,6 +56,10 @@ All notable changes to this project will be documented in this file.
|
|
|
46
56
|
|
|
47
57
|
## [1.2.1](https://github.com/apify/apify-cli/releases/tag/v1.2.1) (2026-01-06)
|
|
48
58
|
|
|
59
|
+
### 🔧 CI/CD
|
|
60
|
+
|
|
61
|
+
- Fix release flow permissions ([#988](https://github.com/apify/apify-cli/pull/988)) ([a9d0d90](https://github.com/apify/apify-cli/commit/a9d0d9013f42e48bfcdddbc467e995b1655cf853)) by [@vladfrangu](https://github.com/vladfrangu)
|
|
62
|
+
|
|
49
63
|
## [1.2.0](https://github.com/apify/apify-cli/releases/tag/v1.2.0) (2026-01-06)
|
|
50
64
|
|
|
51
65
|
### 🚀 Features
|
package/README.md
CHANGED
|
@@ -1,283 +1,129 @@
|
|
|
1
|
-
# Apify
|
|
1
|
+
# Apify CLI
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/apify-cli)
|
|
4
4
|
[](https://github.com/apify/apify-cli/actions/workflows/check.yaml)
|
|
5
5
|
|
|
6
|
-
Apify command-line
|
|
7
|
-
[Apify Actors](https://www.apify.com/actors),
|
|
8
|
-
and manage the Apify cloud platform from any computer.
|
|
6
|
+
Apify CLI is the command-line tool for creating, developing, and deploying [Apify Actors](https://www.apify.com/actors), and for managing the Apify cloud platform from your terminal.
|
|
9
7
|
|
|
10
|
-
|
|
11
|
-
They accept input, perform their job and generate output.
|
|
12
|
-
While you can develop Actors in an online IDE directly in the [Apify web application](https://console.apify.com/),
|
|
13
|
-
for complex projects it is more convenient to develop Actors locally on your computer
|
|
14
|
-
using <a href="https://github.com/apify/apify-sdk-js">Apify SDK</a>
|
|
15
|
-
and only push the Actors to the Apify cloud during deployment.
|
|
16
|
-
This is where the Apify CLI comes in.
|
|
8
|
+
## Features
|
|
17
9
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
10
|
+
- Create, develop, and deploy Apify Actors from your terminal
|
|
11
|
+
- Run Actors locally for development and testing, or in the Apify cloud
|
|
12
|
+
- Manage Actors, datasets, key-value stores, and request queues
|
|
13
|
+
- Manage secret environment variables used by your Actors
|
|
14
|
+
- Works with any programming language — Actors run as Docker containers on the platform
|
|
21
15
|
|
|
22
|
-
##
|
|
23
|
-
|
|
24
|
-
### Via bundles
|
|
25
|
-
|
|
26
|
-
#### MacOS / Unix
|
|
27
|
-
|
|
28
|
-
```bash
|
|
29
|
-
curl -fsSL https://apify.com/install-cli.sh | bash
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
#### Windows
|
|
33
|
-
|
|
34
|
-
```powershell
|
|
35
|
-
irm https://apify.com/install-cli.ps1 | iex
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
### Via Homebrew
|
|
16
|
+
## Quick start
|
|
39
17
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
```bash
|
|
43
|
-
brew install apify-cli
|
|
44
|
-
```
|
|
18
|
+
1. **Install the CLI** (macOS / Linux):
|
|
45
19
|
|
|
46
|
-
|
|
20
|
+
```bash
|
|
21
|
+
curl -fsSL https://apify.com/install-cli.sh | bash
|
|
22
|
+
```
|
|
47
23
|
|
|
48
|
-
|
|
24
|
+
For Windows and other installation options, see [Installation](#installation).
|
|
49
25
|
|
|
50
|
-
|
|
51
|
-
node --version
|
|
52
|
-
npm --version
|
|
53
|
-
```
|
|
26
|
+
2. **Log in** with your [Apify API token](https://console.apify.com/settings/integrations):
|
|
54
27
|
|
|
55
|
-
|
|
28
|
+
```bash
|
|
29
|
+
apify login
|
|
30
|
+
```
|
|
56
31
|
|
|
57
|
-
|
|
58
|
-
npm install -g apify-cli
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
Alternatively, you can use [fnm (Fast Node Manager)](https://github.com/Schniz/fnm) and install Apify CLI only into a selected user-level Node version without requiring root privileges:
|
|
62
|
-
|
|
63
|
-
```bash
|
|
64
|
-
fnm install 22
|
|
65
|
-
fnm use 22
|
|
66
|
-
npm install -g apify-cli
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
Finally, verify that Apify CLI was installed correctly by running:
|
|
70
|
-
|
|
71
|
-
```bash
|
|
72
|
-
apify --version
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
> You can also skip the manual global installation altogether and use `npx apify-cli` with all the following commands instead.
|
|
76
|
-
|
|
77
|
-
## Basic usage
|
|
78
|
-
|
|
79
|
-
The following examples demonstrate the basic usage of Apify CLI.
|
|
80
|
-
|
|
81
|
-
### Create a new Actor from scratch
|
|
82
|
-
|
|
83
|
-
```bash
|
|
84
|
-
apify create my-hello-world
|
|
85
|
-
```
|
|
32
|
+
3. **Create, run, and deploy** your first Actor:
|
|
86
33
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
34
|
+
```bash
|
|
35
|
+
apify create # it will walk you through an interactive wizard
|
|
36
|
+
cd my-actor
|
|
37
|
+
apify run
|
|
38
|
+
apify push
|
|
39
|
+
```
|
|
90
40
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
### Create a new Actor from existing project
|
|
94
|
-
|
|
95
|
-
```bash
|
|
96
|
-
cd ./my/awesome/project
|
|
97
|
-
apify init
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
This command will only set up local Actor development environment in an existing directory,
|
|
101
|
-
i.e. it will create the `.actor/actor.json` file and `apify_storage` directory.
|
|
102
|
-
|
|
103
|
-
Before you can run your project locally using `apify run`, you have to set up the right start command in `package.json` under scripts.start. For example:
|
|
104
|
-
|
|
105
|
-
```text
|
|
106
|
-
{
|
|
107
|
-
...
|
|
108
|
-
"scripts": {
|
|
109
|
-
"start": "node your_main_file.js",
|
|
110
|
-
},
|
|
111
|
-
...
|
|
112
|
-
}
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
You can find more information about by running `apify help run`.
|
|
116
|
-
|
|
117
|
-
### Create a new Actor from Scrapy project
|
|
118
|
-
|
|
119
|
-
If you want to run a Scrapy project on Apify platform, follow the [Scrapy integration guide](https://docs.apify.com/cli/docs/integrating-scrapy).
|
|
41
|
+
## Installation
|
|
120
42
|
|
|
121
|
-
###
|
|
43
|
+
### macOS / Linux (bundle, recommended)
|
|
122
44
|
|
|
123
45
|
```bash
|
|
124
|
-
|
|
125
|
-
apify run
|
|
46
|
+
curl -fsSL https://apify.com/install-cli.sh | bash
|
|
126
47
|
```
|
|
127
48
|
|
|
128
|
-
|
|
129
|
-
Now's your chance to develop the logic - or magic :smirk:
|
|
130
|
-
|
|
131
|
-
### Login with your Apify account
|
|
49
|
+
### macOS / Linux (Homebrew)
|
|
132
50
|
|
|
133
51
|
```bash
|
|
134
|
-
apify
|
|
52
|
+
brew install apify-cli
|
|
135
53
|
```
|
|
136
54
|
|
|
137
|
-
|
|
138
|
-
and log in to it using the above command. You will be prompted for
|
|
139
|
-
your [Apify API token](https://console.apify.com/settings/integrations).
|
|
140
|
-
Note that the command will store the API token and other sensitive information to `~/.apify`.
|
|
55
|
+
### Windows
|
|
141
56
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
```bash
|
|
145
|
-
apify push
|
|
57
|
+
```powershell
|
|
58
|
+
irm https://apify.com/install-cli.ps1 | iex
|
|
146
59
|
```
|
|
147
60
|
|
|
148
|
-
|
|
61
|
+
### npm (cross-platform)
|
|
149
62
|
|
|
150
|
-
|
|
63
|
+
Requires [Node.js](https://nodejs.org) 22 or higher:
|
|
151
64
|
|
|
152
65
|
```bash
|
|
153
|
-
apify
|
|
66
|
+
npm install -g apify-cli
|
|
154
67
|
```
|
|
155
68
|
|
|
156
|
-
|
|
69
|
+
You can also run the CLI without a global install via `npx apify-cli <command>`.
|
|
157
70
|
|
|
158
|
-
|
|
71
|
+
Verify the installation:
|
|
159
72
|
|
|
160
73
|
```bash
|
|
161
|
-
apify
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
### So what's in this .actor/actor.json file?
|
|
165
|
-
|
|
166
|
-
This file associates your local development project with an Actor on the Apify platform.
|
|
167
|
-
It contains information such as Actor name, version, build tag and environment variables.
|
|
168
|
-
Make sure you commit this file to the Git repository.
|
|
169
|
-
|
|
170
|
-
For example, `.actor/actor.json` file can look as follows:
|
|
171
|
-
|
|
172
|
-
```json
|
|
173
|
-
{
|
|
174
|
-
"actorSpecification": 1,
|
|
175
|
-
"name": "name-of-my-scraper",
|
|
176
|
-
"version": "0.0",
|
|
177
|
-
"buildTag": "latest",
|
|
178
|
-
"environmentVariables": {
|
|
179
|
-
"MYSQL_USER": "my_username",
|
|
180
|
-
"MYSQL_PASSWORD": "@mySecretPassword"
|
|
181
|
-
},
|
|
182
|
-
"dockerfile": "./Dockerfile",
|
|
183
|
-
"readme": "./ACTOR.md",
|
|
184
|
-
"input": "./input_schema.json",
|
|
185
|
-
"storages": {
|
|
186
|
-
"dataset": "./dataset_schema.json"
|
|
187
|
-
}
|
|
188
|
-
}
|
|
74
|
+
apify --version
|
|
189
75
|
```
|
|
190
76
|
|
|
191
|
-
|
|
192
|
-
If you specify the path to your Docker file under the `dockerfile` field, this file will be used for Actor builds on the platform. If not specified, the system will look for Docker files at `.actor/Dockerfile` and `Dockerfile` in this order of preference.
|
|
193
|
-
|
|
194
|
-
**`Readme` field** \
|
|
195
|
-
If you specify the path to your readme file under the `readme` field, the readme at this path will be used on the platform. If not specified, readme at `.actor/README.md` and `README.md` will be used in this order of preference.
|
|
77
|
+
## Commands
|
|
196
78
|
|
|
197
|
-
|
|
198
|
-
You can embed your [input schema](https://docs.apify.com/actors/development/input-schema#specification-version-1) object directly in `actor.json` under `input` field. Alternatively, you can provide a path to a custom input schema. If not provided, the input schema at `.actor/INPUT_SCHEMA.json` and `INPUT_SCHEMA.json` is used in this order of preference.
|
|
79
|
+
The table below lists the most common commands. For the full reference, see the [command reference](https://docs.apify.com/cli/docs/reference).
|
|
199
80
|
|
|
200
|
-
|
|
201
|
-
|
|
81
|
+
| Command | Description |
|
|
82
|
+
| --------------- | --------------------------------------------------------- |
|
|
83
|
+
| `apify create` | Create a new Actor project from a template |
|
|
84
|
+
| `apify init` | Initialize an existing project as an Actor |
|
|
85
|
+
| `apify run` | Run the Actor locally |
|
|
86
|
+
| `apify login` | Authenticate with the Apify platform |
|
|
87
|
+
| `apify logout` | Log out of the Apify platform |
|
|
88
|
+
| `apify push` | Deploy the Actor to the Apify cloud |
|
|
89
|
+
| `apify pull` | Pull an Actor from the cloud to your local machine |
|
|
90
|
+
| `apify call` | Run the Actor on the Apify cloud |
|
|
91
|
+
| `apify builds` | Manage Actor builds (`create`, `info`, `ls`, `log`, `rm`) |
|
|
92
|
+
| `apify secrets` | Manage secret environment variables |
|
|
93
|
+
| `apify help` | Show help for any command |
|
|
202
94
|
|
|
203
|
-
|
|
204
|
-
_Note that previously, Actor config was stored in the `apify.json` file that has been deprecated. You can find the (very slight) differences and migration info in [migration guidelines](https://github.com/apify/apify-cli/blob/master/MIGRATIONS.md)._
|
|
95
|
+
Actor configuration lives in `.actor/actor.json`. See the [Actor configuration docs](https://docs.apify.com/platform/actors/development/actor-definition/actor-json) for the full schema (name, version, build tag, environment variables, Dockerfile, input schema, storages).
|
|
205
96
|
|
|
206
|
-
##
|
|
97
|
+
## Documentation
|
|
207
98
|
|
|
208
|
-
|
|
99
|
+
- [Apify CLI documentation](https://docs.apify.com/cli)
|
|
100
|
+
- [Command reference](https://docs.apify.com/cli/docs/reference)
|
|
101
|
+
- [Actor development guide](https://docs.apify.com/platform/actors/development)
|
|
102
|
+
- [Apify platform documentation](https://docs.apify.com/platform)
|
|
209
103
|
|
|
210
|
-
|
|
104
|
+
## Telemetry
|
|
211
105
|
|
|
212
|
-
|
|
106
|
+
Apify CLI collects anonymous usage data to help us improve the tool and the Apify platform. See [Telemetry](https://docs.apify.com/cli/docs/telemetry) for details on what is collected.
|
|
213
107
|
|
|
214
|
-
|
|
215
|
-
{
|
|
216
|
-
"actorSpecification": 1,
|
|
217
|
-
"name": "dataset-to-mysql",
|
|
218
|
-
"version": "0.1",
|
|
219
|
-
"buildTag": "latest",
|
|
220
|
-
"environmentVariables": {
|
|
221
|
-
"MYSQL_USER": "my_username",
|
|
222
|
-
"MYSQL_PASSWORD": "@mySecretPassword"
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
```
|
|
226
|
-
|
|
227
|
-
### Set up environment variables in Apify Console
|
|
228
|
-
|
|
229
|
-
In [Apify Console](https://console.apify.com/actors) select your Actor, you can set up variables into Source tab.
|
|
230
|
-
After setting up variables in the app, remove the `environmentVariables` from `.actor/actor.json`. Otherwise, variables from `.actor/actor.json` will override variables in the app.
|
|
231
|
-
|
|
232
|
-
```json
|
|
233
|
-
{
|
|
234
|
-
"actorSpecification": 1,
|
|
235
|
-
"name": "dataset-to-mysql",
|
|
236
|
-
"version": "0.1",
|
|
237
|
-
"buildTag": "latest"
|
|
238
|
-
}
|
|
239
|
-
```
|
|
240
|
-
|
|
241
|
-
#### How to set secret environment variables in .actor/actor.json
|
|
242
|
-
|
|
243
|
-
CLI provides commands to manage secrets environment variables. Secrets are stored to the `~/.apify` directory.
|
|
244
|
-
You can add a new secret using the command:
|
|
108
|
+
To opt out, either run:
|
|
245
109
|
|
|
246
110
|
```bash
|
|
247
|
-
apify
|
|
111
|
+
apify telemetry disable
|
|
248
112
|
```
|
|
249
113
|
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
```text
|
|
253
|
-
{
|
|
254
|
-
"actorSpecification": 1,
|
|
255
|
-
"name": "dataset-to-mysql",
|
|
256
|
-
...
|
|
257
|
-
"environmentVariables": {
|
|
258
|
-
"MYSQL_PASSWORD": "@mySecretPassword"
|
|
259
|
-
},
|
|
260
|
-
...
|
|
261
|
-
}
|
|
262
|
-
```
|
|
114
|
+
or set the `APIFY_CLI_DISABLE_TELEMETRY=1` environment variable.
|
|
263
115
|
|
|
264
|
-
|
|
116
|
+
## Contributing
|
|
265
117
|
|
|
266
|
-
|
|
118
|
+
Contributions are welcome. See [CONTRIBUTING.md](./CONTRIBUTING.md) for local setup, code style, test categories, and PR guidelines.
|
|
267
119
|
|
|
268
|
-
|
|
269
|
-
apify help
|
|
270
|
-
```
|
|
271
|
-
|
|
272
|
-
To get information about a specific command run:
|
|
273
|
-
|
|
274
|
-
```bash
|
|
275
|
-
apify help COMMAND
|
|
276
|
-
```
|
|
120
|
+
## Feedback & support
|
|
277
121
|
|
|
278
|
-
|
|
279
|
-
|
|
122
|
+
- Report bugs or request features via [GitHub Issues](https://github.com/apify/apify-cli/issues)
|
|
123
|
+
- Browse the [Apify Help Center](https://www.apify.com/help)
|
|
124
|
+
- [Contact Apify support](https://www.apify.com/contact)
|
|
125
|
+
- Join the community on [Discord](https://discord.gg/crawlee-apify-801163717915574323)
|
|
280
126
|
|
|
281
|
-
##
|
|
127
|
+
## License
|
|
282
128
|
|
|
283
|
-
|
|
129
|
+
[Apache-2.0](./LICENSE.md)
|