apify-cli 0.19.3-beta.5 → 0.19.4
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 +100 -125
- package/oclif.manifest.json +1 -1
- package/package.json +111 -113
- package/src/commands/actor/index.js +1 -1
- package/src/commands/actor/set-value.js +1 -1
- package/src/commands/call.js +4 -4
- package/src/commands/create.js +6 -6
- package/src/commands/init.js +5 -6
- package/src/commands/push.js +1 -1
- package/src/commands/run.js +15 -13
- package/src/commands/secrets/index.js +1 -1
- package/src/commands/vis.js +1 -1
- package/src/lib/create-utils.js +3 -3
- package/src/lib/utils.js +2 -2
- package/src/lib/apify-oclif-help.js +0 -23
package/README.md
CHANGED
|
@@ -4,19 +4,19 @@
|
|
|
4
4
|
<a href="https://travis-ci.com/apify/apify-cli?branch=master"><img src="https://travis-ci.com/apify/apify-cli.svg?branch=master" loading="lazy" alt="Build Status" style="display:inherit;" /></a>
|
|
5
5
|
|
|
6
6
|
Apify command-line interface (Apify CLI) helps you create, develop, build and run
|
|
7
|
-
[Apify
|
|
7
|
+
[Apify actors](https://www.apify.com/actors),
|
|
8
8
|
and manage the Apify cloud platform from any computer.
|
|
9
9
|
|
|
10
|
-
Apify
|
|
10
|
+
Apify actors are cloud programs that can perform arbitrary web scraping, automation or data processing job.
|
|
11
11
|
They accept input, perform their job and generate output.
|
|
12
|
-
While you can develop
|
|
13
|
-
for complex projects it is more convenient to develop
|
|
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
14
|
using <a href="https://github.com/apify/apify-sdk-js">Apify SDK</a>
|
|
15
|
-
and only push the
|
|
15
|
+
and only push the actors to the Apify cloud during deployment.
|
|
16
16
|
This is where the Apify CLI comes in.
|
|
17
17
|
|
|
18
|
-
Note that
|
|
19
|
-
you can build your
|
|
18
|
+
Note that actors running on the Apify platform are executed in Docker containers, so with an appropriate `Dockerfile`
|
|
19
|
+
you can build your actors in any programming language.
|
|
20
20
|
However, we recommend using JavaScript / Node.js, for which we provide most libraries and support.
|
|
21
21
|
|
|
22
22
|
|
|
@@ -151,7 +151,7 @@ apify call
|
|
|
151
151
|
|
|
152
152
|
Runs the actor corresponding to the current directory on the Apify platform.
|
|
153
153
|
|
|
154
|
-
This command can also be used to run other
|
|
154
|
+
This command can also be used to run other actors, for example:
|
|
155
155
|
|
|
156
156
|
```bash
|
|
157
157
|
apify call apify/hello-world
|
|
@@ -202,7 +202,7 @@ You can define the schema of the items in your dataset under the `storages.datas
|
|
|
202
202
|
|
|
203
203
|
## Environment variables
|
|
204
204
|
|
|
205
|
-
There are two options how you can set up environment variables for
|
|
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
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.
|
|
@@ -280,7 +280,7 @@ This section contains printouts of `apify help` for all commands.
|
|
|
280
280
|
* [`apify actor:get-value KEY`](#apify-actorget-value-key)
|
|
281
281
|
* [`apify actor:push-data [ITEM]`](#apify-actorpush-data-item)
|
|
282
282
|
* [`apify actor:set-value KEY [VALUE]`](#apify-actorset-value-key-value)
|
|
283
|
-
* [`apify call [
|
|
283
|
+
* [`apify call [ACTID]`](#apify-call-actid)
|
|
284
284
|
* [`apify create [ACTORNAME]`](#apify-create-actorname)
|
|
285
285
|
* [`apify info`](#apify-info)
|
|
286
286
|
* [`apify init [ACTORNAME]`](#apify-init-actorname)
|
|
@@ -296,17 +296,14 @@ This section contains printouts of `apify help` for all commands.
|
|
|
296
296
|
|
|
297
297
|
## `apify actor`
|
|
298
298
|
|
|
299
|
-
Commands are designed to be used in
|
|
299
|
+
Commands are designed to be used in actor runs. All commands are in PoC state, do not use in production environments.
|
|
300
300
|
|
|
301
301
|
```
|
|
302
302
|
USAGE
|
|
303
303
|
$ apify actor
|
|
304
|
-
|
|
305
|
-
DESCRIPTION
|
|
306
|
-
Commands are designed to be used in Actor runs. All commands are in PoC state, do not use in production environments.
|
|
307
304
|
```
|
|
308
305
|
|
|
309
|
-
_See code: [src/commands/actor/index.js](https://github.com/apify/apify-cli/blob/v0.19.
|
|
306
|
+
_See code: [src/commands/actor/index.js](https://github.com/apify/apify-cli/blob/v0.19.4/src/commands/actor/index.js)_
|
|
310
307
|
|
|
311
308
|
## `apify actor:get-input`
|
|
312
309
|
|
|
@@ -315,12 +312,9 @@ Gets the actor input value from the default key-value store associated with the
|
|
|
315
312
|
```
|
|
316
313
|
USAGE
|
|
317
314
|
$ apify actor:get-input
|
|
318
|
-
|
|
319
|
-
DESCRIPTION
|
|
320
|
-
Gets the actor input value from the default key-value store associated with the actor run.
|
|
321
315
|
```
|
|
322
316
|
|
|
323
|
-
_See code: [src/commands/actor/get-input.js](https://github.com/apify/apify-cli/blob/v0.19.
|
|
317
|
+
_See code: [src/commands/actor/get-input.js](https://github.com/apify/apify-cli/blob/v0.19.4/src/commands/actor/get-input.js)_
|
|
324
318
|
|
|
325
319
|
## `apify actor:get-value KEY`
|
|
326
320
|
|
|
@@ -332,12 +326,9 @@ USAGE
|
|
|
332
326
|
|
|
333
327
|
ARGUMENTS
|
|
334
328
|
KEY Key of the record in key-value store
|
|
335
|
-
|
|
336
|
-
DESCRIPTION
|
|
337
|
-
Gets a value from the default key-value store associated with the actor run.
|
|
338
329
|
```
|
|
339
330
|
|
|
340
|
-
_See code: [src/commands/actor/get-value.js](https://github.com/apify/apify-cli/blob/v0.19.
|
|
331
|
+
_See code: [src/commands/actor/get-value.js](https://github.com/apify/apify-cli/blob/v0.19.4/src/commands/actor/get-value.js)_
|
|
341
332
|
|
|
342
333
|
## `apify actor:push-data [ITEM]`
|
|
343
334
|
|
|
@@ -351,7 +342,6 @@ ARGUMENTS
|
|
|
351
342
|
ITEM JSON string with one object or array of objects containing data to be stored in the default dataset.
|
|
352
343
|
|
|
353
344
|
DESCRIPTION
|
|
354
|
-
Stores an object or an array of objects to the default dataset of the actor run.
|
|
355
345
|
It is possible to pass data using item argument or stdin.
|
|
356
346
|
Passing data using argument:
|
|
357
347
|
$ apify actor:push-data {"foo": "bar"}
|
|
@@ -359,28 +349,29 @@ DESCRIPTION
|
|
|
359
349
|
$ cat ./test.json | apify actor:push-data
|
|
360
350
|
```
|
|
361
351
|
|
|
362
|
-
_See code: [src/commands/actor/push-data.js](https://github.com/apify/apify-cli/blob/v0.19.
|
|
352
|
+
_See code: [src/commands/actor/push-data.js](https://github.com/apify/apify-cli/blob/v0.19.4/src/commands/actor/push-data.js)_
|
|
363
353
|
|
|
364
354
|
## `apify actor:set-value KEY [VALUE]`
|
|
365
355
|
|
|
366
|
-
Sets or removes record into the default
|
|
356
|
+
Sets or removes record into the default KeyValueStore associated with the actor run.
|
|
367
357
|
|
|
368
358
|
```
|
|
369
359
|
USAGE
|
|
370
|
-
$ apify actor:set-value KEY [VALUE]
|
|
360
|
+
$ apify actor:set-value KEY [VALUE]
|
|
371
361
|
|
|
372
362
|
ARGUMENTS
|
|
373
363
|
KEY Key of the record in key-value store.
|
|
364
|
+
|
|
374
365
|
VALUE Record data, which can be one of the following values:
|
|
375
366
|
- If empty, the record in the key-value store is deleted.
|
|
376
367
|
- If no `contentType` flag is specified, value is expected to be any JSON string value.
|
|
377
368
|
- If options.contentType is set, value is taken as is.
|
|
378
369
|
|
|
379
|
-
|
|
380
|
-
-c, --contentType
|
|
370
|
+
OPTIONS
|
|
371
|
+
-c, --contentType=contentType Specifies a custom MIME content type of the record. By default "application/json" is
|
|
372
|
+
used.
|
|
381
373
|
|
|
382
374
|
DESCRIPTION
|
|
383
|
-
Sets or removes record into the default key-value store associated with the Actor run.
|
|
384
375
|
It is possible to pass data using argument or stdin.
|
|
385
376
|
Passing data using argument:
|
|
386
377
|
$ apify actor:set-value KEY my-value
|
|
@@ -388,57 +379,54 @@ DESCRIPTION
|
|
|
388
379
|
$ cat ./my-text-file.txt | apify actor:set-value KEY --contentType text/plain
|
|
389
380
|
```
|
|
390
381
|
|
|
391
|
-
_See code: [src/commands/actor/set-value.js](https://github.com/apify/apify-cli/blob/v0.19.
|
|
382
|
+
_See code: [src/commands/actor/set-value.js](https://github.com/apify/apify-cli/blob/v0.19.4/src/commands/actor/set-value.js)_
|
|
392
383
|
|
|
393
|
-
## `apify call [
|
|
384
|
+
## `apify call [ACTID]`
|
|
394
385
|
|
|
395
386
|
Runs a specific actor remotely on the Apify cloud platform.
|
|
396
387
|
|
|
397
388
|
```
|
|
398
389
|
USAGE
|
|
399
|
-
$ apify call [
|
|
390
|
+
$ apify call [ACTID]
|
|
400
391
|
|
|
401
392
|
ARGUMENTS
|
|
402
|
-
|
|
403
|
-
|
|
393
|
+
ACTID Name or ID of the actor to run (e.g. "apify/hello-world" or "E2jjCZBezvAZnX8Rb"). If not provided, the command
|
|
394
|
+
runs the remote actor specified in the ".actor/actor.json" file.
|
|
404
395
|
|
|
405
|
-
|
|
406
|
-
-b, --build
|
|
407
|
-
-m, --memory
|
|
408
|
-
-t, --timeout
|
|
409
|
-
-w, --wait-for-finish
|
|
396
|
+
OPTIONS
|
|
397
|
+
-b, --build=build Tag or number of the build to run (e.g. "latest" or "1.2.34").
|
|
398
|
+
-m, --memory=memory Amount of memory allocated for the actor run, in megabytes.
|
|
399
|
+
-t, --timeout=timeout Timeout for the actor run in seconds. Zero value means there is no timeout.
|
|
400
|
+
-w, --wait-for-finish=wait-for-finish Seconds for waiting to run to finish, if no value passed, it waits forever.
|
|
410
401
|
|
|
411
402
|
DESCRIPTION
|
|
412
|
-
|
|
413
|
-
The Actor is run under your current Apify account. Therefore you need to be logged in by calling "apify login". It
|
|
403
|
+
The Actor is run under your current Apify account. Therefore you need to be logged in by calling "apify login". It
|
|
414
404
|
takes input for the Actor from the default local key-value store by default.
|
|
415
405
|
```
|
|
416
406
|
|
|
417
|
-
_See code: [src/commands/call.js](https://github.com/apify/apify-cli/blob/v0.19.
|
|
407
|
+
_See code: [src/commands/call.js](https://github.com/apify/apify-cli/blob/v0.19.4/src/commands/call.js)_
|
|
418
408
|
|
|
419
409
|
## `apify create [ACTORNAME]`
|
|
420
410
|
|
|
421
|
-
Creates a new
|
|
411
|
+
Creates a new actor project directory from a selected boilerplate template.
|
|
422
412
|
|
|
423
413
|
```
|
|
424
414
|
USAGE
|
|
425
|
-
$ apify create [ACTORNAME]
|
|
415
|
+
$ apify create [ACTORNAME]
|
|
426
416
|
|
|
427
417
|
ARGUMENTS
|
|
428
|
-
ACTORNAME Name of the
|
|
418
|
+
ACTORNAME Name of the actor and its directory
|
|
429
419
|
|
|
430
|
-
|
|
431
|
-
-t, --template
|
|
420
|
+
OPTIONS
|
|
421
|
+
-t, --template=template Template for the actor. If not provided, the command will prompt for it.
|
|
432
422
|
Visit
|
|
433
423
|
https://raw.githubusercontent.com/apify/actor-templates/master/templates/manifest.json to
|
|
434
424
|
find available template names.
|
|
435
|
-
--skip-dependency-install Skip installing Actor dependencies.
|
|
436
425
|
|
|
437
|
-
|
|
438
|
-
Creates a new Actor project directory from a selected boilerplate template.
|
|
426
|
+
--skip-dependency-install Skip installing actor dependencies.
|
|
439
427
|
```
|
|
440
428
|
|
|
441
|
-
_See code: [src/commands/create.js](https://github.com/apify/apify-cli/blob/v0.19.
|
|
429
|
+
_See code: [src/commands/create.js](https://github.com/apify/apify-cli/blob/v0.19.4/src/commands/create.js)_
|
|
442
430
|
|
|
443
431
|
## `apify info`
|
|
444
432
|
|
|
@@ -449,39 +437,34 @@ USAGE
|
|
|
449
437
|
$ apify info
|
|
450
438
|
|
|
451
439
|
DESCRIPTION
|
|
452
|
-
Displays information about the currently active Apify account.
|
|
453
440
|
The information is printed to the console.
|
|
454
441
|
```
|
|
455
442
|
|
|
456
|
-
_See code: [src/commands/info.js](https://github.com/apify/apify-cli/blob/v0.19.
|
|
443
|
+
_See code: [src/commands/info.js](https://github.com/apify/apify-cli/blob/v0.19.4/src/commands/info.js)_
|
|
457
444
|
|
|
458
445
|
## `apify init [ACTORNAME]`
|
|
459
446
|
|
|
460
|
-
Initializes a new
|
|
447
|
+
Initializes a new actor project in an existing directory.
|
|
461
448
|
|
|
462
449
|
```
|
|
463
450
|
USAGE
|
|
464
|
-
$ apify init [ACTORNAME]
|
|
451
|
+
$ apify init [ACTORNAME]
|
|
465
452
|
|
|
466
453
|
ARGUMENTS
|
|
467
|
-
ACTORNAME Name of the
|
|
454
|
+
ACTORNAME Name of the actor. If not provided, you will be prompted for it.
|
|
468
455
|
|
|
469
|
-
|
|
456
|
+
OPTIONS
|
|
470
457
|
-y, --yes Automatic yes to prompts; assume "yes" as answer to all prompts. Note that in some cases, the command may
|
|
471
458
|
still ask for confirmation.
|
|
472
459
|
|
|
473
460
|
DESCRIPTION
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
your scrapers without changes.
|
|
477
|
-
|
|
478
|
-
The command creates the ".actor/actor.json" file and the "storage" directory in the current directory, but does not
|
|
479
|
-
touch any other existing files or directories.
|
|
461
|
+
The command only creates the ".actor/actor.json" file and the "storage" directory in the current directory, but will
|
|
462
|
+
not touch anything else.
|
|
480
463
|
|
|
481
464
|
WARNING: The directory at "storage" will be overwritten if it already exists.
|
|
482
465
|
```
|
|
483
466
|
|
|
484
|
-
_See code: [src/commands/init.js](https://github.com/apify/apify-cli/blob/v0.19.
|
|
467
|
+
_See code: [src/commands/init.js](https://github.com/apify/apify-cli/blob/v0.19.4/src/commands/init.js)_
|
|
485
468
|
|
|
486
469
|
## `apify login`
|
|
487
470
|
|
|
@@ -489,18 +472,17 @@ Logs in to your Apify account using a provided API token.
|
|
|
489
472
|
|
|
490
473
|
```
|
|
491
474
|
USAGE
|
|
492
|
-
$ apify login
|
|
475
|
+
$ apify login
|
|
493
476
|
|
|
494
|
-
|
|
495
|
-
-t, --token
|
|
477
|
+
OPTIONS
|
|
478
|
+
-t, --token=token [Optional] Apify API token
|
|
496
479
|
|
|
497
480
|
DESCRIPTION
|
|
498
|
-
|
|
499
|
-
The API token and other account information is stored in the ~/.apify directory, from where it is read by all other
|
|
481
|
+
The API token and other account information is stored in the ~/.apify directory, from where it is read by all other
|
|
500
482
|
"apify" commands. To log out, call "apify logout".
|
|
501
483
|
```
|
|
502
484
|
|
|
503
|
-
_See code: [src/commands/login.js](https://github.com/apify/apify-cli/blob/v0.19.
|
|
485
|
+
_See code: [src/commands/login.js](https://github.com/apify/apify-cli/blob/v0.19.4/src/commands/login.js)_
|
|
504
486
|
|
|
505
487
|
## `apify logout`
|
|
506
488
|
|
|
@@ -511,12 +493,11 @@ USAGE
|
|
|
511
493
|
$ apify logout
|
|
512
494
|
|
|
513
495
|
DESCRIPTION
|
|
514
|
-
Logs out of your Apify account.
|
|
515
496
|
The command deletes the API token and all other account information stored in the ~/.apify directory. To log in again,
|
|
516
|
-
|
|
497
|
+
call "apify login".
|
|
517
498
|
```
|
|
518
499
|
|
|
519
|
-
_See code: [src/commands/logout.js](https://github.com/apify/apify-cli/blob/v0.19.
|
|
500
|
+
_See code: [src/commands/logout.js](https://github.com/apify/apify-cli/blob/v0.19.4/src/commands/logout.js)_
|
|
520
501
|
|
|
521
502
|
## `apify pull [ACTORID]`
|
|
522
503
|
|
|
@@ -524,21 +505,17 @@ Pulls an Actor from the Apify platform to the current directory. If it is define
|
|
|
524
505
|
|
|
525
506
|
```
|
|
526
507
|
USAGE
|
|
527
|
-
$ apify pull [ACTORID]
|
|
508
|
+
$ apify pull [ACTORID]
|
|
528
509
|
|
|
529
510
|
ARGUMENTS
|
|
530
511
|
ACTORID Name or ID of the actor to run (e.g. "apify/hello-world" or "E2jjCZBezvAZnX8Rb"). If not provided, the
|
|
531
512
|
command will update the Actor in the current directory based on its name in ".actor/actor.json" file.
|
|
532
513
|
|
|
533
|
-
|
|
534
|
-
-v, --version
|
|
535
|
-
|
|
536
|
-
DESCRIPTION
|
|
537
|
-
Pulls an Actor from the Apify platform to the current directory. If it is defined as Git repository, it will be
|
|
538
|
-
cloned. If it is defined as Web IDE, it will fetch the files.
|
|
514
|
+
OPTIONS
|
|
515
|
+
-v, --version=version Actor version number which will be pulled, e.g. 1.2. Default: the highest version
|
|
539
516
|
```
|
|
540
517
|
|
|
541
|
-
_See code: [src/commands/pull.js](https://github.com/apify/apify-cli/blob/v0.19.
|
|
518
|
+
_See code: [src/commands/pull.js](https://github.com/apify/apify-cli/blob/v0.19.4/src/commands/pull.js)_
|
|
542
519
|
|
|
543
520
|
## `apify push [ACTORID]`
|
|
544
521
|
|
|
@@ -546,92 +523,95 @@ Uploads the actor to the Apify platform and builds it there.
|
|
|
546
523
|
|
|
547
524
|
```
|
|
548
525
|
USAGE
|
|
549
|
-
$ apify push [ACTORID]
|
|
526
|
+
$ apify push [ACTORID]
|
|
550
527
|
|
|
551
528
|
ARGUMENTS
|
|
552
529
|
ACTORID Name or ID of the Actor to push (e.g. "apify/hello-world" or "E2jjCZBezvAZnX8Rb"). If not provided, the
|
|
553
530
|
command will create or modify the actor with the name specified in ".actor/actor.json" file.
|
|
554
531
|
|
|
555
|
-
|
|
556
|
-
-b, --build-tag
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
532
|
+
OPTIONS
|
|
533
|
+
-b, --build-tag=build-tag Build tag to be applied to the successful Actor build. By default, it is taken
|
|
534
|
+
from the ".actor/actor.json" file
|
|
535
|
+
|
|
536
|
+
-v, --version=version Actor version number to which the files should be pushed. By default, it is
|
|
537
|
+
taken from the ".actor/actor.json" file.
|
|
538
|
+
|
|
539
|
+
-w, --wait-for-finish=wait-for-finish Seconds for waiting to build to finish, if no value passed, it waits forever.
|
|
540
|
+
|
|
541
|
+
--no-prompt Do not prompt for opening the actor details in a browser. This will also not
|
|
542
|
+
open the browser automatically.
|
|
543
|
+
|
|
544
|
+
--version-number=version-number DEPRECATED: Use flag version instead. Actor version number to which the files
|
|
545
|
+
should be pushed. By default, it is taken from the ".actor/actor.json" file.
|
|
565
546
|
|
|
566
547
|
DESCRIPTION
|
|
567
|
-
|
|
568
|
-
The Actor settings are read from the ".actor/actor.json" file in the current directory, but they can be overridden
|
|
548
|
+
The Actor settings are read from the ".actor/actor.json" file in the current directory, but they can be overridden
|
|
569
549
|
using command-line options.
|
|
570
|
-
NOTE: If the source files are smaller than 3 MB then they are uploaded as
|
|
550
|
+
NOTE: If the source files are smaller than 3 MB then they are uploaded as
|
|
571
551
|
"Multiple source files", otherwise they are uploaded as "Zip file".
|
|
572
552
|
|
|
573
553
|
WARNING: If the target Actor already exists in your Apify account, it will be overwritten!
|
|
574
554
|
```
|
|
575
555
|
|
|
576
|
-
_See code: [src/commands/push.js](https://github.com/apify/apify-cli/blob/v0.19.
|
|
556
|
+
_See code: [src/commands/push.js](https://github.com/apify/apify-cli/blob/v0.19.4/src/commands/push.js)_
|
|
577
557
|
|
|
578
558
|
## `apify run`
|
|
579
559
|
|
|
580
|
-
Runs the
|
|
560
|
+
Runs the actor locally in the current directory.
|
|
581
561
|
|
|
582
562
|
```
|
|
583
563
|
USAGE
|
|
584
|
-
$ apify run
|
|
564
|
+
$ apify run
|
|
585
565
|
|
|
586
|
-
|
|
566
|
+
OPTIONS
|
|
587
567
|
-p, --purge Shortcut that combines the --purge-queue, --purge-dataset and --purge-key-value-store
|
|
588
568
|
options.
|
|
569
|
+
|
|
589
570
|
--purge-dataset Deletes the local directory containing the default dataset before the run starts.
|
|
571
|
+
|
|
590
572
|
--purge-key-value-store Deletes all records from the default key-value store in the local directory before the run
|
|
591
573
|
starts, except for the "INPUT" key.
|
|
574
|
+
|
|
592
575
|
--purge-queue Deletes the local directory containing the default request queue before the run starts.
|
|
593
576
|
|
|
594
577
|
DESCRIPTION
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
stored in the "storage" directory, rather than on the Apify platform.
|
|
578
|
+
It sets various APIFY_XYZ environment variables in order to provide a working execution environment for the actor. For
|
|
579
|
+
example, this causes the actor input, as well as all other data in key-value stores, datasets or request queues to be
|
|
580
|
+
stored in the "storage" directory, rather than on the Apify platform.
|
|
599
581
|
|
|
600
|
-
NOTE: You can override the command's default behavior for Node.js actors by overriding the "start" script in the
|
|
582
|
+
NOTE: You can override the command's default behavior for Node.js actors by overriding the "start" script in the
|
|
601
583
|
package.json file. You can set up your own main file or environment variables by changing it.
|
|
602
584
|
```
|
|
603
585
|
|
|
604
|
-
_See code: [src/commands/run.js](https://github.com/apify/apify-cli/blob/v0.19.
|
|
586
|
+
_See code: [src/commands/run.js](https://github.com/apify/apify-cli/blob/v0.19.4/src/commands/run.js)_
|
|
605
587
|
|
|
606
588
|
## `apify secrets`
|
|
607
589
|
|
|
608
|
-
Manages secret values for
|
|
590
|
+
Manages secret values for actor environment variables.
|
|
609
591
|
|
|
610
592
|
```
|
|
611
593
|
USAGE
|
|
612
594
|
$ apify secrets
|
|
613
595
|
|
|
614
596
|
DESCRIPTION
|
|
615
|
-
Manages secret values for Actor environment variables.
|
|
616
|
-
|
|
617
597
|
Example:
|
|
618
598
|
$ apify secrets:add mySecret TopSecretValue123
|
|
619
599
|
|
|
620
|
-
Now the "mySecret" value can be used in an environment variable defined in ".actor/actor.json" file by adding the "@"
|
|
600
|
+
Now the "mySecret" value can be used in an environment variable defined in ".actor/actor.json" file by adding the "@"
|
|
621
601
|
prefix:
|
|
622
602
|
|
|
623
603
|
{
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
604
|
+
"actorSpecification": 1,
|
|
605
|
+
"name": "my_actor",
|
|
606
|
+
"environmentVariables": { "SECRET_ENV_VAR": "@mySecret" },
|
|
607
|
+
"version": "0.1
|
|
628
608
|
}
|
|
629
609
|
|
|
630
610
|
When the actor is pushed to Apify cloud, the "SECRET_ENV_VAR" and its value is stored as a secret environment variable
|
|
631
|
-
|
|
611
|
+
of the actor.
|
|
632
612
|
```
|
|
633
613
|
|
|
634
|
-
_See code: [src/commands/secrets/index.js](https://github.com/apify/apify-cli/blob/v0.19.
|
|
614
|
+
_See code: [src/commands/secrets/index.js](https://github.com/apify/apify-cli/blob/v0.19.4/src/commands/secrets/index.js)_
|
|
635
615
|
|
|
636
616
|
## `apify secrets:add NAME VALUE`
|
|
637
617
|
|
|
@@ -646,11 +626,10 @@ ARGUMENTS
|
|
|
646
626
|
VALUE Value of the secret
|
|
647
627
|
|
|
648
628
|
DESCRIPTION
|
|
649
|
-
Adds a new secret value.
|
|
650
629
|
The secrets are stored to a file at ~/.apify
|
|
651
630
|
```
|
|
652
631
|
|
|
653
|
-
_See code: [src/commands/secrets/add.js](https://github.com/apify/apify-cli/blob/v0.19.
|
|
632
|
+
_See code: [src/commands/secrets/add.js](https://github.com/apify/apify-cli/blob/v0.19.4/src/commands/secrets/add.js)_
|
|
654
633
|
|
|
655
634
|
## `apify secrets:rm NAME`
|
|
656
635
|
|
|
@@ -662,12 +641,9 @@ USAGE
|
|
|
662
641
|
|
|
663
642
|
ARGUMENTS
|
|
664
643
|
NAME Name of the secret
|
|
665
|
-
|
|
666
|
-
DESCRIPTION
|
|
667
|
-
Removes the secret.
|
|
668
644
|
```
|
|
669
645
|
|
|
670
|
-
_See code: [src/commands/secrets/rm.js](https://github.com/apify/apify-cli/blob/v0.19.
|
|
646
|
+
_See code: [src/commands/secrets/rm.js](https://github.com/apify/apify-cli/blob/v0.19.4/src/commands/secrets/rm.js)_
|
|
671
647
|
|
|
672
648
|
## `apify vis [PATH]`
|
|
673
649
|
|
|
@@ -681,8 +657,7 @@ ARGUMENTS
|
|
|
681
657
|
PATH Optional path to your INPUT_SCHEMA.json file. If not provided ./INPUT_SCHEMA.json is used.
|
|
682
658
|
|
|
683
659
|
DESCRIPTION
|
|
684
|
-
|
|
685
|
-
The input schema for the Actor is used from these locations in order of preference.
|
|
660
|
+
The input schema for the actor is used from these locations in order of preference.
|
|
686
661
|
The first one found is validated as it would be the one used on the Apify platform.
|
|
687
662
|
1. Directly embedded object in ".actor/actor.json" under 'input' key
|
|
688
663
|
2. Path to JSON file referenced in ".actor/actor.json" under 'input' key
|
|
@@ -692,5 +667,5 @@ DESCRIPTION
|
|
|
692
667
|
You can also pass any custom path to your input schema to have it validated instead.
|
|
693
668
|
```
|
|
694
669
|
|
|
695
|
-
_See code: [src/commands/vis.js](https://github.com/apify/apify-cli/blob/v0.19.
|
|
670
|
+
_See code: [src/commands/vis.js](https://github.com/apify/apify-cli/blob/v0.19.4/src/commands/vis.js)_
|
|
696
671
|
<!-- commandsstop -->
|
package/oclif.manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"0.19.3","commands":{"call":{"id":"call","description":"Runs a specific actor remotely on the Apify cloud platform.\nThe Actor is run under your current Apify account. Therefore you need to be logged in by calling \"apify login\". It takes input for the Actor from the default local key-value store by default.","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{"build":{"name":"build","type":"option","char":"b","description":"Tag or number of the build to run (e.g. \"latest\" or \"1.2.34\").","required":false},"timeout":{"name":"timeout","type":"option","char":"t","description":"Timeout for the actor run in seconds. Zero value means there is no timeout.","required":false},"memory":{"name":"memory","type":"option","char":"m","description":"Amount of memory allocated for the actor run, in megabytes.","required":false},"wait-for-finish":{"name":"wait-for-finish","type":"option","char":"w","description":"Seconds for waiting to run to finish, if no value passed, it waits forever.","required":false}},"args":[{"name":"actorId","description":"Name or ID of the actor to run (e.g. \"apify/hello-world\" or \"E2jjCZBezvAZnX8Rb\"). If not provided, the command runs the remote actor specified in the \".actor/actor.json\" file.","required":false}]},"check-version":{"id":"check-version","description":"Checks that installed Apify CLI version is up to date.","pluginName":"apify-cli","pluginType":"core","hidden":true,"aliases":["cv"],"flags":{"enforce-update":{"name":"enforce-update","type":"boolean","char":"e","description":"[Optional] Enforce version update from NPM","required":false,"allowNo":false}},"args":[]},"create":{"id":"create","description":"Creates a new Actor project directory from a selected boilerplate template.","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{"template":{"name":"template","type":"option","char":"t","description":"Template for the Actor. If not provided, the command will prompt for it.\nVisit https://raw.githubusercontent.com/apify/actor-templates/master/templates/manifest.json to find available template names.","required":false},"skip-dependency-install":{"name":"skip-dependency-install","type":"boolean","description":"Skip installing Actor dependencies.","required":false,"allowNo":false},"template-archive-url":{"name":"template-archive-url","type":"option","description":"Actor template archive url. Useful for developing new templates.","hidden":true,"required":false}},"args":[{"name":"actorName","description":"Name of the Actor and its directory","required":false}]},"edit-input-schema":{"id":"edit-input-schema","description":"Lets you edit your input schema that would be used on the platform in a visual input schema editor.","pluginName":"apify-cli","pluginType":"core","hidden":true,"aliases":["eis"],"flags":{},"args":[{"name":"path","description":"Optional path to your INPUT_SCHEMA.json file. If not provided default platform location for input schema is used.","required":false}]},"info":{"id":"info","description":"Displays information about the currently active Apify account.\nThe information is printed to the console.","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"init-wrap-scrapy":{"id":"init-wrap-scrapy","description":"Wraps your existing Scrapy project to work like an Apify Actor.\n\nIt adds the following features:\n- Automatic retry of failed requests\n- Automatic proxy rotation\n- Automatic user agent rotation\n...\n","pluginName":"apify-cli","pluginType":"core","hidden":true,"aliases":[],"flags":{},"args":[{"name":"path","description":"Optional path to your scrapy project. If not provided, the current directory is used.","required":false}]},"init":{"id":"init","description":"Initializes a new Actor project in an existing directory.\nIf the directory contains a Scrapy project in Python, the command automatically creates wrappers so that you can run your scrapers without changes.\n\nThe command creates the \".actor/actor.json\" file and the \"storage\" directory in the current directory, but does not touch any other existing files or directories.\n\nWARNING: The directory at \"storage\" will be overwritten if it already exists.","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{"yes":{"name":"yes","type":"boolean","char":"y","description":"Automatic yes to prompts; assume \"yes\" as answer to all prompts. Note that in some cases, the command may still ask for confirmation.","required":false,"allowNo":false}},"args":[{"name":"actorName","description":"Name of the Actor. If not provided, you will be prompted for it.","required":false}]},"login-new":{"id":"login-new","description":"Logs in to your Apify account using your API token.\nThe API token and other account information is stored in the ~/.apify directory, from where it is read by all other \"apify\" commands. To log out, call \"apify logout\".","pluginName":"apify-cli","pluginType":"core","hidden":true,"aliases":[],"flags":{"token":{"name":"token","type":"option","char":"t","description":"[Optional] Apify API token","required":false}},"args":[]},"login":{"id":"login","description":"Logs in to your Apify account using a provided API token.\nThe API token and other account information is stored in the ~/.apify directory, from where it is read by all other \"apify\" commands. To log out, call \"apify logout\".","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{"token":{"name":"token","type":"option","char":"t","description":"[Optional] Apify API token","required":false}},"args":[]},"logout":{"id":"logout","description":"Logs out of your Apify account.\nThe command deletes the API token and all other account information stored in the ~/.apify directory. To log in again, call \"apify login\".","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"pull":{"id":"pull","description":"Pulls an Actor from the Apify platform to the current directory. If it is defined as Git repository, it will be cloned. If it is defined as Web IDE, it will fetch the files.","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{"version":{"name":"version","type":"option","char":"v","description":"Actor version number which will be pulled, e.g. 1.2. Default: the highest version","required":false}},"args":[{"name":"actorId","description":"Name or ID of the actor to run (e.g. \"apify/hello-world\" or \"E2jjCZBezvAZnX8Rb\"). If not provided, the command will update the Actor in the current directory based on its name in \".actor/actor.json\" file.","required":false}]},"push":{"id":"push","description":"Uploads the actor to the Apify platform and builds it there.\nThe Actor settings are read from the \".actor/actor.json\" file in the current directory, but they can be overridden using command-line options.\nNOTE: If the source files are smaller than 3 MB then they are uploaded as \n\"Multiple source files\", otherwise they are uploaded as \"Zip file\".\n\nWARNING: If the target Actor already exists in your Apify account, it will be overwritten!","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{"version-number":{"name":"version-number","type":"option","description":"DEPRECATED: Use flag version instead. Actor version number to which the files should be pushed. By default, it is taken from the \".actor/actor.json\" file.","required":false},"version":{"name":"version","type":"option","char":"v","description":"Actor version number to which the files should be pushed. By default, it is taken from the \".actor/actor.json\" file.","required":false},"build-tag":{"name":"build-tag","type":"option","char":"b","description":"Build tag to be applied to the successful Actor build. By default, it is taken from the \".actor/actor.json\" file","required":false},"wait-for-finish":{"name":"wait-for-finish","type":"option","char":"w","description":"Seconds for waiting to build to finish, if no value passed, it waits forever.","required":false},"no-prompt":{"name":"no-prompt","type":"boolean","description":"Do not prompt for opening the actor details in a browser. This will also not open the browser automatically.","required":false,"allowNo":false}},"args":[{"name":"actorId","description":"Name or ID of the Actor to push (e.g. \"apify/hello-world\" or \"E2jjCZBezvAZnX8Rb\"). If not provided, the command will create or modify the actor with the name specified in \".actor/actor.json\" file.","required":false}]},"run":{"id":"run","description":"Runs the Actor locally in the current directory.\nIt sets various APIFY_XYZ environment variables in order to provide a working execution environment for the Actor. For example, this causes the Actor input, as well as all other data in key-value stores, datasets or request queues to be stored in the \"storage\" directory, rather than on the Apify platform.\n\nNOTE: You can override the command's default behavior for Node.js actors by overriding the \"start\" script in the package.json file. You can set up your own main file or environment variables by changing it.","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{"purge":{"name":"purge","type":"boolean","char":"p","description":"Shortcut that combines the --purge-queue, --purge-dataset and --purge-key-value-store options.","required":false,"allowNo":false},"purge-queue":{"name":"purge-queue","type":"boolean","description":"Deletes the local directory containing the default request queue before the run starts.","required":false,"allowNo":false},"purge-dataset":{"name":"purge-dataset","type":"boolean","description":"Deletes the local directory containing the default dataset before the run starts.","required":false,"allowNo":false},"purge-key-value-store":{"name":"purge-key-value-store","type":"boolean","description":"Deletes all records from the default key-value store in the local directory before the run starts, except for the \"INPUT\" key.","required":false,"allowNo":false}},"args":[]},"vis":{"id":"vis","description":"Validates input schema and prints errors found.\nThe input schema for the Actor is used from these locations in order of preference.\nThe first one found is validated as it would be the one used on the Apify platform.\n1. Directly embedded object in \".actor/actor.json\" under 'input' key\n2. Path to JSON file referenced in \".actor/actor.json\" under 'input' key\n3. JSON file at .actor/INPUT_SCHEMA.json\n4. JSON file at INPUT_SCHEMA.json\n\nYou can also pass any custom path to your input schema to have it validated instead.\n","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"path","description":"Optional path to your INPUT_SCHEMA.json file. If not provided ./INPUT_SCHEMA.json is used.","required":false}]},"actor:get-input":{"id":"actor:get-input","description":"Gets the actor input value from the default key-value store associated with the actor run.","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"actor:get-value":{"id":"actor:get-value","description":"Gets a value from the default key-value store associated with the actor run.","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"key","description":"Key of the record in key-value store","required":true}]},"actor":{"id":"actor","description":"Commands are designed to be used in Actor runs. All commands are in PoC state, do not use in production environments.\n","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"actor:push-data":{"id":"actor:push-data","description":"Stores an object or an array of objects to the default dataset of the actor run.\nIt is possible to pass data using item argument or stdin.\nPassing data using argument:\n$ apify actor:push-data {\"foo\": \"bar\"}\nPassing data using stdin with pipe:\n$ cat ./test.json | apify actor:push-data\n","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"item","description":"JSON string with one object or array of objects containing data to be stored in the default dataset.","required":false}]},"actor:set-value":{"id":"actor:set-value","description":"Sets or removes record into the default key-value store associated with the Actor run.\nIt is possible to pass data using argument or stdin.\nPassing data using argument:\n$ apify actor:set-value KEY my-value\nPassing data using stdin with pipe:\n$ cat ./my-text-file.txt | apify actor:set-value KEY --contentType text/plain\n","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{"contentType":{"name":"contentType","type":"option","char":"c","description":"Specifies a custom MIME content type of the record. By default \"application/json\" is used.","required":false}},"args":[{"name":"key","description":"Key of the record in key-value store.","required":true},{"name":"value","description":"Record data, which can be one of the following values:\n- If empty, the record in the key-value store is deleted.\n- If no `contentType` flag is specified, value is expected to be any JSON string value.\n- If options.contentType is set, value is taken as is.","required":false}]},"secrets:add":{"id":"secrets:add","description":"Adds a new secret value.\nThe secrets are stored to a file at ~/.apify","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"name","description":"Name of the secret","required":true},{"name":"value","description":"Value of the secret","required":true}]},"secrets":{"id":"secrets","description":"Manages secret values for Actor environment variables.\n\nExample:\n$ apify secrets:add mySecret TopSecretValue123\n\nNow the \"mySecret\" value can be used in an environment variable defined in \".actor/actor.json\" file by adding the \"@\" prefix:\n\n{\n \"actorSpecification\": 1,\n \"name\": \"my_actor\",\n \"environmentVariables\": { \"SECRET_ENV_VAR\": \"@mySecret\" },\n \"version\": \"0.1\n}\n\nWhen the actor is pushed to Apify cloud, the \"SECRET_ENV_VAR\" and its value is stored as a secret environment variable of the actor.","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"secrets:rm":{"id":"secrets:rm","description":"Removes the secret.","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"name","description":"Name of the secret","required":true}]}}}
|
|
1
|
+
{"version":"0.19.4","commands":{"call":{"id":"call","description":"Runs a specific actor remotely on the Apify cloud platform.\nThe Actor is run under your current Apify account. Therefore you need to be logged in by calling \"apify login\". It takes input for the Actor from the default local key-value store by default.","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{"build":{"name":"build","type":"option","char":"b","description":"Tag or number of the build to run (e.g. \"latest\" or \"1.2.34\").","required":false},"timeout":{"name":"timeout","type":"option","char":"t","description":"Timeout for the actor run in seconds. Zero value means there is no timeout.","required":false},"memory":{"name":"memory","type":"option","char":"m","description":"Amount of memory allocated for the actor run, in megabytes.","required":false},"wait-for-finish":{"name":"wait-for-finish","type":"option","char":"w","description":"Seconds for waiting to run to finish, if no value passed, it waits forever.","required":false}},"args":[{"name":"actId","description":"Name or ID of the actor to run (e.g. \"apify/hello-world\" or \"E2jjCZBezvAZnX8Rb\"). If not provided, the command runs the remote actor specified in the \".actor/actor.json\" file.","required":false}]},"check-version":{"id":"check-version","description":"Checks that installed Apify CLI version is up to date.","pluginName":"apify-cli","pluginType":"core","hidden":true,"aliases":["cv"],"flags":{"enforce-update":{"name":"enforce-update","type":"boolean","char":"e","description":"[Optional] Enforce version update from NPM","required":false,"allowNo":false}},"args":[]},"create":{"id":"create","description":"Creates a new actor project directory from a selected boilerplate template.","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{"template":{"name":"template","type":"option","char":"t","description":"Template for the actor. If not provided, the command will prompt for it.\nVisit https://raw.githubusercontent.com/apify/actor-templates/master/templates/manifest.json to find available template names.","required":false},"skip-dependency-install":{"name":"skip-dependency-install","type":"boolean","description":"Skip installing actor dependencies.","required":false,"allowNo":false},"template-archive-url":{"name":"template-archive-url","type":"option","description":"Actor template archive url. Useful for developing new templates.","hidden":true,"required":false}},"args":[{"name":"actorName","description":"Name of the actor and its directory","required":false}]},"edit-input-schema":{"id":"edit-input-schema","description":"Lets you edit your input schema that would be used on the platform in a visual input schema editor.","pluginName":"apify-cli","pluginType":"core","hidden":true,"aliases":["eis"],"flags":{},"args":[{"name":"path","description":"Optional path to your INPUT_SCHEMA.json file. If not provided default platform location for input schema is used.","required":false}]},"info":{"id":"info","description":"Displays information about the currently active Apify account.\nThe information is printed to the console.","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"init-wrap-scrapy":{"id":"init-wrap-scrapy","description":"Wraps your existing Scrapy project to work like an Apify Actor.\n\nIt adds the following features:\n- Automatic retry of failed requests\n- Automatic proxy rotation\n- Automatic user agent rotation\n...\n","pluginName":"apify-cli","pluginType":"core","hidden":true,"aliases":[],"flags":{},"args":[{"name":"path","description":"Optional path to your scrapy project. If not provided, the current directory is used.","required":false}]},"init":{"id":"init","description":"Initializes a new actor project in an existing directory.\nThe command only creates the \".actor/actor.json\" file and the \"storage\" directory in the current directory, but will not touch anything else.\n\nWARNING: The directory at \"storage\" will be overwritten if it already exists.","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{"yes":{"name":"yes","type":"boolean","char":"y","description":"Automatic yes to prompts; assume \"yes\" as answer to all prompts. Note that in some cases, the command may still ask for confirmation.","required":false,"allowNo":false}},"args":[{"name":"actorName","description":"Name of the actor. If not provided, you will be prompted for it.","required":false}]},"login-new":{"id":"login-new","description":"Logs in to your Apify account using your API token.\nThe API token and other account information is stored in the ~/.apify directory, from where it is read by all other \"apify\" commands. To log out, call \"apify logout\".","pluginName":"apify-cli","pluginType":"core","hidden":true,"aliases":[],"flags":{"token":{"name":"token","type":"option","char":"t","description":"[Optional] Apify API token","required":false}},"args":[]},"login":{"id":"login","description":"Logs in to your Apify account using a provided API token.\nThe API token and other account information is stored in the ~/.apify directory, from where it is read by all other \"apify\" commands. To log out, call \"apify logout\".","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{"token":{"name":"token","type":"option","char":"t","description":"[Optional] Apify API token","required":false}},"args":[]},"logout":{"id":"logout","description":"Logs out of your Apify account.\nThe command deletes the API token and all other account information stored in the ~/.apify directory. To log in again, call \"apify login\".","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"pull":{"id":"pull","description":"Pulls an Actor from the Apify platform to the current directory. If it is defined as Git repository, it will be cloned. If it is defined as Web IDE, it will fetch the files.","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{"version":{"name":"version","type":"option","char":"v","description":"Actor version number which will be pulled, e.g. 1.2. Default: the highest version","required":false}},"args":[{"name":"actorId","description":"Name or ID of the actor to run (e.g. \"apify/hello-world\" or \"E2jjCZBezvAZnX8Rb\"). If not provided, the command will update the Actor in the current directory based on its name in \".actor/actor.json\" file.","required":false}]},"push":{"id":"push","description":"Uploads the actor to the Apify platform and builds it there.\nThe Actor settings are read from the \".actor/actor.json\" file in the current directory, but they can be overridden using command-line options.\nNOTE: If the source files are smaller than 3 MB then they are uploaded as \n\"Multiple source files\", otherwise they are uploaded as \"Zip file\".\n\nWARNING: If the target Actor already exists in your Apify account, it will be overwritten!","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{"version-number":{"name":"version-number","type":"option","description":"DEPRECATED: Use flag version instead. Actor version number to which the files should be pushed. By default, it is taken from the \".actor/actor.json\" file.","required":false},"version":{"name":"version","type":"option","char":"v","description":"Actor version number to which the files should be pushed. By default, it is taken from the \".actor/actor.json\" file.","required":false},"build-tag":{"name":"build-tag","type":"option","char":"b","description":"Build tag to be applied to the successful Actor build. By default, it is taken from the \".actor/actor.json\" file","required":false},"wait-for-finish":{"name":"wait-for-finish","type":"option","char":"w","description":"Seconds for waiting to build to finish, if no value passed, it waits forever.","required":false},"no-prompt":{"name":"no-prompt","type":"boolean","description":"Do not prompt for opening the actor details in a browser. This will also not open the browser automatically.","required":false,"allowNo":false}},"args":[{"name":"actorId","description":"Name or ID of the Actor to push (e.g. \"apify/hello-world\" or \"E2jjCZBezvAZnX8Rb\"). If not provided, the command will create or modify the actor with the name specified in \".actor/actor.json\" file.","required":false}]},"run":{"id":"run","description":"Runs the actor locally in the current directory.\nIt sets various APIFY_XYZ environment variables in order to provide a working execution environment for the actor. For example, this causes the actor input, as well as all other data in key-value stores, datasets or request queues to be stored in the \"storage\" directory, rather than on the Apify platform.\n\nNOTE: You can override the command's default behavior for Node.js actors by overriding the \"start\" script in the package.json file. You can set up your own main file or environment variables by changing it.","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{"purge":{"name":"purge","type":"boolean","char":"p","description":"Shortcut that combines the --purge-queue, --purge-dataset and --purge-key-value-store options.","required":false,"allowNo":false},"purge-queue":{"name":"purge-queue","type":"boolean","description":"Deletes the local directory containing the default request queue before the run starts.","required":false,"allowNo":false},"purge-dataset":{"name":"purge-dataset","type":"boolean","description":"Deletes the local directory containing the default dataset before the run starts.","required":false,"allowNo":false},"purge-key-value-store":{"name":"purge-key-value-store","type":"boolean","description":"Deletes all records from the default key-value store in the local directory before the run starts, except for the \"INPUT\" key.","required":false,"allowNo":false}},"args":[]},"vis":{"id":"vis","description":"Validates input schema and prints errors found.\nThe input schema for the actor is used from these locations in order of preference.\nThe first one found is validated as it would be the one used on the Apify platform.\n1. Directly embedded object in \".actor/actor.json\" under 'input' key\n2. Path to JSON file referenced in \".actor/actor.json\" under 'input' key\n3. JSON file at .actor/INPUT_SCHEMA.json\n4. JSON file at INPUT_SCHEMA.json\n\nYou can also pass any custom path to your input schema to have it validated instead.\n","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"path","description":"Optional path to your INPUT_SCHEMA.json file. If not provided ./INPUT_SCHEMA.json is used.","required":false}]},"actor:get-input":{"id":"actor:get-input","description":"Gets the actor input value from the default key-value store associated with the actor run.","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"actor:get-value":{"id":"actor:get-value","description":"Gets a value from the default key-value store associated with the actor run.","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"key","description":"Key of the record in key-value store","required":true}]},"actor":{"id":"actor","description":"Commands are designed to be used in actor runs. All commands are in PoC state, do not use in production environments.\n","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"actor:push-data":{"id":"actor:push-data","description":"Stores an object or an array of objects to the default dataset of the actor run.\nIt is possible to pass data using item argument or stdin.\nPassing data using argument:\n$ apify actor:push-data {\"foo\": \"bar\"}\nPassing data using stdin with pipe:\n$ cat ./test.json | apify actor:push-data\n","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"item","description":"JSON string with one object or array of objects containing data to be stored in the default dataset.","required":false}]},"actor:set-value":{"id":"actor:set-value","description":"Sets or removes record into the default KeyValueStore associated with the actor run.\nIt is possible to pass data using argument or stdin.\nPassing data using argument:\n$ apify actor:set-value KEY my-value\nPassing data using stdin with pipe:\n$ cat ./my-text-file.txt | apify actor:set-value KEY --contentType text/plain\n","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{"contentType":{"name":"contentType","type":"option","char":"c","description":"Specifies a custom MIME content type of the record. By default \"application/json\" is used.","required":false}},"args":[{"name":"key","description":"Key of the record in key-value store.","required":true},{"name":"value","description":"Record data, which can be one of the following values:\n- If empty, the record in the key-value store is deleted.\n- If no `contentType` flag is specified, value is expected to be any JSON string value.\n- If options.contentType is set, value is taken as is.","required":false}]},"secrets:add":{"id":"secrets:add","description":"Adds a new secret value.\nThe secrets are stored to a file at ~/.apify","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"name","description":"Name of the secret","required":true},{"name":"value","description":"Value of the secret","required":true}]},"secrets":{"id":"secrets","description":"Manages secret values for actor environment variables.\n\nExample:\n$ apify secrets:add mySecret TopSecretValue123\n\nNow the \"mySecret\" value can be used in an environment variable defined in \".actor/actor.json\" file by adding the \"@\" prefix:\n\n{\n \"actorSpecification\": 1,\n \"name\": \"my_actor\",\n \"environmentVariables\": { \"SECRET_ENV_VAR\": \"@mySecret\" },\n \"version\": \"0.1\n}\n\nWhen the actor is pushed to Apify cloud, the \"SECRET_ENV_VAR\" and its value is stored as a secret environment variable of the actor.","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"secrets:rm":{"id":"secrets:rm","description":"Removes the secret.","pluginName":"apify-cli","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"name","description":"Name of the secret","required":true}]}}}
|
package/package.json
CHANGED
|
@@ -1,116 +1,114 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
},
|
|
17
|
-
"files": [
|
|
18
|
-
"src",
|
|
19
|
-
"oclif.manifest.json",
|
|
20
|
-
"index.js",
|
|
21
|
-
"package.json"
|
|
22
|
-
],
|
|
23
|
-
"bin": {
|
|
24
|
-
"apify": "./src/bin/run"
|
|
25
|
-
},
|
|
26
|
-
"contributors": [
|
|
27
|
-
"Jakub Drobník <jakub.drobnik@apify.com>",
|
|
28
|
-
"Jan Curn <jan@apify.com>"
|
|
29
|
-
],
|
|
30
|
-
"repository": {
|
|
31
|
-
"type": "git",
|
|
32
|
-
"url": "git+https://github.com/apify/apify-cli.git"
|
|
33
|
-
},
|
|
34
|
-
"keywords": [
|
|
35
|
-
"apify",
|
|
36
|
-
"client",
|
|
37
|
-
"node",
|
|
38
|
-
"command",
|
|
39
|
-
"line",
|
|
40
|
-
"bash"
|
|
41
|
-
],
|
|
42
|
-
"author": {
|
|
43
|
-
"name": "Apify",
|
|
44
|
-
"email": "support@apify.com",
|
|
45
|
-
"url": "https://www.apify.com"
|
|
46
|
-
},
|
|
47
|
-
"license": "Apache-2.0",
|
|
48
|
-
"bugs": {
|
|
49
|
-
"url": "https://github.com/apify/apify-cli/issues"
|
|
50
|
-
},
|
|
51
|
-
"homepage": "https://github.com/apify/apify-cli#readme",
|
|
52
|
-
"engines": {
|
|
53
|
-
"node": ">=16.0.0"
|
|
54
|
-
},
|
|
55
|
-
"dependencies": {
|
|
56
|
-
"@apify/actor-templates": "^0.1.4",
|
|
57
|
-
"@apify/consts": "^2.23.0",
|
|
58
|
-
"@apify/input_schema": "^3.5.8",
|
|
59
|
-
"@apify/utilities": "^2.9.3",
|
|
60
|
-
"@crawlee/memory-storage": "^3.5.8",
|
|
61
|
-
"@oclif/command": "^1.8.36",
|
|
62
|
-
"@oclif/config": "^1.18.17",
|
|
63
|
-
"@oclif/core": "^2.15.0",
|
|
64
|
-
"@oclif/errors": "^1.3.6",
|
|
65
|
-
"@oclif/plugin-commands": "^2.1.0",
|
|
66
|
-
"@oclif/plugin-help": "^5.1.12",
|
|
67
|
-
"@root/walk": "^1.1.0",
|
|
68
|
-
"adm-zip": "^0.5.10",
|
|
69
|
-
"ajv": "^8.12.0",
|
|
70
|
-
"apify-client": "^2.9.0",
|
|
71
|
-
"archiver-promise": "^1.0.0",
|
|
72
|
-
"axios": "^1.6.7",
|
|
73
|
-
"chalk": "^4.1.2",
|
|
74
|
-
"computer-name": "^0.1.0",
|
|
75
|
-
"configparser": "^0.3.10",
|
|
76
|
-
"cors": "^2.8.5",
|
|
77
|
-
"detect-indent": "^6.1.0",
|
|
78
|
-
"escape-string-regexp": "^4.0.0",
|
|
79
|
-
"express": "^4.18.2",
|
|
80
|
-
"globby": "^11.1.0",
|
|
81
|
-
"handlebars": "^4.7.8",
|
|
82
|
-
"inquirer": "^7.3.3",
|
|
83
|
-
"is-ci": "^3.0.1",
|
|
84
|
-
"is-online": "^10.0.0",
|
|
85
|
-
"istextorbinary": "^8.0.0",
|
|
86
|
-
"jju": "^1.4.0",
|
|
87
|
-
"load-json-file": "^6.2.0",
|
|
88
|
-
"mime": "^3.0.0",
|
|
89
|
-
"mixpanel": "^0.18.0",
|
|
90
|
-
"open": "^8.4.0",
|
|
91
|
-
"ow": "^0.28.2",
|
|
92
|
-
"rimraf": "^3.0.2",
|
|
93
|
-
"semver": "^7.5.4",
|
|
94
|
-
"tiged": "^2.12.5",
|
|
95
|
-
"underscore": "^1.13.6",
|
|
96
|
-
"write-json-file": "^4.3.0"
|
|
97
|
-
},
|
|
98
|
-
"devDependencies": {
|
|
99
|
-
"@apify/eslint-config": "^0.4.0",
|
|
100
|
-
"@oclif/dev-cli": "^1.26.0",
|
|
101
|
-
"@oclif/test": "^2.1.0",
|
|
102
|
-
"cross-env": "^7.0.3",
|
|
103
|
-
"eslint": "^8.53.0",
|
|
104
|
-
"vitest": "^1.0.4"
|
|
105
|
-
},
|
|
106
|
-
"oclif": {
|
|
107
|
-
"bin": "apify",
|
|
108
|
-
"commands": "./src/commands",
|
|
109
|
-
"hooks": {
|
|
110
|
-
"init": [
|
|
111
|
-
"./src/hooks/init"
|
|
112
|
-
]
|
|
2
|
+
"name": "apify-cli",
|
|
3
|
+
"version": "0.19.4",
|
|
4
|
+
"description": "Apify command-line interface helps you create, develop, build and run Apify actors, and manage the Apify cloud platform.",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"test": "cross-env APIFY_CLI_SKIP_UPDATE_CHECK=1 vitest run",
|
|
8
|
+
"test-python": "cross-env APIFY_CLI_SKIP_UPDATE_CHECK=1 vitest run -t '.*\\[python\\]'",
|
|
9
|
+
"lint": "eslint src test",
|
|
10
|
+
"lint:fix": "eslint src test --fix",
|
|
11
|
+
"commands-md": "npm run manifest && oclif-dev readme",
|
|
12
|
+
"prepare-release": "npm run commands-md && npm run prod-shrinkwrap",
|
|
13
|
+
"prod-shrinkwrap": "rm -rf node_modules && npm install --production && npm shrinkwrap",
|
|
14
|
+
"manifest": "rm -f oclif.manifest.json && oclif-dev manifest",
|
|
15
|
+
"postinstall": "node \"./src/bin/run\" check-version && node ./src/lib/community"
|
|
113
16
|
},
|
|
114
|
-
"
|
|
115
|
-
|
|
17
|
+
"files": [
|
|
18
|
+
"src",
|
|
19
|
+
"oclif.manifest.json",
|
|
20
|
+
"index.js",
|
|
21
|
+
"package.json"
|
|
22
|
+
],
|
|
23
|
+
"bin": {
|
|
24
|
+
"apify": "./src/bin/run"
|
|
25
|
+
},
|
|
26
|
+
"contributors": [
|
|
27
|
+
"Jakub Drobník <jakub.drobnik@apify.com>",
|
|
28
|
+
"Jan Curn <jan@apify.com>"
|
|
29
|
+
],
|
|
30
|
+
"repository": {
|
|
31
|
+
"type": "git",
|
|
32
|
+
"url": "git+https://github.com/apify/apify-cli.git"
|
|
33
|
+
},
|
|
34
|
+
"keywords": [
|
|
35
|
+
"apify",
|
|
36
|
+
"client",
|
|
37
|
+
"node",
|
|
38
|
+
"command",
|
|
39
|
+
"line",
|
|
40
|
+
"bash"
|
|
41
|
+
],
|
|
42
|
+
"author": {
|
|
43
|
+
"name": "Apify",
|
|
44
|
+
"email": "support@apify.com",
|
|
45
|
+
"url": "https://www.apify.com"
|
|
46
|
+
},
|
|
47
|
+
"license": "Apache-2.0",
|
|
48
|
+
"bugs": {
|
|
49
|
+
"url": "https://github.com/apify/apify-cli/issues"
|
|
50
|
+
},
|
|
51
|
+
"homepage": "https://github.com/apify/apify-cli#readme",
|
|
52
|
+
"engines": {
|
|
53
|
+
"node": ">=16.0.0"
|
|
54
|
+
},
|
|
55
|
+
"dependencies": {
|
|
56
|
+
"@apify/actor-templates": "^0.1.4",
|
|
57
|
+
"@apify/consts": "^2.23.0",
|
|
58
|
+
"@apify/input_schema": "^3.5.8",
|
|
59
|
+
"@apify/utilities": "^2.9.3",
|
|
60
|
+
"@crawlee/memory-storage": "^3.5.8",
|
|
61
|
+
"@oclif/command": "^1.8.36",
|
|
62
|
+
"@oclif/config": "^1.18.17",
|
|
63
|
+
"@oclif/errors": "^1.3.6",
|
|
64
|
+
"@oclif/plugin-commands": "^2.1.0",
|
|
65
|
+
"@oclif/plugin-help": "^5.1.12",
|
|
66
|
+
"@root/walk": "^1.1.0",
|
|
67
|
+
"adm-zip": "^0.5.10",
|
|
68
|
+
"ajv": "^8.12.0",
|
|
69
|
+
"apify-client": "^2.9.0",
|
|
70
|
+
"archiver-promise": "^1.0.0",
|
|
71
|
+
"axios": "^1.6.7",
|
|
72
|
+
"chalk": "^4.1.2",
|
|
73
|
+
"computer-name": "^0.1.0",
|
|
74
|
+
"configparser": "^0.3.10",
|
|
75
|
+
"cors": "^2.8.5",
|
|
76
|
+
"detect-indent": "^6.1.0",
|
|
77
|
+
"escape-string-regexp": "^4.0.0",
|
|
78
|
+
"express": "^4.18.2",
|
|
79
|
+
"globby": "^11.1.0",
|
|
80
|
+
"handlebars": "^4.7.8",
|
|
81
|
+
"inquirer": "^7.3.3",
|
|
82
|
+
"is-ci": "^3.0.1",
|
|
83
|
+
"is-online": "^10.0.0",
|
|
84
|
+
"istextorbinary": "^8.0.0",
|
|
85
|
+
"jju": "^1.4.0",
|
|
86
|
+
"load-json-file": "^6.2.0",
|
|
87
|
+
"mime": "^3.0.0",
|
|
88
|
+
"mixpanel": "^0.18.0",
|
|
89
|
+
"open": "^8.4.0",
|
|
90
|
+
"ow": "^0.28.2",
|
|
91
|
+
"rimraf": "^3.0.2",
|
|
92
|
+
"semver": "^7.5.4",
|
|
93
|
+
"tiged": "^2.12.5",
|
|
94
|
+
"underscore": "^1.13.6",
|
|
95
|
+
"write-json-file": "^4.3.0"
|
|
96
|
+
},
|
|
97
|
+
"devDependencies": {
|
|
98
|
+
"@apify/eslint-config": "^0.4.0",
|
|
99
|
+
"@oclif/dev-cli": "^1.26.0",
|
|
100
|
+
"@oclif/test": "^2.1.0",
|
|
101
|
+
"cross-env": "^7.0.3",
|
|
102
|
+
"eslint": "^8.53.0",
|
|
103
|
+
"vitest": "^1.0.4"
|
|
104
|
+
},
|
|
105
|
+
"oclif": {
|
|
106
|
+
"bin": "apify",
|
|
107
|
+
"commands": "./src/commands",
|
|
108
|
+
"hooks": {
|
|
109
|
+
"init": [
|
|
110
|
+
"./src/hooks/init"
|
|
111
|
+
]
|
|
112
|
+
}
|
|
113
|
+
}
|
|
116
114
|
}
|
|
@@ -8,6 +8,6 @@ class ActorIndexCommand extends Command {
|
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
ActorIndexCommand.description = 'Commands are designed to be used in
|
|
11
|
+
ActorIndexCommand.description = 'Commands are designed to be used in actor runs. All commands are in PoC state, do not use in production environments.\n';
|
|
12
12
|
|
|
13
13
|
module.exports = ActorIndexCommand;
|
|
@@ -28,7 +28,7 @@ class SetValueCommand extends ApifyCommand {
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
SetValueCommand.description = 'Sets or removes record into the default
|
|
31
|
+
SetValueCommand.description = 'Sets or removes record into the default KeyValueStore associated with the actor run.\n'
|
|
32
32
|
+ 'It is possible to pass data using argument or stdin.\n'
|
|
33
33
|
+ 'Passing data using argument:\n'
|
|
34
34
|
+ '$ apify actor:set-value KEY my-value\n'
|
package/src/commands/call.js
CHANGED
|
@@ -21,11 +21,11 @@ class CallCommand extends ApifyCommand {
|
|
|
21
21
|
const userInfo = await getLocalUserInfo();
|
|
22
22
|
const usernameOrId = userInfo.username || userInfo.id;
|
|
23
23
|
|
|
24
|
-
const forceActorId = args.
|
|
24
|
+
const forceActorId = args.actId;
|
|
25
25
|
let actorId;
|
|
26
26
|
if (forceActorId) {
|
|
27
27
|
const actor = await apifyClient.actor(forceActorId).get();
|
|
28
|
-
if (!actor) throw new Error(`Cannot find
|
|
28
|
+
if (!actor) throw new Error(`Cannot find actor with ID '${forceActorId}' in your account.`);
|
|
29
29
|
actorId = actor.username ? `${actor.username}/${actor.name}` : actor.id;
|
|
30
30
|
} else {
|
|
31
31
|
actorId = `${usernameOrId}/${localConfig.name}`;
|
|
@@ -65,7 +65,7 @@ class CallCommand extends ApifyCommand {
|
|
|
65
65
|
}
|
|
66
66
|
} catch (err) {
|
|
67
67
|
// TODO: Better error message in apify-client-js
|
|
68
|
-
if (err.type === 'record-not-found') throw new Error(`Actor ${
|
|
68
|
+
if (err.type === 'record-not-found') throw new Error(`Actor ${runOpts.actId} not found!`);
|
|
69
69
|
else throw err;
|
|
70
70
|
}
|
|
71
71
|
|
|
@@ -121,7 +121,7 @@ CallCommand.flags = {
|
|
|
121
121
|
|
|
122
122
|
CallCommand.args = [
|
|
123
123
|
{
|
|
124
|
-
name: '
|
|
124
|
+
name: 'actId',
|
|
125
125
|
required: false,
|
|
126
126
|
description: 'Name or ID of the actor to run (e.g. "apify/hello-world" or "E2jjCZBezvAZnX8Rb"). '
|
|
127
127
|
+ `If not provided, the command runs the remote actor specified in the "${LOCAL_CONFIG_PATH}" file.`,
|
package/src/commands/create.js
CHANGED
|
@@ -71,8 +71,8 @@ class CreateCommand extends ApifyCommand {
|
|
|
71
71
|
fs.mkdirSync(actFolderDir);
|
|
72
72
|
} catch (err) {
|
|
73
73
|
if (err?.code === 'EEXIST') {
|
|
74
|
-
outputs.error(`Cannot create new
|
|
75
|
-
+ 'You can use "apify init" to create a local
|
|
74
|
+
outputs.error(`Cannot create new actor, directory '${actorName}' already exists. `
|
|
75
|
+
+ 'You can use "apify init" to create a local actor environment inside an existing directory.');
|
|
76
76
|
return;
|
|
77
77
|
}
|
|
78
78
|
throw err;
|
|
@@ -172,17 +172,17 @@ class CreateCommand extends ApifyCommand {
|
|
|
172
172
|
}
|
|
173
173
|
}
|
|
174
174
|
|
|
175
|
-
CreateCommand.description = 'Creates a new
|
|
175
|
+
CreateCommand.description = 'Creates a new actor project directory from a selected boilerplate template.';
|
|
176
176
|
|
|
177
177
|
CreateCommand.flags = {
|
|
178
178
|
template: flagsHelper.string({
|
|
179
179
|
char: 't',
|
|
180
|
-
description: 'Template for the
|
|
180
|
+
description: 'Template for the actor. If not provided, the command will prompt for it.\n'
|
|
181
181
|
+ `Visit ${actorTemplates.manifestUrl} to find available template names.`,
|
|
182
182
|
required: false,
|
|
183
183
|
}),
|
|
184
184
|
'skip-dependency-install': flagsHelper.boolean({
|
|
185
|
-
description: 'Skip installing
|
|
185
|
+
description: 'Skip installing actor dependencies.',
|
|
186
186
|
required: false,
|
|
187
187
|
}),
|
|
188
188
|
'template-archive-url': flagsHelper.string({
|
|
@@ -196,7 +196,7 @@ CreateCommand.args = [
|
|
|
196
196
|
{
|
|
197
197
|
name: 'actorName',
|
|
198
198
|
required: false,
|
|
199
|
-
description: 'Name of the
|
|
199
|
+
description: 'Name of the actor and its directory',
|
|
200
200
|
},
|
|
201
201
|
];
|
|
202
202
|
|
package/src/commands/init.js
CHANGED
|
@@ -55,21 +55,20 @@ class InitCommand extends ApifyCommand {
|
|
|
55
55
|
await setLocalEnv(cwd);
|
|
56
56
|
// Create prefilled INPUT.json file from the input schema prefills
|
|
57
57
|
await createPrefilledInputFileFromInputSchema(cwd);
|
|
58
|
-
outputs.success('The
|
|
58
|
+
outputs.success('The Apify actor has been initialized in the current directory.');
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
InitCommand.description = 'Initializes a new
|
|
63
|
-
+ `
|
|
64
|
-
+
|
|
65
|
-
+ 'but does not touch any other existing files or directories.\n\n'
|
|
62
|
+
InitCommand.description = 'Initializes a new actor project in an existing directory.\n'
|
|
63
|
+
+ `The command only creates the "${LOCAL_CONFIG_PATH}" file and the "${DEFAULT_LOCAL_STORAGE_DIR}" directory in the current directory, `
|
|
64
|
+
+ 'but will not touch anything else.\n\n'
|
|
66
65
|
+ `WARNING: The directory at "${DEFAULT_LOCAL_STORAGE_DIR}" will be overwritten if it already exists.`;
|
|
67
66
|
|
|
68
67
|
InitCommand.args = [
|
|
69
68
|
{
|
|
70
69
|
name: 'actorName',
|
|
71
70
|
required: false,
|
|
72
|
-
description: 'Name of the
|
|
71
|
+
description: 'Name of the actor. If not provided, you will be prompted for it.',
|
|
73
72
|
},
|
|
74
73
|
];
|
|
75
74
|
|
package/src/commands/push.js
CHANGED
|
@@ -60,7 +60,7 @@ class PushCommand extends ApifyCommand {
|
|
|
60
60
|
const forceActorId = args.actorId;
|
|
61
61
|
if (forceActorId) {
|
|
62
62
|
actor = await apifyClient.actor(forceActorId).get();
|
|
63
|
-
if (!actor) throw new Error(`Cannot find
|
|
63
|
+
if (!actor) throw new Error(`Cannot find actor with ID '${forceActorId}' in your account.`);
|
|
64
64
|
actorId = actor.id;
|
|
65
65
|
} else {
|
|
66
66
|
const usernameOrId = userInfo.username || userInfo.id;
|
package/src/commands/run.js
CHANGED
|
@@ -35,6 +35,7 @@ class RunCommand extends ApifyCommand {
|
|
|
35
35
|
const packageJsonExists = fs.existsSync(packageJsonPath);
|
|
36
36
|
const mainPyExists = fs.existsSync(mainPyPath);
|
|
37
37
|
const isScrapyProject = projectType === PROJECT_TYPES.SCRAPY;
|
|
38
|
+
const { language, languageVersion } = detectLocalActorLanguage();
|
|
38
39
|
|
|
39
40
|
if (!packageJsonExists && !mainPyExists && !isScrapyProject) {
|
|
40
41
|
throw new Error(
|
|
@@ -54,33 +55,35 @@ class RunCommand extends ApifyCommand {
|
|
|
54
55
|
// Purge stores
|
|
55
56
|
if (flags.purge) {
|
|
56
57
|
switch (projectType) {
|
|
57
|
-
case PROJECT_TYPES.CRAWLEE: {
|
|
58
|
-
CRAWLEE_PURGE_ON_START = '1';
|
|
59
|
-
break;
|
|
60
|
-
}
|
|
61
58
|
case PROJECT_TYPES.PRE_CRAWLEE_APIFY_SDK: {
|
|
62
59
|
await Promise.all([purgeDefaultQueue(), purgeDefaultKeyValueStore(), purgeDefaultDataset()]);
|
|
63
60
|
info('All default local stores were purged.');
|
|
64
61
|
break;
|
|
65
62
|
}
|
|
63
|
+
case PROJECT_TYPES.CRAWLEE:
|
|
66
64
|
default: {
|
|
67
|
-
|
|
65
|
+
CRAWLEE_PURGE_ON_START = '1';
|
|
68
66
|
}
|
|
69
67
|
}
|
|
68
|
+
|
|
69
|
+
if (language === LANGUAGE.PYTHON) {
|
|
70
|
+
await Promise.all([purgeDefaultQueue(), purgeDefaultKeyValueStore(), purgeDefaultDataset()]);
|
|
71
|
+
info('All default local stores were purged.');
|
|
72
|
+
}
|
|
70
73
|
}
|
|
71
74
|
|
|
72
75
|
// TODO: deprecate these flags
|
|
73
|
-
if (flags.purgeQueue) {
|
|
76
|
+
if (flags.purgeQueue && !flags.purge) {
|
|
74
77
|
await purgeDefaultQueue();
|
|
75
78
|
info('Default local request queue was purged.');
|
|
76
79
|
}
|
|
77
80
|
|
|
78
|
-
if (flags.purgeDataset) {
|
|
81
|
+
if (flags.purgeDataset && !flags.purge) {
|
|
79
82
|
await purgeDefaultDataset();
|
|
80
83
|
info('Default local dataset was purged.');
|
|
81
84
|
}
|
|
82
85
|
|
|
83
|
-
if (flags.purgeKeyValueStore) {
|
|
86
|
+
if (flags.purgeKeyValueStore && !flags.purge) {
|
|
84
87
|
await purgeDefaultKeyValueStore();
|
|
85
88
|
info('Default local key-value store was purged.');
|
|
86
89
|
}
|
|
@@ -88,7 +91,7 @@ class RunCommand extends ApifyCommand {
|
|
|
88
91
|
if (!flags.purge) {
|
|
89
92
|
const isStorageEmpty = await checkIfStorageIsEmpty();
|
|
90
93
|
if (!isStorageEmpty) {
|
|
91
|
-
warning('The storage directory contains a previous state, the
|
|
94
|
+
warning('The storage directory contains a previous state, the actor will continue where it left off. '
|
|
92
95
|
+ 'To start from the initial state, use --purge parameter to clean the storage directory.');
|
|
93
96
|
}
|
|
94
97
|
}
|
|
@@ -113,7 +116,6 @@ class RunCommand extends ApifyCommand {
|
|
|
113
116
|
warning('You are not logged in with your Apify Account. Some features like Apify Proxy will not work. Call "apify login" to fix that.');
|
|
114
117
|
}
|
|
115
118
|
|
|
116
|
-
const { language, languageVersion } = detectLocalActorLanguage();
|
|
117
119
|
if (language === LANGUAGE.NODEJS) { // Actor is written in Node.js
|
|
118
120
|
const currentNodeVersion = languageVersion;
|
|
119
121
|
const minimumSupportedNodeVersion = semver.minVersion(SUPPORTED_NODEJS_VERSION);
|
|
@@ -172,10 +174,10 @@ class RunCommand extends ApifyCommand {
|
|
|
172
174
|
|
|
173
175
|
// TODO: we should describe which env vars are set here:
|
|
174
176
|
|
|
175
|
-
RunCommand.description = 'Runs the
|
|
177
|
+
RunCommand.description = 'Runs the actor locally in the current directory.\n'
|
|
176
178
|
+ 'It sets various APIFY_XYZ environment variables '
|
|
177
|
-
+ 'in order to provide a working execution environment for the
|
|
178
|
-
+ 'the
|
|
179
|
+
+ 'in order to provide a working execution environment for the actor. For example, this causes '
|
|
180
|
+
+ 'the actor input, as well as all other data in key-value stores, '
|
|
179
181
|
+ `datasets or request queues to be stored in the "${DEFAULT_LOCAL_STORAGE_DIR}" directory, `
|
|
180
182
|
+ 'rather than on the Apify platform.\n\n'
|
|
181
183
|
+ 'NOTE: You can override the command\'s default behavior for Node.js actors by overriding the "start" script in the package.json file. '
|
|
@@ -9,7 +9,7 @@ class SecretsIndexCommand extends Command {
|
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
SecretsIndexCommand.description = 'Manages secret values for
|
|
12
|
+
SecretsIndexCommand.description = 'Manages secret values for actor environment variables.\n\n'
|
|
13
13
|
+ 'Example:\n'
|
|
14
14
|
+ '$ apify secrets:add mySecret TopSecretValue123\n\n'
|
|
15
15
|
+ `Now the "mySecret" value can be used in an environment variable defined in "${LOCAL_CONFIG_PATH}" file by adding the "@" prefix:\n\n`
|
package/src/commands/vis.js
CHANGED
|
@@ -29,7 +29,7 @@ class ValidateInputSchemaCommand extends ApifyCommand {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
ValidateInputSchemaCommand.description = `Validates input schema and prints errors found.
|
|
32
|
-
The input schema for the
|
|
32
|
+
The input schema for the actor is used from these locations in order of preference.
|
|
33
33
|
The first one found is validated as it would be the one used on the Apify platform.
|
|
34
34
|
1. Directly embedded object in "${LOCAL_CONFIG_PATH}" under 'input' key
|
|
35
35
|
2. Path to JSON file referenced in "${LOCAL_CONFIG_PATH}" under 'input' key
|
package/src/lib/create-utils.js
CHANGED
|
@@ -94,7 +94,7 @@ async function executePrompts(manifest) {
|
|
|
94
94
|
async function promptActorName() {
|
|
95
95
|
const answer = await inquirer.prompt([{
|
|
96
96
|
name: 'actorName',
|
|
97
|
-
message: 'Name of your new
|
|
97
|
+
message: 'Name of your new actor:',
|
|
98
98
|
type: 'input',
|
|
99
99
|
validate: (promptText) => {
|
|
100
100
|
try {
|
|
@@ -115,7 +115,7 @@ async function promptProgrammingLanguage() {
|
|
|
115
115
|
const answer = await inquirer.prompt([{
|
|
116
116
|
type: 'list',
|
|
117
117
|
name: 'programmingLanguage',
|
|
118
|
-
message: 'Choose the programming language of your new
|
|
118
|
+
message: 'Choose the programming language of your new actor:',
|
|
119
119
|
default: PROGRAMMING_LANGUAGES[0],
|
|
120
120
|
choices: PROGRAMMING_LANGUAGES,
|
|
121
121
|
loop: false,
|
|
@@ -149,7 +149,7 @@ async function promptTemplateDefinition(manifest, programmingLanguage) {
|
|
|
149
149
|
const answer = await inquirer.prompt([{
|
|
150
150
|
type: 'list',
|
|
151
151
|
name: 'templateDefinition',
|
|
152
|
-
message: 'Choose a template for your new
|
|
152
|
+
message: 'Choose a template for your new actor. Detailed information about the template will be shown in the next step.',
|
|
153
153
|
default: choices[0],
|
|
154
154
|
choices,
|
|
155
155
|
loop: false,
|
package/src/lib/utils.js
CHANGED
|
@@ -210,10 +210,10 @@ const getLocalConfigOrThrow = async () => {
|
|
|
210
210
|
name: 'isConfirm',
|
|
211
211
|
type: 'confirm',
|
|
212
212
|
|
|
213
|
-
message: `The new version of Apify CLI uses the "${LOCAL_CONFIG_PATH}" instead of the "apify.json" file. Since we have found both files in your
|
|
213
|
+
message: `The new version of Apify CLI uses the "${LOCAL_CONFIG_PATH}" instead of the "apify.json" file. Since we have found both files in your actor directory, "apify.json" will be renamed to "apify.json.deprecated". Going forward, all commands will use "${LOCAL_CONFIG_PATH}". You can read about the differences between the old and the new config at https://github.com/apify/apify-cli/blob/master/MIGRATIONS.md. Do you want to continue?`,
|
|
214
214
|
}]);
|
|
215
215
|
if (!answer.isConfirm) {
|
|
216
|
-
throw new Error('Command can not run with old "apify.json" file present in your
|
|
216
|
+
throw new Error('Command can not run with old "apify.json" file present in your actor directory., Please, either rename or remove it.');
|
|
217
217
|
}
|
|
218
218
|
try {
|
|
219
219
|
fs.renameSync(getDeprecatedLocalConfigPath(), `${getDeprecatedLocalConfigPath()}.deprecated`);
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
const { Help } = require('@oclif/core');
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Custom help class that overrides how oclif renders help screens.
|
|
5
|
-
*
|
|
6
|
-
* It is registered through package.json.
|
|
7
|
-
*
|
|
8
|
-
* Refer to the oclif documentation for more information:
|
|
9
|
-
* https://oclif.io/docs/help_classes/#custom-help
|
|
10
|
-
*
|
|
11
|
-
* Note: The CLI was crashing when printing help with the latest oclif packages. Be careful when upgrading.
|
|
12
|
-
*/
|
|
13
|
-
module.exports = class ApifyOclifHelp extends Help {
|
|
14
|
-
showRootHelp() {
|
|
15
|
-
super.showRootHelp();
|
|
16
|
-
|
|
17
|
-
this.log(this.section(
|
|
18
|
-
'TROUBLESHOOTING',
|
|
19
|
-
this.wrap(
|
|
20
|
-
'For general support, reach out to us at https://apify.com/contact\n\n'
|
|
21
|
-
+ 'If you believe you are encountering a bug, file it at https://github.com/apify/apify-cli/issues/new')));
|
|
22
|
-
}
|
|
23
|
-
};
|