mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-12 06:10:42 -07:00
Centralized profile loading and management in packages/core. Updated CLI commands to use core ProfileManager. Implemented persistent profile selection in loadCliConfig. Standardized profile format as Markdown with YAML frontmatter. Verified multi-extension loading with 'coder' profile.
42 lines
1.2 KiB
TypeScript
42 lines
1.2 KiB
TypeScript
/**
|
|
* @license
|
|
* Copyright 2026 Google LLC
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
import { type CommandModule } from 'yargs';
|
|
import { Storage, ProfileManager, debugLogger } from '@google/gemini-cli-core';
|
|
import { exitCli } from '../utils.js';
|
|
|
|
/**
|
|
* Command module for `gemini profiles uninstall <name>`.
|
|
*/
|
|
export const uninstallCommand: CommandModule = {
|
|
command: 'uninstall <name>',
|
|
describe: 'Uninstalls a profile.',
|
|
builder: (yargs) =>
|
|
yargs.positional('name', {
|
|
describe: 'The name of the profile to uninstall.',
|
|
type: 'string',
|
|
}),
|
|
handler: async (argv) => {
|
|
const name = String(argv['name']);
|
|
try {
|
|
const manager = new ProfileManager(Storage.getProfilesDir());
|
|
await manager.load();
|
|
|
|
await manager.uninstallProfile(name);
|
|
debugLogger.log(`Profile "${name}" successfully uninstalled.`);
|
|
// eslint-disable-next-line no-console
|
|
console.log(`Profile "${name}" successfully uninstalled.`);
|
|
} catch (error) {
|
|
// eslint-disable-next-line no-console
|
|
console.error(
|
|
`Error uninstalling profile: ${error instanceof Error ? error.message : String(error)}`,
|
|
);
|
|
await exitCli(1);
|
|
}
|
|
await exitCli();
|
|
},
|
|
};
|