Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,10 @@ This will start the interactive mode, which will guide you through:

## Features

- Interactive CLI interface
- Interactive CLI interface with autocomplete search
- Easy navigation between instances and projects
- Type-to-search project selection with autocomplete
- Fast action selection with search capability
- Safe environment deletion (prevents deletion of protected environments)
- GitHub PR integration for PR environments
- One-click login link generation for Drupal environments
Expand Down
14 changes: 6 additions & 8 deletions src/interactive.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@ import { logAction } from './logger.mjs';
import { configureSshKey } from './lagoon-ssh-key-configurator.mjs';

// Import the modern inquirer prompts
import { select } from '@inquirer/prompts';
import { input } from '@inquirer/prompts';
import { confirm } from '@inquirer/prompts';
import { checkbox } from '@inquirer/prompts';
import { select, input, confirm, checkbox, search } from '@inquirer/prompts';

/**
* Starts the interactive Lagoon CLI session for managing projects and environments.
Expand Down Expand Up @@ -156,8 +153,9 @@ async function selectProjectWithDetails(instance) {
const projectsWithDetails = await getProjectsWithDetails(instance);
spinner.stop();

const project = await select({
message: 'Select a project:',
// Use search prompt with autocomplete functionality
const project = await search({
message: 'Select a project (type to search):',
choices: projectsWithDetails.map(project => ({
value: project.projectname,
label: project.projectname
Expand All @@ -183,8 +181,8 @@ async function showMainMenu(instance, project) {
console.log(chalk.blue(`\nCurrent Instance: ${chalk.bold(instance)}`));
console.log(chalk.blue(`Current Project: ${chalk.bold(project)}\n`));

const action = await select({
message: 'What would you like to do?',
const action = await search({
message: 'What would you like to do? (type to search)',
choices: [
{ value: 'listEnvironments', label: 'List Environments' },
{ value: 'listUsers', label: 'List Users' },
Expand Down