apify-cli 0.19.4 → 0.20.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +200 -0
- package/README.md +273 -167
- package/bin/dev.cmd +3 -0
- package/bin/dev.js +21 -0
- package/bin/dev.sh +4 -0
- package/bin/run.js +23 -0
- package/dist/.tsbuildinfo +1 -0
- package/dist/commands/actor/get-input.d.ts +6 -0
- package/dist/commands/actor/get-input.d.ts.map +1 -0
- package/dist/commands/actor/get-input.js +14 -0
- package/dist/commands/actor/get-input.js.map +1 -0
- package/dist/commands/actor/get-value.d.ts +9 -0
- package/dist/commands/actor/get-value.d.ts.map +1 -0
- package/dist/commands/actor/get-value.js +27 -0
- package/dist/commands/actor/get-value.js.map +1 -0
- package/dist/commands/actor/index.d.ts +6 -0
- package/dist/commands/actor/index.d.ts.map +1 -0
- package/dist/commands/actor/index.js +13 -0
- package/dist/commands/actor/index.js.map +1 -0
- package/dist/commands/actor/push-data.d.ts +11 -0
- package/dist/commands/actor/push-data.d.ts.map +1 -0
- package/dist/commands/actor/push-data.js +56 -0
- package/dist/commands/actor/push-data.js.map +1 -0
- package/dist/commands/actor/set-value.d.ts +15 -0
- package/dist/commands/actor/set-value.d.ts.map +1 -0
- package/dist/commands/actor/set-value.js +76 -0
- package/dist/commands/actor/set-value.js.map +1 -0
- package/dist/commands/call.d.ts +19 -0
- package/dist/commands/call.d.ts.map +1 -0
- package/dist/commands/call.js +193 -0
- package/dist/commands/call.js.map +1 -0
- package/dist/commands/check-version.d.ts +11 -0
- package/dist/commands/check-version.d.ts.map +1 -0
- package/dist/commands/check-version.js +39 -0
- package/dist/commands/check-version.js.map +1 -0
- package/dist/commands/create.d.ts +15 -0
- package/dist/commands/create.d.ts.map +1 -0
- package/dist/commands/create.js +201 -0
- package/dist/commands/create.js.map +1 -0
- package/dist/commands/edit-input-schema.d.ts +11 -0
- package/dist/commands/edit-input-schema.d.ts.map +1 -0
- package/{src → dist}/commands/edit-input-schema.js +81 -85
- package/dist/commands/edit-input-schema.js.map +1 -0
- package/dist/commands/info.d.ts +6 -0
- package/dist/commands/info.d.ts.map +1 -0
- package/dist/commands/info.js +26 -0
- package/dist/commands/info.js.map +1 -0
- package/dist/commands/init-wrap-scrapy.d.ts +10 -0
- package/dist/commands/init-wrap-scrapy.d.ts.map +1 -0
- package/dist/commands/init-wrap-scrapy.js +41 -0
- package/dist/commands/init-wrap-scrapy.js.map +1 -0
- package/dist/commands/init.d.ts +12 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +88 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/login.d.ts +10 -0
- package/dist/commands/login.d.ts.map +1 -0
- package/dist/commands/login.js +174 -0
- package/dist/commands/login.js.map +1 -0
- package/dist/commands/logout.d.ts +6 -0
- package/dist/commands/logout.d.ts.map +1 -0
- package/dist/commands/logout.js +20 -0
- package/dist/commands/logout.js.map +1 -0
- package/dist/commands/pull.d.ts +12 -0
- package/dist/commands/pull.d.ts.map +1 -0
- package/dist/commands/pull.js +148 -0
- package/dist/commands/pull.js.map +1 -0
- package/dist/commands/push.d.ts +18 -0
- package/dist/commands/push.d.ts.map +1 -0
- package/dist/commands/push.js +298 -0
- package/dist/commands/push.js.map +1 -0
- package/dist/commands/run.d.ts +16 -0
- package/dist/commands/run.d.ts.map +1 -0
- package/dist/commands/run.js +383 -0
- package/dist/commands/run.js.map +1 -0
- package/dist/commands/secrets/add.d.ts +10 -0
- package/dist/commands/secrets/add.d.ts.map +1 -0
- package/dist/commands/secrets/add.js +31 -0
- package/dist/commands/secrets/add.js.map +1 -0
- package/dist/commands/secrets/index.d.ts +6 -0
- package/dist/commands/secrets/index.d.ts.map +1 -0
- package/dist/commands/secrets/index.js +24 -0
- package/dist/commands/secrets/index.js.map +1 -0
- package/dist/commands/secrets/rm.d.ts +9 -0
- package/dist/commands/secrets/rm.d.ts.map +1 -0
- package/dist/commands/secrets/rm.js +27 -0
- package/dist/commands/secrets/rm.js.map +1 -0
- 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/validate-schema.d.ts +10 -0
- package/dist/commands/validate-schema.d.ts.map +1 -0
- package/dist/commands/validate-schema.js +58 -0
- 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/hooks/init.d.ts +7 -0
- package/dist/hooks/init.d.ts.map +1 -0
- package/dist/hooks/init.js +17 -0
- package/dist/hooks/init.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/actor.d.ts +27 -0
- package/dist/lib/actor.d.ts.map +1 -0
- package/{src → dist}/lib/actor.js +22 -45
- package/dist/lib/actor.js.map +1 -0
- package/dist/lib/apify-oclif-help.d.ts +15 -0
- package/dist/lib/apify-oclif-help.d.ts.map +1 -0
- package/dist/lib/apify-oclif-help.js +19 -0
- package/dist/lib/apify-oclif-help.js.map +1 -0
- package/dist/lib/apify_command.d.ts +21 -0
- package/dist/lib/apify_command.d.ts.map +1 -0
- package/dist/lib/apify_command.js +104 -0
- package/dist/lib/apify_command.js.map +1 -0
- package/dist/lib/commands/resolve-input.d.ts +5 -0
- package/dist/lib/commands/resolve-input.d.ts.map +1 -0
- package/dist/lib/commands/resolve-input.js +29 -0
- package/dist/lib/commands/resolve-input.js.map +1 -0
- package/dist/lib/commands/run-on-cloud.d.ts +20 -0
- package/dist/lib/commands/run-on-cloud.d.ts.map +1 -0
- package/dist/lib/commands/run-on-cloud.js +89 -0
- package/dist/lib/commands/run-on-cloud.js.map +1 -0
- package/dist/lib/community.d.ts +2 -0
- package/dist/lib/community.d.ts.map +1 -0
- package/dist/lib/community.js +4 -0
- package/dist/lib/community.js.map +1 -0
- package/dist/lib/consts.d.ts +54 -0
- package/dist/lib/consts.d.ts.map +1 -0
- package/dist/lib/consts.js +65 -0
- package/dist/lib/consts.js.map +1 -0
- package/dist/lib/create-utils.d.ts +8 -0
- package/dist/lib/create-utils.d.ts.map +1 -0
- package/dist/lib/create-utils.js +148 -0
- package/dist/lib/create-utils.js.map +1 -0
- package/dist/lib/exec.d.ts +3 -0
- package/dist/lib/exec.d.ts.map +1 -0
- package/dist/lib/exec.js +40 -0
- package/dist/lib/exec.js.map +1 -0
- package/dist/lib/files.d.ts +14 -0
- package/dist/lib/files.d.ts.map +1 -0
- package/dist/lib/files.js +58 -0
- package/dist/lib/files.js.map +1 -0
- package/dist/lib/input_schema.d.ts +28 -0
- package/dist/lib/input_schema.d.ts.map +1 -0
- package/dist/lib/input_schema.js +126 -0
- package/dist/lib/input_schema.js.map +1 -0
- package/dist/lib/local_state.d.ts +11 -0
- package/dist/lib/local_state.d.ts.map +1 -0
- package/dist/lib/local_state.js +27 -0
- package/dist/lib/local_state.js.map +1 -0
- package/dist/lib/outputs.d.ts +19 -0
- package/dist/lib/outputs.d.ts.map +1 -0
- package/dist/lib/outputs.js +45 -0
- package/dist/lib/outputs.js.map +1 -0
- package/dist/lib/project_analyzer.d.ts +4 -0
- package/dist/lib/project_analyzer.d.ts.map +1 -0
- package/{src → dist}/lib/project_analyzer.js +6 -11
- package/dist/lib/project_analyzer.js.map +1 -0
- package/dist/lib/projects/CrawleeAnalyzer.d.ts +4 -0
- package/dist/lib/projects/CrawleeAnalyzer.d.ts.map +1 -0
- package/{src → dist}/lib/projects/CrawleeAnalyzer.js +7 -24
- package/dist/lib/projects/CrawleeAnalyzer.js.map +1 -0
- package/dist/lib/projects/OldApifySDKAnalyzer.d.ts +4 -0
- package/dist/lib/projects/OldApifySDKAnalyzer.d.ts.map +1 -0
- package/{src → dist}/lib/projects/OldApifySDKAnalyzer.js +9 -32
- package/dist/lib/projects/OldApifySDKAnalyzer.js.map +1 -0
- package/dist/lib/projects/scrapy/ScrapyProjectAnalyzer.d.ts +17 -0
- package/dist/lib/projects/scrapy/ScrapyProjectAnalyzer.d.ts.map +1 -0
- package/{src/lib/scrapy-wrapper → dist/lib/projects/scrapy}/ScrapyProjectAnalyzer.js +33 -36
- package/dist/lib/projects/scrapy/ScrapyProjectAnalyzer.js.map +1 -0
- package/dist/lib/projects/scrapy/Spider.d.ts +14 -0
- package/dist/lib/projects/scrapy/Spider.d.ts.map +1 -0
- package/dist/lib/projects/scrapy/Spider.js +33 -0
- package/dist/lib/projects/scrapy/Spider.js.map +1 -0
- package/dist/lib/projects/scrapy/SpiderFileAnalyzer.d.ts +7 -0
- package/dist/lib/projects/scrapy/SpiderFileAnalyzer.d.ts.map +1 -0
- package/dist/lib/projects/scrapy/SpiderFileAnalyzer.js +25 -0
- package/dist/lib/projects/scrapy/SpiderFileAnalyzer.js.map +1 -0
- package/dist/lib/projects/scrapy/wrapScrapyProject.d.ts +4 -0
- package/dist/lib/projects/scrapy/wrapScrapyProject.d.ts.map +1 -0
- package/{src/lib/scrapy-wrapper/index.js → dist/lib/projects/scrapy/wrapScrapyProject.js} +43 -73
- package/dist/lib/projects/scrapy/wrapScrapyProject.js.map +1 -0
- package/dist/lib/projects/shared.d.ts +2 -0
- package/dist/lib/projects/shared.d.ts.map +1 -0
- package/dist/lib/projects/shared.js +13 -0
- package/dist/lib/projects/shared.js.map +1 -0
- package/dist/lib/secrets.d.ts +22 -0
- package/dist/lib/secrets.d.ts.map +1 -0
- package/{src → dist}/lib/secrets.js +34 -42
- package/dist/lib/secrets.js.map +1 -0
- package/dist/lib/telemetry.d.ts +21 -0
- package/dist/lib/telemetry.d.ts.map +1 -0
- package/dist/lib/telemetry.js +87 -0
- package/dist/lib/telemetry.js.map +1 -0
- package/dist/lib/types.d.ts +11 -0
- package/dist/lib/types.d.ts.map +1 -0
- package/dist/lib/types.js +2 -0
- package/dist/lib/types.js.map +1 -0
- package/dist/lib/utils.d.ts +102 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +577 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/lib/version_check.d.ts +14 -0
- package/dist/lib/version_check.d.ts.map +1 -0
- package/{src → dist}/lib/version_check.js +31 -60
- package/dist/lib/version_check.js.map +1 -0
- package/oclif.manifest.json +867 -1
- package/package.json +151 -109
- package/index.js +0 -1
- package/src/bin/run +0 -16
- package/src/commands/actor/get-input.js +0 -12
- package/src/commands/actor/get-value.js +0 -23
- package/src/commands/actor/index.js +0 -13
- package/src/commands/actor/push-data.js +0 -44
- package/src/commands/actor/set-value.js +0 -63
- package/src/commands/call.js +0 -131
- package/src/commands/check-version.js +0 -28
- package/src/commands/create.js +0 -203
- package/src/commands/info.js +0 -24
- package/src/commands/init-wrap-scrapy.js +0 -34
- package/src/commands/init.js +0 -83
- package/src/commands/login-new.js +0 -169
- package/src/commands/login.js +0 -40
- package/src/commands/logout.js +0 -18
- package/src/commands/pull.js +0 -154
- package/src/commands/push.js +0 -234
- package/src/commands/run.js +0 -206
- package/src/commands/secrets/add.js +0 -28
- package/src/commands/secrets/index.js +0 -24
- package/src/commands/secrets/rm.js +0 -23
- package/src/commands/vis.js +0 -50
- package/src/hooks/init.js +0 -16
- package/src/lib/apify_command.js +0 -82
- package/src/lib/community.js +0 -3
- package/src/lib/consts.js +0 -69
- package/src/lib/create-utils.js +0 -187
- package/src/lib/exec.js +0 -36
- package/src/lib/files.js +0 -76
- package/src/lib/input_schema.js +0 -114
- package/src/lib/local_state.js +0 -39
- package/src/lib/outputs.js +0 -27
- package/src/lib/scrapy-wrapper/Spider.js +0 -10
- package/src/lib/scrapy-wrapper/SpiderFileAnalyzer.js +0 -26
- package/src/lib/telemetry.js +0 -104
- package/src/lib/utils.js +0 -690
- /package/{src/bin → bin}/run.cmd +0 -0
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
|
|
|
@@ -51,7 +51,7 @@ If you receive an `EACCES` error, you might need to run the command as root:
|
|
|
51
51
|
sudo npm -g install apify-cli
|
|
52
52
|
```
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
Alternatively, you can use [Node Version Manager (nvm)](https://github.com/nvm-sh/nvm) and install Apify CLI only into a selected user-level Node version without requiring root privileges:
|
|
55
55
|
|
|
56
56
|
```
|
|
57
57
|
nvm install 16
|
|
@@ -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,27 +131,27 @@ 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
|
-
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
|
|
@@ -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
|
-
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
|
-
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,12 +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
|
|
283
|
-
* [`apify call [
|
|
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
|
+
* [`apify call [ACTORID]`](#apify-call-actorid)
|
|
284
284
|
* [`apify create [ACTORNAME]`](#apify-create-actorname)
|
|
285
|
+
* [`apify help [COMMAND]`](#apify-help-command)
|
|
285
286
|
* [`apify info`](#apify-info)
|
|
286
287
|
* [`apify init [ACTORNAME]`](#apify-init-actorname)
|
|
287
288
|
* [`apify login`](#apify-login)
|
|
@@ -290,143 +291,182 @@ This section contains printouts of `apify help` for all commands.
|
|
|
290
291
|
* [`apify push [ACTORID]`](#apify-push-actorid)
|
|
291
292
|
* [`apify run`](#apify-run)
|
|
292
293
|
* [`apify secrets`](#apify-secrets)
|
|
293
|
-
* [`apify secrets
|
|
294
|
-
* [`apify secrets
|
|
295
|
-
* [`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)
|
|
296
299
|
|
|
297
300
|
## `apify actor`
|
|
298
301
|
|
|
299
|
-
Commands are designed to be used in
|
|
302
|
+
Commands are designed to be used in Actor runs. All commands are in PoC state, do not use in production environments.
|
|
300
303
|
|
|
301
304
|
```
|
|
302
305
|
USAGE
|
|
303
306
|
$ apify actor
|
|
307
|
+
|
|
308
|
+
DESCRIPTION
|
|
309
|
+
Commands are designed to be used in Actor runs. All commands are in PoC state, do not use in production environments.
|
|
304
310
|
```
|
|
305
311
|
|
|
306
|
-
_See code: [src/commands/actor/index.
|
|
312
|
+
_See code: [src/commands/actor/index.ts](https://github.com/apify/apify-cli/blob/v0.20.0-beta.0/src/commands/actor/index.ts)_
|
|
307
313
|
|
|
308
|
-
## `apify actor
|
|
314
|
+
## `apify actor get-input`
|
|
309
315
|
|
|
310
|
-
Gets the
|
|
316
|
+
Gets the Actor input value from the default key-value store associated with the Actor run.
|
|
311
317
|
|
|
312
318
|
```
|
|
313
319
|
USAGE
|
|
314
|
-
$ apify actor
|
|
320
|
+
$ apify actor get-input
|
|
321
|
+
|
|
322
|
+
DESCRIPTION
|
|
323
|
+
Gets the Actor input value from the default key-value store associated with the Actor run.
|
|
315
324
|
```
|
|
316
325
|
|
|
317
|
-
_See code: [src/commands/actor/get-input.
|
|
326
|
+
_See code: [src/commands/actor/get-input.ts](https://github.com/apify/apify-cli/blob/v0.20.0-beta.0/src/commands/actor/get-input.ts)_
|
|
318
327
|
|
|
319
|
-
## `apify actor
|
|
328
|
+
## `apify actor get-value KEY`
|
|
320
329
|
|
|
321
|
-
Gets a value from the default key-value store associated with the
|
|
330
|
+
Gets a value from the default key-value store associated with the Actor run.
|
|
322
331
|
|
|
323
332
|
```
|
|
324
333
|
USAGE
|
|
325
|
-
$ apify actor
|
|
334
|
+
$ apify actor get-value KEY
|
|
326
335
|
|
|
327
336
|
ARGUMENTS
|
|
328
337
|
KEY Key of the record in key-value store
|
|
338
|
+
|
|
339
|
+
DESCRIPTION
|
|
340
|
+
Gets a value from the default key-value store associated with the Actor run.
|
|
329
341
|
```
|
|
330
342
|
|
|
331
|
-
_See code: [src/commands/actor/get-value.
|
|
343
|
+
_See code: [src/commands/actor/get-value.ts](https://github.com/apify/apify-cli/blob/v0.20.0-beta.0/src/commands/actor/get-value.ts)_
|
|
332
344
|
|
|
333
|
-
## `apify actor
|
|
345
|
+
## `apify actor push-data [ITEM]`
|
|
334
346
|
|
|
335
|
-
Stores an object or an array of objects to the default dataset of the
|
|
347
|
+
Stores an object or an array of objects to the default dataset of the Actor run.
|
|
336
348
|
|
|
337
349
|
```
|
|
338
350
|
USAGE
|
|
339
|
-
$ apify actor
|
|
351
|
+
$ apify actor push-data [ITEM]
|
|
340
352
|
|
|
341
353
|
ARGUMENTS
|
|
342
354
|
ITEM JSON string with one object or array of objects containing data to be stored in the default dataset.
|
|
343
355
|
|
|
344
356
|
DESCRIPTION
|
|
357
|
+
Stores an object or an array of objects to the default dataset of the Actor run.
|
|
345
358
|
It is possible to pass data using item argument or stdin.
|
|
346
359
|
Passing data using argument:
|
|
347
|
-
$ apify actor
|
|
360
|
+
$ apify actor push-data {"foo": "bar"}
|
|
348
361
|
Passing data using stdin with pipe:
|
|
349
|
-
$ cat ./test.json | apify actor
|
|
362
|
+
$ cat ./test.json | apify actor push-data
|
|
350
363
|
```
|
|
351
364
|
|
|
352
|
-
_See code: [src/commands/actor/push-data.
|
|
365
|
+
_See code: [src/commands/actor/push-data.ts](https://github.com/apify/apify-cli/blob/v0.20.0-beta.0/src/commands/actor/push-data.ts)_
|
|
353
366
|
|
|
354
|
-
## `apify actor
|
|
367
|
+
## `apify actor set-value KEY [VALUE]`
|
|
355
368
|
|
|
356
|
-
Sets or removes record into the default KeyValueStore associated with the
|
|
369
|
+
Sets or removes record into the default KeyValueStore associated with the Actor run.
|
|
357
370
|
|
|
358
371
|
```
|
|
359
372
|
USAGE
|
|
360
|
-
$ apify actor
|
|
373
|
+
$ apify actor set-value KEY [VALUE] [-c <value>]
|
|
361
374
|
|
|
362
375
|
ARGUMENTS
|
|
363
376
|
KEY Key of the record in key-value store.
|
|
364
|
-
|
|
365
377
|
VALUE Record data, which can be one of the following values:
|
|
366
378
|
- If empty, the record in the key-value store is deleted.
|
|
367
379
|
- If no `contentType` flag is specified, value is expected to be any JSON string value.
|
|
368
380
|
- If options.contentType is set, value is taken as is.
|
|
369
381
|
|
|
370
|
-
|
|
371
|
-
-c, --contentType
|
|
372
|
-
used.
|
|
382
|
+
FLAGS
|
|
383
|
+
-c, --contentType=<value> Specifies a custom MIME content type of the record. By default "application/json" is used.
|
|
373
384
|
|
|
374
385
|
DESCRIPTION
|
|
386
|
+
Sets or removes record into the default KeyValueStore associated with the Actor run.
|
|
375
387
|
It is possible to pass data using argument or stdin.
|
|
376
388
|
Passing data using argument:
|
|
377
|
-
$ apify actor
|
|
389
|
+
$ apify actor set-value KEY my-value
|
|
378
390
|
Passing data using stdin with pipe:
|
|
379
|
-
$ cat ./my-text-file.txt | apify actor
|
|
391
|
+
$ cat ./my-text-file.txt | apify actor set-value KEY --contentType text/plain
|
|
380
392
|
```
|
|
381
393
|
|
|
382
|
-
_See code: [src/commands/actor/set-value.
|
|
394
|
+
_See code: [src/commands/actor/set-value.ts](https://github.com/apify/apify-cli/blob/v0.20.0-beta.0/src/commands/actor/set-value.ts)_
|
|
383
395
|
|
|
384
|
-
## `apify call [
|
|
396
|
+
## `apify call [ACTORID]`
|
|
385
397
|
|
|
386
|
-
Runs a specific
|
|
398
|
+
Runs a specific Actor remotely on the Apify cloud platform.
|
|
387
399
|
|
|
388
400
|
```
|
|
389
401
|
USAGE
|
|
390
|
-
$ apify call [
|
|
402
|
+
$ apify call [ACTORID] [-b <value>] [-t <value>] [-m <value>] [-w <value>] [-i <value> | --input-file
|
|
403
|
+
<value>]
|
|
391
404
|
|
|
392
405
|
ARGUMENTS
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
-b, --build
|
|
398
|
-
-
|
|
399
|
-
-
|
|
400
|
-
-
|
|
406
|
+
ACTORID Name or ID of the Actor to run (e.g. "my-actor", "apify/hello-world" or "E2jjCZBezvAZnX8Rb"). If not
|
|
407
|
+
provided, the command runs the remote Actor specified in the ".actor/actor.json" file.
|
|
408
|
+
|
|
409
|
+
FLAGS
|
|
410
|
+
-b, --build=<value> Tag or number of the build to run (e.g. "latest" or "1.2.34").
|
|
411
|
+
-i, --input=<value> Optional JSON input to be given to the Actor.
|
|
412
|
+
-m, --memory=<value> Amount of memory allocated for the Actor run, in megabytes.
|
|
413
|
+
-t, --timeout=<value> Timeout for the Actor run in seconds. Zero value means there is no timeout.
|
|
414
|
+
-w, --wait-for-finish=<value> Seconds for waiting to run to finish, if no value passed, it waits forever.
|
|
415
|
+
--input-file=<value> Optional path to a file with JSON input to be given to the Actor. The file must be a
|
|
416
|
+
valid JSON file. You can also specify `-` to read from standard input.
|
|
401
417
|
|
|
402
418
|
DESCRIPTION
|
|
403
|
-
|
|
419
|
+
Runs a specific Actor remotely on the Apify cloud platform.
|
|
420
|
+
The Actor is run under your current Apify account. Therefore you need to be logged in by calling "apify login". It
|
|
404
421
|
takes input for the Actor from the default local key-value store by default.
|
|
405
422
|
```
|
|
406
423
|
|
|
407
|
-
_See code: [src/commands/call.
|
|
424
|
+
_See code: [src/commands/call.ts](https://github.com/apify/apify-cli/blob/v0.20.0-beta.0/src/commands/call.ts)_
|
|
408
425
|
|
|
409
426
|
## `apify create [ACTORNAME]`
|
|
410
427
|
|
|
411
|
-
Creates a new
|
|
428
|
+
Creates a new Actor project directory from a selected boilerplate template.
|
|
429
|
+
|
|
430
|
+
```
|
|
431
|
+
USAGE
|
|
432
|
+
$ apify create [ACTORNAME] [-t <value>] [--skip-dependency-install] [--omit-optional-deps]
|
|
433
|
+
|
|
434
|
+
ARGUMENTS
|
|
435
|
+
ACTORNAME Name of the Actor and its directory
|
|
436
|
+
|
|
437
|
+
FLAGS
|
|
438
|
+
-t, --template=<value> Template for the Actor. If not provided, the command will prompt for it.
|
|
439
|
+
Visit
|
|
440
|
+
https://raw.githubusercontent.com/apify/actor-templates/master/templates/manifest.json
|
|
441
|
+
to find available template names.
|
|
442
|
+
--omit-optional-deps Skip installing optional dependencies.
|
|
443
|
+
--skip-dependency-install Skip installing Actor dependencies.
|
|
444
|
+
|
|
445
|
+
DESCRIPTION
|
|
446
|
+
Creates a new Actor project directory from a selected boilerplate template.
|
|
447
|
+
```
|
|
448
|
+
|
|
449
|
+
_See code: [src/commands/create.ts](https://github.com/apify/apify-cli/blob/v0.20.0-beta.0/src/commands/create.ts)_
|
|
450
|
+
|
|
451
|
+
## `apify help [COMMAND]`
|
|
452
|
+
|
|
453
|
+
Display help for apify.
|
|
412
454
|
|
|
413
455
|
```
|
|
414
456
|
USAGE
|
|
415
|
-
$ apify
|
|
457
|
+
$ apify help [COMMAND...] [-n]
|
|
416
458
|
|
|
417
459
|
ARGUMENTS
|
|
418
|
-
|
|
460
|
+
COMMAND... Command to show help for.
|
|
419
461
|
|
|
420
|
-
|
|
421
|
-
-
|
|
422
|
-
Visit
|
|
423
|
-
https://raw.githubusercontent.com/apify/actor-templates/master/templates/manifest.json to
|
|
424
|
-
find available template names.
|
|
462
|
+
FLAGS
|
|
463
|
+
-n, --nested-commands Include all nested commands in the output.
|
|
425
464
|
|
|
426
|
-
|
|
465
|
+
DESCRIPTION
|
|
466
|
+
Display help for apify.
|
|
427
467
|
```
|
|
428
468
|
|
|
429
|
-
_See code: [
|
|
469
|
+
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.2.3/src/commands/help.ts)_
|
|
430
470
|
|
|
431
471
|
## `apify info`
|
|
432
472
|
|
|
@@ -437,52 +477,60 @@ USAGE
|
|
|
437
477
|
$ apify info
|
|
438
478
|
|
|
439
479
|
DESCRIPTION
|
|
480
|
+
Displays information about the currently active Apify account.
|
|
440
481
|
The information is printed to the console.
|
|
441
482
|
```
|
|
442
483
|
|
|
443
|
-
_See code: [src/commands/info.
|
|
484
|
+
_See code: [src/commands/info.ts](https://github.com/apify/apify-cli/blob/v0.20.0-beta.0/src/commands/info.ts)_
|
|
444
485
|
|
|
445
486
|
## `apify init [ACTORNAME]`
|
|
446
487
|
|
|
447
|
-
Initializes a new
|
|
488
|
+
Initializes a new Actor project in an existing directory.
|
|
448
489
|
|
|
449
490
|
```
|
|
450
491
|
USAGE
|
|
451
|
-
$ apify init [ACTORNAME]
|
|
492
|
+
$ apify init [ACTORNAME] [-y]
|
|
452
493
|
|
|
453
494
|
ARGUMENTS
|
|
454
|
-
ACTORNAME Name of the
|
|
495
|
+
ACTORNAME Name of the Actor. If not provided, you will be prompted for it.
|
|
455
496
|
|
|
456
|
-
|
|
497
|
+
FLAGS
|
|
457
498
|
-y, --yes Automatic yes to prompts; assume "yes" as answer to all prompts. Note that in some cases, the command may
|
|
458
499
|
still ask for confirmation.
|
|
459
500
|
|
|
460
501
|
DESCRIPTION
|
|
461
|
-
|
|
462
|
-
|
|
502
|
+
Initializes a new Actor project in an existing directory.
|
|
503
|
+
If the directory contains a Scrapy project in Python, the command automatically creates wrappers so that you can run
|
|
504
|
+
your scrapers without changes.
|
|
505
|
+
|
|
506
|
+
The command creates the ".actor/actor.json" file and the "storage" directory in the current directory, but does not
|
|
507
|
+
touch any other existing files or directories.
|
|
463
508
|
|
|
464
509
|
WARNING: The directory at "storage" will be overwritten if it already exists.
|
|
465
510
|
```
|
|
466
511
|
|
|
467
|
-
_See code: [src/commands/init.
|
|
512
|
+
_See code: [src/commands/init.ts](https://github.com/apify/apify-cli/blob/v0.20.0-beta.0/src/commands/init.ts)_
|
|
468
513
|
|
|
469
514
|
## `apify login`
|
|
470
515
|
|
|
471
|
-
Logs in to your Apify account
|
|
516
|
+
Logs in to your Apify account.
|
|
472
517
|
|
|
473
518
|
```
|
|
474
519
|
USAGE
|
|
475
|
-
$ apify login
|
|
520
|
+
$ apify login [-t <value>] [-m console|manual]
|
|
476
521
|
|
|
477
|
-
|
|
478
|
-
-
|
|
522
|
+
FLAGS
|
|
523
|
+
-m, --method=<option> [Optional] Method of logging in to Apify
|
|
524
|
+
<options: console|manual>
|
|
525
|
+
-t, --token=<value> [Optional] Apify API token
|
|
479
526
|
|
|
480
527
|
DESCRIPTION
|
|
481
|
-
|
|
528
|
+
Logs in to your Apify account.
|
|
529
|
+
The API token and other account information is stored in the ~/.apify directory, from where it is read by all other
|
|
482
530
|
"apify" commands. To log out, call "apify logout".
|
|
483
531
|
```
|
|
484
532
|
|
|
485
|
-
_See code: [src/commands/login.
|
|
533
|
+
_See code: [src/commands/login.ts](https://github.com/apify/apify-cli/blob/v0.20.0-beta.0/src/commands/login.ts)_
|
|
486
534
|
|
|
487
535
|
## `apify logout`
|
|
488
536
|
|
|
@@ -493,11 +541,12 @@ USAGE
|
|
|
493
541
|
$ apify logout
|
|
494
542
|
|
|
495
543
|
DESCRIPTION
|
|
544
|
+
Logs out of your Apify account.
|
|
496
545
|
The command deletes the API token and all other account information stored in the ~/.apify directory. To log in again,
|
|
497
|
-
|
|
546
|
+
call "apify login".
|
|
498
547
|
```
|
|
499
548
|
|
|
500
|
-
_See code: [src/commands/logout.
|
|
549
|
+
_See code: [src/commands/logout.ts](https://github.com/apify/apify-cli/blob/v0.20.0-beta.0/src/commands/logout.ts)_
|
|
501
550
|
|
|
502
551
|
## `apify pull [ACTORID]`
|
|
503
552
|
|
|
@@ -505,159 +554,216 @@ Pulls an Actor from the Apify platform to the current directory. If it is define
|
|
|
505
554
|
|
|
506
555
|
```
|
|
507
556
|
USAGE
|
|
508
|
-
$ apify pull [ACTORID]
|
|
557
|
+
$ apify pull [ACTORID] [-v <value>]
|
|
509
558
|
|
|
510
559
|
ARGUMENTS
|
|
511
|
-
ACTORID Name or ID of the
|
|
560
|
+
ACTORID Name or ID of the Actor to run (e.g. "apify/hello-world" or "E2jjCZBezvAZnX8Rb"). If not provided, the
|
|
512
561
|
command will update the Actor in the current directory based on its name in ".actor/actor.json" file.
|
|
513
562
|
|
|
514
|
-
|
|
515
|
-
-v, --version
|
|
563
|
+
FLAGS
|
|
564
|
+
-v, --version=<value> Actor version number which will be pulled, e.g. 1.2. Default: the highest version
|
|
565
|
+
|
|
566
|
+
DESCRIPTION
|
|
567
|
+
Pulls an Actor from the Apify platform to the current directory. If it is defined as Git repository, it will be
|
|
568
|
+
cloned. If it is defined as Web IDE, it will fetch the files.
|
|
516
569
|
```
|
|
517
570
|
|
|
518
|
-
_See code: [src/commands/pull.
|
|
571
|
+
_See code: [src/commands/pull.ts](https://github.com/apify/apify-cli/blob/v0.20.0-beta.0/src/commands/pull.ts)_
|
|
519
572
|
|
|
520
573
|
## `apify push [ACTORID]`
|
|
521
574
|
|
|
522
|
-
Uploads the
|
|
575
|
+
Uploads the Actor to the Apify platform and builds it there.
|
|
523
576
|
|
|
524
577
|
```
|
|
525
578
|
USAGE
|
|
526
|
-
$ apify push [ACTORID]
|
|
579
|
+
$ apify push [ACTORID] [--version-number <value>] [-v <value>] [-b <value>] [-w <value>] [--no-prompt]
|
|
580
|
+
[--force]
|
|
527
581
|
|
|
528
582
|
ARGUMENTS
|
|
529
583
|
ACTORID Name or ID of the Actor to push (e.g. "apify/hello-world" or "E2jjCZBezvAZnX8Rb"). If not provided, the
|
|
530
|
-
command will create or modify the
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
-b, --build-tag
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
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.
|
|
584
|
+
command will create or modify the Actor with the name specified in ".actor/actor.json" file.
|
|
585
|
+
|
|
586
|
+
FLAGS
|
|
587
|
+
-b, --build-tag=<value> Build tag to be applied to the successful Actor build. By default, it is taken from the
|
|
588
|
+
".actor/actor.json" file
|
|
589
|
+
-v, --version=<value> Actor version number to which the files should be pushed. By default, it is taken from
|
|
590
|
+
the ".actor/actor.json" file.
|
|
591
|
+
-w, --wait-for-finish=<value> Seconds for waiting to build to finish, if no value passed, it waits forever.
|
|
592
|
+
--force Push an Actor even when the local files are older than the Actor on the platform.
|
|
593
|
+
--no-prompt Do not prompt for opening the Actor details in a browser. This will also not open the
|
|
594
|
+
browser automatically.
|
|
595
|
+
--version-number=<value> DEPRECATED: Use flag version instead. Actor version number to which the files should be
|
|
596
|
+
pushed. By default, it is taken from the ".actor/actor.json" file.
|
|
546
597
|
|
|
547
598
|
DESCRIPTION
|
|
548
|
-
|
|
599
|
+
Uploads the Actor to the Apify platform and builds it there.
|
|
600
|
+
The Actor settings are read from the ".actor/actor.json" file in the current directory, but they can be overridden
|
|
549
601
|
using command-line options.
|
|
550
|
-
NOTE: If the source files are smaller than 3 MB then they are uploaded as
|
|
602
|
+
NOTE: If the source files are smaller than 3 MB then they are uploaded as
|
|
551
603
|
"Multiple source files", otherwise they are uploaded as "Zip file".
|
|
552
604
|
|
|
553
|
-
|
|
605
|
+
When there's an attempt to push files that are older than the Actor on the platform, the command will fail. Can be
|
|
606
|
+
overwritten with --force flag.
|
|
554
607
|
```
|
|
555
608
|
|
|
556
|
-
_See code: [src/commands/push.
|
|
609
|
+
_See code: [src/commands/push.ts](https://github.com/apify/apify-cli/blob/v0.20.0-beta.0/src/commands/push.ts)_
|
|
557
610
|
|
|
558
611
|
## `apify run`
|
|
559
612
|
|
|
560
|
-
Runs the
|
|
613
|
+
Runs the Actor locally in the current directory.
|
|
561
614
|
|
|
562
615
|
```
|
|
563
616
|
USAGE
|
|
564
|
-
$ apify run
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
--purge
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
617
|
+
$ apify run [-p] [--purge-queue] [--purge-dataset] [--purge-key-value-store] [--entrypoint <value>] [-i
|
|
618
|
+
<value> | --input-file <value>]
|
|
619
|
+
|
|
620
|
+
FLAGS
|
|
621
|
+
-i, --input=<value> Optional JSON input to be given to the Actor. You can either provide the JSON string as a
|
|
622
|
+
value to this, or `-` to read from standard input.
|
|
623
|
+
-p, --purge Shortcut that combines the --purge-queue, --purge-dataset and --purge-key-value-store
|
|
624
|
+
options.
|
|
625
|
+
--entrypoint=<value> Optional entrypoint for running with injected environment variables.
|
|
626
|
+
For Python, it is the module name, or a path to a file.
|
|
627
|
+
For node.js, it is the npm script name, or a path to a JS/MJS file. You can also pass in
|
|
628
|
+
a directory name, provided that directory contains an "index.js" file.
|
|
629
|
+
--input-file=<value> Optional path to a file with JSON input to be given to the Actor. The file must be a
|
|
630
|
+
valid JSON file.
|
|
631
|
+
--purge-dataset Deletes the local directory containing the default dataset before the run starts.
|
|
632
|
+
--purge-key-value-store Deletes all records from the default key-value store in the local directory before the
|
|
633
|
+
run starts, except for the "INPUT" key.
|
|
634
|
+
--purge-queue Deletes the local directory containing the default request queue before the run starts.
|
|
576
635
|
|
|
577
636
|
DESCRIPTION
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
637
|
+
Runs the Actor locally in the current directory.
|
|
638
|
+
It sets various APIFY_XYZ environment variables in order to provide a working execution environment for the Actor. For
|
|
639
|
+
example, this causes the Actor input, as well as all other data in key-value stores, datasets or request queues to be
|
|
640
|
+
stored in the "storage" directory, rather than on the Apify platform.
|
|
581
641
|
|
|
582
|
-
NOTE: You can override the command's default behavior for Node.js
|
|
642
|
+
NOTE: You can override the command's default behavior for Node.js Actors by overriding the "start" script in the
|
|
583
643
|
package.json file. You can set up your own main file or environment variables by changing it.
|
|
584
644
|
```
|
|
585
645
|
|
|
586
|
-
_See code: [src/commands/run.
|
|
646
|
+
_See code: [src/commands/run.ts](https://github.com/apify/apify-cli/blob/v0.20.0-beta.0/src/commands/run.ts)_
|
|
587
647
|
|
|
588
648
|
## `apify secrets`
|
|
589
649
|
|
|
590
|
-
Manages secret values for
|
|
650
|
+
Manages secret values for Actor environment variables.
|
|
591
651
|
|
|
592
652
|
```
|
|
593
653
|
USAGE
|
|
594
654
|
$ apify secrets
|
|
595
655
|
|
|
596
656
|
DESCRIPTION
|
|
657
|
+
Manages secret values for Actor environment variables.
|
|
658
|
+
|
|
597
659
|
Example:
|
|
598
|
-
$ apify secrets
|
|
660
|
+
$ apify secrets add mySecret TopSecretValue123
|
|
599
661
|
|
|
600
|
-
Now the "mySecret" value can be used in an environment variable defined in ".actor/actor.json" file by adding the "@"
|
|
662
|
+
Now the "mySecret" value can be used in an environment variable defined in ".actor/actor.json" file by adding the "@"
|
|
601
663
|
prefix:
|
|
602
664
|
|
|
603
665
|
{
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
666
|
+
"actorSpecification": 1,
|
|
667
|
+
"name": "my_actor",
|
|
668
|
+
"environmentVariables": { "SECRET_ENV_VAR": "@mySecret" },
|
|
669
|
+
"version": "0.1
|
|
608
670
|
}
|
|
609
671
|
|
|
610
|
-
When the
|
|
611
|
-
|
|
672
|
+
When the Actor is pushed to Apify cloud, the "SECRET_ENV_VAR" and its value is stored as a secret environment variable
|
|
673
|
+
of the Actor.
|
|
612
674
|
```
|
|
613
675
|
|
|
614
|
-
_See code: [src/commands/secrets/index.
|
|
676
|
+
_See code: [src/commands/secrets/index.ts](https://github.com/apify/apify-cli/blob/v0.20.0-beta.0/src/commands/secrets/index.ts)_
|
|
615
677
|
|
|
616
|
-
## `apify secrets
|
|
678
|
+
## `apify secrets add NAME VALUE`
|
|
617
679
|
|
|
618
680
|
Adds a new secret value.
|
|
619
681
|
|
|
620
682
|
```
|
|
621
683
|
USAGE
|
|
622
|
-
$ apify secrets
|
|
684
|
+
$ apify secrets add NAME VALUE
|
|
623
685
|
|
|
624
686
|
ARGUMENTS
|
|
625
687
|
NAME Name of the secret
|
|
626
688
|
VALUE Value of the secret
|
|
627
689
|
|
|
628
690
|
DESCRIPTION
|
|
691
|
+
Adds a new secret value.
|
|
629
692
|
The secrets are stored to a file at ~/.apify
|
|
630
693
|
```
|
|
631
694
|
|
|
632
|
-
_See code: [src/commands/secrets/add.
|
|
695
|
+
_See code: [src/commands/secrets/add.ts](https://github.com/apify/apify-cli/blob/v0.20.0-beta.0/src/commands/secrets/add.ts)_
|
|
633
696
|
|
|
634
|
-
## `apify secrets
|
|
697
|
+
## `apify secrets rm NAME`
|
|
635
698
|
|
|
636
699
|
Removes the secret.
|
|
637
700
|
|
|
638
701
|
```
|
|
639
702
|
USAGE
|
|
640
|
-
$ apify secrets
|
|
703
|
+
$ apify secrets rm NAME
|
|
641
704
|
|
|
642
705
|
ARGUMENTS
|
|
643
706
|
NAME Name of the secret
|
|
707
|
+
|
|
708
|
+
DESCRIPTION
|
|
709
|
+
Removes the secret.
|
|
710
|
+
```
|
|
711
|
+
|
|
712
|
+
_See code: [src/commands/secrets/rm.ts](https://github.com/apify/apify-cli/blob/v0.20.0-beta.0/src/commands/secrets/rm.ts)_
|
|
713
|
+
|
|
714
|
+
## `apify task`
|
|
715
|
+
|
|
716
|
+
Commands are designed to be used to interact with Tasks.
|
|
717
|
+
|
|
718
|
+
```
|
|
719
|
+
USAGE
|
|
720
|
+
$ apify task
|
|
721
|
+
|
|
722
|
+
DESCRIPTION
|
|
723
|
+
Commands are designed to be used to interact with Tasks.
|
|
724
|
+
```
|
|
725
|
+
|
|
726
|
+
_See code: [src/commands/task/index.ts](https://github.com/apify/apify-cli/blob/v0.20.0-beta.0/src/commands/task/index.ts)_
|
|
727
|
+
|
|
728
|
+
## `apify task run TASKID`
|
|
729
|
+
|
|
730
|
+
Runs a specific Actor remotely on the Apify cloud platform.
|
|
731
|
+
|
|
732
|
+
```
|
|
733
|
+
USAGE
|
|
734
|
+
$ apify task run TASKID [-b <value>] [-t <value>] [-m <value>] [-w <value>]
|
|
735
|
+
|
|
736
|
+
ARGUMENTS
|
|
737
|
+
TASKID Name or ID of the Task to run (e.g. "my-task" or "E2jjCZBezvAZnX8Rb").
|
|
738
|
+
|
|
739
|
+
FLAGS
|
|
740
|
+
-b, --build=<value> Tag or number of the build to run (e.g. "latest" or "1.2.34").
|
|
741
|
+
-m, --memory=<value> Amount of memory allocated for the Task run, in megabytes.
|
|
742
|
+
-t, --timeout=<value> Timeout for the Task run in seconds. Zero value means there is no timeout.
|
|
743
|
+
-w, --wait-for-finish=<value> Seconds for waiting to run to finish, if no value passed, it waits forever.
|
|
744
|
+
|
|
745
|
+
DESCRIPTION
|
|
746
|
+
Runs a specific Actor remotely on the Apify cloud platform.
|
|
747
|
+
The Actor is run under your current Apify account. Therefore you need to be logged in by calling "apify login". It
|
|
748
|
+
takes input for the Actor from the default local key-value store by default.
|
|
644
749
|
```
|
|
645
750
|
|
|
646
|
-
_See code: [src/commands/
|
|
751
|
+
_See code: [src/commands/task/run.ts](https://github.com/apify/apify-cli/blob/v0.20.0-beta.0/src/commands/task/run.ts)_
|
|
647
752
|
|
|
648
|
-
## `apify
|
|
753
|
+
## `apify validate-schema [PATH]`
|
|
649
754
|
|
|
650
755
|
Validates input schema and prints errors found.
|
|
651
756
|
|
|
652
757
|
```
|
|
653
758
|
USAGE
|
|
654
|
-
$ apify
|
|
759
|
+
$ apify validate-schema [PATH]
|
|
655
760
|
|
|
656
761
|
ARGUMENTS
|
|
657
762
|
PATH Optional path to your INPUT_SCHEMA.json file. If not provided ./INPUT_SCHEMA.json is used.
|
|
658
763
|
|
|
659
764
|
DESCRIPTION
|
|
660
|
-
|
|
765
|
+
Validates input schema and prints errors found.
|
|
766
|
+
The input schema for the Actor is used from these locations in order of preference.
|
|
661
767
|
The first one found is validated as it would be the one used on the Apify platform.
|
|
662
768
|
1. Directly embedded object in ".actor/actor.json" under 'input' key
|
|
663
769
|
2. Path to JSON file referenced in ".actor/actor.json" under 'input' key
|
|
@@ -667,5 +773,5 @@ DESCRIPTION
|
|
|
667
773
|
You can also pass any custom path to your input schema to have it validated instead.
|
|
668
774
|
```
|
|
669
775
|
|
|
670
|
-
_See code: [src/commands/
|
|
776
|
+
_See code: [src/commands/validate-schema.ts](https://github.com/apify/apify-cli/blob/v0.20.0-beta.0/src/commands/validate-schema.ts)_
|
|
671
777
|
<!-- commandsstop -->
|