feat(cli): add interactive wizards for fetch and init commands#73
Merged
alexey1312 merged 12 commits intomainfrom Mar 20, 2026
Merged
feat(cli): add interactive wizards for fetch and init commands#73alexey1312 merged 12 commits intomainfrom
alexey1312 merged 12 commits intomainfrom
Conversation
When required options (--file-id, --frame, --output) are omitted in an interactive terminal, a guided wizard helps fill them in with smart platform-specific defaults. Changes: - NooraUI: add textPrompt, singleChoicePrompt, yesOrNoPrompt wrappers - FetchWizard: wizard flow with WizardPlatform, WizardAssetType, PlatformDefaults (format, scale, nameStyle per platform) - DownloadOptions: make fileId, frameName, outputPath optional - DownloadImages: wire wizard into run(), fallback to error in non-TTY - ImageFormat: add CustomStringConvertible for display in prompts - Usage spec: update fetch flags as optional with interactive docs - Tests: FetchWizardTests (16 tests), updated DownloadOptionsTests
Add `exfig fetch` wizard mentions to Quick Start (README), Quick Fetch section (Usage.md), and ExFig.md landing page capabilities. Update CLAUDE.md with documentation structure guidance for future sessions.
When --platform is omitted in a TTY, `exfig init` launches a guided wizard that collects platform, asset types, Figma file IDs, and frame names, then generates a ready-to-run config with unselected sections removed and IDs substituted. - Add InitWizard with run() and pure applyResult() for testability - Add multipleChoicePrompt wrapper to NooraUI - Add WizardPlatform.asPlatform mapping - Make --platform optional, gate wizard on TTYDetector.isTTY - Replace readLine() overwrite prompt with NooraUI.yesOrNoPrompt - Context-aware "next steps" output (skip "edit file IDs" after wizard) - 16 tests covering section removal, ID substitution, brace balance - Update exfig.usage.kdl, README, DocC articles, CLAUDE.md
- Add colors source choice: Styles vs Figma Variables - When Variables selected: uncomment variablesColors block, populate tokensFileId, collectionName, lightModeName, darkModeName - Add optional page name filter for icons and images (figmaPageName) - Split transform logic into InitWizardTransform.swift (file_length) - 23 tests covering variables, page names, section removal, brace balance
Generated exfig.pkl now references published PKL package URIs
(package://github.com/DesignPipe/exfig/releases/download/v{VERSION}/...)
instead of local .exfig/schemas/ paths. Version is taken from
ExFigCommand.version at generation time.
- Add substitutePackageURI() to replace .exfig/schemas/ with package://
- Remove SchemaExtractor.extract() call from `exfig init`
- No more .exfig/schemas/ created on init
- Make DownloadOptions.format optional with effectiveFormat computed property so wizard doesn't override explicit --format png - Add extractFigmaFileId() to auto-extract file IDs from full Figma URLs - Trim whitespace on text prompt inputs before empty-check defaults - Add defensive check in removeSection for unclosed brace-counted sections - Remove unnecessary swiftlint:disable function_parameter_count - Add tests for substitutePackageURI, extractFigmaFileId, Android/Web templates, removeSection edge cases, and collapseBlankLines - Update CLAUDE.md with wizard patterns and CLI flag gotcha
Automatically regenerates and stages llms.txt / llms-full.txt when documentation sources (README, DocC articles, CONFIG.md) are modified. - check uses temp dir generation (parallel-safe for hk batching) - fix regenerates in-place and auto-stages via hk stage list - generate-llms.sh now accepts LLMS_TXT/LLMS_FULL env overrides
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.
Description
exfig fetch— walks user through file ID, asset type, platform, format, and output path selection with smart per-platform defaultsexfig init— guided config generation with platform, asset types (multi-select), Figma file IDs, frame/page names, and colors source (Styles vs Variables)multipleChoicePromptwrapper to NooraUI adapter for multi-select prompts with min/max limitsWizardPlatform.asPlatformmapping for reuse across wizardspackage://URIs instead of local.exfig/schemas/paths, with version fromExFigCommand.versionSchemaExtractor.extract()fromexfig init— no more.exfig/schemas/created on initreadLine()overwrite prompt withNooraUI.yesOrNoPromptfor consistent UX--platformoptional inexfig init(wizard in TTY,ValidationErrorin non-TTY)exfig.usage.kdl, README, DocC articlesAdditional notes
WizardPlatformfrom fetch wizard for consistent platform selectionInitWizardTransform.swiftextension to stay within SwiftLint file/type length limits