Summary
Add an apify templates command to list the available Actor templates and expose their metadata as JSON. No such command exists today; template data is only reachable internally through the @apify/actor-templates manifest (fetchManifest, used in src/lib/create-utils.ts).
Motivation
Both automated callers and the guided apify create flow need to discover the valid template choices, together with their use-cases and recommendations, programmatically rather than scraping --help. A first-class templates command is also useful on its own: it lets anyone inspect what's available before creating an Actor.
Command
apify templates ls [--json] lists the available templates.
- Human output: a readable table (name, language, description).
--json output: the full template list plus, for each template, its language and use-case tags, and which template(s) are recommended.
The framework already provides the --json flag (opt-in via static enableJsonFlag = true) and printJsonToStdout, so this is opt-in plus the output shape.
Shared metadata (likely cross-repo)
useCases[] and recommended need a single source of truth, ideally added to the @apify/actor-templates manifest (repo: apify/actor-templates). Apify Console already encodes use-case and recommendation logic in its creation wizard via getTemplateRecommendation; both should consume the same metadata so results stay identical across Console and CLI.
Notes
- Register the new command in
src/commands/_register.ts (subcommands go through a templates/_index.ts).
- Update docs after adding it: run
pnpm run update-docs and refresh the public CLI reference on docs.apify.com.
- Current template fetching lives in
@apify/actor-templates (fetchManifest, manifestUrl), used by src/lib/create-utils.ts.
Related
Consumed by the guided apify create work in #1153, but shippable independently.
Summary
Add an
apify templatescommand to list the available Actor templates and expose their metadata as JSON. No such command exists today; template data is only reachable internally through the@apify/actor-templatesmanifest (fetchManifest, used insrc/lib/create-utils.ts).Motivation
Both automated callers and the guided
apify createflow need to discover the valid template choices, together with their use-cases and recommendations, programmatically rather than scraping--help. A first-classtemplatescommand is also useful on its own: it lets anyone inspect what's available before creating an Actor.Command
apify templates ls [--json]lists the available templates.--jsonoutput: the full template list plus, for each template, its language and use-case tags, and which template(s) arerecommended.The framework already provides the
--jsonflag (opt-in viastatic enableJsonFlag = true) andprintJsonToStdout, so this is opt-in plus the output shape.Shared metadata (likely cross-repo)
useCases[]andrecommendedneed a single source of truth, ideally added to the@apify/actor-templatesmanifest (repo:apify/actor-templates). Apify Console already encodes use-case and recommendation logic in its creation wizard viagetTemplateRecommendation; both should consume the same metadata so results stay identical across Console and CLI.Notes
src/commands/_register.ts(subcommands go through atemplates/_index.ts).pnpm run update-docsand refresh the public CLI reference on docs.apify.com.@apify/actor-templates(fetchManifest,manifestUrl), used bysrc/lib/create-utils.ts.Related
Consumed by the guided
apify creatework in #1153, but shippable independently.