|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import type { ICommandLoader } from './types.js'; |
|
|
import type { SlashCommand } from '../ui/commands/types.js'; |
|
|
import type { Config } from '@google/gemini-cli-core'; |
|
|
import { aboutCommand } from '../ui/commands/aboutCommand.js'; |
|
|
import { authCommand } from '../ui/commands/authCommand.js'; |
|
|
import { bugCommand } from '../ui/commands/bugCommand.js'; |
|
|
import { chatCommand } from '../ui/commands/chatCommand.js'; |
|
|
import { clearCommand } from '../ui/commands/clearCommand.js'; |
|
|
import { compressCommand } from '../ui/commands/compressCommand.js'; |
|
|
import { copyCommand } from '../ui/commands/copyCommand.js'; |
|
|
import { corgiCommand } from '../ui/commands/corgiCommand.js'; |
|
|
import { docsCommand } from '../ui/commands/docsCommand.js'; |
|
|
import { directoryCommand } from '../ui/commands/directoryCommand.js'; |
|
|
import { editorCommand } from '../ui/commands/editorCommand.js'; |
|
|
import { extensionsCommand } from '../ui/commands/extensionsCommand.js'; |
|
|
import { helpCommand } from '../ui/commands/helpCommand.js'; |
|
|
import { ideCommand } from '../ui/commands/ideCommand.js'; |
|
|
import { initCommand } from '../ui/commands/initCommand.js'; |
|
|
import { mcpCommand } from '../ui/commands/mcpCommand.js'; |
|
|
import { memoryCommand } from '../ui/commands/memoryCommand.js'; |
|
|
import { privacyCommand } from '../ui/commands/privacyCommand.js'; |
|
|
import { quitCommand } from '../ui/commands/quitCommand.js'; |
|
|
import { restoreCommand } from '../ui/commands/restoreCommand.js'; |
|
|
import { statsCommand } from '../ui/commands/statsCommand.js'; |
|
|
import { themeCommand } from '../ui/commands/themeCommand.js'; |
|
|
import { toolsCommand } from '../ui/commands/toolsCommand.js'; |
|
|
import { settingsCommand } from '../ui/commands/settingsCommand.js'; |
|
|
import { vimCommand } from '../ui/commands/vimCommand.js'; |
|
|
import { setupGithubCommand } from '../ui/commands/setupGithubCommand.js'; |
|
|
import { terminalSetupCommand } from '../ui/commands/terminalSetupCommand.js'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export class BuiltinCommandLoader implements ICommandLoader { |
|
|
constructor(private config: Config | null) {} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async loadCommands(_signal: AbortSignal): Promise<SlashCommand[]> { |
|
|
const allDefinitions: Array<SlashCommand | null> = [ |
|
|
aboutCommand, |
|
|
authCommand, |
|
|
bugCommand, |
|
|
chatCommand, |
|
|
clearCommand, |
|
|
compressCommand, |
|
|
copyCommand, |
|
|
corgiCommand, |
|
|
docsCommand, |
|
|
directoryCommand, |
|
|
editorCommand, |
|
|
extensionsCommand, |
|
|
helpCommand, |
|
|
ideCommand(this.config), |
|
|
initCommand, |
|
|
mcpCommand, |
|
|
memoryCommand, |
|
|
privacyCommand, |
|
|
quitCommand, |
|
|
restoreCommand(this.config), |
|
|
statsCommand, |
|
|
themeCommand, |
|
|
toolsCommand, |
|
|
settingsCommand, |
|
|
vimCommand, |
|
|
setupGithubCommand, |
|
|
terminalSetupCommand, |
|
|
]; |
|
|
|
|
|
return allDefinitions.filter((cmd): cmd is SlashCommand => cmd !== null); |
|
|
} |
|
|
} |
|
|
|