feat(codegen): semantic question types, INPUT_OBJECT dot-notation, --no-tty flag#785
Merged
pyramation merged 3 commits intomainfrom Mar 6, 2026
Merged
Conversation
…no-tty flag
1. Semantic question types in table CRUD commands:
- Boolean fields use type: 'boolean' instead of 'text'
- JSON/GeoJSON fields use type: 'json' instead of 'text'
- Maps GraphQL scalar types to appropriate inquirerer question types
2. INPUT_OBJECT dot-notation flattening with nested-obj:
- Flattened INPUT_OBJECT fields use dot-notation names (e.g. input.email)
- Added unflattenDotNotation() to reconstruct nested objects from CLI answers
- Custom commands use unflattenDotNotation instead of parseMutationInput
3. --no-tty flag support in CLI entry point:
- Added process.argv.includes('--no-tty') check alongside existing --tty false
Updated test snapshots and regenerated constructive-cli code.
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
…otation, --no-tty)
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.
feat(codegen): semantic question types, INPUT_OBJECT dot-notation, --no-tty flag
Summary
Three CLI codegen improvements to the generated
csdkcommands:Semantic question types for table CRUD: Boolean fields now generate
type: 'boolean'and JSON/GeoJSON fields generatetype: 'json'instead of everything beingtype: 'text'. Implemented via newgetQuestionTypeForField()intable-command-generator.ts.INPUT_OBJECT dot-notation flattening: When custom commands have INPUT_OBJECT args (e.g.
input: SignUpInput), the inner fields are now named with dot-notation (input.email,input.password) instead of losing the parent name. A newunflattenDotNotation()utility (usingnested-obj) reconstructs the nested structure from flat CLI answers. ReplacesparseMutationInputin generated imports.--no-ttyflag: CLI entry points now accept--no-ttyas a shorthand for--tty falsefor non-interactive/scripted usage.All changes propagate through codegen → regenerated
constructive-clioutput (141 files touched).Dependency: Requires
inquirerer@4.7.0for'boolean'and'json'type support — published via dev-utils PR #69 (merged). Theconstructive-clipackage.jsonhas been bumped to"inquirerer": "^4.7.0".Updates since last revision
inquirerer@4.7.0published — dependency blocker resolvedinquirererfrom^4.6.0to^4.7.0insdk/constructive-cli/package.json@ts-nocheckor type suppressionsReview & Testing Checklist for Human
booleanandjsonquestion types are new ininquirerer@4.7.0— verify they handle edge cases (e.g., "true"/"false" string coercion, malformed JSON input).sign-up,verify-password), verify that:--input.email foowork correctlyunflattenDotNotation()correctly reconstructs{ input: { email: 'foo' } }before sending to the ORMinputFields— this is expected fallback behaviorparseMutationInput→unflattenDotNotationswap: The oldparseMutationInputattempted to JSON.parse string values. The newunflattenDotNotationonly restructures dot-notation keys. Confirm no custom commands relied on the JSON-parsing behavior of the old function.--no-ttyflag: Run a CLI command with--no-ttyand verify non-interactive mode works (no prompts, uses defaults/CLI flags only).Recommended Test Plan
pnpm run generateinsdk/constructive-clito verify regenerationcsdk public app-grant create --appId <uuid> --isGrant truecsdk public view create --name test --data '{"key":"value"}'--no-tty:csdk public user list --no-ttycsdk public sign-up --input.email test@example.com --input.password secretNotes
type: 'number'— they remain astype: 'text'. If this was intended to be included, it's missing fromgetQuestionTypeForField().inputFieldson INPUT_OBJECT types. Some custom commands may not get this data and will fall back to single text input.parseMutationInput()still exists in template but is no longer imported by generated commands (replaced byunflattenDotNotation). Not a breaking change since the function is still exported.Link to Devin Session: https://app.devin.ai/sessions/0852119907284bb4a09c1910ef213240
Requested by: @pyramation