From 4d0d4c4d0d9ddfb121aeb9740e1d19ef03bf2b43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Sol=C3=A1r?= Date: Thu, 16 Jul 2026 12:08:24 +0200 Subject: [PATCH 1/2] feat(create): guided wizard with use-case and language filters Reshape `apify create` into a guided wizard: prompt for what the user wants to build (use case) and the language, then present a single fit-ranked template list (exact matches first, top preselected, a non-selectable separator, then the closest alternatives). - Add `-u/--use-case` and `-l/--language` filter flags; `-t/--template` stays authoritative and bypasses the wizard. - Add `apify templates ls [--json]`, exposing each template's useCases[] so agents can discover the enum values. - Port apify-core's getTemplateRecommendation tier algorithm, with a per-template isExactMatch flag (no aggregate) and no result limit; a skipped use case and "any language" both mean "no filter". Refs #1236 Co-Authored-By: Claude Opus 4.8 --- docs/reference.md | 39 +++- scripts/generate-cli-docs.ts | 2 + src/commands/_register.ts | 2 + src/commands/create.ts | 18 +- src/commands/templates/_index.ts | 16 ++ src/commands/templates/ls.ts | 63 +++++++ src/lib/create-utils.ts | 133 +++++++------- src/lib/templates/consts.ts | 102 +++++++++++ .../templates/getTemplateRecommendation.ts | 78 ++++++++ src/lib/templates/templateChoices.ts | 71 ++++++++ .../lib/getTemplateRecommendation.test.ts | 172 ++++++++++++++++++ test/local/lib/templateChoices.test.ts | 92 ++++++++++ 12 files changed, 724 insertions(+), 64 deletions(-) create mode 100644 src/commands/templates/_index.ts create mode 100644 src/commands/templates/ls.ts create mode 100644 src/lib/templates/consts.ts create mode 100644 src/lib/templates/getTemplateRecommendation.ts create mode 100644 src/lib/templates/templateChoices.ts create mode 100644 test/local/lib/getTemplateRecommendation.test.ts create mode 100644 test/local/lib/templateChoices.test.ts diff --git a/docs/reference.md b/docs/reference.md index 09af9be11..33c75780f 100644 --- a/docs/reference.md +++ b/docs/reference.md @@ -277,13 +277,19 @@ DESCRIPTION directory. USAGE - $ apify create [actorName] [--omit-optional-deps] + $ apify create [actorName] + [-l javascript|typescript|python|other] [--omit-optional-deps] [--skip-dependency-install] [--skip-git-init] [-t ] + [-u web-scraping|ai-agent|api-pipeline|browser-automation] ARGUMENTS actorName Name of the Actor and its directory. FLAGS + -l, --language=