apify-cli 1.0.0-beta.99 → 1.1.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.
Files changed (221) hide show
  1. package/CHANGELOG.md +236 -84
  2. package/LICENSE.md +201 -0
  3. package/README.md +50 -535
  4. package/dist/.tsbuildinfo +1 -1
  5. package/dist/actor.js +3 -0
  6. package/dist/actor.js.map +1 -0
  7. package/dist/apify.js +3 -0
  8. package/dist/apify.js.map +1 -0
  9. package/dist/chunk-TJMCNXPV.js +242 -0
  10. package/dist/chunk-TJMCNXPV.js.map +1 -0
  11. package/dist/index.js +2 -3
  12. package/package.json +116 -89
  13. package/bin/dev.cmd +0 -3
  14. package/bin/dev.js +0 -21
  15. package/bin/dev.sh +0 -4
  16. package/bin/run.cmd +0 -3
  17. package/bin/run.js +0 -23
  18. package/dist/commands/actor/get-input.d.ts +0 -6
  19. package/dist/commands/actor/get-input.d.ts.map +0 -1
  20. package/dist/commands/actor/get-input.js +0 -14
  21. package/dist/commands/actor/get-input.js.map +0 -1
  22. package/dist/commands/actor/get-value.d.ts +0 -9
  23. package/dist/commands/actor/get-value.d.ts.map +0 -1
  24. package/dist/commands/actor/get-value.js +0 -27
  25. package/dist/commands/actor/get-value.js.map +0 -1
  26. package/dist/commands/actor/index.d.ts +0 -6
  27. package/dist/commands/actor/index.d.ts.map +0 -1
  28. package/dist/commands/actor/index.js +0 -13
  29. package/dist/commands/actor/index.js.map +0 -1
  30. package/dist/commands/actor/push-data.d.ts +0 -11
  31. package/dist/commands/actor/push-data.d.ts.map +0 -1
  32. package/dist/commands/actor/push-data.js +0 -56
  33. package/dist/commands/actor/push-data.js.map +0 -1
  34. package/dist/commands/actor/set-value.d.ts +0 -15
  35. package/dist/commands/actor/set-value.d.ts.map +0 -1
  36. package/dist/commands/actor/set-value.js +0 -76
  37. package/dist/commands/actor/set-value.js.map +0 -1
  38. package/dist/commands/call.d.ts +0 -16
  39. package/dist/commands/call.d.ts.map +0 -1
  40. package/dist/commands/call.js +0 -108
  41. package/dist/commands/call.js.map +0 -1
  42. package/dist/commands/check-version.d.ts +0 -11
  43. package/dist/commands/check-version.d.ts.map +0 -1
  44. package/dist/commands/check-version.js +0 -39
  45. package/dist/commands/check-version.js.map +0 -1
  46. package/dist/commands/create.d.ts +0 -15
  47. package/dist/commands/create.d.ts.map +0 -1
  48. package/dist/commands/create.js +0 -201
  49. package/dist/commands/create.js.map +0 -1
  50. package/dist/commands/edit-input-schema.d.ts +0 -11
  51. package/dist/commands/edit-input-schema.d.ts.map +0 -1
  52. package/dist/commands/edit-input-schema.js +0 -176
  53. package/dist/commands/edit-input-schema.js.map +0 -1
  54. package/dist/commands/info.d.ts +0 -6
  55. package/dist/commands/info.d.ts.map +0 -1
  56. package/dist/commands/info.js +0 -26
  57. package/dist/commands/info.js.map +0 -1
  58. package/dist/commands/init-wrap-scrapy.d.ts +0 -10
  59. package/dist/commands/init-wrap-scrapy.d.ts.map +0 -1
  60. package/dist/commands/init-wrap-scrapy.js +0 -41
  61. package/dist/commands/init-wrap-scrapy.js.map +0 -1
  62. package/dist/commands/init.d.ts +0 -12
  63. package/dist/commands/init.d.ts.map +0 -1
  64. package/dist/commands/init.js +0 -88
  65. package/dist/commands/init.js.map +0 -1
  66. package/dist/commands/login.d.ts +0 -10
  67. package/dist/commands/login.d.ts.map +0 -1
  68. package/dist/commands/login.js +0 -174
  69. package/dist/commands/login.js.map +0 -1
  70. package/dist/commands/logout.d.ts +0 -6
  71. package/dist/commands/logout.d.ts.map +0 -1
  72. package/dist/commands/logout.js +0 -20
  73. package/dist/commands/logout.js.map +0 -1
  74. package/dist/commands/pull.d.ts +0 -12
  75. package/dist/commands/pull.d.ts.map +0 -1
  76. package/dist/commands/pull.js +0 -148
  77. package/dist/commands/pull.js.map +0 -1
  78. package/dist/commands/push.d.ts +0 -18
  79. package/dist/commands/push.d.ts.map +0 -1
  80. package/dist/commands/push.js +0 -298
  81. package/dist/commands/push.js.map +0 -1
  82. package/dist/commands/run.d.ts +0 -13
  83. package/dist/commands/run.d.ts.map +0 -1
  84. package/dist/commands/run.js +0 -257
  85. package/dist/commands/run.js.map +0 -1
  86. package/dist/commands/secrets/add.d.ts +0 -10
  87. package/dist/commands/secrets/add.d.ts.map +0 -1
  88. package/dist/commands/secrets/add.js +0 -31
  89. package/dist/commands/secrets/add.js.map +0 -1
  90. package/dist/commands/secrets/index.d.ts +0 -6
  91. package/dist/commands/secrets/index.d.ts.map +0 -1
  92. package/dist/commands/secrets/index.js +0 -24
  93. package/dist/commands/secrets/index.js.map +0 -1
  94. package/dist/commands/secrets/rm.d.ts +0 -9
  95. package/dist/commands/secrets/rm.d.ts.map +0 -1
  96. package/dist/commands/secrets/rm.js +0 -27
  97. package/dist/commands/secrets/rm.js.map +0 -1
  98. package/dist/commands/task/index.d.ts +0 -6
  99. package/dist/commands/task/index.d.ts.map +0 -1
  100. package/dist/commands/task/index.js +0 -13
  101. package/dist/commands/task/index.js.map +0 -1
  102. package/dist/commands/task/run.d.ts +0 -16
  103. package/dist/commands/task/run.d.ts.map +0 -1
  104. package/dist/commands/task/run.js +0 -91
  105. package/dist/commands/task/run.js.map +0 -1
  106. package/dist/commands/validate-schema.d.ts +0 -10
  107. package/dist/commands/validate-schema.d.ts.map +0 -1
  108. package/dist/commands/validate-schema.js +0 -58
  109. package/dist/commands/validate-schema.js.map +0 -1
  110. package/dist/hooks/deprecations.d.ts +0 -4
  111. package/dist/hooks/deprecations.d.ts.map +0 -1
  112. package/dist/hooks/deprecations.js +0 -18
  113. package/dist/hooks/deprecations.js.map +0 -1
  114. package/dist/hooks/init.d.ts +0 -7
  115. package/dist/hooks/init.d.ts.map +0 -1
  116. package/dist/hooks/init.js +0 -17
  117. package/dist/hooks/init.js.map +0 -1
  118. package/dist/index.d.ts +0 -2
  119. package/dist/index.d.ts.map +0 -1
  120. package/dist/index.js.map +0 -1
  121. package/dist/lib/actor.d.ts +0 -27
  122. package/dist/lib/actor.d.ts.map +0 -1
  123. package/dist/lib/actor.js +0 -67
  124. package/dist/lib/actor.js.map +0 -1
  125. package/dist/lib/apify-oclif-help.d.ts +0 -15
  126. package/dist/lib/apify-oclif-help.d.ts.map +0 -1
  127. package/dist/lib/apify-oclif-help.js +0 -19
  128. package/dist/lib/apify-oclif-help.js.map +0 -1
  129. package/dist/lib/apify_command.d.ts +0 -22
  130. package/dist/lib/apify_command.d.ts.map +0 -1
  131. package/dist/lib/apify_command.js +0 -103
  132. package/dist/lib/apify_command.js.map +0 -1
  133. package/dist/lib/commands/run-on-cloud.d.ts +0 -19
  134. package/dist/lib/commands/run-on-cloud.d.ts.map +0 -1
  135. package/dist/lib/commands/run-on-cloud.js +0 -90
  136. package/dist/lib/commands/run-on-cloud.js.map +0 -1
  137. package/dist/lib/community.d.ts +0 -2
  138. package/dist/lib/community.d.ts.map +0 -1
  139. package/dist/lib/community.js +0 -4
  140. package/dist/lib/community.js.map +0 -1
  141. package/dist/lib/consts.d.ts +0 -53
  142. package/dist/lib/consts.d.ts.map +0 -1
  143. package/dist/lib/consts.js +0 -64
  144. package/dist/lib/consts.js.map +0 -1
  145. package/dist/lib/create-utils.d.ts +0 -8
  146. package/dist/lib/create-utils.d.ts.map +0 -1
  147. package/dist/lib/create-utils.js +0 -148
  148. package/dist/lib/create-utils.js.map +0 -1
  149. package/dist/lib/exec.d.ts +0 -4
  150. package/dist/lib/exec.d.ts.map +0 -1
  151. package/dist/lib/exec.js +0 -40
  152. package/dist/lib/exec.js.map +0 -1
  153. package/dist/lib/files.d.ts +0 -14
  154. package/dist/lib/files.d.ts.map +0 -1
  155. package/dist/lib/files.js +0 -58
  156. package/dist/lib/files.js.map +0 -1
  157. package/dist/lib/input_schema.d.ts +0 -26
  158. package/dist/lib/input_schema.d.ts.map +0 -1
  159. package/dist/lib/input_schema.js +0 -93
  160. package/dist/lib/input_schema.js.map +0 -1
  161. package/dist/lib/local_state.d.ts +0 -11
  162. package/dist/lib/local_state.d.ts.map +0 -1
  163. package/dist/lib/local_state.js +0 -27
  164. package/dist/lib/local_state.js.map +0 -1
  165. package/dist/lib/outputs.d.ts +0 -19
  166. package/dist/lib/outputs.d.ts.map +0 -1
  167. package/dist/lib/outputs.js +0 -45
  168. package/dist/lib/outputs.js.map +0 -1
  169. package/dist/lib/project_analyzer.d.ts +0 -4
  170. package/dist/lib/project_analyzer.d.ts.map +0 -1
  171. package/dist/lib/project_analyzer.js +0 -30
  172. package/dist/lib/project_analyzer.js.map +0 -1
  173. package/dist/lib/projects/CrawleeAnalyzer.d.ts +0 -4
  174. package/dist/lib/projects/CrawleeAnalyzer.d.ts.map +0 -1
  175. package/dist/lib/projects/CrawleeAnalyzer.js +0 -20
  176. package/dist/lib/projects/CrawleeAnalyzer.js.map +0 -1
  177. package/dist/lib/projects/OldApifySDKAnalyzer.d.ts +0 -4
  178. package/dist/lib/projects/OldApifySDKAnalyzer.d.ts.map +0 -1
  179. package/dist/lib/projects/OldApifySDKAnalyzer.js +0 -38
  180. package/dist/lib/projects/OldApifySDKAnalyzer.js.map +0 -1
  181. package/dist/lib/projects/scrapy/ScrapyProjectAnalyzer.d.ts +0 -17
  182. package/dist/lib/projects/scrapy/ScrapyProjectAnalyzer.d.ts.map +0 -1
  183. package/dist/lib/projects/scrapy/ScrapyProjectAnalyzer.js +0 -87
  184. package/dist/lib/projects/scrapy/ScrapyProjectAnalyzer.js.map +0 -1
  185. package/dist/lib/projects/scrapy/Spider.d.ts +0 -14
  186. package/dist/lib/projects/scrapy/Spider.d.ts.map +0 -1
  187. package/dist/lib/projects/scrapy/Spider.js +0 -33
  188. package/dist/lib/projects/scrapy/Spider.js.map +0 -1
  189. package/dist/lib/projects/scrapy/SpiderFileAnalyzer.d.ts +0 -7
  190. package/dist/lib/projects/scrapy/SpiderFileAnalyzer.d.ts.map +0 -1
  191. package/dist/lib/projects/scrapy/SpiderFileAnalyzer.js +0 -25
  192. package/dist/lib/projects/scrapy/SpiderFileAnalyzer.js.map +0 -1
  193. package/dist/lib/projects/scrapy/wrapScrapyProject.d.ts +0 -4
  194. package/dist/lib/projects/scrapy/wrapScrapyProject.d.ts.map +0 -1
  195. package/dist/lib/projects/scrapy/wrapScrapyProject.js +0 -109
  196. package/dist/lib/projects/scrapy/wrapScrapyProject.js.map +0 -1
  197. package/dist/lib/projects/shared.d.ts +0 -2
  198. package/dist/lib/projects/shared.d.ts.map +0 -1
  199. package/dist/lib/projects/shared.js +0 -13
  200. package/dist/lib/projects/shared.js.map +0 -1
  201. package/dist/lib/secrets.d.ts +0 -22
  202. package/dist/lib/secrets.d.ts.map +0 -1
  203. package/dist/lib/secrets.js +0 -104
  204. package/dist/lib/secrets.js.map +0 -1
  205. package/dist/lib/telemetry.d.ts +0 -21
  206. package/dist/lib/telemetry.d.ts.map +0 -1
  207. package/dist/lib/telemetry.js +0 -87
  208. package/dist/lib/telemetry.js.map +0 -1
  209. package/dist/lib/types.d.ts +0 -11
  210. package/dist/lib/types.d.ts.map +0 -1
  211. package/dist/lib/types.js +0 -2
  212. package/dist/lib/types.js.map +0 -1
  213. package/dist/lib/utils.d.ts +0 -105
  214. package/dist/lib/utils.d.ts.map +0 -1
  215. package/dist/lib/utils.js +0 -575
  216. package/dist/lib/utils.js.map +0 -1
  217. package/dist/lib/version_check.d.ts +0 -14
  218. package/dist/lib/version_check.d.ts.map +0 -1
  219. package/dist/lib/version_check.js +0 -90
  220. package/dist/lib/version_check.js.map +0 -1
  221. package/oclif.manifest.json +0 -815
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Apify command-line interface (Apify CLI)
2
2
 
