From 41f94e346ffc3880b17bcc3d173b45da6e02add4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Olender?= Date: Tue, 14 Jan 2025 22:45:50 +0100 Subject: [PATCH 01/14] feat: rewrite command descriptions --- src/commands/actor/index.ts | 2 +- src/commands/actor/push-data.ts | 12 +++++------ src/commands/actor/set-value.ts | 6 +++--- src/commands/actors/call.ts | 6 +++--- src/commands/actors/index.ts | 2 +- src/commands/actors/ls.ts | 2 +- src/commands/actors/pull.ts | 4 ++-- src/commands/actors/push.ts | 10 +++------ src/commands/actors/rm.ts | 2 +- src/commands/actors/start.ts | 6 +++--- src/commands/builds/index.ts | 2 +- src/commands/builds/rm.ts | 2 +- src/commands/create.ts | 2 +- src/commands/datasets/create.ts | 2 +- src/commands/datasets/get-items.ts | 2 +- src/commands/datasets/index.ts | 2 +- src/commands/datasets/info.ts | 2 +- src/commands/datasets/ls.ts | 10 ++++----- src/commands/datasets/push-items.ts | 6 +++--- src/commands/datasets/rename.ts | 16 +++++++-------- src/commands/datasets/rm.ts | 6 +++--- src/commands/info.ts | 3 +-- src/commands/init.ts | 11 +++++----- src/commands/key-value-stores/create.ts | 6 +++--- src/commands/key-value-stores/get-value.ts | 2 +- src/commands/key-value-stores/index.ts | 2 +- src/commands/key-value-stores/ls.ts | 12 +++++------ src/commands/key-value-stores/set-value.ts | 2 +- src/commands/login.ts | 6 +++--- src/commands/logout.ts | 4 ++-- src/commands/request-queues/index.ts | 2 +- src/commands/run.ts | 11 +++------- src/commands/secrets/add.ts | 2 +- src/commands/secrets/index.ts | 24 ++++++++++++---------- src/commands/secrets/rm.ts | 2 +- src/commands/task/index.ts | 2 +- src/commands/task/run.ts | 6 +++--- src/commands/validate-schema.ts | 17 +++++++-------- 38 files changed, 103 insertions(+), 115 deletions(-) diff --git a/src/commands/actor/index.ts b/src/commands/actor/index.ts index c2eaa567..b3a360c5 100644 --- a/src/commands/actor/index.ts +++ b/src/commands/actor/index.ts @@ -2,7 +2,7 @@ import { ApifyCommand } from '../../lib/apify_command.js'; export class ActorIndexCommand extends ApifyCommand { static override description = - 'Commands are designed to be used in Actor runs. All commands are in PoC state, do not use in production environments.\n'; + 'Manages data operations during Actor execution\nNote: Commands are in preview state. Do not use in production environment.\n'; async run() { await this.printHelp(); diff --git a/src/commands/actor/push-data.ts b/src/commands/actor/push-data.ts index a33bae4b..09a348d8 100644 --- a/src/commands/actor/push-data.ts +++ b/src/commands/actor/push-data.ts @@ -7,12 +7,12 @@ import { error } from '../../lib/outputs.js'; export class PushDataCommand extends ApifyCommand { static override description = - 'Stores an object or an array of objects to the default dataset of the Actor run.\n' + - 'It is possible to pass data using item argument or stdin.\n' + - 'Passing data using argument:\n' + - '$ apify actor push-data {"foo": "bar"}\n' + - 'Passing data using stdin with pipe:\n' + - '$ cat ./test.json | apify actor push-data\n'; + 'Saves data to Actor\'s run default dataset.\n\n' + + 'Accept input as:\n' + + ' - JSON argument:\n' + + ' $ apify actor push-data {"key": "value"}\n' + + ' - Piped stdin:\n' + + ' $ cat ./test.json | apify actor push-data\n'; static override args = { item: Args.string({ diff --git a/src/commands/actor/set-value.ts b/src/commands/actor/set-value.ts index 481e7576..0595b23e 100644 --- a/src/commands/actor/set-value.ts +++ b/src/commands/actor/set-value.ts @@ -5,10 +5,10 @@ import { ApifyCommand } from '../../lib/apify_command.js'; export class SetValueCommand extends ApifyCommand { static override description = - 'Sets or removes record into the default KeyValueStore associated with the Actor run.\n' + - 'It is possible to pass data using argument or stdin.\n' + + 'Sets or removes record into the default KeyValueStore associated with the Actor run.\n\n' + + 'It is possible to pass data using argument or stdin.\n\n' + 'Passing data using argument:\n' + - '$ apify actor set-value KEY my-value\n' + + '$ apify actor set-value KEY my-value\n\n' + 'Passing data using stdin with pipe:\n' + '$ cat ./my-text-file.txt | apify actor set-value KEY --contentType text/plain\n'; diff --git a/src/commands/actors/call.ts b/src/commands/actors/call.ts index 5ef627ee..e58ed7cc 100644 --- a/src/commands/actors/call.ts +++ b/src/commands/actors/call.ts @@ -20,9 +20,9 @@ import { getLocalConfig, getLocalUserInfo, getLoggedClientOrThrow, TimestampForm export class ActorsCallCommand extends ApifyCommand { static override description = - 'Runs a specific Actor remotely on the Apify cloud platform.\n' + - 'The 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.'; + 'Requires login.\n' + + 'Executes Actor remotely using your authenticated account.\n' + + 'Reads input from local key-value store by default.\n'; static override flags = { ...SharedRunOnCloudFlags('Actor'), diff --git a/src/commands/actors/index.ts b/src/commands/actors/index.ts index 0a29e6b4..b5cdaee0 100644 --- a/src/commands/actors/index.ts +++ b/src/commands/actors/index.ts @@ -1,7 +1,7 @@ import { ApifyCommand } from '../../lib/apify_command.js'; export class ActorIndexCommand extends ApifyCommand { - static override description = 'Commands are designed to be used with Actors.'; + static override description = 'Manages Actor creation, deployment, and execution on the Apify platform.'; async run() { await this.printHelp(); diff --git a/src/commands/actors/ls.ts b/src/commands/actors/ls.ts index e61ad076..ee2a919b 100644 --- a/src/commands/actors/ls.ts +++ b/src/commands/actors/ls.ts @@ -93,7 +93,7 @@ interface HydratedListData { } export class ActorsLsCommand extends ApifyCommand { - static override description = 'Lists all recently ran Actors or your own Actors.'; + static override description = 'Prints a list of recently executed Actors or Actors you own.'; static override flags = { my: Flags.boolean({ diff --git a/src/commands/actors/pull.ts b/src/commands/actors/pull.ts index 02238a97..72d98ee2 100644 --- a/src/commands/actors/pull.ts +++ b/src/commands/actors/pull.ts @@ -24,8 +24,8 @@ const extractGitHubZip = async (url: string, directoryPath: string) => { export class ActorsPullCommand extends ApifyCommand { static override 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.'; + 'Download Actor code to current directory. ' + + 'Clones Git repositories or fetches Web IDE files based on Actor source type.'; static override flags = { version: Flags.string({ diff --git a/src/commands/actors/push.ts b/src/commands/actors/push.ts index 01c3a33b..b223c874 100644 --- a/src/commands/actors/push.ts +++ b/src/commands/actors/push.ts @@ -41,13 +41,9 @@ const DEFAULT_BUILD_TAG = 'latest'; export class ActorsPushCommand extends ApifyCommand { static override description = - 'Uploads the Actor to the Apify platform and builds it there.\n' + - `The Actor settings are read from the "${LOCAL_CONFIG_PATH}" file in the current directory, but they can be overridden using command-line options.\n` + - `NOTE: If the source files are smaller than ${ - MAX_MULTIFILE_BYTES / 1024 ** 2 - } MB then they are uploaded as \n` + - '"Multiple source files", otherwise they are uploaded as "Zip file".\n\n' + - "When there's an attempt to push files that are older than the Actor on the platform, the command will fail. Can be overwritten with --force flag."; + 'Deploys Actor to Apify platform using settings from actor.json.\n' + + 'Files under 3MB upload as "Multiple source files"; larger projects upload as ZIP file.\n' + + 'Use --force to override newer remote versions.\n'; static override flags = { version: Flags.string({ diff --git a/src/commands/actors/rm.ts b/src/commands/actors/rm.ts index 6a0fc713..cab233c4 100644 --- a/src/commands/actors/rm.ts +++ b/src/commands/actors/rm.ts @@ -7,7 +7,7 @@ import { error, info, success } from '../../lib/outputs.js'; import { getLoggedClientOrThrow } from '../../lib/utils.js'; export class ActorRmCommand extends ApifyCommand { - static override description = 'Deletes an Actor.'; + static override description = 'Permanently removes an Actor from your account.'; static override args = { actorId: Args.string({ diff --git a/src/commands/actors/start.ts b/src/commands/actors/start.ts index 9808c7ad..d84fa50b 100644 --- a/src/commands/actors/start.ts +++ b/src/commands/actors/start.ts @@ -12,9 +12,9 @@ import { getLocalConfig, getLocalUserInfo, getLoggedClientOrThrow, TimestampForm export class ActorsStartCommand extends ApifyCommand { static override description = - 'Runs a specific Actor remotely on the Apify cloud platform and immediately returns information about the run.\n' + - 'The 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.'; + 'Requires login.\n' + + 'Starts Actor remotely and returns run details immediately.\n' + + 'Uses authenticated account and local key-value store for input.\n'; static override flags = { ...SharedRunOnCloudFlags('Actor'), diff --git a/src/commands/builds/index.ts b/src/commands/builds/index.ts index e66fa0b6..e804d3b5 100644 --- a/src/commands/builds/index.ts +++ b/src/commands/builds/index.ts @@ -1,7 +1,7 @@ import { ApifyCommand } from '../../lib/apify_command.js'; export class ActorIndexCommand extends ApifyCommand { - static override description = 'Commands are designed to be used with Actor Builds.'; + static override description = 'Manages Actor build processes and versioning.'; async run() { await this.printHelp(); diff --git a/src/commands/builds/rm.ts b/src/commands/builds/rm.ts index 79132537..bba7dc39 100644 --- a/src/commands/builds/rm.ts +++ b/src/commands/builds/rm.ts @@ -7,7 +7,7 @@ import { error, info, success } from '../../lib/outputs.js'; import { getLoggedClientOrThrow } from '../../lib/utils.js'; export class BuildsRmCommand extends ApifyCommand { - static override description = 'Deletes an Actor Build.'; + static override description = 'Permanently removes an Actor build from the Apify platform'; static override args = { buildId: Args.string({ diff --git a/src/commands/create.ts b/src/commands/create.ts index 7133d33f..edd6fc62 100644 --- a/src/commands/create.ts +++ b/src/commands/create.ts @@ -29,7 +29,7 @@ import { } from '../lib/utils.js'; export class CreateCommand extends ApifyCommand { - static override description = 'Creates a new Actor project directory from a selected boilerplate template.'; + static override description = 'Creates an Actor project from a template in a new directory.'; static override flags = { template: Flags.string({ diff --git a/src/commands/datasets/create.ts b/src/commands/datasets/create.ts index b1b91ac5..36b3f427 100644 --- a/src/commands/datasets/create.ts +++ b/src/commands/datasets/create.ts @@ -7,7 +7,7 @@ import { error, success } from '../../lib/outputs.js'; import { getLoggedClientOrThrow } from '../../lib/utils.js'; export class DatasetsCreateCommand extends ApifyCommand { - static override description = 'Creates a new Dataset on your account'; + static override description = 'Creates named dataset for storing structured data on your account.'; static override args = { datasetName: Args.string({ diff --git a/src/commands/datasets/get-items.ts b/src/commands/datasets/get-items.ts index 28a9844b..58f89ae9 100644 --- a/src/commands/datasets/get-items.ts +++ b/src/commands/datasets/get-items.ts @@ -17,7 +17,7 @@ const downloadFormatToContentType: Record = { }; export class DatasetsGetItems extends ApifyCommand { - static override description = 'Exports the items present in a Dataset.'; + static override description = 'Retrieves dataset items in specified format (JSON, CSV, etc).'; static override flags = { limit: Flags.integer({ diff --git a/src/commands/datasets/index.ts b/src/commands/datasets/index.ts index c8a55dac..b73e2a19 100644 --- a/src/commands/datasets/index.ts +++ b/src/commands/datasets/index.ts @@ -1,7 +1,7 @@ import { ApifyCommand } from '../../lib/apify_command.js'; export class DatasetsIndexCommand extends ApifyCommand { - static override description = 'Commands are designed to be used with Datasets.'; + static override description = 'Manages structured data storage and retrieval.'; async run() { await this.printHelp(); diff --git a/src/commands/datasets/info.ts b/src/commands/datasets/info.ts index 222f4335..12fc2702 100644 --- a/src/commands/datasets/info.ts +++ b/src/commands/datasets/info.ts @@ -16,7 +16,7 @@ const consoleLikeTable = new ResponsiveTable({ }); export class DatasetsInfoCommand extends ApifyCommand { - static override description = 'Shows information about a dataset.'; + static override description = 'Prints information about a specific dataset.'; static override args = { storeId: Args.string({ diff --git a/src/commands/datasets/ls.ts b/src/commands/datasets/ls.ts index 4628d6bf..22a71c79 100644 --- a/src/commands/datasets/ls.ts +++ b/src/commands/datasets/ls.ts @@ -16,23 +16,23 @@ const table = new ResponsiveTable({ }); export class DatasetsLsCommand extends ApifyCommand { - static override description = 'Lists all Datasets on your account.'; + static override description = 'Prints all datasets on your account.'; static override flags = { offset: Flags.integer({ - description: 'Number of Datasets that will be skipped.', + description: 'Number of datasets that will be skipped.', default: 0, }), limit: Flags.integer({ - description: 'Number of Datasets that will be listed.', + description: 'Number of datasets that will be listed.', default: 20, }), desc: Flags.boolean({ - description: 'Sorts Datasets in descending order.', + description: 'Sorts datasets in descending order.', default: false, }), unnamed: Flags.boolean({ - description: "Lists Datasets that don't have a name set.", + description: "Lists datasets that don't have a name set.", default: false, }), }; diff --git a/src/commands/datasets/push-items.ts b/src/commands/datasets/push-items.ts index 8b593e93..14919647 100644 --- a/src/commands/datasets/push-items.ts +++ b/src/commands/datasets/push-items.ts @@ -9,12 +9,12 @@ import { error, success } from '../../lib/outputs.js'; import { getLoggedClientOrThrow } from '../../lib/utils.js'; export class DatasetsPushDataCommand extends ApifyCommand { - static override description = 'Pushes an object or an array of objects to the provided Dataset.'; + static override description = 'Adds data items to specified dataset. Accepts single object or array of objects.'; static override args = { nameOrId: Args.string({ required: true, - description: 'The Dataset ID or name to push the objects to', + description: 'The dataset ID or name to push the objects to', ignoreStdin: true, }), item: Args.string({ @@ -30,7 +30,7 @@ export class DatasetsPushDataCommand extends ApifyCommand { - static override description = 'Renames a Dataset, or removes its unique name'; + static override description = 'Change dataset name or removes name with --unname flag.'; static override flags = { unname: Flags.boolean({ - description: 'Removes the unique name of the Dataset', + description: 'Removes the unique name of the dataset.', }), }; static override args = { nameOrId: Args.string({ - description: 'The Dataset ID or name to delete', + description: 'The dataset ID or name to delete.', required: true, }), newName: Args.string({ - description: 'The new name for the Dataset', + description: 'The new name for the dataset.', }), }; @@ -57,14 +57,14 @@ export class DatasetsRenameCommand extends ApifyCommand { if (!name) { - return `The name of the Dataset with ID ${chalk.yellow(id)} has been set to: ${chalk.yellow(newName)}`; + return `The name of the dataset with ID ${chalk.yellow(id)} has been set to: ${chalk.yellow(newName)}`; } if (unname) { - return `The name of the Dataset with ID ${chalk.yellow(id)} has been removed (was ${chalk.yellow(name)} previously).`; + return `The name of the dataset with ID ${chalk.yellow(id)} has been removed (was ${chalk.yellow(name)} previously).`; } - return `The name of the Dataset with ID ${chalk.yellow(id)} was changed from ${chalk.yellow(name)} to ${chalk.yellow(newName)}.`; + return `The name of the dataset with ID ${chalk.yellow(id)} was changed from ${chalk.yellow(name)} to ${chalk.yellow(newName)}.`; })(); try { @@ -78,7 +78,7 @@ export class DatasetsRenameCommand extends ApifyCommand { - static override description = 'Deletes a Dataset'; + static override description = 'Permanently removes a dataset.'; static override args = { datasetNameOrId: Args.string({ - description: 'The Dataset ID or name to delete', + description: 'The dataset ID or name to delete', required: true, }), }; @@ -53,7 +53,7 @@ export class DatasetsRmCommand extends ApifyCommand { const casted = err as ApifyApiError; error({ - message: `Failed to delete Dataset with ID ${chalk.yellow(id)}\n ${casted.message || casted}`, + message: `Failed to delete dataset with ID ${chalk.yellow(id)}\n ${casted.message || casted}`, }); } } diff --git a/src/commands/info.ts b/src/commands/info.ts index 65f0844f..7f508727 100644 --- a/src/commands/info.ts +++ b/src/commands/info.ts @@ -5,8 +5,7 @@ import { getLocalUserInfo, getLoggedClientOrThrow } from '../lib/utils.js'; export class InfoCommand extends ApifyCommand { static override description = - 'Displays information about the currently active Apify account.\n' + - 'The information is printed to the console.'; + 'Prints details about your currently authenticated Apify account.'; async run() { await getLoggedClientOrThrow(); diff --git a/src/commands/init.ts b/src/commands/init.ts index dc4daa9b..df56b79c 100644 --- a/src/commands/init.ts +++ b/src/commands/init.ts @@ -28,13 +28,12 @@ import { export class InitCommand extends ApifyCommand { static override description = - 'Initializes a new Actor project in an existing directory.\n' + - `If the directory contains a Scrapy project in Python, the command automatically creates wrappers so that you can run your scrapers without changes.\n\n` + - `The command creates the "${LOCAL_CONFIG_PATH}" file and the "${DEFAULT_LOCAL_STORAGE_DIR}" directory in the current directory, ` + - 'but does not touch any other existing files or directories.\n\n' + - `WARNING: The directory at "${DEFAULT_LOCAL_STORAGE_DIR}" will be overwritten if it already exists.`; + 'Sets up an Actor project in your current directory by creating actor.json and storage files.\n' + + 'If the directory contains a Scrapy project in Python, the command automatically creates wrappers so that you can run your scrapers without changes.\n' + + '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\n' + + 'WARNING: Overwrites existing \'storage\' directory.\n'; - static override args = { + static override args = { actorName: Args.string({ required: false, description: 'Name of the Actor. If not provided, you will be prompted for it.', diff --git a/src/commands/key-value-stores/create.ts b/src/commands/key-value-stores/create.ts index 3bf7bc0d..fc5910de 100644 --- a/src/commands/key-value-stores/create.ts +++ b/src/commands/key-value-stores/create.ts @@ -7,13 +7,13 @@ import { error, success } from '../../lib/outputs.js'; import { getLoggedClientOrThrow } from '../../lib/utils.js'; export class KeyValueStoresCreateCommand extends ApifyCommand { - static override description = 'Creates a new Key-value store on your account'; + static override description = 'Creates a new key-value store on your account'; static override hiddenAliases = ['kvs:create']; static override args = { keyValueStoreName: Args.string({ - description: 'Optional name for the Key-value store', + description: 'Optional name for the key-value store', required: false, }), }; @@ -29,7 +29,7 @@ export class KeyValueStoresCreateCommand extends ApifyCommand { - static override description = 'Gets a value by key in the given key-value store.'; + static override description = 'Retrieves stored value for specified key. Use --only-content-type to check MIME type.'; static override hiddenAliases = ['kvs:get-value']; diff --git a/src/commands/key-value-stores/index.ts b/src/commands/key-value-stores/index.ts index d6b7c980..71d1a6f9 100644 --- a/src/commands/key-value-stores/index.ts +++ b/src/commands/key-value-stores/index.ts @@ -1,7 +1,7 @@ import { ApifyCommand } from '../../lib/apify_command.js'; export class KeyValueStoresIndexCommand extends ApifyCommand { - static override description = 'Commands are designed to be used with Key Value Stores.\n\nAliases: kvs'; + static override description = 'Manages persistent key-value storage.\n\nAlias: kvs'; static override hiddenAliases = ['kvs']; diff --git a/src/commands/key-value-stores/ls.ts b/src/commands/key-value-stores/ls.ts index 6c0bc925..69ce3485 100644 --- a/src/commands/key-value-stores/ls.ts +++ b/src/commands/key-value-stores/ls.ts @@ -13,25 +13,25 @@ const table = new ResponsiveTable({ }); export class KeyValueStoresLsCommand extends ApifyCommand { - static override description = 'Lists all Key-value stores on your account.'; + static override description = 'Lists all key-value stores on your account.'; static override hiddenAliases = ['kvs:ls']; static override flags = { offset: Flags.integer({ - description: 'Number of Key-value stores that will be skipped.', + description: 'Number of key-value stores that will be skipped.', default: 0, }), limit: Flags.integer({ - description: 'Number of Key-value stores that will be listed.', + description: 'Number of key-value stores that will be listed.', default: 20, }), desc: Flags.boolean({ - description: 'Sorts Key-value stores in descending order.', + description: 'Sorts key-value stores in descending order.', default: false, }), unnamed: Flags.boolean({ - description: "Lists Key-value stores that don't have a name set.", + description: "Lists key-value stores that don't have a name set.", default: false, }), }; @@ -52,7 +52,7 @@ export class KeyValueStoresLsCommand extends ApifyCommand { - static override description = 'Sets a value in a key-value store.'; + static override description = 'Stores value with specified key. Set content-type with --content-type flag.'; static override hiddenAliases = ['kvs:set-value']; diff --git a/src/commands/login.ts b/src/commands/login.ts index 1403e96b..c280ae51 100644 --- a/src/commands/login.ts +++ b/src/commands/login.ts @@ -41,9 +41,9 @@ const tryToLogin = async (token: string) => { export class LoginCommand extends ApifyCommand { static override description = - 'Logs in to your Apify account.\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".'; + 'Authenticates your Apify account and saves credentials to ~/.apify.\n' + + 'All other commands use these stored credentials.\n\n' + + 'Use \'apify logout\' to remove authentication.\n'; static override flags = { token: Flags.string({ diff --git a/src/commands/logout.ts b/src/commands/logout.ts index 566f7ba9..235efe50 100644 --- a/src/commands/logout.ts +++ b/src/commands/logout.ts @@ -6,8 +6,8 @@ import { regenerateLocalDistinctId } from '../lib/telemetry.js'; export class LogoutCommand extends ApifyCommand { static override 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".'; + 'Removes authentiocation by deleting your API token and account information from ~/.apify.\n' + + 'Run \'apify login\' to auethenticate again.'; async run() { await rimrafPromised(AUTH_FILE_PATH()); diff --git a/src/commands/request-queues/index.ts b/src/commands/request-queues/index.ts index 6303bf04..808d18df 100644 --- a/src/commands/request-queues/index.ts +++ b/src/commands/request-queues/index.ts @@ -1,7 +1,7 @@ import { ApifyCommand } from '../../lib/apify_command.js'; export class RequestQueuesIndexCommand extends ApifyCommand { - static override description = 'Commands are designed to be used with Request Queues.'; + static override description = 'Manages URL queues for web scraping and automation tasks.'; async run() { await this.printHelp(); diff --git a/src/commands/run.ts b/src/commands/run.ts index f7806135..33ed6d39 100644 --- a/src/commands/run.ts +++ b/src/commands/run.ts @@ -48,14 +48,9 @@ import { export class RunCommand extends ApifyCommand { static override description = - 'Runs the Actor locally in the current directory.\n' + - 'It 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 "${DEFAULT_LOCAL_STORAGE_DIR}" directory, ` + - 'rather than on the Apify platform.\n\n' + - 'NOTE: 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.'; + 'Executes Actor locally with simulated Apify environment variables.\n' + + 'Stores data in local \'storage\' directory.\n\n' + + 'NOTE: For Node.js Actors, customize behavior by modifying the \'start\' script in package.json file.\n'; static override flags = { purge: Flags.boolean({ diff --git a/src/commands/secrets/add.ts b/src/commands/secrets/add.ts index 0801022a..0105bb52 100644 --- a/src/commands/secrets/add.ts +++ b/src/commands/secrets/add.ts @@ -4,7 +4,7 @@ import { ApifyCommand } from '../../lib/apify_command.js'; import { addSecret } from '../../lib/secrets.js'; export class SecretsAddCommand extends ApifyCommand { - static override description = 'Adds a new secret value.\nThe secrets are stored to a file at ~/.apify'; + static override description = ' Adds a new secret to ~/.apify for use in Actor environment variables.'; static override args = { name: Args.string({ diff --git a/src/commands/secrets/index.ts b/src/commands/secrets/index.ts index 79c5b8ce..e7a16d71 100644 --- a/src/commands/secrets/index.ts +++ b/src/commands/secrets/index.ts @@ -3,17 +3,19 @@ import { LOCAL_CONFIG_PATH } from '../../lib/consts.js'; export class SecretsIndexCommand extends ApifyCommand { static override description = - 'Manages secret values for Actor environment variables.\n\n' + - 'Example:\n' + - '$ apify secrets add mySecret TopSecretValue123\n\n' + - `Now the "mySecret" value can be used in an environment variable defined in "${LOCAL_CONFIG_PATH}" 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\n' + - 'When the Actor is pushed to Apify cloud, the "SECRET_ENV_VAR" and its value is stored as a secret environment variable of the Actor.'; + ' Manages secure environment variables for Actors.\n\n' + + ' Example:\n' + + ' $ apify secrets add mySecret TopSecretValue123\n\n' + + ' Now the "mySecret" value can be used in an environment variable defined in ".actor/actor.json" file by adding the "@"\n' + + ' prefix:\n\n' + + ' {\n' + + ' "actorSpecification": 1,\n' + + ' "name": "my_actor",\n' + + ' "environmentVariables": { "SECRET_ENV_VAR": "@mySecret" },\n' + + ' "version": "0.1"\n' + + ' }\n\n' + + ' When the Actor is pushed to Apify cloud, the "SECRET_ENV_VAR" and its value is stored as a secret environment variable\n' + + ' of the Actor.\n'; async run() { await this.printHelp(); diff --git a/src/commands/secrets/rm.ts b/src/commands/secrets/rm.ts index 1a83533e..786da24e 100644 --- a/src/commands/secrets/rm.ts +++ b/src/commands/secrets/rm.ts @@ -4,7 +4,7 @@ import { ApifyCommand } from '../../lib/apify_command.js'; import { removeSecret } from '../../lib/secrets.js'; export class SecretRmCommand extends ApifyCommand { - static override description = 'Removes the secret.'; + static override description = 'Permanently deletes a secret from your stored credentials.'; static override args = { name: Args.string({ diff --git a/src/commands/task/index.ts b/src/commands/task/index.ts index 5387dacd..d2068843 100644 --- a/src/commands/task/index.ts +++ b/src/commands/task/index.ts @@ -1,7 +1,7 @@ import { ApifyCommand } from '../../lib/apify_command.js'; export class TasksIndexCommand extends ApifyCommand { - static override description = 'Commands are designed to be used to interact with Tasks.'; + static override description = 'Manages scheduled and predefined Actor configurations.'; async run() { await this.printHelp(); } diff --git a/src/commands/task/run.ts b/src/commands/task/run.ts index 285a3e74..e947c4ed 100644 --- a/src/commands/task/run.ts +++ b/src/commands/task/run.ts @@ -9,9 +9,9 @@ import { getLocalUserInfo, getLoggedClientOrThrow } from '../../lib/utils.js'; export class TaskRunCommand extends ApifyCommand { static override description = - 'Runs a specific Actor remotely on the Apify cloud platform.\n' + - 'The 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.'; + 'Requires prior login.\n' + + 'Executes predefined Actor task remotely using local key-value store for input.\n' + + 'Customize with --memory and --timeout flags.\n'; static override flags = SharedRunOnCloudFlags('Task'); diff --git a/src/commands/validate-schema.ts b/src/commands/validate-schema.ts index af80481f..9b9cfad5 100644 --- a/src/commands/validate-schema.ts +++ b/src/commands/validate-schema.ts @@ -10,16 +10,13 @@ import { info, success } from '../lib/outputs.js'; import { Ajv } from '../lib/utils.js'; export class ValidateInputSchemaCommand extends ApifyCommand { - static override description = `Validates input schema and prints errors found. -The input schema for the Actor is used from these locations in order of preference. -The first one found is validated as it would be the one used on the Apify platform. -1. Directly embedded object in "${LOCAL_CONFIG_PATH}" under 'input' key -2. Path to JSON file referenced in "${LOCAL_CONFIG_PATH}" under 'input' key -3. JSON file at .actor/INPUT_SCHEMA.json -4. JSON file at INPUT_SCHEMA.json - -You can also pass any custom path to your input schema to have it validated instead. -`; + static override description = + 'Validates Actor input schema from one of these locations (in priority order):\n' + + '1. Object in actor.json under \'input\' key\n' + + '2. JSON file path in actor.json \'input\' key\n' + + '3. .actor/INPUT_SCHEMA.json\n' + + '4. INPUT_SCHEMA.json\n\n' + + 'Optionally specify custom schema path to validate.\n'; static override args = { path: Args.string({ From fea2612dc671a530b440f7d72ce96ffe4a700b02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Olender?= Date: Wed, 15 Jan 2025 10:21:06 +0100 Subject: [PATCH 02/14] remove tabs & adjust secret description --- src/commands/actor/push-data.ts | 12 ++++++------ src/commands/secrets/index.ts | 26 +++++++++++++------------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/commands/actor/push-data.ts b/src/commands/actor/push-data.ts index 09a348d8..db801a44 100644 --- a/src/commands/actor/push-data.ts +++ b/src/commands/actor/push-data.ts @@ -7,12 +7,12 @@ import { error } from '../../lib/outputs.js'; export class PushDataCommand extends ApifyCommand { static override description = - 'Saves data to Actor\'s run default dataset.\n\n' + - 'Accept input as:\n' + - ' - JSON argument:\n' + - ' $ apify actor push-data {"key": "value"}\n' + - ' - Piped stdin:\n' + - ' $ cat ./test.json | apify actor push-data\n'; + 'Saves data to Actor\'s run default dataset.\n\n' + + 'Accept input as:\n' + + ' - JSON argument:\n' + + ' $ apify actor push-data {"key": "value"}\n' + + ' - Piped stdin:\n' + + ' $ cat ./test.json | apify actor push-data\n'; static override args = { item: Args.string({ diff --git a/src/commands/secrets/index.ts b/src/commands/secrets/index.ts index e7a16d71..52aea480 100644 --- a/src/commands/secrets/index.ts +++ b/src/commands/secrets/index.ts @@ -3,19 +3,19 @@ import { LOCAL_CONFIG_PATH } from '../../lib/consts.js'; export class SecretsIndexCommand extends ApifyCommand { static override description = - ' Manages secure environment variables for Actors.\n\n' + - ' Example:\n' + - ' $ apify secrets add mySecret TopSecretValue123\n\n' + - ' Now the "mySecret" value can be used in an environment variable defined in ".actor/actor.json" file by adding the "@"\n' + - ' prefix:\n\n' + - ' {\n' + - ' "actorSpecification": 1,\n' + - ' "name": "my_actor",\n' + - ' "environmentVariables": { "SECRET_ENV_VAR": "@mySecret" },\n' + - ' "version": "0.1"\n' + - ' }\n\n' + - ' When the Actor is pushed to Apify cloud, the "SECRET_ENV_VAR" and its value is stored as a secret environment variable\n' + - ' of the Actor.\n'; + 'Manages secure environment variables for Actors.\n\n' + + 'Example:\n' + + '$ apify secrets add mySecret TopSecretValue123\n\n' + + 'The "mySecret" value can be used in an environment variable defined in ".actor/actor.json" file by adding the "@"\n' + + 'prefix:\n\n' + + '{\n' + + ' "actorSpecification": 1,\n' + + ' "name": "my_actor",\n' + + ' "environmentVariables": { "SECRET_ENV_VAR": "@mySecret" },\n' + + ' "version": "0.1"\n' + + '}\n\n' + + 'When the Actor is pushed to Apify cloud, the "SECRET_ENV_VAR" and its value is stored as a secret environment variable\n' + + 'of the Actor.\n'; async run() { await this.printHelp(); From f9dca21815c43943d4267fe0e6c1d33e72465755 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Olender?= Date: Wed, 15 Jan 2025 10:36:18 +0100 Subject: [PATCH 03/14] change directory & config paths to not be hard written --- src/commands/init.ts | 6 +++--- src/commands/run.ts | 2 +- src/commands/secrets/index.ts | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/commands/init.ts b/src/commands/init.ts index df56b79c..702f10e0 100644 --- a/src/commands/init.ts +++ b/src/commands/init.ts @@ -30,10 +30,10 @@ export class InitCommand extends ApifyCommand { static override description = 'Sets up an Actor project in your current directory by creating actor.json and storage files.\n' + 'If the directory contains a Scrapy project in Python, the command automatically creates wrappers so that you can run your scrapers without changes.\n' + - '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\n' + - 'WARNING: Overwrites existing \'storage\' directory.\n'; + 'Creates the "${LOCAL_CONFIG_PATH}" file and the "${DEFAULT_LOCAL_STORAGE_DIR}"directory in the current directory, but does not touch any other existing files or directories.\n\n' + + 'WARNING: Overwrites existing "${LOCAL_CONFIG_PATH}" directory.\n'; - static override args = { + static override args = { actorName: Args.string({ required: false, description: 'Name of the Actor. If not provided, you will be prompted for it.', diff --git a/src/commands/run.ts b/src/commands/run.ts index 33ed6d39..c0936ded 100644 --- a/src/commands/run.ts +++ b/src/commands/run.ts @@ -49,7 +49,7 @@ import { export class RunCommand extends ApifyCommand { static override description = 'Executes Actor locally with simulated Apify environment variables.\n' + - 'Stores data in local \'storage\' directory.\n\n' + + 'Stores data in local "${DEFAULT_LOCAL_STORAGE_DIR}" directory.\n\n' + 'NOTE: For Node.js Actors, customize behavior by modifying the \'start\' script in package.json file.\n'; static override flags = { diff --git a/src/commands/secrets/index.ts b/src/commands/secrets/index.ts index 52aea480..9c8bf7bf 100644 --- a/src/commands/secrets/index.ts +++ b/src/commands/secrets/index.ts @@ -6,7 +6,7 @@ export class SecretsIndexCommand extends ApifyCommand Date: Wed, 15 Jan 2025 10:43:02 +0100 Subject: [PATCH 04/14] another fix --- src/commands/init.ts | 8 ++++---- src/commands/run.ts | 6 +++--- src/commands/secrets/index.ts | 26 +++++++++++++------------- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/commands/init.ts b/src/commands/init.ts index 702f10e0..8378250b 100644 --- a/src/commands/init.ts +++ b/src/commands/init.ts @@ -28,10 +28,10 @@ import { export class InitCommand extends ApifyCommand { static override description = - 'Sets up an Actor project in your current directory by creating actor.json and storage files.\n' + - 'If the directory contains a Scrapy project in Python, the command automatically creates wrappers so that you can run your scrapers without changes.\n' + - 'Creates the "${LOCAL_CONFIG_PATH}" file and the "${DEFAULT_LOCAL_STORAGE_DIR}"directory in the current directory, but does not touch any other existing files or directories.\n\n' + - 'WARNING: Overwrites existing "${LOCAL_CONFIG_PATH}" directory.\n'; + `Sets up an Actor project in your current directory by creating actor.json and storage files.\n` + + `If the directory contains a Scrapy project in Python, the command automatically creates wrappers so that you can run your scrapers without changes.\n` + + `Creates the ${LOCAL_CONFIG_PATH} file and the ${DEFAULT_LOCAL_STORAGE_DIR} directory in the current directory, but does not touch any other existing files or directories.\n\n` + + `WARNING: Overwrites existing ${DEFAULT_LOCAL_STORAGE_DIR} directory.\n`; static override args = { actorName: Args.string({ diff --git a/src/commands/run.ts b/src/commands/run.ts index c0936ded..455d9a8b 100644 --- a/src/commands/run.ts +++ b/src/commands/run.ts @@ -48,9 +48,9 @@ import { export class RunCommand extends ApifyCommand { static override description = - 'Executes Actor locally with simulated Apify environment variables.\n' + - 'Stores data in local "${DEFAULT_LOCAL_STORAGE_DIR}" directory.\n\n' + - 'NOTE: For Node.js Actors, customize behavior by modifying the \'start\' script in package.json file.\n'; + `Executes Actor locally with simulated Apify environment variables.\n` + + `Stores data in local ${DEFAULT_LOCAL_STORAGE_DIR} directory.\n\n` + + `NOTE: For Node.js Actors, customize behavior by modifying the 'start' script in package.json file.\n`; static override flags = { purge: Flags.boolean({ diff --git a/src/commands/secrets/index.ts b/src/commands/secrets/index.ts index 9c8bf7bf..2b351189 100644 --- a/src/commands/secrets/index.ts +++ b/src/commands/secrets/index.ts @@ -3,19 +3,19 @@ import { LOCAL_CONFIG_PATH } from '../../lib/consts.js'; export class SecretsIndexCommand extends ApifyCommand { static override description = - 'Manages secure environment variables for Actors.\n\n' + - 'Example:\n' + - '$ apify secrets add mySecret TopSecretValue123\n\n' + - 'The "mySecret" value can be used in an environment variable defined in "${LOCAL_CONFIG_PATH}" file by adding the "@"\n' + - 'prefix:\n\n' + - '{\n' + - ' "actorSpecification": 1,\n' + - ' "name": "my_actor",\n' + - ' "environmentVariables": { "SECRET_ENV_VAR": "@mySecret" },\n' + - ' "version": "0.1"\n' + - '}\n\n' + - 'When the Actor is pushed to Apify cloud, the "SECRET_ENV_VAR" and its value is stored as a secret environment variable\n' + - 'of the Actor.\n'; + `Manages secure environment variables for Actors.\n\n` + + `Example:\n` + + `$ apify secrets add mySecret TopSecretValue123\n\n` + + `The "mySecret" value can be used in an environment variable defined in ${LOCAL_CONFIG_PATH} file by adding the "@"\n` + + `prefix:\n\n` + + `{\n` + + ` "actorSpecification": 1,\n` + + ` "name": "my_actor",\n` + + ` "environmentVariables": { "SECRET_ENV_VAR": "@mySecret" },\n` + + ` "version": "0.1"\n` + + `}\n\n` + + `When the Actor is pushed to Apify cloud, the "SECRET_ENV_VAR" and its value is stored as a secret environment variable\n` + + `of the Actor.\n`; async run() { await this.printHelp(); From 04ed3ae6dacd9c68b8daa3701412cc58b20af9c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Olender?= Date: Wed, 15 Jan 2025 11:00:52 +0100 Subject: [PATCH 05/14] lint fixes --- src/commands/actor/push-data.ts | 2 +- src/commands/info.ts | 3 +-- src/commands/key-value-stores/get-value.ts | 3 ++- src/commands/login.ts | 2 +- src/commands/logout.ts | 2 +- src/commands/secrets/index.ts | 26 +++++++++++----------- src/commands/validate-schema.ts | 6 ++--- 7 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/commands/actor/push-data.ts b/src/commands/actor/push-data.ts index db801a44..d4f55785 100644 --- a/src/commands/actor/push-data.ts +++ b/src/commands/actor/push-data.ts @@ -7,7 +7,7 @@ import { error } from '../../lib/outputs.js'; export class PushDataCommand extends ApifyCommand { static override description = - 'Saves data to Actor\'s run default dataset.\n\n' + + "Saves data to Actor's run default dataset.\n\n" + 'Accept input as:\n' + ' - JSON argument:\n' + ' $ apify actor push-data {"key": "value"}\n' + diff --git a/src/commands/info.ts b/src/commands/info.ts index 7f508727..e398568c 100644 --- a/src/commands/info.ts +++ b/src/commands/info.ts @@ -4,8 +4,7 @@ import { ApifyCommand } from '../lib/apify_command.js'; import { getLocalUserInfo, getLoggedClientOrThrow } from '../lib/utils.js'; export class InfoCommand extends ApifyCommand { - static override description = - 'Prints details about your currently authenticated Apify account.'; + static override description = 'Prints details about your currently authenticated Apify account.'; async run() { await getLoggedClientOrThrow(); diff --git a/src/commands/key-value-stores/get-value.ts b/src/commands/key-value-stores/get-value.ts index d65e38f0..b0261b39 100644 --- a/src/commands/key-value-stores/get-value.ts +++ b/src/commands/key-value-stores/get-value.ts @@ -6,7 +6,8 @@ import { error, simpleLog } from '../../lib/outputs.js'; import { getLoggedClientOrThrow } from '../../lib/utils.js'; export class KeyValueStoresGetValueCommand extends ApifyCommand { - static override description = 'Retrieves stored value for specified key. Use --only-content-type to check MIME type.'; + static override description = + 'Retrieves stored value for specified key. Use --only-content-type to check MIME type.'; static override hiddenAliases = ['kvs:get-value']; diff --git a/src/commands/login.ts b/src/commands/login.ts index c280ae51..11679c2b 100644 --- a/src/commands/login.ts +++ b/src/commands/login.ts @@ -43,7 +43,7 @@ export class LoginCommand extends ApifyCommand { static override description = 'Authenticates your Apify account and saves credentials to ~/.apify.\n' + 'All other commands use these stored credentials.\n\n' + - 'Use \'apify logout\' to remove authentication.\n'; + "Use 'apify logout' to remove authentication.\n"; static override flags = { token: Flags.string({ diff --git a/src/commands/logout.ts b/src/commands/logout.ts index 235efe50..d685dde6 100644 --- a/src/commands/logout.ts +++ b/src/commands/logout.ts @@ -7,7 +7,7 @@ import { regenerateLocalDistinctId } from '../lib/telemetry.js'; export class LogoutCommand extends ApifyCommand { static override description = 'Removes authentiocation by deleting your API token and account information from ~/.apify.\n' + - 'Run \'apify login\' to auethenticate again.'; + "Run 'apify login' to auethenticate again."; async run() { await rimrafPromised(AUTH_FILE_PATH()); diff --git a/src/commands/secrets/index.ts b/src/commands/secrets/index.ts index 2b351189..bf3594f4 100644 --- a/src/commands/secrets/index.ts +++ b/src/commands/secrets/index.ts @@ -3,19 +3,19 @@ import { LOCAL_CONFIG_PATH } from '../../lib/consts.js'; export class SecretsIndexCommand extends ApifyCommand { static override description = - `Manages secure environment variables for Actors.\n\n` + - `Example:\n` + - `$ apify secrets add mySecret TopSecretValue123\n\n` + - `The "mySecret" value can be used in an environment variable defined in ${LOCAL_CONFIG_PATH} file by adding the "@"\n` + - `prefix:\n\n` + - `{\n` + - ` "actorSpecification": 1,\n` + - ` "name": "my_actor",\n` + - ` "environmentVariables": { "SECRET_ENV_VAR": "@mySecret" },\n` + - ` "version": "0.1"\n` + - `}\n\n` + - `When the Actor is pushed to Apify cloud, the "SECRET_ENV_VAR" and its value is stored as a secret environment variable\n` + - `of the Actor.\n`; + `Manages secure environment variables for Actors.\n\n` + + `Example:\n` + + `$ apify secrets add mySecret TopSecretValue123\n\n` + + `The "mySecret" value can be used in an environment variable defined in ${LOCAL_CONFIG_PATH} file by adding the "@"\n` + + `prefix:\n\n` + + `{\n` + + ` "actorSpecification": 1,\n` + + ` "name": "my_actor",\n` + + ` "environmentVariables": { "SECRET_ENV_VAR": "@mySecret" },\n` + + ` "version": "0.1"\n` + + `}\n\n` + + `When the Actor is pushed to Apify cloud, the "SECRET_ENV_VAR" and its value is stored as a secret environment variable\n` + + `of the Actor.\n`; async run() { await this.printHelp(); diff --git a/src/commands/validate-schema.ts b/src/commands/validate-schema.ts index 9b9cfad5..cfcf64c9 100644 --- a/src/commands/validate-schema.ts +++ b/src/commands/validate-schema.ts @@ -10,10 +10,10 @@ import { info, success } from '../lib/outputs.js'; import { Ajv } from '../lib/utils.js'; export class ValidateInputSchemaCommand extends ApifyCommand { - static override description = + static override description = 'Validates Actor input schema from one of these locations (in priority order):\n' + - '1. Object in actor.json under \'input\' key\n' + - '2. JSON file path in actor.json \'input\' key\n' + + "1. Object in actor.json under 'input' key\n" + + "2. JSON file path in actor.json 'input' key\n" + '3. .actor/INPUT_SCHEMA.json\n' + '4. INPUT_SCHEMA.json\n\n' + 'Optionally specify custom schema path to validate.\n'; From df84a98c381c4897f9d774df5de89c8e7e8d83c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Olender?= Date: Wed, 15 Jan 2025 11:27:05 +0100 Subject: [PATCH 06/14] fix hardcoded values in descriptions --- src/commands/actors/push.ts | 6 +++--- src/commands/validate-schema.ts | 13 +++++++------ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/commands/actors/push.ts b/src/commands/actors/push.ts index b223c874..03bce91a 100644 --- a/src/commands/actors/push.ts +++ b/src/commands/actors/push.ts @@ -41,9 +41,9 @@ const DEFAULT_BUILD_TAG = 'latest'; export class ActorsPushCommand extends ApifyCommand { static override description = - 'Deploys Actor to Apify platform using settings from actor.json.\n' + - 'Files under 3MB upload as "Multiple source files"; larger projects upload as ZIP file.\n' + - 'Use --force to override newer remote versions.\n'; + `Deploys Actor to Apify platform using settings from "${LOCAL_CONFIG_PATH}". + Files under "${MAX_MULTIFILE_BYTES / 1024 ** 2}"MB upload as "Multiple source files"; larger projects upload as ZIP file. + Use --force to override newer remote versions.` static override flags = { version: Flags.string({ diff --git a/src/commands/validate-schema.ts b/src/commands/validate-schema.ts index cfcf64c9..dcc14c92 100644 --- a/src/commands/validate-schema.ts +++ b/src/commands/validate-schema.ts @@ -11,12 +11,13 @@ import { Ajv } from '../lib/utils.js'; export class ValidateInputSchemaCommand extends ApifyCommand { static override description = - 'Validates Actor input schema from one of these locations (in priority order):\n' + - "1. Object in actor.json under 'input' key\n" + - "2. JSON file path in actor.json 'input' key\n" + - '3. .actor/INPUT_SCHEMA.json\n' + - '4. INPUT_SCHEMA.json\n\n' + - 'Optionally specify custom schema path to validate.\n'; + `Validates Actor input schema from one of these locations (in priority order): + 1. Object in "${LOCAL_CONFIG_PATH}" under "input" key + 2. JSON file path in "${LOCAL_CONFIG_PATH}" "input" key + 3. .actor/INPUT_SCHEMA.json + 4. INPUT_SCHEMA.json + + Optionally specify custom schema path to validate.` static override args = { path: Args.string({ From 0b3364a70aef331d38018c50b25fa343eedf1727 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Olender?= Date: Wed, 15 Jan 2025 11:29:05 +0100 Subject: [PATCH 07/14] fix lint --- src/commands/actors/push.ts | 5 ++--- src/commands/validate-schema.ts | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/commands/actors/push.ts b/src/commands/actors/push.ts index 03bce91a..bc506a5c 100644 --- a/src/commands/actors/push.ts +++ b/src/commands/actors/push.ts @@ -40,10 +40,9 @@ const DEFAULT_ACTOR_VERSION_NUMBER = '0.0'; const DEFAULT_BUILD_TAG = 'latest'; export class ActorsPushCommand extends ApifyCommand { - static override description = - `Deploys Actor to Apify platform using settings from "${LOCAL_CONFIG_PATH}". + static override description = `Deploys Actor to Apify platform using settings from "${LOCAL_CONFIG_PATH}". Files under "${MAX_MULTIFILE_BYTES / 1024 ** 2}"MB upload as "Multiple source files"; larger projects upload as ZIP file. - Use --force to override newer remote versions.` + Use --force to override newer remote versions.`; static override flags = { version: Flags.string({ diff --git a/src/commands/validate-schema.ts b/src/commands/validate-schema.ts index dcc14c92..3e204742 100644 --- a/src/commands/validate-schema.ts +++ b/src/commands/validate-schema.ts @@ -10,14 +10,13 @@ import { info, success } from '../lib/outputs.js'; import { Ajv } from '../lib/utils.js'; export class ValidateInputSchemaCommand extends ApifyCommand { - static override description = - `Validates Actor input schema from one of these locations (in priority order): + static override description = `Validates Actor input schema from one of these locations (in priority order): 1. Object in "${LOCAL_CONFIG_PATH}" under "input" key 2. JSON file path in "${LOCAL_CONFIG_PATH}" "input" key 3. .actor/INPUT_SCHEMA.json 4. INPUT_SCHEMA.json - Optionally specify custom schema path to validate.` + Optionally specify custom schema path to validate.`; static override args = { path: Args.string({ From 20203efa40cd5934299ca28da4971f3afe2f2818 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Olender?= Date: Wed, 15 Jan 2025 11:43:36 +0100 Subject: [PATCH 08/14] add missing space & fix typo --- src/commands/actors/push.ts | 2 +- src/commands/datasets/push-items.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/commands/actors/push.ts b/src/commands/actors/push.ts index bc506a5c..d2f36a9b 100644 --- a/src/commands/actors/push.ts +++ b/src/commands/actors/push.ts @@ -41,7 +41,7 @@ const DEFAULT_BUILD_TAG = 'latest'; export class ActorsPushCommand extends ApifyCommand { static override description = `Deploys Actor to Apify platform using settings from "${LOCAL_CONFIG_PATH}". - Files under "${MAX_MULTIFILE_BYTES / 1024 ** 2}"MB upload as "Multiple source files"; larger projects upload as ZIP file. + Files under "${MAX_MULTIFILE_BYTES / 1024 ** 2}" MB upload as "Multiple source files"; larger projects upload as ZIP file. Use --force to override newer remote versions.`; static override flags = { diff --git a/src/commands/datasets/push-items.ts b/src/commands/datasets/push-items.ts index 14919647..87999ed1 100644 --- a/src/commands/datasets/push-items.ts +++ b/src/commands/datasets/push-items.ts @@ -30,7 +30,7 @@ export class DatasetsPushDataCommand extends ApifyCommand Date: Wed, 15 Jan 2025 12:16:39 +0100 Subject: [PATCH 09/14] Apply suggestions from code review fix typos Co-authored-by: Adam Kliment <79609+netmilk@users.noreply.github.com> --- src/commands/logout.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/commands/logout.ts b/src/commands/logout.ts index d685dde6..a29f328d 100644 --- a/src/commands/logout.ts +++ b/src/commands/logout.ts @@ -6,8 +6,8 @@ import { regenerateLocalDistinctId } from '../lib/telemetry.js'; export class LogoutCommand extends ApifyCommand { static override description = - 'Removes authentiocation by deleting your API token and account information from ~/.apify.\n' + - "Run 'apify login' to auethenticate again."; + 'Removes authentication by deleting your API token and account information from ~/.apify.\n' + + "Run 'apify login' to authenticate again."; async run() { await rimrafPromised(AUTH_FILE_PATH()); From a4fc2af33b84bc02b7170e06affc0d747d8d59d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Olender?= Date: Wed, 15 Jan 2025 12:53:33 +0100 Subject: [PATCH 10/14] address review feedback add missing quotes in descriptions change double quotes to single quotes throughout descriptions for consistency fixed KeyValueStore to key-value store Consisteny regarding login requirement --- src/commands/actor/set-value.ts | 2 +- src/commands/actors/call.ts | 2 +- src/commands/actors/push.ts | 10 +++++----- src/commands/actors/start.ts | 2 +- src/commands/edit-input-schema.ts | 2 +- src/commands/init.ts | 6 +++--- src/commands/run.ts | 2 +- src/commands/secrets/index.ts | 2 +- src/commands/task/run.ts | 2 +- src/commands/validate-schema.ts | 6 +++--- 10 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/commands/actor/set-value.ts b/src/commands/actor/set-value.ts index 0595b23e..d5513872 100644 --- a/src/commands/actor/set-value.ts +++ b/src/commands/actor/set-value.ts @@ -5,7 +5,7 @@ import { ApifyCommand } from '../../lib/apify_command.js'; export class SetValueCommand extends ApifyCommand { static override description = - 'Sets or removes record into the default KeyValueStore associated with the Actor run.\n\n' + + 'Sets or removes record into the default key-value store associated with the Actor run.\n\n' + 'It is possible to pass data using argument or stdin.\n\n' + 'Passing data using argument:\n' + '$ apify actor set-value KEY my-value\n\n' + diff --git a/src/commands/actors/call.ts b/src/commands/actors/call.ts index e58ed7cc..c29a247c 100644 --- a/src/commands/actors/call.ts +++ b/src/commands/actors/call.ts @@ -60,7 +60,7 @@ export class ActorsCallCommand extends ApifyCommand { required: false, description: 'Name or ID of the Actor to run (e.g. "my-actor", "apify/hello-world" or "E2jjCZBezvAZnX8Rb"). ' + - `If not provided, the command runs the remote Actor specified in the "${LOCAL_CONFIG_PATH}" file.`, + `If not provided, the command runs the remote Actor specified in the '${LOCAL_CONFIG_PATH}' file.`, }), }; diff --git a/src/commands/actors/push.ts b/src/commands/actors/push.ts index d2f36a9b..cbda9038 100644 --- a/src/commands/actors/push.ts +++ b/src/commands/actors/push.ts @@ -40,19 +40,19 @@ const DEFAULT_ACTOR_VERSION_NUMBER = '0.0'; const DEFAULT_BUILD_TAG = 'latest'; export class ActorsPushCommand extends ApifyCommand { - static override description = `Deploys Actor to Apify platform using settings from "${LOCAL_CONFIG_PATH}". - Files under "${MAX_MULTIFILE_BYTES / 1024 ** 2}" MB upload as "Multiple source files"; larger projects upload as ZIP file. + static override description = `Deploys Actor to Apify platform using settings from '${LOCAL_CONFIG_PATH}'. + Files under '${MAX_MULTIFILE_BYTES / 1024 ** 2}' MB upload as "Multiple source files"; larger projects upload as ZIP file. Use --force to override newer remote versions.`; static override flags = { version: Flags.string({ char: 'v', - description: `Actor version number to which the files should be pushed. By default, it is taken from the "${LOCAL_CONFIG_PATH}" file.`, + description: `Actor version number to which the files should be pushed. By default, it is taken from the '${LOCAL_CONFIG_PATH}' file.`, required: false, }), 'build-tag': Flags.string({ char: 'b', - description: `Build tag to be applied to the successful Actor build. By default, it is taken from the "${LOCAL_CONFIG_PATH}" file`, + description: `Build tag to be applied to the successful Actor build. By default, it is taken from the '${LOCAL_CONFIG_PATH}' file`, required: false, }), 'wait-for-finish': Flags.string({ @@ -82,7 +82,7 @@ export class ActorsPushCommand extends ApifyCommand { required: false, 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 "${LOCAL_CONFIG_PATH}" file.`, + `If not provided, the command will create or modify the Actor with the name specified in '${LOCAL_CONFIG_PATH}' file.`, }), }; diff --git a/src/commands/actors/start.ts b/src/commands/actors/start.ts index d84fa50b..0f541336 100644 --- a/src/commands/actors/start.ts +++ b/src/commands/actors/start.ts @@ -42,7 +42,7 @@ export class ActorsStartCommand extends ApifyCommand required: false, description: 'Name or ID of the Actor to run (e.g. "my-actor", "apify/hello-world" or "E2jjCZBezvAZnX8Rb"). ' + - `If not provided, the command runs the remote Actor specified in the "${LOCAL_CONFIG_PATH}" file.`, + `If not provided, the command runs the remote Actor specified in the '${LOCAL_CONFIG_PATH}' file.`, }), }; diff --git a/src/commands/edit-input-schema.ts b/src/commands/edit-input-schema.ts index 65a60ed5..cc81ad44 100644 --- a/src/commands/edit-input-schema.ts +++ b/src/commands/edit-input-schema.ts @@ -48,7 +48,7 @@ export class EditInputSchemaCommand extends ApifyCommand { static override description = `Sets up an Actor project in your current directory by creating actor.json and storage files.\n` + `If the directory contains a Scrapy project in Python, the command automatically creates wrappers so that you can run your scrapers without changes.\n` + - `Creates the ${LOCAL_CONFIG_PATH} file and the ${DEFAULT_LOCAL_STORAGE_DIR} directory in the current directory, but does not touch any other existing files or directories.\n\n` + - `WARNING: Overwrites existing ${DEFAULT_LOCAL_STORAGE_DIR} directory.\n`; + `Creates the '${LOCAL_CONFIG_PATH}' file and the '${DEFAULT_LOCAL_STORAGE_DIR}' directory in the current directory, but does not touch any other existing files or directories.\n\n` + + `WARNING: Overwrites existing '${DEFAULT_LOCAL_STORAGE_DIR}' directory.\n`; static override args = { actorName: Args.string({ @@ -68,7 +68,7 @@ export class InitCommand extends ApifyCommand { if (getLocalConfig(cwd)) { warning({ - message: `Skipping creation of "${LOCAL_CONFIG_PATH}", the file already exists in the current directory.`, + message: `Skipping creation of '${LOCAL_CONFIG_PATH}', the file already exists in the current directory.`, }); } else { if (!actorName) { diff --git a/src/commands/run.ts b/src/commands/run.ts index 455d9a8b..3e16448e 100644 --- a/src/commands/run.ts +++ b/src/commands/run.ts @@ -49,7 +49,7 @@ import { export class RunCommand extends ApifyCommand { static override description = `Executes Actor locally with simulated Apify environment variables.\n` + - `Stores data in local ${DEFAULT_LOCAL_STORAGE_DIR} directory.\n\n` + + `Stores data in local '${DEFAULT_LOCAL_STORAGE_DIR}' directory.\n\n` + `NOTE: For Node.js Actors, customize behavior by modifying the 'start' script in package.json file.\n`; static override flags = { diff --git a/src/commands/secrets/index.ts b/src/commands/secrets/index.ts index bf3594f4..023c20c5 100644 --- a/src/commands/secrets/index.ts +++ b/src/commands/secrets/index.ts @@ -6,7 +6,7 @@ export class SecretsIndexCommand extends ApifyCommand { static override description = - 'Requires prior login.\n' + + 'Requires login.\n' + 'Executes predefined Actor task remotely using local key-value store for input.\n' + 'Customize with --memory and --timeout flags.\n'; diff --git a/src/commands/validate-schema.ts b/src/commands/validate-schema.ts index 3e204742..76704916 100644 --- a/src/commands/validate-schema.ts +++ b/src/commands/validate-schema.ts @@ -11,8 +11,8 @@ import { Ajv } from '../lib/utils.js'; export class ValidateInputSchemaCommand extends ApifyCommand { static override description = `Validates Actor input schema from one of these locations (in priority order): - 1. Object in "${LOCAL_CONFIG_PATH}" under "input" key - 2. JSON file path in "${LOCAL_CONFIG_PATH}" "input" key + 1. Object in '${LOCAL_CONFIG_PATH}' under "input" key + 2. JSON file path in '${LOCAL_CONFIG_PATH}' "input" key 3. .actor/INPUT_SCHEMA.json 4. INPUT_SCHEMA.json @@ -40,7 +40,7 @@ export class ValidateInputSchemaCommand extends ApifyCommand Date: Wed, 15 Jan 2025 12:58:25 +0100 Subject: [PATCH 11/14] Apply suggestions from code review Co-authored-by: Adam Kliment <79609+netmilk@users.noreply.github.com> --- src/commands/actor/index.ts | 2 +- src/commands/secrets/add.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/commands/actor/index.ts b/src/commands/actor/index.ts index b3a360c5..c7fa1f1c 100644 --- a/src/commands/actor/index.ts +++ b/src/commands/actor/index.ts @@ -2,7 +2,7 @@ import { ApifyCommand } from '../../lib/apify_command.js'; export class ActorIndexCommand extends ApifyCommand { static override description = - 'Manages data operations during Actor execution\nNote: Commands are in preview state. Do not use in production environment.\n'; + 'Manages runtime data operations inside of a running Actor.\n'; async run() { await this.printHelp(); diff --git a/src/commands/secrets/add.ts b/src/commands/secrets/add.ts index 0105bb52..74d24db5 100644 --- a/src/commands/secrets/add.ts +++ b/src/commands/secrets/add.ts @@ -4,7 +4,7 @@ import { ApifyCommand } from '../../lib/apify_command.js'; import { addSecret } from '../../lib/secrets.js'; export class SecretsAddCommand extends ApifyCommand { - static override description = ' Adds a new secret to ~/.apify for use in Actor environment variables.'; + static override description = 'Adds a new secret to ~/.apify for use in Actor environment variables.'; static override args = { name: Args.string({ From bacf3110c8d3e89a561252b8cfce1a43f4f738d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Olender?= Date: Wed, 15 Jan 2025 13:26:23 +0100 Subject: [PATCH 12/14] fix lint & address review Removed mentions of creating named dataset & alligned it with kvs create description for consistency change the way description of push is written Rewrite pull command description to remove mentions of Web IDE files --- src/commands/actor/index.ts | 3 +-- src/commands/actors/pull.ts | 2 +- src/commands/actors/push.ts | 8 +++++--- src/commands/datasets/create.ts | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/commands/actor/index.ts b/src/commands/actor/index.ts index c7fa1f1c..2c420bb1 100644 --- a/src/commands/actor/index.ts +++ b/src/commands/actor/index.ts @@ -1,8 +1,7 @@ import { ApifyCommand } from '../../lib/apify_command.js'; export class ActorIndexCommand extends ApifyCommand { - static override description = - 'Manages runtime data operations inside of a running Actor.\n'; + static override description = 'Manages runtime data operations inside of a running Actor.\n'; async run() { await this.printHelp(); diff --git a/src/commands/actors/pull.ts b/src/commands/actors/pull.ts index 72d98ee2..bd4b74c8 100644 --- a/src/commands/actors/pull.ts +++ b/src/commands/actors/pull.ts @@ -25,7 +25,7 @@ const extractGitHubZip = async (url: string, directoryPath: string) => { export class ActorsPullCommand extends ApifyCommand { static override description = 'Download Actor code to current directory. ' + - 'Clones Git repositories or fetches Web IDE files based on Actor source type.'; + 'Clones Git repositories or fetches Actor files based on the source type.'; static override flags = { version: Flags.string({ diff --git a/src/commands/actors/push.ts b/src/commands/actors/push.ts index cbda9038..f7c12739 100644 --- a/src/commands/actors/push.ts +++ b/src/commands/actors/push.ts @@ -40,9 +40,11 @@ const DEFAULT_ACTOR_VERSION_NUMBER = '0.0'; const DEFAULT_BUILD_TAG = 'latest'; export class ActorsPushCommand extends ApifyCommand { - static override description = `Deploys Actor to Apify platform using settings from '${LOCAL_CONFIG_PATH}'. - Files under '${MAX_MULTIFILE_BYTES / 1024 ** 2}' MB upload as "Multiple source files"; larger projects upload as ZIP file. - Use --force to override newer remote versions.`; + static override description = + `Deploys Actor to Apify platform using settings from '${LOCAL_CONFIG_PATH}'.\n` + + `Files under '${MAX_MULTIFILE_BYTES / 1024 ** 2}' MB upload as "Multiple source files"; ` + + `larger projects upload as ZIP file.\n` + + `Use --force to override newer remote versions.`; static override flags = { version: Flags.string({ diff --git a/src/commands/datasets/create.ts b/src/commands/datasets/create.ts index 36b3f427..2afa649c 100644 --- a/src/commands/datasets/create.ts +++ b/src/commands/datasets/create.ts @@ -7,7 +7,7 @@ import { error, success } from '../../lib/outputs.js'; import { getLoggedClientOrThrow } from '../../lib/utils.js'; export class DatasetsCreateCommand extends ApifyCommand { - static override description = 'Creates named dataset for storing structured data on your account.'; + static override description = 'Creates a new dataset for storing structured data on your account.'; static override args = { datasetName: Args.string({ From 65defdebea81ae4969761ec50861fc4788593dff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Olender?= <92638966+TC-MO@users.noreply.github.com> Date: Wed, 15 Jan 2025 14:42:52 +0100 Subject: [PATCH 13/14] remove trailing \n & fix typos Fix typo (missing periods) Remove trailing \n at the end of description Add missing periods Fix inconsistency in run commands --- src/commands/actor/index.ts | 2 +- src/commands/actor/push-data.ts | 2 +- src/commands/actor/set-value.ts | 2 +- src/commands/actors/call.ts | 2 +- src/commands/actors/start.ts | 2 +- src/commands/builds/rm.ts | 2 +- src/commands/init.ts | 2 +- src/commands/key-value-stores/create.ts | 2 +- src/commands/key-value-stores/rename.ts | 16 ++++++++-------- src/commands/key-value-stores/rm.ts | 6 +++--- src/commands/login.ts | 6 +++--- src/commands/logout.ts | 4 ++-- src/commands/run.ts | 2 +- src/commands/runs/abort.ts | 2 +- src/commands/runs/index.ts | 2 +- src/commands/runs/info.ts | 4 ++-- src/commands/secrets/add.ts | 2 +- src/commands/secrets/index.ts | 2 +- 18 files changed, 31 insertions(+), 31 deletions(-) diff --git a/src/commands/actor/index.ts b/src/commands/actor/index.ts index 2c420bb1..70f8b61f 100644 --- a/src/commands/actor/index.ts +++ b/src/commands/actor/index.ts @@ -1,7 +1,7 @@ import { ApifyCommand } from '../../lib/apify_command.js'; export class ActorIndexCommand extends ApifyCommand { - static override description = 'Manages runtime data operations inside of a running Actor.\n'; + static override description = 'Manages runtime data operations inside of a running Actor.'; async run() { await this.printHelp(); diff --git a/src/commands/actor/push-data.ts b/src/commands/actor/push-data.ts index d4f55785..0c01ff45 100644 --- a/src/commands/actor/push-data.ts +++ b/src/commands/actor/push-data.ts @@ -12,7 +12,7 @@ export class PushDataCommand extends ApifyCommand { ' - JSON argument:\n' + ' $ apify actor push-data {"key": "value"}\n' + ' - Piped stdin:\n' + - ' $ cat ./test.json | apify actor push-data\n'; + ' $ cat ./test.json | apify actor push-data'; static override args = { item: Args.string({ diff --git a/src/commands/actor/set-value.ts b/src/commands/actor/set-value.ts index d5513872..03628ff0 100644 --- a/src/commands/actor/set-value.ts +++ b/src/commands/actor/set-value.ts @@ -10,7 +10,7 @@ export class SetValueCommand extends ApifyCommand { 'Passing data using argument:\n' + '$ apify actor set-value KEY my-value\n\n' + 'Passing data using stdin with pipe:\n' + - '$ cat ./my-text-file.txt | apify actor set-value KEY --contentType text/plain\n'; + '$ cat ./my-text-file.txt | apify actor set-value KEY --contentType text/plain'; static override args = { key: Args.string({ diff --git a/src/commands/actors/call.ts b/src/commands/actors/call.ts index c29a247c..09ef7c65 100644 --- a/src/commands/actors/call.ts +++ b/src/commands/actors/call.ts @@ -22,7 +22,7 @@ export class ActorsCallCommand extends ApifyCommand { static override description = 'Requires login.\n' + 'Executes Actor remotely using your authenticated account.\n' + - 'Reads input from local key-value store by default.\n'; + 'Reads input from local key-value store by default.'; static override flags = { ...SharedRunOnCloudFlags('Actor'), diff --git a/src/commands/actors/start.ts b/src/commands/actors/start.ts index 0f541336..60f661ac 100644 --- a/src/commands/actors/start.ts +++ b/src/commands/actors/start.ts @@ -14,7 +14,7 @@ export class ActorsStartCommand extends ApifyCommand static override description = 'Requires login.\n' + 'Starts Actor remotely and returns run details immediately.\n' + - 'Uses authenticated account and local key-value store for input.\n'; + 'Uses authenticated account and local key-value store for input.'; static override flags = { ...SharedRunOnCloudFlags('Actor'), diff --git a/src/commands/builds/rm.ts b/src/commands/builds/rm.ts index bba7dc39..e03c7ac7 100644 --- a/src/commands/builds/rm.ts +++ b/src/commands/builds/rm.ts @@ -7,7 +7,7 @@ import { error, info, success } from '../../lib/outputs.js'; import { getLoggedClientOrThrow } from '../../lib/utils.js'; export class BuildsRmCommand extends ApifyCommand { - static override description = 'Permanently removes an Actor build from the Apify platform'; + static override description = 'Permanently removes an Actor build from the Apify platform.'; static override args = { buildId: Args.string({ diff --git a/src/commands/init.ts b/src/commands/init.ts index 71d9e629..07869c62 100644 --- a/src/commands/init.ts +++ b/src/commands/init.ts @@ -31,7 +31,7 @@ export class InitCommand extends ApifyCommand { `Sets up an Actor project in your current directory by creating actor.json and storage files.\n` + `If the directory contains a Scrapy project in Python, the command automatically creates wrappers so that you can run your scrapers without changes.\n` + `Creates the '${LOCAL_CONFIG_PATH}' file and the '${DEFAULT_LOCAL_STORAGE_DIR}' directory in the current directory, but does not touch any other existing files or directories.\n\n` + - `WARNING: Overwrites existing '${DEFAULT_LOCAL_STORAGE_DIR}' directory.\n`; + `WARNING: Overwrites existing '${DEFAULT_LOCAL_STORAGE_DIR}' directory.`; static override args = { actorName: Args.string({ diff --git a/src/commands/key-value-stores/create.ts b/src/commands/key-value-stores/create.ts index fc5910de..3fc16e57 100644 --- a/src/commands/key-value-stores/create.ts +++ b/src/commands/key-value-stores/create.ts @@ -7,7 +7,7 @@ import { error, success } from '../../lib/outputs.js'; import { getLoggedClientOrThrow } from '../../lib/utils.js'; export class KeyValueStoresCreateCommand extends ApifyCommand { - static override description = 'Creates a new key-value store on your account'; + static override description = 'Creates a new key-value store on your account.'; static override hiddenAliases = ['kvs:create']; diff --git a/src/commands/key-value-stores/rename.ts b/src/commands/key-value-stores/rename.ts index 74e0feee..a9e8297e 100644 --- a/src/commands/key-value-stores/rename.ts +++ b/src/commands/key-value-stores/rename.ts @@ -8,23 +8,23 @@ import { error, success } from '../../lib/outputs.js'; import { getLoggedClientOrThrow } from '../../lib/utils.js'; export class KeyValueStoresRenameCommand extends ApifyCommand { - static override description = 'Renames a Key-value store, or removes its unique name'; + static override description = 'Renames a key-value store, or removes its unique name.'; static override hiddenAliases = ['kvs:rename']; static override flags = { unname: Flags.boolean({ - description: 'Removes the unique name of the Key-value store', + description: 'Removes the unique name of the key-value store', }), }; static override args = { keyValueStoreNameOrId: Args.string({ - description: 'The Key-value store ID or name to delete', + description: 'The key-value store ID or name to delete', required: true, }), newName: Args.string({ - description: 'The new name for the Key-value store', + description: 'The new name for the key-value store', }), }; @@ -59,14 +59,14 @@ export class KeyValueStoresRenameCommand extends ApifyCommand { if (!name) { - return `The name of the Key-value store with ID ${chalk.yellow(id)} has been set to: ${chalk.yellow(newName)}`; + return `The name of the key-value store with ID ${chalk.yellow(id)} has been set to: ${chalk.yellow(newName)}`; } if (unname) { - return `The name of the Key-value store with ID ${chalk.yellow(id)} has been removed (was ${chalk.yellow(name)} previously).`; + return `The name of the key-value store with ID ${chalk.yellow(id)} has been removed (was ${chalk.yellow(name)} previously).`; } - return `The name of the Key-value store with ID ${chalk.yellow(id)} was changed from ${chalk.yellow(name)} to ${chalk.yellow(newName)}.`; + return `The name of the key-value store with ID ${chalk.yellow(id)} was changed from ${chalk.yellow(name)} to ${chalk.yellow(newName)}.`; })(); try { @@ -80,7 +80,7 @@ export class KeyValueStoresRenameCommand extends ApifyCommand { - static override description = 'Deletes a Key-value store'; + static override description = 'Permanently removes a key-value store.'; static override hiddenAliases = ['kvs:rm']; static override args = { keyValueStoreNameOrId: Args.string({ - description: 'The Key-value store ID or name to delete', + description: 'The key-value store ID or name to delete', required: true, }), }; @@ -55,7 +55,7 @@ export class KeyValueStoresRmCommand extends ApifyCommand { export class LoginCommand extends ApifyCommand { static override description = - 'Authenticates your Apify account and saves credentials to ~/.apify.\n' + - 'All other commands use these stored credentials.\n\n' + - "Use 'apify logout' to remove authentication.\n"; + `Authenticates your Apify account and saves credentials to '~/.apify'.\n` + + `All other commands use these stored credentials.\n\n` + + `Run 'apify logout' to remove authentication.`; static override flags = { token: Flags.string({ diff --git a/src/commands/logout.ts b/src/commands/logout.ts index a29f328d..41faf3cc 100644 --- a/src/commands/logout.ts +++ b/src/commands/logout.ts @@ -6,8 +6,8 @@ import { regenerateLocalDistinctId } from '../lib/telemetry.js'; export class LogoutCommand extends ApifyCommand { static override description = - 'Removes authentication by deleting your API token and account information from ~/.apify.\n' + - "Run 'apify login' to authenticate again."; + `Removes authentication by deleting your API token and account information from '~/.apify'.\n` + + `Run 'apify login' to authenticate again.`; async run() { await rimrafPromised(AUTH_FILE_PATH()); diff --git a/src/commands/run.ts b/src/commands/run.ts index 3e16448e..88351579 100644 --- a/src/commands/run.ts +++ b/src/commands/run.ts @@ -50,7 +50,7 @@ export class RunCommand extends ApifyCommand { static override description = `Executes Actor locally with simulated Apify environment variables.\n` + `Stores data in local '${DEFAULT_LOCAL_STORAGE_DIR}' directory.\n\n` + - `NOTE: For Node.js Actors, customize behavior by modifying the 'start' script in package.json file.\n`; + `NOTE: For Node.js Actors, customize behavior by modifying the 'start' script in package.json file.`; static override flags = { purge: Flags.boolean({ diff --git a/src/commands/runs/abort.ts b/src/commands/runs/abort.ts index d1111bc5..fe714728 100644 --- a/src/commands/runs/abort.ts +++ b/src/commands/runs/abort.ts @@ -11,7 +11,7 @@ const runningStatuses = [ACTOR_JOB_STATUSES.READY, ACTOR_JOB_STATUSES.RUNNING]; const abortingStatuses = [ACTOR_JOB_STATUSES.ABORTING, ACTOR_JOB_STATUSES.TIMING_OUT]; export class RunsAbortCommand extends ApifyCommand { - static override description = 'Aborts an Actor Run.'; + static override description = 'Aborts an Actor run.'; static override args = { runId: Args.string({ diff --git a/src/commands/runs/index.ts b/src/commands/runs/index.ts index e8f80f1e..e991aba5 100644 --- a/src/commands/runs/index.ts +++ b/src/commands/runs/index.ts @@ -1,7 +1,7 @@ import { ApifyCommand } from '../../lib/apify_command.js'; export class RunsIndexCommand extends ApifyCommand { - static override description = 'Commands are designed to be used with Actor Runs.'; + static override description = 'Manages Actor run operations '; async run() { await this.printHelp(); diff --git a/src/commands/runs/info.ts b/src/commands/runs/info.ts index 5749f234..49c72bac 100644 --- a/src/commands/runs/info.ts +++ b/src/commands/runs/info.ts @@ -34,7 +34,7 @@ const usageMapping: Record = { }; export class RunsInfoCommand extends ApifyCommand { - static override description = 'Prints information about an Actor Run.'; + static override description = 'Prints information about an Actor run.'; static override args = { runId: Args.string({ @@ -46,7 +46,7 @@ export class RunsInfoCommand extends ApifyCommand { static override flags = { verbose: Flags.boolean({ char: 'v', - description: 'Prints more in-depth information about the Actor Run.', + description: 'Prints more in-depth information about the Actor run.', default: false, }), }; diff --git a/src/commands/secrets/add.ts b/src/commands/secrets/add.ts index 74d24db5..6089589d 100644 --- a/src/commands/secrets/add.ts +++ b/src/commands/secrets/add.ts @@ -4,7 +4,7 @@ import { ApifyCommand } from '../../lib/apify_command.js'; import { addSecret } from '../../lib/secrets.js'; export class SecretsAddCommand extends ApifyCommand { - static override description = 'Adds a new secret to ~/.apify for use in Actor environment variables.'; + static override description = `Adds a new secret to '~/.apify' for use in Actor environment variables.`; static override args = { name: Args.string({ diff --git a/src/commands/secrets/index.ts b/src/commands/secrets/index.ts index 023c20c5..4110efe2 100644 --- a/src/commands/secrets/index.ts +++ b/src/commands/secrets/index.ts @@ -15,7 +15,7 @@ export class SecretsIndexCommand extends ApifyCommand Date: Wed, 15 Jan 2025 15:43:33 +0100 Subject: [PATCH 14/14] remove login requirement from descriptions --- src/commands/actors/call.ts | 1 - src/commands/actors/start.ts | 1 - src/commands/task/run.ts | 1 - 3 files changed, 3 deletions(-) diff --git a/src/commands/actors/call.ts b/src/commands/actors/call.ts index 09ef7c65..c956ee6f 100644 --- a/src/commands/actors/call.ts +++ b/src/commands/actors/call.ts @@ -20,7 +20,6 @@ import { getLocalConfig, getLocalUserInfo, getLoggedClientOrThrow, TimestampForm export class ActorsCallCommand extends ApifyCommand { static override description = - 'Requires login.\n' + 'Executes Actor remotely using your authenticated account.\n' + 'Reads input from local key-value store by default.'; diff --git a/src/commands/actors/start.ts b/src/commands/actors/start.ts index 60f661ac..ff59482a 100644 --- a/src/commands/actors/start.ts +++ b/src/commands/actors/start.ts @@ -12,7 +12,6 @@ import { getLocalConfig, getLocalUserInfo, getLoggedClientOrThrow, TimestampForm export class ActorsStartCommand extends ApifyCommand { static override description = - 'Requires login.\n' + 'Starts Actor remotely and returns run details immediately.\n' + 'Uses authenticated account and local key-value store for input.'; diff --git a/src/commands/task/run.ts b/src/commands/task/run.ts index a83bd237..be978d7a 100644 --- a/src/commands/task/run.ts +++ b/src/commands/task/run.ts @@ -9,7 +9,6 @@ import { getLocalUserInfo, getLoggedClientOrThrow } from '../../lib/utils.js'; export class TaskRunCommand extends ApifyCommand { static override description = - 'Requires login.\n' + 'Executes predefined Actor task remotely using local key-value store for input.\n' + 'Customize with --memory and --timeout flags.\n';