feat(create): guided wizard with use-case and language filters#1278
Open
l2ysho wants to merge 2 commits into
Open
feat(create): guided wizard with use-case and language filters#1278l2ysho wants to merge 2 commits into
l2ysho wants to merge 2 commits into
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>
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.
Reshapes
apify createinto the guided wizard from the epic: use case → language → best-match template, plus a newapify templates lscommand. Local scaffold only (--source apify); the Git path stays a separate sub-issue.What changed
apify create: prompts for "What do you want to build?" (use case) and the language, then shows one scrollable, fit-ranked template list — exact matches first with the top one preselected, a non-selectable separator (── The templates below don't exactly match your selection ──), then the closest alternatives in tier order.-u/--use-caseand-l/--language.-t/--templatestays authoritative and bypasses the wizard entirely;-u/-lare ignored when-tis given (stated in the flag descriptions).apify templates ls [--json]— human table by default;--jsonemits the full template objects includinguseCases[], so agents can discover the enum values without scraping--help.getTemplateRecommendationfrom apify-core, with the two CLI-specific changes agreed on the issue: a per-templateisExactMatchflag (no aggregate boolean) and no result limit (tier order already sorts most→least fitting).Flag → manifest-id mapping
--use-case--languagecategoryweb-scrapingWEB_SCRAPINGjavascriptjavascriptai-agentAItypescripttypescriptapi-pipelineINTEGRATIONpythonpythonbrowser-automationAUTOMATIONother"Skip (show all)" in the use-case prompt and "Any language" in the language prompt both mean no filter (the algorithm's exact match then reduces to the remaining dimension, or everything when both are skipped).
Notes for reviewers
-l other(BYO Docker) is kept as a valid flag value even though no manifest template matches it today (per the team decision on Guidedapify createwizard: use-case → language → best-match template #1236). It's a flag-only escape hatch — not offered in the interactive prompt — and currently falls through to showing all templates with no exact match. Full BYO-Docker scaffolding is out of scope here.?useCase=WEB_SCRAPING), the Console "Use locally" emit will need its own id→kebab mapping when it builds theapify createline.js-cypress(JavaScript + AUTOMATION), so that pair now has an exact match. The zero-exact "no exact match — showing the closest alternatives" hint path is still covered by a synthetic-fixture unit test.--skip-dependency-install.Test plan
getTemplateRecommendation(tiers, dedup, any-language, skip-use-case, BYO-other, no-exact) andbuildTemplateChoiceList(separator placement, language-suffix labels, hint text). 31 relevant tests green (incl. existingcreatetests).pnpm run build,pnpm run lint,pnpm run format— clean.docs/reference.mdregenerated viapnpm run update-docs.🤖 Generated with Claude Code