Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 15 additions & 14 deletions packages/create-nx-workspace/src/internal-utils/prompts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,20 +90,21 @@ export async function determineAiAgents(
}

async function aiAgentsPrompt(): Promise<Agent[]> {
return (
await enquirer.prompt<{ agents: Agent[] }>([
{
name: 'agents',
message:
'Which AI agents would you like to set up? (space to select, enter to confirm)',
type: 'multiselect',
choices: supportedAgents.map((a) => ({
name: a,
message: agentDisplayMap[a],
})),
},
])
).agents;
const promptConfig = {
name: 'agents',
message:
'Which AI agents would you like to set up? (space to select, enter to confirm)',
type: 'multiselect',
choices: supportedAgents.map((a) => ({
name: a,
message: agentDisplayMap[a],
})),
footer: () =>
chalk.dim(
"Multiple selections possible. If you don't want any agents, just hit enter."
),
};
return (await enquirer.prompt<{ agents: Agent[] }>([promptConfig])).agents;
}

export async function determineDefaultBase(
Expand Down
30 changes: 16 additions & 14 deletions packages/nx/src/command-line/init/ai-agent-prompts.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { prompt } from 'enquirer';
import { isCI } from '../../utils/is-ci';
import { Agent, agentDisplayMap, supportedAgents } from '../../ai/utils';
import chalk = require('chalk');

export async function determineAiAgents(
aiAgents?: Agent[],
Expand All @@ -17,18 +18,19 @@ export async function determineAiAgents(
}

async function aiAgentsPrompt(): Promise<Agent[]> {
return (
await prompt<{ agents: Agent[] }>([
{
name: 'agents',
message:
'Which AI agents would you like to set up? (space to select, enter to confirm)',
type: 'multiselect',
choices: supportedAgents.map((a) => ({
name: a,
message: agentDisplayMap[a],
})),
},
])
).agents;
const promptConfig = {
name: 'agents',
message:
'Which AI agents would you like to set up? (space to select, enter to confirm)',
type: 'multiselect',
choices: supportedAgents.map((a) => ({
name: a,
message: agentDisplayMap[a],
})),
footer: () =>
chalk.dim(
"Multiple selections possible. If you don't want any agents, just hit enter."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about Select multiple or press Enter to skip.? Shorter and says the same thing.

),
};
return (await prompt<{ agents: Agent[] }>([promptConfig])).agents;
}
Loading