Skip to content

Commit afe2b40

Browse files
Merge pull request #3 from trustgraph-ai/feature/remove-singleton-choices
Auto-choose singleton choices
2 parents 59d9081 + 7bd670e commit afe2b40

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

cli.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,13 @@ const promptStep = async (step) => {
109109
const type = input.type || 'select';
110110

111111
if (type === 'select') {
112+
// Auto-select if only one option
113+
if (input.options.length === 1) {
114+
const opt = input.options[0];
115+
p.log.info(`${step.title} ${opt.label}`);
116+
return opt.value;
117+
}
118+
112119
const options = input.options.map(opt => ({
113120
value: opt.value,
114121
label: opt.label + (opt.recommended ? ' (Recommended)' : ''),

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@trustgraph/config",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"description": "TrustGraph Configuration CLI - Interactive terminal wizard",
55
"type": "module",
66
"main": "cli.js",

0 commit comments

Comments
 (0)