3
- <a href="https://www.npmjs.com/package/apify-cli"><img src="https://badge.fury.io/js/apify-cli.svg" alt="npm version" loading="lazy" style="display:inherit;" /></a>
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>
3
+ [![NPM version](https://badge.fury.io/js/apify-cli.svg)](https://www.npmjs.com/package/apify-cli)
4
+ [![GitHub workflow](https://github.com/apify/apify-cli/actions/workflows/check.yaml/badge.svg)](https://github.com/apify/apify-cli/actions/workflows/check.yaml)
5
5
 
6
6
  Apify command-line interface (Apify CLI) helps you create, develop, build and run
7
7
  [Apify Actors](https://www.apify.com/actors),
@@ -19,9 +19,22 @@ Note that Actors running on the Apify platform are executed in Docker containers
19
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
-
23
22
  ## Installation
24
23
 
24
+ ### Via bundles
25
+
26
+ #### MacOS / Unix
27
+
28
+ ```bash
29
+ curl -fsSL https://apify.com/install-cli.sh | bash
30
+ ```
31
+
32
+ #### Windows
33
+
34
+ ```powershell
35
+ irm https://apify.com/install-cli.ps1 | iex
36
+ ```
37
+
25
38
  ### Via Homebrew
26
39
 
27
40
  On macOS (or Linux), you can install the Apify CLI via the [Homebrew package manager](https://brew.sh).
@@ -32,7 +45,7 @@ brew install apify-cli
32
45
 
33
46
  ### Via NPM
34
47
 
35
- First, make sure you have [Node.js](https://nodejs.org) version 16 or higher with NPM installed on your computer:
48
+ First, make sure you have [Node.js](https://nodejs.org) version 22 or higher with NPM installed on your computer:
36
49
 
37
50
  ```bash
38
51
  node --version
@@ -42,21 +55,15 @@ npm --version
42
55
  Install or upgrade Apify CLI by running:
43
56
 
44
57
  ```bash
45
- npm -g install apify-cli
58
+ npm install -g apify-cli
46
59
  ```
47
60
 
48
- If you receive an `EACCES` error, you might need to run the command as root:
61
+ Alternatively, you can use [fnm (Fast Node Manager)](https://github.com/Schniz/fnm) and install Apify CLI only into a selected user-level Node version without requiring root privileges:
49
62
 
50
63
  ```bash
51
- sudo npm -g install apify-cli
52
- ```
53
-
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
-
56
- ```
57
- nvm install 16
58
- nvm use 16
59
- npm -g install apify-cli
64
+ fnm install 22
65
+ fnm use 22
66
+ npm install -g apify-cli
60
67
  ```
61
68
 
62
69
  Finally, verify that Apify CLI was installed correctly by running:
@@ -65,11 +72,6 @@ Finally, verify that Apify CLI was installed correctly by running:
65
72
  apify --version
66
73
  ```
67
74
 
68
- which should print something like:
69
- ```
70
- apify-cli/0.10.0 darwin-x64 node-v16.14.2
71
- ```
72
-
73
75
  > You can also skip the manual global installation altogether and use `npx apify-cli` with all the following commands instead.
74
76
 
75
77
  ## Basic usage
@@ -94,10 +96,12 @@ for the Actor and a few configuration files.
94
96
  cd ./my/awesome/project
95
97
  apify init
96
98
  ```
99
+
97
100
  This command will only set up local Actor development environment in an existing directory,
98
101
  i.e. it will create the `.actor/actor.json` file and `apify_storage` directory.
99
102
 
100
103
  Before you can run your project locally using `apify run`, you have to set up the right start command in `package.json` under scripts.start. For example:
104
+
101
105
  ```text
102
106
  {
103
107
  ...
@@ -107,11 +111,12 @@ Before you can run your project locally using `apify run`, you have to set up th
107
111
  ...
108
112
  }
109
113
  ```
114
+
110
115
  You can find more information about by running `apify help run`.
111
116
 
112
117
  ### Create a new Actor from Scrapy project
113
118
 
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).
119
+ If you want to run a Scrapy project on Apify platform, follow the [Scrapy integration guide](https://docs.apify.com/cli/docs/integrating-scrapy).
115
120
 
116
121
  ### Run the Actor locally
117
122
 
@@ -131,10 +136,9 @@ apify login
131
136
 
132
137
  Before you can interact with the Apify cloud, you need to [create an Apify account](https://console.apify.com/)
133
138
  and log in to it using the above command. You will be prompted for
134
- your [Apify API token](https://console.apify.com/account#/integrations).
139
+ your [Apify API token](https://console.apify.com/settings/integrations).
135
140
  Note that the command will store the API token and other sensitive information to `~/.apify`.
136
141
 
137
-
138
142
  ### Push the Actor to the Apify cloud
139
143
 
140
144
  ```bash
@@ -165,7 +169,6 @@ Make sure you commit this file to the Git repository.
165
169
 
166
170
  For example, `.actor/actor.json` file can look as follows:
167
171
 
168
-
169
172
  ```json
170
173
  {
171
174
  "actorSpecification": 1,
@@ -173,8 +176,8 @@ For example, `.actor/actor.json` file can look as follows:
173
176
  "version": "0.0",
174
177
  "buildTag": "latest",
175
178
  "environmentVariables": {
176
- "MYSQL_USER": "my_username",
177
- "MYSQL_PASSWORD": "@mySecretPassword"
179
+ "MYSQL_USER": "my_username",
180
+ "MYSQL_PASSWORD": "@mySecretPassword"
178
181
  },
179
182
  "dockerfile": "./Dockerfile",
180
183
  "readme": "./ACTOR.md",
@@ -198,48 +201,54 @@ You can embed your [input schema](https://docs.apify.com/actors/development/inpu
198
201
  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
202
 
200
203
  **Note on migration from deprecated config "apify.json"**\
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).*
204
+ _Note that previously, Actor config was stored in the `apify.json` file that has been deprecated. You can find the (very slight) differences and migration info in [migration guidelines](https://github.com/apify/apify-cli/blob/master/MIGRATIONS.md)._
202
205
 
203
206
  ## Environment variables
204
207
 
205
208
  There are two options how you can set up environment variables for Actors.
206
209
 
207
210
  ### Set up environment variables in .actor/actor.json
211
+
208
212
  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.
213
+
209
214
  ```json
210
215
  {
211
- "actorSpecification": 1,
212
- "name": "dataset-to-mysql",
213
- "version": "0.1",
214
- "buildTag": "latest",
215
- "environmentVariables": {
216
- "MYSQL_USER": "my_username",
217
- "MYSQL_PASSWORD": "@mySecretPassword"
218
- }
216
+ "actorSpecification": 1,
217
+ "name": "dataset-to-mysql",
218
+ "version": "0.1",
219
+ "buildTag": "latest",
220
+ "environmentVariables": {
221
+ "MYSQL_USER": "my_username",
222
+ "MYSQL_PASSWORD": "@mySecretPassword"
223
+ }
219
224
  }
220
225
  ```
221
226
 
222
227
  ### Set up environment variables in Apify Console
228
+
223
229
  In [Apify Console](https://console.apify.com/actors) select your Actor, you can set up variables into Source tab.
224
230
  After setting up variables in the app, remove the `environmentVariables` from `.actor/actor.json`. Otherwise, variables from `.actor/actor.json` will override variables in the app.
231
+
225
232
  ```json
226
233
  {
227
- "actorSpecification": 1,
228
- "name": "dataset-to-mysql",
229
- "version": "0.1",
230
- "buildTag": "latest"
234
+ "actorSpecification": 1,
235
+ "name": "dataset-to-mysql",
236
+ "version": "0.1",
237
+ "buildTag": "latest"
231
238
  }
232
239
  ```
233
240
 
234
-
235
241
  #### How to set secret environment variables in .actor/actor.json
236
242
 
237
243
  CLI provides commands to manage secrets environment variables. Secrets are stored to the `~/.apify` directory.
238
244
  You can add a new secret using the command:
245
+
239
246
  ```bash
240
247
  apify secrets:add mySecretPassword pwd1234
241
248
  ```
249
+
242
250
  After adding a new secret you can use the secret in `.actor/actor.json`.
251
+
243
252
  ```text
244
253
  {
245
254
  "actorSpecification": 1,
@@ -269,500 +278,6 @@ apify help COMMAND
269
278
  Still haven't found what you were looking for? Please go to [Apify Help center](https://www.apify.com/help)
270
279
  or [contact us](https://www.apify.com/contact).
271
280
 
272
-
273
281
  ## Command reference
274
282
 
275
- This section contains printouts of `apify help` for all commands.
276
-
277
- <!-- commands -->
278
- * [`apify actor`](#apify-actor)
279
- * [`apify actor get-input`](#apify-actor-get-input)
280
- * [`apify actor get-value KEY`](#apify-actor-get-value-key)
281
- * [`apify actor push-data [ITEM]`](#apify-actor-push-data-item)
282
- * [`apify actor set-value KEY [VALUE]`](#apify-actor-set-value-key-value)
283
- * [`apify call [ACTORID]`](#apify-call-actorid)
284
- * [`apify create [ACTORNAME]`](#apify-create-actorname)
285
- * [`apify help [COMMAND]`](#apify-help-command)
286
- * [`apify info`](#apify-info)
287
- * [`apify init [ACTORNAME]`](#apify-init-actorname)
288
- * [`apify login`](#apify-login)
289
- * [`apify logout`](#apify-logout)
290
- * [`apify pull [ACTORID]`](#apify-pull-actorid)
291
- * [`apify push [ACTORID]`](#apify-push-actorid)
292
- * [`apify run`](#apify-run)
293
- * [`apify secrets`](#apify-secrets)
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)
299
-
300
- ## `apify actor`
301
-
302
- Commands are designed to be used in Actor runs. All commands are in PoC state, do not use in production environments.
303
-
304
- ```
305
- USAGE
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.
310
- ```
311
-
312
- _See code: [src/commands/actor/index.ts](https://github.com/apify/apify-cli/blob/v1.0.0-beta.99/src/commands/actor/index.ts)_
313
-
314
- ## `apify actor get-input`
315
-
316
- Gets the Actor input value from the default key-value store associated with the Actor run.
317
-
318
- ```
319
- USAGE
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.
324
- ```
325
-
326
- _See code: [src/commands/actor/get-input.ts](https://github.com/apify/apify-cli/blob/v1.0.0-beta.99/src/commands/actor/get-input.ts)_
327
-
328
- ## `apify actor get-value KEY`
329
-
330
- Gets a value from the default key-value store associated with the Actor run.
331
-
332
- ```
333
- USAGE
334
- $ apify actor get-value KEY
335
-
336
- ARGUMENTS
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.
341
- ```
342
-
343
- _See code: [src/commands/actor/get-value.ts](https://github.com/apify/apify-cli/blob/v1.0.0-beta.99/src/commands/actor/get-value.ts)_
344
-
345
- ## `apify actor push-data [ITEM]`
346
-
347
- Stores an object or an array of objects to the default dataset of the Actor run.
348
-
349
- ```
350
- USAGE
351
- $ apify actor push-data [ITEM]
352
-
353
- ARGUMENTS
354
- ITEM JSON string with one object or array of objects containing data to be stored in the default dataset.
355
-
356
- DESCRIPTION
357
- Stores an object or an array of objects to the default dataset of the Actor run.
358
- It is possible to pass data using item argument or stdin.
359
- Passing data using argument:
360
- $ apify actor push-data {"foo": "bar"}
361
- Passing data using stdin with pipe:
362
- $ cat ./test.json | apify actor push-data
363
- ```
364
-
365
- _See code: [src/commands/actor/push-data.ts](https://github.com/apify/apify-cli/blob/v1.0.0-beta.99/src/commands/actor/push-data.ts)_
366
-
367
- ## `apify actor set-value KEY [VALUE]`
368
-
369
- Sets or removes record into the default KeyValueStore associated with the Actor run.
370
-
371
- ```
372
- USAGE
373
- $ apify actor set-value KEY [VALUE] [-c <value>]
374
-
375
- ARGUMENTS
376
- KEY Key of the record in key-value store.
377
- VALUE Record data, which can be one of the following values:
378
- - If empty, the record in the key-value store is deleted.
379
- - If no `contentType` flag is specified, value is expected to be any JSON string value.
380
- - If options.contentType is set, value is taken as is.
381
-
382
- FLAGS
383
- -c, --contentType=<value> Specifies a custom MIME content type of the record. By default "application/json" is used.
384
-
385
- DESCRIPTION
386
- Sets or removes record into the default KeyValueStore associated with the Actor run.
387
- It is possible to pass data using argument or stdin.
388
- Passing data using argument:
389
- $ apify actor set-value KEY my-value
390
- Passing data using stdin with pipe:
391
- $ cat ./my-text-file.txt | apify actor set-value KEY --contentType text/plain
392
- ```
393
-
394
- _See code: [src/commands/actor/set-value.ts](https://github.com/apify/apify-cli/blob/v1.0.0-beta.99/src/commands/actor/set-value.ts)_
395
-
396
- ## `apify call [ACTORID]`
397
-
398
- Runs a specific Actor remotely on the Apify cloud platform.
399
-
400
- ```
401
- USAGE
402
- $ apify call [ACTORID] [-b <value>] [-t <value>] [-m <value>] [-w <value>]
403
-
404
- ARGUMENTS
405
- ACTORID Name or ID of the Actor to run (e.g. "my-actor", "apify/hello-world" or "E2jjCZBezvAZnX8Rb"). If not
406
- provided, the command runs the remote Actor specified in the ".actor/actor.json" file.
407
-
408
- FLAGS
409
- -b, --build=<value> Tag or number of the build to run (e.g. "latest" or "1.2.34").
410
- -m, --memory=<value> Amount of memory allocated for the Actor run, in megabytes.
411
- -t, --timeout=<value> Timeout for the Actor run in seconds. Zero value means there is no timeout.
412
- -w, --wait-for-finish=<value> Seconds for waiting to run to finish, if no value passed, it waits forever.
413
-
414
- DESCRIPTION
415
- Runs a specific Actor remotely on the Apify cloud platform.
416
- The Actor is run under your current Apify account. Therefore you need to be logged in by calling "apify login". It
417
- takes input for the Actor from the default local key-value store by default.
418
- ```
419
-
420
- _See code: [src/commands/call.ts](https://github.com/apify/apify-cli/blob/v1.0.0-beta.99/src/commands/call.ts)_
421
-
422
- ## `apify create [ACTORNAME]`
423
-
424
- Creates a new Actor project directory from a selected boilerplate template.
425
-
426
- ```
427
- USAGE
428
- $ apify create [ACTORNAME] [-t <value>] [--skip-dependency-install] [--omit-optional-deps]
429
-
430
- ARGUMENTS
431
- ACTORNAME Name of the Actor and its directory
432
-
433
- FLAGS
434
- -t, --template=<value> Template for the Actor. If not provided, the command will prompt for it.
435
- Visit
436
- https://raw.githubusercontent.com/apify/actor-templates/master/templates/manifest.json
437
- to find available template names.
438
- --omit-optional-deps Skip installing optional dependencies.
439
- --skip-dependency-install Skip installing Actor dependencies.
440
-
441
- DESCRIPTION
442
- Creates a new Actor project directory from a selected boilerplate template.
443
- ```
444
-
445
- _See code: [src/commands/create.ts](https://github.com/apify/apify-cli/blob/v1.0.0-beta.99/src/commands/create.ts)_
446
-
447
- ## `apify help [COMMAND]`
448
-
449
- Display help for apify.
450
-
451
- ```
452
- USAGE
453
- $ apify help [COMMAND...] [-n]
454
-
455
- ARGUMENTS
456
- COMMAND... Command to show help for.
457
-
458
- FLAGS
459
- -n, --nested-commands Include all nested commands in the output.
460
-
461
- DESCRIPTION
462
- Display help for apify.
463
- ```
464
-
465
- _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.2.2/src/commands/help.ts)_
466
-
467
- ## `apify info`
468
-
469
- Displays information about the currently active Apify account.
470
-
471
- ```
472
- USAGE
473
- $ apify info
474
-
475
- DESCRIPTION
476
- Displays information about the currently active Apify account.
477
- The information is printed to the console.
478
- ```
479
-
480
- _See code: [src/commands/info.ts](https://github.com/apify/apify-cli/blob/v1.0.0-beta.99/src/commands/info.ts)_
481
-
482
- ## `apify init [ACTORNAME]`
483
-
484
- Initializes a new Actor project in an existing directory.
485
-
486
- ```
487
- USAGE
488
- $ apify init [ACTORNAME] [-y]
489
-
490
- ARGUMENTS
491
- ACTORNAME Name of the Actor. If not provided, you will be prompted for it.
492
-
493
- FLAGS
494
- -y, --yes Automatic yes to prompts; assume "yes" as answer to all prompts. Note that in some cases, the command may
495
- still ask for confirmation.
496
-
497
- DESCRIPTION
498
- Initializes a new Actor project in an existing directory.
499
- If the directory contains a Scrapy project in Python, the command automatically creates wrappers so that you can run
500
- your scrapers without changes.
501
-
502
- The command creates the ".actor/actor.json" file and the "storage" directory in the current directory, but does not
503
- touch any other existing files or directories.
504
-
505
- WARNING: The directory at "storage" will be overwritten if it already exists.
506
- ```
507
-
508
- _See code: [src/commands/init.ts](https://github.com/apify/apify-cli/blob/v1.0.0-beta.99/src/commands/init.ts)_
509
-
510
- ## `apify login`
511
-
512
- Logs in to your Apify account.
513
-
514
- ```
515
- USAGE
516
- $ apify login [-t <value>] [-m console|manual]
517
-
518
- FLAGS
519
- -m, --method=<option> [Optional] Method of logging in to Apify
520
- <options: console|manual>
521
- -t, --token=<value> [Optional] Apify API token
522
-
523
- DESCRIPTION
524
- Logs in to your Apify account.
525
- The API token and other account information is stored in the ~/.apify directory, from where it is read by all other
526
- "apify" commands. To log out, call "apify logout".
527
- ```
528
-
529
- _See code: [src/commands/login.ts](https://github.com/apify/apify-cli/blob/v1.0.0-beta.99/src/commands/login.ts)_
530
-
531
- ## `apify logout`
532
-
533
- Logs out of your Apify account.
534
-
535
- ```
536
- USAGE
537
- $ apify logout
538
-
539
- DESCRIPTION
540
- Logs out of your Apify account.
541
- The command deletes the API token and all other account information stored in the ~/.apify directory. To log in again,
542
- call "apify login".
543
- ```
544
-
545
- _See code: [src/commands/logout.ts](https://github.com/apify/apify-cli/blob/v1.0.0-beta.99/src/commands/logout.ts)_
546
-
547
- ## `apify pull [ACTORID]`
548
-
549
- 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.
550
-
551
- ```
552
- USAGE
553
- $ apify pull [ACTORID] [-v <value>]
554
-
555
- ARGUMENTS
556
- ACTORID Name or ID of the Actor to run (e.g. "apify/hello-world" or "E2jjCZBezvAZnX8Rb"). If not provided, the
557
- command will update the Actor in the current directory based on its name in ".actor/actor.json" file.
558
-
559
- FLAGS
560
- -v, --version=<value> Actor version number which will be pulled, e.g. 1.2. Default: the highest version
561
-
562
- DESCRIPTION
563
- Pulls an Actor from the Apify platform to the current directory. If it is defined as Git repository, it will be
564
- cloned. If it is defined as Web IDE, it will fetch the files.
565
- ```
566
-
567
- _See code: [src/commands/pull.ts](https://github.com/apify/apify-cli/blob/v1.0.0-beta.99/src/commands/pull.ts)_
568
-
569
- ## `apify push [ACTORID]`
570
-
571
- Uploads the Actor to the Apify platform and builds it there.
572
-
573
- ```
574
- USAGE
575
- $ apify push [ACTORID] [--version-number <value>] [-v <value>] [-b <value>] [-w <value>] [--no-prompt]
576
- [--force]
577
-
578
- ARGUMENTS
579
- ACTORID Name or ID of the Actor to push (e.g. "apify/hello-world" or "E2jjCZBezvAZnX8Rb"). If not provided, the
580
- command will create or modify the Actor with the name specified in ".actor/actor.json" file.
581
-
582
- FLAGS
583
- -b, --build-tag=<value> Build tag to be applied to the successful Actor build. By default, it is taken from the
584
- ".actor/actor.json" file
585
- -v, --version=<value> Actor version number to which the files should be pushed. By default, it is taken from
586
- the ".actor/actor.json" file.
587
- -w, --wait-for-finish=<value> Seconds for waiting to build to finish, if no value passed, it waits forever.
588
- --force Push an Actor even when the local files are older than the Actor on the platform.
589
- --no-prompt Do not prompt for opening the Actor details in a browser. This will also not open the
590
- browser automatically.
591
- --version-number=<value> DEPRECATED: Use flag version instead. Actor version number to which the files should be
592
- pushed. By default, it is taken from the ".actor/actor.json" file.
593
-
594
- DESCRIPTION
595
- Uploads the Actor to the Apify platform and builds it there.
596
- The Actor settings are read from the ".actor/actor.json" file in the current directory, but they can be overridden
597
- using command-line options.
598
- NOTE: If the source files are smaller than 3 MB then they are uploaded as
599
- "Multiple source files", otherwise they are uploaded as "Zip file".
600
-
601
- When there's an attempt to push files that are older than the Actor on the platform, the command will fail. Can be
602
- overwritten with --force flag.
603
- ```
604
-
605
- _See code: [src/commands/push.ts](https://github.com/apify/apify-cli/blob/v1.0.0-beta.99/src/commands/push.ts)_
606
-
607
- ## `apify run`
608
-
609
- Runs the Actor locally in the current directory.
610
-
611
- ```
612
- USAGE
613
- $ apify run [-p] [--purge-queue] [--purge-dataset] [--purge-key-value-store] [--entrypoint <value>]
614
-
615
- FLAGS
616
- -p, --purge Shortcut that combines the --purge-queue, --purge-dataset and --purge-key-value-store
617
- options.
618
- --entrypoint=<value> Optional entrypoint for running with injected environment variables.
619
- For Python, it is the module name, or a path to a file.
620
- For node.js, it is the npm script name, or a path to a JS/MJS file. You can also pass in
621
- a directory name, provided that directory contains an "index.js" file.
622
- --purge-dataset Deletes the local directory containing the default dataset before the run starts.
623
- --purge-key-value-store Deletes all records from the default key-value store in the local directory before the
624
- run starts, except for the "INPUT" key.
625
- --purge-queue Deletes the local directory containing the default request queue before the run starts.
626
-
627
- DESCRIPTION
628
- Runs the Actor locally in the current directory.
629
- It sets various APIFY_XYZ environment variables in order to provide a working execution environment for the Actor. For
630
- example, this causes the Actor input, as well as all other data in key-value stores, datasets or request queues to be
631
- stored in the "storage" directory, rather than on the Apify platform.
632
-
633
- NOTE: You can override the command's default behavior for Node.js Actors by overriding the "start" script in the
634
- package.json file. You can set up your own main file or environment variables by changing it.
635
- ```
636
-
637
- _See code: [src/commands/run.ts](https://github.com/apify/apify-cli/blob/v1.0.0-beta.99/src/commands/run.ts)_
638
-
639
- ## `apify secrets`
640
-
641
- Manages secret values for Actor environment variables.
642
-
643
- ```
644
- USAGE
645
- $ apify secrets
646
-
647
- DESCRIPTION
648
- Manages secret values for Actor environment variables.
649
-
650
- Example:
651
- $ apify secrets add mySecret TopSecretValue123
652
-
653
- Now the "mySecret" value can be used in an environment variable defined in ".actor/actor.json" file by adding the "@"
654
- prefix:
655
-
656
- {
657
- "actorSpecification": 1,
658
- "name": "my_actor",
659
- "environmentVariables": { "SECRET_ENV_VAR": "@mySecret" },
660
- "version": "0.1
661
- }
662
-
663
- When the Actor is pushed to Apify cloud, the "SECRET_ENV_VAR" and its value is stored as a secret environment variable
664
- of the Actor.
665
- ```
666
-
667
- _See code: [src/commands/secrets/index.ts](https://github.com/apify/apify-cli/blob/v1.0.0-beta.99/src/commands/secrets/index.ts)_
668
-
669
- ## `apify secrets add NAME VALUE`
670
-
671
- Adds a new secret value.
672
-
673
- ```
674
- USAGE
675
- $ apify secrets add NAME VALUE
676
-
677
- ARGUMENTS
678
- NAME Name of the secret
679
- VALUE Value of the secret
680
-
681
- DESCRIPTION
682
- Adds a new secret value.
683
- The secrets are stored to a file at ~/.apify
684
- ```
685
-
686
- _See code: [src/commands/secrets/add.ts](https://github.com/apify/apify-cli/blob/v1.0.0-beta.99/src/commands/secrets/add.ts)_
687
-
688
- ## `apify secrets rm NAME`
689
-
690
- Removes the secret.
691
-
692
- ```
693
- USAGE
694
- $ apify secrets rm NAME
695
-
696
- ARGUMENTS
697
- NAME Name of the secret
698
-
699
- DESCRIPTION
700
- Removes the secret.
701
- ```
702
-
703
- _See code: [src/commands/secrets/rm.ts](https://github.com/apify/apify-cli/blob/v1.0.0-beta.99/src/commands/secrets/rm.ts)_
704
-
705
- ## `apify task`
706
-
707
- Commands are designed to be used to interact with Tasks.
708
-
709
- ```
710
- USAGE
711
- $ apify task
712
-
713
- DESCRIPTION
714
- Commands are designed to be used to interact with Tasks.
715
- ```
716
-
717
- _See code: [src/commands/task/index.ts](https://github.com/apify/apify-cli/blob/v1.0.0-beta.99/src/commands/task/index.ts)_
718
-
719
- ## `apify task run TASKID`
720
-
721
- Runs a specific Actor remotely on the Apify cloud platform.
722
-
723
- ```
724
- USAGE
725
- $ apify task run TASKID [-b <value>] [-t <value>] [-m <value>] [-w <value>]
726
-
727
- ARGUMENTS
728
- TASKID Name or ID of the Task to run (e.g. "my-task" or "E2jjCZBezvAZnX8Rb").
729
-
730
- FLAGS
731
- -b, --build=<value> Tag or number of the build to run (e.g. "latest" or "1.2.34").
732
- -m, --memory=<value> Amount of memory allocated for the Task run, in megabytes.
733
- -t, --timeout=<value> Timeout for the Task run in seconds. Zero value means there is no timeout.
734
- -w, --wait-for-finish=<value> Seconds for waiting to run to finish, if no value passed, it waits forever.
735
-
736
- DESCRIPTION
737
- Runs a specific Actor remotely on the Apify cloud platform.
738
- The Actor is run under your current Apify account. Therefore you need to be logged in by calling "apify login". It
739
- takes input for the Actor from the default local key-value store by default.
740
- ```
741
-
742
- _See code: [src/commands/task/run.ts](https://github.com/apify/apify-cli/blob/v1.0.0-beta.99/src/commands/task/run.ts)_
743
-
744
- ## `apify validate-schema [PATH]`
745
-
746
- Validates input schema and prints errors found.
747
-
748
- ```
749
- USAGE
750
- $ apify validate-schema [PATH]
751
-
752
- ARGUMENTS
753
- PATH Optional path to your INPUT_SCHEMA.json file. If not provided ./INPUT_SCHEMA.json is used.
754
-
755
- DESCRIPTION
756
- Validates input schema and prints errors found.
757
- The input schema for the Actor is used from these locations in order of preference.
758
- The first one found is validated as it would be the one used on the Apify platform.
759
- 1. Directly embedded object in ".actor/actor.json" under 'input' key
760
- 2. Path to JSON file referenced in ".actor/actor.json" under 'input' key
761
- 3. JSON file at .actor/INPUT_SCHEMA.json
762
- 4. JSON file at INPUT_SCHEMA.json
763
-
764
- You can also pass any custom path to your input schema to have it validated instead.
765
- ```
766
-
767
- _See code: [src/commands/validate-schema.ts](https://github.com/apify/apify-cli/blob/v1.0.0-beta.99/src/commands/validate-schema.ts)_
768
- <!-- commandsstop -->
283
+ See a list of all our commands on the [reference page](https://docs.apify.com/cli/docs/reference)