W-21017394 feat: add sf flexipage generate command#833
Merged
iowillhoit merged 14 commits intosalesforcecli:mainfrom Feb 12, 2026
Merged
W-21017394 feat: add sf flexipage generate command#833iowillhoit merged 14 commits intosalesforcecli:mainfrom
iowillhoit merged 14 commits intosalesforcecli:mainfrom
Conversation
Add CLI command to generate FlexiPage metadata with flags: - --name: FlexiPage name (required) - --template: RecordPage, AppPage, or HomePage (required) - --entity-name: SObject API name (required for RecordPage) - --primary-field: Primary field for dynamic highlights - --secondary-fields: Secondary fields for highlights - --detail-fields: Fields for Details tab field section
Contributor
jshackell-sfdc
left a comment
There was a problem hiding this comment.
See my suggestions, mostly for the --help messages, but also a suggestion to change one of your flag name.
FYI @iowillhoit .
- Rename --entity-name to --sobject for CLI consistency - Improve command summary and description messaging - Fix custom field __c formatting in examples - Consolidate flag summaries and descriptions - Remove redundant flag descriptions
c016f9c to
f947bb0
Compare
- Mark command as beta for future flexibility - Add validation for max 11 secondary fields - Add tests for beta state and secondary fields limit
… formatting - Add custom validation to ensure primary-field, secondary-fields, and detail-fields flags can only be used with --template RecordPage - Remove dependsOn since it only checks flag presence, not value - Fix __c formatting in examples (was showing as **c or \_\_c) - Add flexipage topic to oclif config in package.json - Consolidate flag descriptions into summaries for cleaner --help output
Verify that --primary-field, --secondary-fields, and --detail-fields throw an error when used with non-RecordPage templates (AppPage, HomePage).
src/commands/flexipage/generate.ts
Outdated
| public static readonly summary = messages.getMessage('summary'); | ||
| public static readonly description = messages.getMessage('description'); | ||
| public static readonly examples = messages.getMessages('examples'); | ||
| public static readonly aliases = ['force:flexipage:create']; |
There was a problem hiding this comment.
I don't think we need aliases for this, since this has never existed before. We can remove this and line 22
Move command and tests to new directory structure: - src/commands/flexipage/generate.ts -> src/commands/template/generate/flexipage.ts - test/commands/flexipage/generate.test.ts -> test/commands/template/generate/flexipage.test.ts Update package.json topics to add flexipage under template.generate.subtopics. Add flexipage:generate as deprecated alias to maintain backward compatibility.
- Remove force:flexipage:create alias (command never existed before) - Keep flexipage:generate as deprecated alias for backward compatibility - Remove unused Messages import from test file
AndrewLPetersonSF
approved these changes
Feb 10, 2026
AndrewLPetersonSF
left a comment
There was a problem hiding this comment.
Tentatively approving, though I know it'd be helpful to also add some NUTS tests (which is basically an integration test, if I understand correctly). Also would love if Juliet could give a once more look-through on the labels
jshackell-sfdc
approved these changes
Feb 10, 2026
Contributor
jshackell-sfdc
left a comment
There was a problem hiding this comment.
Message look great!
Move command and tests to directory structure for future extensibility: - flexipage.ts -> flexipage/index.ts - flexipage.test.ts -> flexipage/index.test.ts This allows adding sub-templates under flexipage/ in the future.
Add integration tests covering: - RecordPage creation with required and optional flags - AppPage creation with label and description - HomePage creation with custom output directory - Error handling for missing/invalid flags - Deprecated alias (flexipage:generate) support
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.
@W-21017394@
Summary
sf flexipage generateCLI command to create FlexiPage metadata--name,--template(RecordPage|AppPage|HomePage)--entity-nameand supports--primary-field,--secondary-fields,--detail-fieldsTest Plan