mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-12 12:54:07 -07:00
feat(cli): add oncall command for issue triage (#17661)
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
@@ -34,6 +34,7 @@ import { initCommand } from '../ui/commands/initCommand.js';
|
|||||||
import { mcpCommand } from '../ui/commands/mcpCommand.js';
|
import { mcpCommand } from '../ui/commands/mcpCommand.js';
|
||||||
import { memoryCommand } from '../ui/commands/memoryCommand.js';
|
import { memoryCommand } from '../ui/commands/memoryCommand.js';
|
||||||
import { modelCommand } from '../ui/commands/modelCommand.js';
|
import { modelCommand } from '../ui/commands/modelCommand.js';
|
||||||
|
import { oncallCommand } from '../ui/commands/oncallCommand.js';
|
||||||
import { permissionsCommand } from '../ui/commands/permissionsCommand.js';
|
import { permissionsCommand } from '../ui/commands/permissionsCommand.js';
|
||||||
import { privacyCommand } from '../ui/commands/privacyCommand.js';
|
import { privacyCommand } from '../ui/commands/privacyCommand.js';
|
||||||
import { policiesCommand } from '../ui/commands/policiesCommand.js';
|
import { policiesCommand } from '../ui/commands/policiesCommand.js';
|
||||||
@@ -110,6 +111,7 @@ export class BuiltinCommandLoader implements ICommandLoader {
|
|||||||
rewindCommand,
|
rewindCommand,
|
||||||
await ideCommand(),
|
await ideCommand(),
|
||||||
initCommand,
|
initCommand,
|
||||||
|
...(isNightlyBuild ? [oncallCommand] : []),
|
||||||
...(this.config?.getMcpEnabled() === false
|
...(this.config?.getMcpEnabled() === false
|
||||||
? [
|
? [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -0,0 +1,53 @@
|
|||||||
|
/**
|
||||||
|
* @license
|
||||||
|
* Copyright 2026 Google LLC
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
import {
|
||||||
|
CommandKind,
|
||||||
|
type SlashCommand,
|
||||||
|
type OpenCustomDialogActionReturn,
|
||||||
|
} from './types.js';
|
||||||
|
import { TriageDuplicates } from '../components/triage/TriageDuplicates.js';
|
||||||
|
|
||||||
|
export const oncallCommand: SlashCommand = {
|
||||||
|
name: 'oncall',
|
||||||
|
description: 'Oncall related commands',
|
||||||
|
kind: CommandKind.BUILT_IN,
|
||||||
|
autoExecute: false,
|
||||||
|
subCommands: [
|
||||||
|
{
|
||||||
|
name: 'dedup',
|
||||||
|
description: 'Triage issues labeled as status/possible-duplicate',
|
||||||
|
kind: CommandKind.BUILT_IN,
|
||||||
|
autoExecute: true,
|
||||||
|
action: async (context, args): Promise<OpenCustomDialogActionReturn> => {
|
||||||
|
const { config } = context.services;
|
||||||
|
if (!config) {
|
||||||
|
throw new Error('Config not available');
|
||||||
|
}
|
||||||
|
|
||||||
|
let limit = 50;
|
||||||
|
if (args && args.trim().length > 0) {
|
||||||
|
const argArray = args.trim().split(/\s+/);
|
||||||
|
const parsedLimit = parseInt(argArray[0], 10);
|
||||||
|
if (!isNaN(parsedLimit) && parsedLimit > 0) {
|
||||||
|
limit = parsedLimit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
type: 'custom_dialog',
|
||||||
|
component: (
|
||||||
|
<TriageDuplicates
|
||||||
|
config={config}
|
||||||
|
initialLimit={limit}
|
||||||
|
onExit={() => context.ui.removeComponent()}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
};
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user