Download packages/cli/src/commands/skills/enable.ts from SaylorTwift/gemini-cli: direct link, hf CLI and curl.
- Browser
- Download file 1.34 kB
-
https://huggingface.co/SaylorTwift/gemini-cli/resolve/main/packages/cli/src/commands/skills/enable.ts
- Command line
-
hf download hf://SaylorTwift/gemini-cli/packages/cli/src/commands/skills/enable.ts
-
curl -L -o enable.ts https://huggingface.co/SaylorTwift/gemini-cli/resolve/main/packages/cli/src/commands/skills/enable.ts
1.34 kB
| /** | |
| * @license | |
| * Copyright 2026 Google LLC | |
| * SPDX-License-Identifier: Apache-2.0 | |
| */ | |
| import type { CommandModule } from 'yargs'; | |
| import { loadSettings } from '../../config/settings.js'; | |
| import { debugLogger } from '@google/gemini-cli-core'; | |
| import { exitCli } from '../utils.js'; | |
| import { enableSkill } from '../../utils/skillSettings.js'; | |
| import { renderSkillActionFeedback } from '../../utils/skillUtils.js'; | |
| import chalk from 'chalk'; | |
| interface EnableArgs { | |
| name: string; | |
| } | |
| export async function handleEnable(args: EnableArgs) { | |
| const { name } = args; | |
| const workspaceDir = process.cwd(); | |
| const settings = loadSettings(workspaceDir); | |
| const result = enableSkill(settings, name); | |
| const feedback = renderSkillActionFeedback( | |
| result, | |
| (label, path) => `${chalk.bold(label)} (${chalk.dim(path)})`, | |
| ); | |
| debugLogger.log(feedback); | |
| } | |
| export const enableCommand: CommandModule = { | |
| command: 'enable <name>', | |
| describe: 'Enables an agent skill.', | |
| builder: (yargs) => | |
| yargs.positional('name', { | |
| describe: 'The name of the skill to enable.', | |
| type: 'string', | |
| demandOption: true, | |
| }), | |
| handler: async (argv) => { | |
| await handleEnable({ | |
| // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion | |
| name: argv['name'] as string, | |
| }); | |
| await exitCli(); | |
| }, | |
| }; | |