apify-cli 1.0.0-beta.11 → 1.0.0-beta.111
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 +200 -0
- package/README.md +124 -76
- package/bin/dev.js +7 -2
- package/bin/dev.sh +4 -0
- package/bin/run.js +7 -0
- package/dist/.tsbuildinfo +1 -1
- package/dist/commands/actor/get-value.d.ts +1 -1
- package/dist/commands/actor/push-data.d.ts +1 -1
- package/dist/commands/actor/push-data.js +2 -2
- package/dist/commands/actor/set-value.d.ts +3 -3
- package/dist/commands/actor/set-value.js +3 -3
- package/dist/commands/actor/set-value.js.map +1 -1
- package/dist/commands/call.d.ts +7 -6
- package/dist/commands/call.d.ts.map +1 -1
- package/dist/commands/call.js +56 -90
- package/dist/commands/call.js.map +1 -1
- package/dist/commands/check-version.d.ts +1 -1
- package/dist/commands/create.d.ts +5 -4
- package/dist/commands/create.d.ts.map +1 -1
- package/dist/commands/create.js +33 -18
- package/dist/commands/create.js.map +1 -1
- package/dist/commands/edit-input-schema.d.ts +1 -1
- package/dist/commands/edit-input-schema.js +15 -15
- package/dist/commands/edit-input-schema.js.map +1 -1
- package/dist/commands/init-wrap-scrapy.d.ts +1 -1
- package/dist/commands/init-wrap-scrapy.js +1 -1
- package/dist/commands/init-wrap-scrapy.js.map +1 -1
- package/dist/commands/init.d.ts +2 -2
- package/dist/commands/init.js +5 -5
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/login.d.ts +2 -1
- package/dist/commands/login.d.ts.map +1 -1
- package/dist/commands/login.js +144 -13
- package/dist/commands/login.js.map +1 -1
- package/dist/commands/logout.js +1 -1
- package/dist/commands/logout.js.map +1 -1
- package/dist/commands/pull.d.ts +2 -2
- package/dist/commands/pull.js +2 -2
- package/dist/commands/pull.js.map +1 -1
- package/dist/commands/push.d.ts +7 -7
- package/dist/commands/push.d.ts.map +1 -1
- package/dist/commands/push.js +51 -22
- package/dist/commands/push.js.map +1 -1
- package/dist/commands/run.d.ts +5 -4
- package/dist/commands/run.d.ts.map +1 -1
- package/dist/commands/run.js +101 -35
- package/dist/commands/run.js.map +1 -1
- package/dist/commands/secrets/add.d.ts +2 -2
- package/dist/commands/secrets/index.js +1 -1
- package/dist/commands/secrets/rm.d.ts +1 -1
- package/dist/commands/task/index.d.ts +6 -0
- package/dist/commands/task/index.d.ts.map +1 -0
- package/dist/commands/task/index.js +13 -0
- package/dist/commands/task/index.js.map +1 -0
- package/dist/commands/task/run.d.ts +16 -0
- package/dist/commands/task/run.d.ts.map +1 -0
- package/dist/commands/task/run.js +91 -0
- package/dist/commands/task/run.js.map +1 -0
- package/dist/commands/{vis.d.ts → validate-schema.d.ts} +3 -2
- package/dist/commands/validate-schema.d.ts.map +1 -0
- package/dist/commands/{vis.js → validate-schema.js} +10 -4
- package/dist/commands/validate-schema.js.map +1 -0
- package/dist/hooks/deprecations.d.ts +4 -0
- package/dist/hooks/deprecations.d.ts.map +1 -0
- package/dist/hooks/deprecations.js +18 -0
- package/dist/hooks/deprecations.js.map +1 -0
- package/dist/lib/actor.d.ts +1 -1
- package/dist/lib/actor.d.ts.map +1 -1
- package/dist/lib/actor.js +2 -2
- package/dist/lib/actor.js.map +1 -1
- package/dist/lib/apify_command.d.ts +0 -1
- package/dist/lib/apify_command.d.ts.map +1 -1
- package/dist/lib/commands/run-on-cloud.d.ts +19 -0
- package/dist/lib/commands/run-on-cloud.d.ts.map +1 -0
- package/dist/lib/commands/run-on-cloud.js +90 -0
- package/dist/lib/commands/run-on-cloud.js.map +1 -0
- package/dist/lib/consts.d.ts +8 -0
- package/dist/lib/consts.d.ts.map +1 -1
- package/dist/lib/consts.js +10 -0
- package/dist/lib/consts.js.map +1 -1
- package/dist/lib/create-utils.d.ts.map +1 -1
- package/dist/lib/create-utils.js +1 -1
- package/dist/lib/create-utils.js.map +1 -1
- package/dist/lib/exec.d.ts +0 -1
- package/dist/lib/exec.d.ts.map +1 -1
- package/dist/lib/exec.js +6 -1
- package/dist/lib/exec.js.map +1 -1
- package/dist/lib/files.d.ts.map +1 -1
- package/dist/lib/input_schema.d.ts +1 -1
- package/dist/lib/input_schema.d.ts.map +1 -1
- package/dist/lib/input_schema.js +1 -1
- package/dist/lib/input_schema.js.map +1 -1
- package/dist/lib/local_state.d.ts.map +1 -1
- package/dist/lib/outputs.d.ts +18 -6
- package/dist/lib/outputs.d.ts.map +1 -1
- package/dist/lib/outputs.js +43 -18
- package/dist/lib/outputs.js.map +1 -1
- package/dist/lib/projects/scrapy/wrapScrapyProject.js +3 -3
- package/dist/lib/projects/scrapy/wrapScrapyProject.js.map +1 -1
- package/dist/lib/secrets.d.ts.map +1 -1
- package/dist/lib/secrets.js +3 -3
- package/dist/lib/secrets.js.map +1 -1
- package/dist/lib/telemetry.d.ts.map +1 -1
- package/dist/lib/telemetry.js +1 -1
- package/dist/lib/telemetry.js.map +1 -1
- package/dist/lib/utils.d.ts +6 -10
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/lib/utils.js +36 -44
- package/dist/lib/utils.js.map +1 -1
- package/dist/lib/version_check.js +7 -7
- package/dist/lib/version_check.js.map +1 -1
- package/oclif.manifest.json +123 -37
- package/package.json +148 -141
- package/dist/commands/login-new.d.ts +0 -10
- package/dist/commands/login-new.d.ts.map +0 -1
- package/dist/commands/login-new.js +0 -166
- package/dist/commands/login-new.js.map +0 -1
- package/dist/commands/vis.d.ts.map +0 -1
- package/dist/commands/vis.js.map +0 -1
package/README.md
CHANGED
|
@@ -76,25 +76,25 @@ apify-cli/0.10.0 darwin-x64 node-v16.14.2
|
|
|
76
76
|
|
|
77
77
|
The following examples demonstrate the basic usage of Apify CLI.
|
|
78
78
|
|
|
79
|
-
### Create a new
|
|
79
|
+
### Create a new Actor from scratch
|
|
80
80
|
|
|
81
81
|
```bash
|
|
82
82
|
apify create my-hello-world
|
|
83
83
|
```
|
|
84
84
|
|
|
85
|
-
First, you will be prompted to select a template with the boilerplate for the
|
|
85
|
+
First, you will be prompted to select a template with the boilerplate for the Actor, to help you get started quickly.
|
|
86
86
|
The command will create a directory called `my-hello-world` that contains a Node.js project
|
|
87
|
-
for the
|
|
87
|
+
for the Actor and a few configuration files.
|
|
88
88
|
|
|
89
89
|
> If you decided to skip the installation and go with `npx`, the command will be `npx apify-cli create my-hello-world`.
|
|
90
90
|
|
|
91
|
-
### Create a new
|
|
91
|
+
### Create a new Actor from existing project
|
|
92
92
|
|
|
93
93
|
```bash
|
|
94
94
|
cd ./my/awesome/project
|
|
95
95
|
apify init
|
|
96
96
|
```
|
|
97
|
-
This command will only set up local
|
|
97
|
+
This command will only set up local Actor development environment in an existing directory,
|
|
98
98
|
i.e. it will create the `.actor/actor.json` file and `apify_storage` directory.
|
|
99
99
|
|
|
100
100
|
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:
|
|
@@ -113,14 +113,14 @@ You can find more information about by running `apify help run`.
|
|
|
113
113
|
|
|
114
114
|
If you want to run a Scrapy project on Apify platform, follow the Scrapy integration guide [here](https://docs.apify.com/cli/docs/integrating-scrapy).
|
|
115
115
|
|
|
116
|
-
### Run the
|
|
116
|
+
### Run the Actor locally
|
|
117
117
|
|
|
118
118
|
```bash
|
|
119
119
|
cd my-hello-world
|
|
120
120
|
apify run
|
|
121
121
|
```
|
|
122
122
|
|
|
123
|
-
This command runs the
|
|
123
|
+
This command runs the Actor on your local machine.
|
|
124
124
|
Now's your chance to develop the logic - or magic :smirk:
|
|
125
125
|
|
|
126
126
|
### Login with your Apify account
|
|
@@ -131,25 +131,25 @@ apify login
|
|
|
131
131
|
|
|
132
132
|
Before you can interact with the Apify cloud, you need to [create an Apify account](https://console.apify.com/)
|
|
133
133
|
and log in to it using the above command. You will be prompted for
|
|
134
|
-
your [Apify API token](https://console.apify.com/
|
|
134
|
+
your [Apify API token](https://console.apify.com/settings/integrations).
|
|
135
135
|
Note that the command will store the API token and other sensitive information to `~/.apify`.
|
|
136
136
|
|
|
137
137
|
|
|
138
|
-
### Push the
|
|
138
|
+
### Push the Actor to the Apify cloud
|
|
139
139
|
|
|
140
140
|
```bash
|
|
141
141
|
apify push
|
|
142
142
|
```
|
|
143
143
|
|
|
144
|
-
This command uploads your project to the Apify cloud and builds an
|
|
144
|
+
This command uploads your project to the Apify cloud and builds an Actor from it. On the platform, Actor needs to be built before it can be run.
|
|
145
145
|
|
|
146
|
-
### Run an
|
|
146
|
+
### Run an Actor on the Apify cloud
|
|
147
147
|
|
|
148
148
|
```bash
|
|
149
149
|
apify call
|
|
150
150
|
```
|
|
151
151
|
|
|
152
|
-
Runs the
|
|
152
|
+
Runs the Actor corresponding to the current directory on the Apify platform.
|
|
153
153
|
|
|
154
154
|
This command can also be used to run other Actors, for example:
|
|
155
155
|
|
|
@@ -159,8 +159,8 @@ apify call apify/hello-world
|
|
|
159
159
|
|
|
160
160
|
### So what's in this .actor/actor.json file?
|
|
161
161
|
|
|
162
|
-
This file associates your local development project with an
|
|
163
|
-
It contains information such as
|
|
162
|
+
This file associates your local development project with an Actor on the Apify platform.
|
|
163
|
+
It contains information such as Actor name, version, build tag and environment variables.
|
|
164
164
|
Make sure you commit this file to the Git repository.
|
|
165
165
|
|
|
166
166
|
For example, `.actor/actor.json` file can look as follows:
|
|
@@ -186,7 +186,7 @@ For example, `.actor/actor.json` file can look as follows:
|
|
|
186
186
|
```
|
|
187
187
|
|
|
188
188
|
**`Dockerfile` field**\
|
|
189
|
-
If you specify the path to your Docker file under the `dockerfile` field, this file will be used for
|
|
189
|
+
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.
|
|
190
190
|
|
|
191
191
|
**`Readme` field** \
|
|
192
192
|
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.
|
|
@@ -195,17 +195,17 @@ If you specify the path to your readme file under the `readme` field, the readme
|
|
|
195
195
|
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.
|
|
196
196
|
|
|
197
197
|
**`Storages.dataset` field**\
|
|
198
|
-
You can define the schema of the items in your dataset under the `storages.dataset` field. This can be either an embedded object or a path to a JSON schema file. You can read more about the schema of your
|
|
198
|
+
You can define the schema of the items in your dataset under the `storages.dataset` field. This can be either an embedded object or a path to a JSON schema file. You can read more about the schema of your Actor output [here](https://docs.apify.com/actors/development/output-schema#specification-version-1).
|
|
199
199
|
|
|
200
200
|
**Note on migration from deprecated config "apify.json"**\
|
|
201
|
-
*Note that previously,
|
|
201
|
+
*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).*
|
|
202
202
|
|
|
203
203
|
## Environment variables
|
|
204
204
|
|
|
205
205
|
There are two options how you can set up environment variables for Actors.
|
|
206
206
|
|
|
207
207
|
### Set up environment variables in .actor/actor.json
|
|
208
|
-
All keys from `env` will be set as environment variables into Apify platform after you push
|
|
208
|
+
All keys from `env` will be set as environment variables into Apify platform after you push Actor to Apify. Current values on Apify will be overridden.
|
|
209
209
|
```json
|
|
210
210
|
{
|
|
211
211
|
"actorSpecification": 1,
|
|
@@ -220,7 +220,7 @@ All keys from `env` will be set as environment variables into Apify platform aft
|
|
|
220
220
|
```
|
|
221
221
|
|
|
222
222
|
### Set up environment variables in Apify Console
|
|
223
|
-
In [Apify Console](https://console.apify.com/actors) select your
|
|
223
|
+
In [Apify Console](https://console.apify.com/actors) select your Actor, you can set up variables into Source tab.
|
|
224
224
|
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.
|
|
225
225
|
```json
|
|
226
226
|
{
|
|
@@ -276,13 +276,13 @@ This section contains printouts of `apify help` for all commands.
|
|
|
276
276
|
|
|
277
277
|
<!-- commands -->
|
|
278
278
|
* [`apify actor`](#apify-actor)
|
|
279
|
-
* [`apify actor
|
|
280
|
-
* [`apify actor
|
|
281
|
-
* [`apify actor
|
|
282
|
-
* [`apify actor
|
|
279
|
+
* [`apify actor get-input`](#apify-actor-get-input)
|
|
280
|
+
* [`apify actor get-value KEY`](#apify-actor-get-value-key)
|
|
281
|
+
* [`apify actor push-data [ITEM]`](#apify-actor-push-data-item)
|
|
282
|
+
* [`apify actor set-value KEY [VALUE]`](#apify-actor-set-value-key-value)
|
|
283
283
|
* [`apify call [ACTORID]`](#apify-call-actorid)
|
|
284
284
|
* [`apify create [ACTORNAME]`](#apify-create-actorname)
|
|
285
|
-
* [`apify help [
|
|
285
|
+
* [`apify help [COMMAND]`](#apify-help-command)
|
|
286
286
|
* [`apify info`](#apify-info)
|
|
287
287
|
* [`apify init [ACTORNAME]`](#apify-init-actorname)
|
|
288
288
|
* [`apify login`](#apify-login)
|
|
@@ -291,9 +291,11 @@ This section contains printouts of `apify help` for all commands.
|
|
|
291
291
|
* [`apify push [ACTORID]`](#apify-push-actorid)
|
|
292
292
|
* [`apify run`](#apify-run)
|
|
293
293
|
* [`apify secrets`](#apify-secrets)
|
|
294
|
-
* [`apify secrets
|
|
295
|
-
* [`apify secrets
|
|
296
|
-
* [`apify
|
|
294
|
+
* [`apify secrets add NAME VALUE`](#apify-secrets-add-name-value)
|
|
295
|
+
* [`apify secrets rm NAME`](#apify-secrets-rm-name)
|
|
296
|
+
* [`apify task`](#apify-task)
|
|
297
|
+
* [`apify task run TASKID`](#apify-task-run-taskid)
|
|
298
|
+
* [`apify validate-schema [PATH]`](#apify-validate-schema-path)
|
|
297
299
|
|
|
298
300
|
## `apify actor`
|
|
299
301
|
|
|
@@ -307,29 +309,29 @@ DESCRIPTION
|
|
|
307
309
|
Commands are designed to be used in Actor runs. All commands are in PoC state, do not use in production environments.
|
|
308
310
|
```
|
|
309
311
|
|
|
310
|
-
_See code: [src/commands/actor/index.ts](https://github.com/apify/apify-cli/blob/v1.0.0-beta.
|
|
312
|
+
_See code: [src/commands/actor/index.ts](https://github.com/apify/apify-cli/blob/v1.0.0-beta.111/src/commands/actor/index.ts)_
|
|
311
313
|
|
|
312
|
-
## `apify actor
|
|
314
|
+
## `apify actor get-input`
|
|
313
315
|
|
|
314
316
|
Gets the Actor input value from the default key-value store associated with the Actor run.
|
|
315
317
|
|
|
316
318
|
```
|
|
317
319
|
USAGE
|
|
318
|
-
$ apify actor
|
|
320
|
+
$ apify actor get-input
|
|
319
321
|
|
|
320
322
|
DESCRIPTION
|
|
321
323
|
Gets the Actor input value from the default key-value store associated with the Actor run.
|
|
322
324
|
```
|
|
323
325
|
|
|
324
|
-
_See code: [src/commands/actor/get-input.ts](https://github.com/apify/apify-cli/blob/v1.0.0-beta.
|
|
326
|
+
_See code: [src/commands/actor/get-input.ts](https://github.com/apify/apify-cli/blob/v1.0.0-beta.111/src/commands/actor/get-input.ts)_
|
|
325
327
|
|
|
326
|
-
## `apify actor
|
|
328
|
+
## `apify actor get-value KEY`
|
|
327
329
|
|
|
328
330
|
Gets a value from the default key-value store associated with the Actor run.
|
|
329
331
|
|
|
330
332
|
```
|
|
331
333
|
USAGE
|
|
332
|
-
$ apify actor
|
|
334
|
+
$ apify actor get-value KEY
|
|
333
335
|
|
|
334
336
|
ARGUMENTS
|
|
335
337
|
KEY Key of the record in key-value store
|
|
@@ -338,15 +340,15 @@ DESCRIPTION
|
|
|
338
340
|
Gets a value from the default key-value store associated with the Actor run.
|
|
339
341
|
```
|
|
340
342
|
|
|
341
|
-
_See code: [src/commands/actor/get-value.ts](https://github.com/apify/apify-cli/blob/v1.0.0-beta.
|
|
343
|
+
_See code: [src/commands/actor/get-value.ts](https://github.com/apify/apify-cli/blob/v1.0.0-beta.111/src/commands/actor/get-value.ts)_
|
|
342
344
|
|
|
343
|
-
## `apify actor
|
|
345
|
+
## `apify actor push-data [ITEM]`
|
|
344
346
|
|
|
345
347
|
Stores an object or an array of objects to the default dataset of the Actor run.
|
|
346
348
|
|
|
347
349
|
```
|
|
348
350
|
USAGE
|
|
349
|
-
$ apify actor
|
|
351
|
+
$ apify actor push-data [ITEM]
|
|
350
352
|
|
|
351
353
|
ARGUMENTS
|
|
352
354
|
ITEM JSON string with one object or array of objects containing data to be stored in the default dataset.
|
|
@@ -355,20 +357,20 @@ DESCRIPTION
|
|
|
355
357
|
Stores an object or an array of objects to the default dataset of the Actor run.
|
|
356
358
|
It is possible to pass data using item argument or stdin.
|
|
357
359
|
Passing data using argument:
|
|
358
|
-
$ apify actor
|
|
360
|
+
$ apify actor push-data {"foo": "bar"}
|
|
359
361
|
Passing data using stdin with pipe:
|
|
360
|
-
$ cat ./test.json | apify actor
|
|
362
|
+
$ cat ./test.json | apify actor push-data
|
|
361
363
|
```
|
|
362
364
|
|
|
363
|
-
_See code: [src/commands/actor/push-data.ts](https://github.com/apify/apify-cli/blob/v1.0.0-beta.
|
|
365
|
+
_See code: [src/commands/actor/push-data.ts](https://github.com/apify/apify-cli/blob/v1.0.0-beta.111/src/commands/actor/push-data.ts)_
|
|
364
366
|
|
|
365
|
-
## `apify actor
|
|
367
|
+
## `apify actor set-value KEY [VALUE]`
|
|
366
368
|
|
|
367
369
|
Sets or removes record into the default KeyValueStore associated with the Actor run.
|
|
368
370
|
|
|
369
371
|
```
|
|
370
372
|
USAGE
|
|
371
|
-
$ apify actor
|
|
373
|
+
$ apify actor set-value KEY [VALUE] [-c <value>]
|
|
372
374
|
|
|
373
375
|
ARGUMENTS
|
|
374
376
|
KEY Key of the record in key-value store.
|
|
@@ -384,12 +386,12 @@ DESCRIPTION
|
|
|
384
386
|
Sets or removes record into the default KeyValueStore associated with the Actor run.
|
|
385
387
|
It is possible to pass data using argument or stdin.
|
|
386
388
|
Passing data using argument:
|
|
387
|
-
$ apify actor
|
|
389
|
+
$ apify actor set-value KEY my-value
|
|
388
390
|
Passing data using stdin with pipe:
|
|
389
|
-
$ cat ./my-text-file.txt | apify actor
|
|
391
|
+
$ cat ./my-text-file.txt | apify actor set-value KEY --contentType text/plain
|
|
390
392
|
```
|
|
391
393
|
|
|
392
|
-
_See code: [src/commands/actor/set-value.ts](https://github.com/apify/apify-cli/blob/v1.0.0-beta.
|
|
394
|
+
_See code: [src/commands/actor/set-value.ts](https://github.com/apify/apify-cli/blob/v1.0.0-beta.111/src/commands/actor/set-value.ts)_
|
|
393
395
|
|
|
394
396
|
## `apify call [ACTORID]`
|
|
395
397
|
|
|
@@ -400,8 +402,8 @@ USAGE
|
|
|
400
402
|
$ apify call [ACTORID] [-b <value>] [-t <value>] [-m <value>] [-w <value>]
|
|
401
403
|
|
|
402
404
|
ARGUMENTS
|
|
403
|
-
ACTORID Name or ID of the Actor to run (e.g. "apify/hello-world" or "E2jjCZBezvAZnX8Rb"). If not
|
|
404
|
-
command runs the remote Actor specified in the ".actor/actor.json" file.
|
|
405
|
+
ACTORID Name or ID of the Actor to run (e.g. "my-actor", "apify/hello-world" or "E2jjCZBezvAZnX8Rb"). If not
|
|
406
|
+
provided, the command runs the remote Actor specified in the ".actor/actor.json" file.
|
|
405
407
|
|
|
406
408
|
FLAGS
|
|
407
409
|
-b, --build=<value> Tag or number of the build to run (e.g. "latest" or "1.2.34").
|
|
@@ -415,7 +417,7 @@ DESCRIPTION
|
|
|
415
417
|
takes input for the Actor from the default local key-value store by default.
|
|
416
418
|
```
|
|
417
419
|
|
|
418
|
-
_See code: [src/commands/call.ts](https://github.com/apify/apify-cli/blob/v1.0.0-beta.
|
|
420
|
+
_See code: [src/commands/call.ts](https://github.com/apify/apify-cli/blob/v1.0.0-beta.111/src/commands/call.ts)_
|
|
419
421
|
|
|
420
422
|
## `apify create [ACTORNAME]`
|
|
421
423
|
|
|
@@ -423,7 +425,7 @@ Creates a new Actor project directory from a selected boilerplate template.
|
|
|
423
425
|
|
|
424
426
|
```
|
|
425
427
|
USAGE
|
|
426
|
-
$ apify create [ACTORNAME] [-t <value>] [--skip-dependency-install]
|
|
428
|
+
$ apify create [ACTORNAME] [-t <value>] [--skip-dependency-install] [--omit-optional-deps]
|
|
427
429
|
|
|
428
430
|
ARGUMENTS
|
|
429
431
|
ACTORNAME Name of the Actor and its directory
|
|
@@ -433,24 +435,25 @@ FLAGS
|
|
|
433
435
|
Visit
|
|
434
436
|
https://raw.githubusercontent.com/apify/actor-templates/master/templates/manifest.json
|
|
435
437
|
to find available template names.
|
|
438
|
+
--omit-optional-deps Skip installing optional dependencies.
|
|
436
439
|
--skip-dependency-install Skip installing Actor dependencies.
|
|
437
440
|
|
|
438
441
|
DESCRIPTION
|
|
439
442
|
Creates a new Actor project directory from a selected boilerplate template.
|
|
440
443
|
```
|
|
441
444
|
|
|
442
|
-
_See code: [src/commands/create.ts](https://github.com/apify/apify-cli/blob/v1.0.0-beta.
|
|
445
|
+
_See code: [src/commands/create.ts](https://github.com/apify/apify-cli/blob/v1.0.0-beta.111/src/commands/create.ts)_
|
|
443
446
|
|
|
444
|
-
## `apify help [
|
|
447
|
+
## `apify help [COMMAND]`
|
|
445
448
|
|
|
446
449
|
Display help for apify.
|
|
447
450
|
|
|
448
451
|
```
|
|
449
452
|
USAGE
|
|
450
|
-
$ apify help [
|
|
453
|
+
$ apify help [COMMAND...] [-n]
|
|
451
454
|
|
|
452
455
|
ARGUMENTS
|
|
453
|
-
|
|
456
|
+
COMMAND... Command to show help for.
|
|
454
457
|
|
|
455
458
|
FLAGS
|
|
456
459
|
-n, --nested-commands Include all nested commands in the output.
|
|
@@ -459,7 +462,7 @@ DESCRIPTION
|
|
|
459
462
|
Display help for apify.
|
|
460
463
|
```
|
|
461
464
|
|
|
462
|
-
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.
|
|
465
|
+
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.2.3/src/commands/help.ts)_
|
|
463
466
|
|
|
464
467
|
## `apify info`
|
|
465
468
|
|
|
@@ -474,7 +477,7 @@ DESCRIPTION
|
|
|
474
477
|
The information is printed to the console.
|
|
475
478
|
```
|
|
476
479
|
|
|
477
|
-
_See code: [src/commands/info.ts](https://github.com/apify/apify-cli/blob/v1.0.0-beta.
|
|
480
|
+
_See code: [src/commands/info.ts](https://github.com/apify/apify-cli/blob/v1.0.0-beta.111/src/commands/info.ts)_
|
|
478
481
|
|
|
479
482
|
## `apify init [ACTORNAME]`
|
|
480
483
|
|
|
@@ -502,26 +505,28 @@ DESCRIPTION
|
|
|
502
505
|
WARNING: The directory at "storage" will be overwritten if it already exists.
|
|
503
506
|
```
|
|
504
507
|
|
|
505
|
-
_See code: [src/commands/init.ts](https://github.com/apify/apify-cli/blob/v1.0.0-beta.
|
|
508
|
+
_See code: [src/commands/init.ts](https://github.com/apify/apify-cli/blob/v1.0.0-beta.111/src/commands/init.ts)_
|
|
506
509
|
|
|
507
510
|
## `apify login`
|
|
508
511
|
|
|
509
|
-
Logs in to your Apify account
|
|
512
|
+
Logs in to your Apify account.
|
|
510
513
|
|
|
511
514
|
```
|
|
512
515
|
USAGE
|
|
513
|
-
$ apify login [-t <value>]
|
|
516
|
+
$ apify login [-t <value>] [-m console|manual]
|
|
514
517
|
|
|
515
518
|
FLAGS
|
|
516
|
-
-
|
|
519
|
+
-m, --method=<option> [Optional] Method of logging in to Apify
|
|
520
|
+
<options: console|manual>
|
|
521
|
+
-t, --token=<value> [Optional] Apify API token
|
|
517
522
|
|
|
518
523
|
DESCRIPTION
|
|
519
|
-
Logs in to your Apify account
|
|
524
|
+
Logs in to your Apify account.
|
|
520
525
|
The API token and other account information is stored in the ~/.apify directory, from where it is read by all other
|
|
521
526
|
"apify" commands. To log out, call "apify logout".
|
|
522
527
|
```
|
|
523
528
|
|
|
524
|
-
_See code: [src/commands/login.ts](https://github.com/apify/apify-cli/blob/v1.0.0-beta.
|
|
529
|
+
_See code: [src/commands/login.ts](https://github.com/apify/apify-cli/blob/v1.0.0-beta.111/src/commands/login.ts)_
|
|
525
530
|
|
|
526
531
|
## `apify logout`
|
|
527
532
|
|
|
@@ -537,7 +542,7 @@ DESCRIPTION
|
|
|
537
542
|
call "apify login".
|
|
538
543
|
```
|
|
539
544
|
|
|
540
|
-
_See code: [src/commands/logout.ts](https://github.com/apify/apify-cli/blob/v1.0.0-beta.
|
|
545
|
+
_See code: [src/commands/logout.ts](https://github.com/apify/apify-cli/blob/v1.0.0-beta.111/src/commands/logout.ts)_
|
|
541
546
|
|
|
542
547
|
## `apify pull [ACTORID]`
|
|
543
548
|
|
|
@@ -559,7 +564,7 @@ DESCRIPTION
|
|
|
559
564
|
cloned. If it is defined as Web IDE, it will fetch the files.
|
|
560
565
|
```
|
|
561
566
|
|
|
562
|
-
_See code: [src/commands/pull.ts](https://github.com/apify/apify-cli/blob/v1.0.0-beta.
|
|
567
|
+
_See code: [src/commands/pull.ts](https://github.com/apify/apify-cli/blob/v1.0.0-beta.111/src/commands/pull.ts)_
|
|
563
568
|
|
|
564
569
|
## `apify push [ACTORID]`
|
|
565
570
|
|
|
@@ -597,7 +602,7 @@ DESCRIPTION
|
|
|
597
602
|
overwritten with --force flag.
|
|
598
603
|
```
|
|
599
604
|
|
|
600
|
-
_See code: [src/commands/push.ts](https://github.com/apify/apify-cli/blob/v1.0.0-beta.
|
|
605
|
+
_See code: [src/commands/push.ts](https://github.com/apify/apify-cli/blob/v1.0.0-beta.111/src/commands/push.ts)_
|
|
601
606
|
|
|
602
607
|
## `apify run`
|
|
603
608
|
|
|
@@ -605,11 +610,15 @@ Runs the Actor locally in the current directory.
|
|
|
605
610
|
|
|
606
611
|
```
|
|
607
612
|
USAGE
|
|
608
|
-
$ apify run [-p] [--purge-queue] [--purge-dataset] [--purge-key-value-store]
|
|
613
|
+
$ apify run [-p] [--purge-queue] [--purge-dataset] [--purge-key-value-store] [--entrypoint <value>]
|
|
609
614
|
|
|
610
615
|
FLAGS
|
|
611
616
|
-p, --purge Shortcut that combines the --purge-queue, --purge-dataset and --purge-key-value-store
|
|
612
617
|
options.
|
|
618
|
+
--entrypoint=<value> Optional entrypoint for running with injected environment variables.
|
|
619
|
+
For Python, it is the module name, or a path to a file.
|
|
620
|
+
For node.js, it is the npm script name, or a path to a JS/MJS file. You can also pass in
|
|
621
|
+
a directory name, provided that directory contains an "index.js" file.
|
|
613
622
|
--purge-dataset Deletes the local directory containing the default dataset before the run starts.
|
|
614
623
|
--purge-key-value-store Deletes all records from the default key-value store in the local directory before the
|
|
615
624
|
run starts, except for the "INPUT" key.
|
|
@@ -625,7 +634,7 @@ DESCRIPTION
|
|
|
625
634
|
package.json file. You can set up your own main file or environment variables by changing it.
|
|
626
635
|
```
|
|
627
636
|
|
|
628
|
-
_See code: [src/commands/run.ts](https://github.com/apify/apify-cli/blob/v1.0.0-beta.
|
|
637
|
+
_See code: [src/commands/run.ts](https://github.com/apify/apify-cli/blob/v1.0.0-beta.111/src/commands/run.ts)_
|
|
629
638
|
|
|
630
639
|
## `apify secrets`
|
|
631
640
|
|
|
@@ -639,7 +648,7 @@ DESCRIPTION
|
|
|
639
648
|
Manages secret values for Actor environment variables.
|
|
640
649
|
|
|
641
650
|
Example:
|
|
642
|
-
$ apify secrets
|
|
651
|
+
$ apify secrets add mySecret TopSecretValue123
|
|
643
652
|
|
|
644
653
|
Now the "mySecret" value can be used in an environment variable defined in ".actor/actor.json" file by adding the "@"
|
|
645
654
|
prefix:
|
|
@@ -655,15 +664,15 @@ DESCRIPTION
|
|
|
655
664
|
of the Actor.
|
|
656
665
|
```
|
|
657
666
|
|
|
658
|
-
_See code: [src/commands/secrets/index.ts](https://github.com/apify/apify-cli/blob/v1.0.0-beta.
|
|
667
|
+
_See code: [src/commands/secrets/index.ts](https://github.com/apify/apify-cli/blob/v1.0.0-beta.111/src/commands/secrets/index.ts)_
|
|
659
668
|
|
|
660
|
-
## `apify secrets
|
|
669
|
+
## `apify secrets add NAME VALUE`
|
|
661
670
|
|
|
662
671
|
Adds a new secret value.
|
|
663
672
|
|
|
664
673
|
```
|
|
665
674
|
USAGE
|
|
666
|
-
$ apify secrets
|
|
675
|
+
$ apify secrets add NAME VALUE
|
|
667
676
|
|
|
668
677
|
ARGUMENTS
|
|
669
678
|
NAME Name of the secret
|
|
@@ -674,15 +683,15 @@ DESCRIPTION
|
|
|
674
683
|
The secrets are stored to a file at ~/.apify
|
|
675
684
|
```
|
|
676
685
|
|
|
677
|
-
_See code: [src/commands/secrets/add.ts](https://github.com/apify/apify-cli/blob/v1.0.0-beta.
|
|
686
|
+
_See code: [src/commands/secrets/add.ts](https://github.com/apify/apify-cli/blob/v1.0.0-beta.111/src/commands/secrets/add.ts)_
|
|
678
687
|
|
|
679
|
-
## `apify secrets
|
|
688
|
+
## `apify secrets rm NAME`
|
|
680
689
|
|
|
681
690
|
Removes the secret.
|
|
682
691
|
|
|
683
692
|
```
|
|
684
693
|
USAGE
|
|
685
|
-
$ apify secrets
|
|
694
|
+
$ apify secrets rm NAME
|
|
686
695
|
|
|
687
696
|
ARGUMENTS
|
|
688
697
|
NAME Name of the secret
|
|
@@ -691,15 +700,54 @@ DESCRIPTION
|
|
|
691
700
|
Removes the secret.
|
|
692
701
|
```
|
|
693
702
|
|
|
694
|
-
_See code: [src/commands/secrets/rm.ts](https://github.com/apify/apify-cli/blob/v1.0.0-beta.
|
|
703
|
+
_See code: [src/commands/secrets/rm.ts](https://github.com/apify/apify-cli/blob/v1.0.0-beta.111/src/commands/secrets/rm.ts)_
|
|
704
|
+
|
|
705
|
+
## `apify task`
|
|
706
|
+
|
|
707
|
+
Commands are designed to be used to interact with Tasks.
|
|
708
|
+
|
|
709
|
+
```
|
|
710
|
+
USAGE
|
|
711
|
+
$ apify task
|
|
712
|
+
|
|
713
|
+
DESCRIPTION
|
|
714
|
+
Commands are designed to be used to interact with Tasks.
|
|
715
|
+
```
|
|
716
|
+
|
|
717
|
+
_See code: [src/commands/task/index.ts](https://github.com/apify/apify-cli/blob/v1.0.0-beta.111/src/commands/task/index.ts)_
|
|
718
|
+
|
|
719
|
+
## `apify task run TASKID`
|
|
720
|
+
|
|
721
|
+
Runs a specific Actor remotely on the Apify cloud platform.
|
|
722
|
+
|
|
723
|
+
```
|
|
724
|
+
USAGE
|
|
725
|
+
$ apify task run TASKID [-b <value>] [-t <value>] [-m <value>] [-w <value>]
|
|
726
|
+
|
|
727
|
+
ARGUMENTS
|
|
728
|
+
TASKID Name or ID of the Task to run (e.g. "my-task" or "E2jjCZBezvAZnX8Rb").
|
|
729
|
+
|
|
730
|
+
FLAGS
|
|
731
|
+
-b, --build=<value> Tag or number of the build to run (e.g. "latest" or "1.2.34").
|
|
732
|
+
-m, --memory=<value> Amount of memory allocated for the Task run, in megabytes.
|
|
733
|
+
-t, --timeout=<value> Timeout for the Task run in seconds. Zero value means there is no timeout.
|
|
734
|
+
-w, --wait-for-finish=<value> Seconds for waiting to run to finish, if no value passed, it waits forever.
|
|
735
|
+
|
|
736
|
+
DESCRIPTION
|
|
737
|
+
Runs a specific Actor remotely on the Apify cloud platform.
|
|
738
|
+
The Actor is run under your current Apify account. Therefore you need to be logged in by calling "apify login". It
|
|
739
|
+
takes input for the Actor from the default local key-value store by default.
|
|
740
|
+
```
|
|
741
|
+
|
|
742
|
+
_See code: [src/commands/task/run.ts](https://github.com/apify/apify-cli/blob/v1.0.0-beta.111/src/commands/task/run.ts)_
|
|
695
743
|
|
|
696
|
-
## `apify
|
|
744
|
+
## `apify validate-schema [PATH]`
|
|
697
745
|
|
|
698
746
|
Validates input schema and prints errors found.
|
|
699
747
|
|
|
700
748
|
```
|
|
701
749
|
USAGE
|
|
702
|
-
$ apify
|
|
750
|
+
$ apify validate-schema [PATH]
|
|
703
751
|
|
|
704
752
|
ARGUMENTS
|
|
705
753
|
PATH Optional path to your INPUT_SCHEMA.json file. If not provided ./INPUT_SCHEMA.json is used.
|
|
@@ -716,5 +764,5 @@ DESCRIPTION
|
|
|
716
764
|
You can also pass any custom path to your input schema to have it validated instead.
|
|
717
765
|
```
|
|
718
766
|
|
|
719
|
-
_See code: [src/commands/
|
|
767
|
+
_See code: [src/commands/validate-schema.ts](https://github.com/apify/apify-cli/blob/v1.0.0-beta.111/src/commands/validate-schema.ts)_
|
|
720
768
|
<!-- commandsstop -->
|
package/bin/dev.js
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
#!/usr/bin/env node_modules/.bin/tsx
|
|
2
|
-
|
|
3
1
|
import { execute } from '@oclif/core';
|
|
2
|
+
import { satisfies } from 'semver';
|
|
4
3
|
|
|
4
|
+
import { SUPPORTED_NODEJS_VERSION } from '../src/lib/consts.ts';
|
|
5
5
|
import { error } from '../src/lib/outputs.ts';
|
|
6
6
|
|
|
7
|
+
if (!satisfies(process.version, SUPPORTED_NODEJS_VERSION)) {
|
|
8
|
+
error(`Apify CLI requires Node.js version ${SUPPORTED_NODEJS_VERSION}. Your current version is ${process.version}.`);
|
|
9
|
+
process.exit(1);
|
|
10
|
+
}
|
|
11
|
+
|
|
7
12
|
try {
|
|
8
13
|
await execute({ development: true, dir: import.meta.url });
|
|
9
14
|
} catch (err) {
|
package/bin/dev.sh
ADDED
package/bin/run.js
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import { execute } from '@oclif/core';
|
|
4
|
+
import { satisfies } from 'semver';
|
|
4
5
|
|
|
6
|
+
import { SUPPORTED_NODEJS_VERSION } from '../dist/lib/consts.js';
|
|
5
7
|
import { error } from '../dist/lib/outputs.js';
|
|
6
8
|
|
|
9
|
+
if (!satisfies(process.version, SUPPORTED_NODEJS_VERSION)) {
|
|
10
|
+
error(`Apify CLI requires Node.js version ${SUPPORTED_NODEJS_VERSION}. Your current version is ${process.version}.`);
|
|
11
|
+
process.exit(1);
|
|
12
|
+
}
|
|
13
|
+
|
|
7
14
|
try {
|
|
8
15
|
await execute({ development: false, dir: import.meta.url });
|
|
9
16
|
} catch (err) {
|