feat(create): guided wizard with use-case and language filters - #1278
Merged
l2ysho merged 19 commits intoAug 3, 2026
Merged
Conversation
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 <noreply@anthropic.com>
- Assert `--use-case` / `--language` are ignored when `--template` is provided: a TypeScript template scaffolds unchanged despite conflicting python/ai filters. - Unit-test the flag→id mappings (useCaseFlagToId, USE_CASE/LANGUAGE flag choices, labels), including that STARTER is never exposed. Refs #1236 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
l2ysho
marked this pull request as ready for review
July 16, 2026 10:56
…anguage-best-match-template
szaganek
approved these changes
Jul 21, 2026
DaveHanns
reviewed
Jul 28, 2026
DaveHanns
reviewed
Jul 28, 2026
DaveHanns
reviewed
Jul 28, 2026
DaveHanns
reviewed
Jul 28, 2026
DaveHanns
reviewed
Jul 28, 2026
DaveHanns
reviewed
Jul 28, 2026
DaveHanns
reviewed
Jul 28, 2026
DaveHanns
reviewed
Jul 28, 2026
DaveHanns
reviewed
Jul 28, 2026
Co-authored-by: Edyta <142720610+szaganek@users.noreply.github.com>
Address PR review: `web-scraper` reads as an Actor identity (like `ai-agent`), and `data-pipeline` matches Console's "API & data pipeline" better than `api-pipeline`. Prompt labels are unchanged. Refs #1236 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Document each TEMPLATE_USE_CASES tag (per-key JSDoc).
- Rename option fields to cliFlag / templateTag and derive UseCaseOption
and LanguageOption from the `as const` option arrays.
- Correct the --use-case flag description ("by use case", not category).
- Simplify matchesUseCase to `!!...includes(...)`.
Refs #1236
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…anguage-best-match-template
- Accept `js`/`ts`/`py` as aliases for `--language`, resolved to the manifest category via a new `languageFlagToTag`. - Drop the `other` (BYO-Docker) language value: no template matches it, and language becomes inherent once templates turn into Actors. Refs #1236 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Replace the `undefined` "skip use case" sentinel with an ANY_TEMPLATE_USE_CASE marker, mirroring ANY_TEMPLATE_LANGUAGE. - Give LanguageOption a `cliFlag` alongside `templateTag` so it mirrors UseCaseOption's shape. Refs #1236 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: David Hanuš <david.hanus@apify.com>
The committed #14 suggestion used `matchesUseCase` (a function) in the guard condition — TS2774 build failure. Use the `hasUseCaseFilter` boolean so the exact-match tier is skipped only when no filter is active, letting the show-all path lead with curated templates. Refs #1236 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
DaveHanns
reviewed
Jul 29, 2026
DaveHanns
reviewed
Jul 29, 2026
DaveHanns
requested changes
Jul 29, 2026
DaveHanns
left a comment
Contributor
There was a problem hiding this comment.
Few comments, otherwise LGTM.
The main things are the drop of other option of --language flag and unification of "skip / no preference / any" language and use case.
…copy
Update `interactiveNote` and `examples` to describe the use-case/language
wizard and the -u/-l filter flags, and unify the use-case prompt's "skip"
copy with the language prompt ("Any use case" ↔ "Any language").
Addresses PR #1278 review comments r3672018996, r3672030798, r3672045202.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The use-case prompt label changed to "Any use case"; update the getTemplateRecommendation doc comment to match. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…anguage-best-match-template
…anguage-best-match-template
…anguage-best-match-template
DaveHanns
reviewed
Aug 2, 2026
| * the fallback tiers. | ||
| */ | ||
| export const USE_CASE_OPTIONS = [ | ||
| { cliFlag: 'web-scraper', templateTag: TEMPLATE_USE_CASES.WEB_SCRAPING, label: 'Web scraping' }, |
Contributor
There was a problem hiding this comment.
Suggestion: lets go with Web scraper label to match the Console.
DaveHanns
approved these changes
Aug 2, 2026
DaveHanns
left a comment
Contributor
There was a problem hiding this comment.
One additional suggestion. Otherwise looks great 🚀
…anguage-best-match-template
DaveHanns
reviewed
Aug 3, 2026
| export const USE_CASE_FLAG_CHOICES: string[] = USE_CASE_OPTIONS.map((option) => option.cliFlag); | ||
|
|
||
| /** Maps a `--use-case` flag value to its manifest tag, or `undefined` when unknown. */ | ||
| export function useCaseFlagToId(flag: string): string | undefined { |
Contributor
There was a problem hiding this comment.
Suggested change
| export function useCaseFlagToId(flag: string): string | undefined { | |
| export function useCaseFlagToTag(flag: string): string | undefined { |
The function returns a manifest `useCases[]` tag, not an id, and its language counterpart is already named `languageFlagToTag`. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
l2ysho
deleted the
1236-guided-apify-create-wizard-use-case-language-best-match-template
branch
August 3, 2026 09:50
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1236.
TL;DR —
apify createbecomes a guided wizard: use case → language → best-match template, plusapify templates lsfor discovery. Local scaffold only; the git-sourced flow is #1237 and--json/--originis #1238.What changed
-u/--use-case,-l/--language.-t/--templatestays authoritative and skips the wizard;-u/-lare ignored when it's passed.js/ts/py. Nootheroption — every template has a language.apify templates ls [--json];--jsonemits the full template objects, includinguseCases[].getTemplateRecommendationfrom apify-core, with two CLI changes: per-templateisExactMatchand no result limit.Flag → manifest mapping
--use-case--language(+ alias)categoryweb-scraperWEB_SCRAPINGjavascript/jsjavascriptai-agentAItypescript/tstypescriptdata-pipelineINTEGRATIONpython/pypythonbrowser-automationAUTOMATION"Any use case" and "Any language" both mean no filter (
ANY_TEMPLATE_USE_CASE/ANY_TEMPLATE_LANGUAGE— symmetric by design).Tests
Unit tests for
getTemplateRecommendation(tiers, dedup, any-language, no-exact),buildTemplateChoiceList(separator, labels, hint), and the flag→tag mappings;createcovers--templateprecedence.build/lint/formatclean,docs/regenerated, wizard driven end-to-end in a terminal.🤖 Generated with Claude Code