Skip to content
3 changes: 1 addition & 2 deletions packages/cli/src/commands/mcp.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@

import { describe, it, expect, vi } from 'vitest';
import { mcpCommand } from './mcp.js';
import { type Argv } from 'yargs';
import yargs from 'yargs';
import yargs, { type Argv } from 'yargs';

describe('mcp command', () => {
it('should have correct command definition', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/commands/mcp/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
// File for 'gemini mcp list' command
import type { CommandModule } from 'yargs';
import { type MergedSettings, loadSettings } from '../../config/settings.js';
import type { MCPServerConfig } from '@google/gemini-cli-core';
import {
type MCPServerConfig,
MCPServerStatus,
createTransport,
debugLogger,
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/config/config.integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import {
import * as fs from 'node:fs';
import * as path from 'node:path';
import { tmpdir } from 'node:os';
import type { ConfigParameters } from '@google/gemini-cli-core';
import {
type ConfigParameters,
Config,
DEFAULT_FILE_FILTERING_OPTIONS,
} from '@google/gemini-cli-core';
Expand Down
3 changes: 1 addition & 2 deletions packages/cli/src/config/extensions/update.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@ import {
type ExtensionUpdateStatus,
} from '../../ui/state/extensions.js';
import { ExtensionStorage } from './storage.js';
import { copyExtension } from '../extension-manager.js';
import { copyExtension, type ExtensionManager } from '../extension-manager.js';
import { checkForExtensionUpdate } from './github.js';
import { loadInstallMetadata } from '../extension.js';
import * as fs from 'node:fs';
import type { ExtensionManager } from '../extension-manager.js';
import type { GeminiCLIExtension } from '@google/gemini-cli-core';

// Mock dependencies
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/config/keyBindings.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
*/

import { describe, it, expect } from 'vitest';
import type { KeyBindingConfig } from './keyBindings.js';
import {
type KeyBindingConfig,
Command,
commandCategories,
commandDescriptions,
Expand Down
3 changes: 1 addition & 2 deletions packages/cli/src/config/trustedFolders.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ import {
isWorkspaceTrusted,
resetTrustedFoldersForTesting,
} from './trustedFolders.js';
import { loadEnvironment } from './settings.js';
import { loadEnvironment, type Settings } from './settings.js';
import { createMockSettings } from '../test-utils/settings.js';
import type { Settings } from './settings.js';

// We explicitly do NOT mock 'fs' or 'proper-lockfile' here to ensure
// we are testing the actual behavior on the real file system.
Expand Down
10 changes: 8 additions & 2 deletions packages/cli/src/deferred.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@
* SPDX-License-Identifier: Apache-2.0
*/

import { describe, it, expect, vi, beforeEach } from 'vitest';
import {
describe,
it,
expect,
vi,
beforeEach,
type MockInstance,
} from 'vitest';
import {
runDeferredCommand,
defer,
Expand All @@ -14,7 +21,6 @@ import {
import { ExitCodes } from '@google/gemini-cli-core';
import type { ArgumentsCamelCase, CommandModule } from 'yargs';
import { createMockSettings } from './test-utils/settings.js';
import type { MockInstance } from 'vitest';

const { mockRunExitCleanup, mockCoreEvents } = vi.hoisted(() => ({
mockRunExitCleanup: vi.fn(),
Expand Down
7 changes: 5 additions & 2 deletions packages/cli/src/gemini.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,17 @@ import {
startInteractiveUI,
getNodeMemoryArgs,
} from './gemini.js';
import { loadCliConfig, parseArguments } from './config/config.js';
import {
loadCliConfig,
parseArguments,
type CliArgs,
} from './config/config.js';
import { loadSandboxConfig } from './config/sandboxConfig.js';
import { terminalCapabilityManager } from './ui/utils/terminalCapabilityManager.js';
import { start_sandbox } from './utils/sandbox.js';
import { validateNonInteractiveAuth } from './validateNonInterActiveAuth.js';
import os from 'node:os';
import v8 from 'node:v8';
import { type CliArgs } from './config/config.js';
import { type LoadedSettings, loadSettings } from './config/settings.js';
import {
createMockConfig,
Expand Down
8 changes: 6 additions & 2 deletions packages/cli/src/gemini.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,16 @@ import v8 from 'node:v8';
import os from 'node:os';
import dns from 'node:dns';
import { start_sandbox } from './utils/sandbox.js';
import type { DnsResolutionOrder, LoadedSettings } from './config/settings.js';
import {
type DnsResolutionOrder,
type LoadedSettings,
loadSettings,
SettingScope,
} from './config/settings.js';
import {
loadTrustedFolders,
type TrustedFoldersError,
} from './config/trustedFolders.js';
import { loadSettings, SettingScope } from './config/settings.js';
import { getStartupWarnings } from './utils/startupWarnings.js';
import { getUserStartupWarnings } from './utils/userStartupWarnings.js';
import { ConsolePatcher } from './ui/utils/ConsolePatcher.js';
Expand Down
3 changes: 1 addition & 2 deletions packages/cli/src/gemini_cleanup.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@

import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
import { main } from './gemini.js';
import { debugLogger } from '@google/gemini-cli-core';
import { type Config } from '@google/gemini-cli-core';
import { debugLogger, type Config } from '@google/gemini-cli-core';

vi.mock('@google/gemini-cli-core', async (importOriginal) => {
const actual =
Expand Down
16 changes: 7 additions & 9 deletions packages/cli/src/nonInteractiveCli.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,14 @@
* SPDX-License-Identifier: Apache-2.0
*/

import type {
Config,
ToolRegistry,
ServerGeminiStreamEvent,
SessionMetrics,
AnyDeclarativeTool,
AnyToolInvocation,
UserFeedbackPayload,
} from '@google/gemini-cli-core';
import {
type Config,
type ToolRegistry,
type ServerGeminiStreamEvent,
type SessionMetrics,
type AnyDeclarativeTool,
type AnyToolInvocation,
type UserFeedbackPayload,
ToolErrorType,
GeminiEventType,
OutputFormat,
Expand Down
14 changes: 6 additions & 8 deletions packages/cli/src/nonInteractiveCli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,11 @@
* SPDX-License-Identifier: Apache-2.0
*/

import type {
Config,
ToolCallRequestInfo,
ResumedSessionData,
UserFeedbackPayload,
} from '@google/gemini-cli-core';
import { isSlashCommand } from './ui/utils/commandUtils.js';
import type { LoadedSettings } from './config/settings.js';
import {
type Config,
type ToolCallRequestInfo,
type ResumedSessionData,
type UserFeedbackPayload,
convertSessionToClientHistory,
GeminiEventType,
FatalInputError,
Expand All @@ -31,6 +27,8 @@ import {
Scheduler,
ROOT_SCHEDULER_ID,
} from '@google/gemini-cli-core';
import { isSlashCommand } from './ui/utils/commandUtils.js';
import type { LoadedSettings } from './config/settings.js';

import type { Content, Part } from '@google/genai';
import readline from 'node:readline';
Expand Down
3 changes: 1 addition & 2 deletions packages/cli/src/services/BuiltinCommandLoader.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ vi.mock('../ui/commands/permissionsCommand.js', async () => {

import { describe, it, expect, vi, beforeEach, type Mock } from 'vitest';
import { BuiltinCommandLoader } from './BuiltinCommandLoader.js';
import type { Config } from '@google/gemini-cli-core';
import { isNightly } from '@google/gemini-cli-core';
import { type Config, isNightly } from '@google/gemini-cli-core';
import { CommandKind } from '../ui/commands/types.js';

import { restoreCommand } from '../ui/commands/restoreCommand.js';
Expand Down
3 changes: 2 additions & 1 deletion packages/cli/src/services/BuiltinCommandLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ import {
type SlashCommand,
type CommandContext,
} from '../ui/commands/types.js';
import type { MessageActionReturn, Config } from '@google/gemini-cli-core';
import {
type MessageActionReturn,
type Config,
isNightly,
startupProfiler,
getAdminErrorMessage,
Expand Down
3 changes: 1 addition & 2 deletions packages/cli/src/services/FileCommandLoader.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@

import * as glob from 'glob';
import * as path from 'node:path';
import type { Config } from '@google/gemini-cli-core';
import { GEMINI_DIR, Storage } from '@google/gemini-cli-core';
import { type Config, GEMINI_DIR, Storage } from '@google/gemini-cli-core';
import mock from 'mock-fs';
import { FileCommandLoader } from './FileCommandLoader.js';
import { assert, vi } from 'vitest';
Expand Down
19 changes: 8 additions & 11 deletions packages/cli/src/services/FileCommandLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,18 @@ import path from 'node:path';
import toml from '@iarna/toml';
import { glob } from 'glob';
import { z } from 'zod';
import type { Config } from '@google/gemini-cli-core';
import { Storage, coreEvents } from '@google/gemini-cli-core';
import { type Config, Storage, coreEvents } from '@google/gemini-cli-core';
import type { ICommandLoader } from './types.js';
import type {
CommandContext,
SlashCommand,
SlashCommandActionReturn,
import {
type CommandContext,
type SlashCommand,
type SlashCommandActionReturn,
CommandKind,
} from '../ui/commands/types.js';
import { CommandKind } from '../ui/commands/types.js';
import { DefaultArgumentProcessor } from './prompt-processors/argumentProcessor.js';
import type {
IPromptProcessor,
PromptPipelineContent,
} from './prompt-processors/types.js';
import {
type IPromptProcessor,
type PromptPipelineContent,
SHORTHAND_ARGS_PLACEHOLDER,
SHELL_INJECTION_TRIGGER,
AT_FILE_INJECTION_TRIGGER,
Expand Down
17 changes: 10 additions & 7 deletions packages/cli/src/services/McpPromptLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,17 @@
* SPDX-License-Identifier: Apache-2.0
*/

import type { Config } from '@google/gemini-cli-core';
import { getErrorMessage, getMCPServerPrompts } from '@google/gemini-cli-core';
import type {
CommandContext,
SlashCommand,
SlashCommandActionReturn,
import {
type Config,
getErrorMessage,
getMCPServerPrompts,
} from '@google/gemini-cli-core';
import {
type CommandContext,
type SlashCommand,
type SlashCommandActionReturn,
CommandKind,
} from '../ui/commands/types.js';
import { CommandKind } from '../ui/commands/types.js';
import type { ICommandLoader } from './types.js';
import type { PromptArgument } from '@modelcontextprotocol/sdk/types.js';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import { describe, it, expect, beforeEach, vi, type Mock } from 'vitest';
import { ConfirmationRequiredError, ShellProcessor } from './shellProcessor.js';
import { createMockCommandContext } from '../../test-utils/mockCommandContext.js';
import type { CommandContext } from '../../ui/commands/types.js';
import type { Config } from '@google/gemini-cli-core';
import {
type Config,
ApprovalMode,
getShellConfiguration,
PolicyDecision,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ import {
} from '@google/gemini-cli-core';

import type { CommandContext } from '../../ui/commands/types.js';
import type { IPromptProcessor, PromptPipelineContent } from './types.js';
import {
type IPromptProcessor,
type PromptPipelineContent,
SHELL_INJECTION_TRIGGER,
SHORTHAND_ARGS_PLACEHOLDER,
} from './types.js';
Expand Down
3 changes: 1 addition & 2 deletions packages/cli/src/test-utils/mockCommandContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@

import { vi } from 'vitest';
import type { CommandContext } from '../ui/commands/types.js';
import type { LoadedSettings } from '../config/settings.js';
import { mergeSettings } from '../config/settings.js';
import { type LoadedSettings, mergeSettings } from '../config/settings.js';
import type { GitService } from '@google/gemini-cli-core';
import type { SessionStatsState } from '../ui/contexts/SessionContext.js';

Expand Down
7 changes: 5 additions & 2 deletions packages/cli/src/test-utils/mockConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@

import { vi } from 'vitest';
import type { Config } from '@google/gemini-cli-core';
import type { LoadedSettings, Settings } from '../config/settings.js';
import { createTestMergedSettings } from '../config/settings.js';
import {
type LoadedSettings,
type Settings,
createTestMergedSettings,
} from '../config/settings.js';

/**
* Creates a mocked Config object with default values and allows overrides.
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/test-utils/render.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ import {
render as inkRenderDirect,
type Instance as InkInstance,
type RenderOptions,
Box,
} from 'ink';
import { EventEmitter } from 'node:events';
import { Box } from 'ink';
import type React from 'react';
import { act, useState } from 'react';
import { Terminal } from '@xterm/headless';
import { vi } from 'vitest';
import stripAnsi from 'strip-ansi';
import { act, useState } from 'react';
import os from 'node:os';
import { LoadedSettings } from '../config/settings.js';
import { KeypressProvider } from '../ui/contexts/KeypressContext.js';
Expand Down
12 changes: 5 additions & 7 deletions packages/cli/src/ui/AppContainer.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ import {
AuthType,
type AgentDefinition,
CoreToolCallStatus,
ShellExecutionService,
writeToStdout,
enableMouseEvents,
disableMouseEvents,
} from '@google/gemini-cli-core';

// Mock coreEvents
Expand Down Expand Up @@ -105,8 +109,8 @@ import {
type UIActions,
} from './contexts/UIActionsContext.js';
import { KeypressProvider } from './contexts/KeypressContext.js';
import { OverflowProvider } from './contexts/OverflowContext.js';
import {
OverflowProvider,
useOverflowActions,
type OverflowActions,
} from './contexts/OverflowContext.js';
Expand Down Expand Up @@ -229,12 +233,6 @@ import * as useKeypressModule from './hooks/useKeypress.js';
import { useSuspend } from './hooks/useSuspend.js';
import { measureElement } from 'ink';
import { useTerminalSize } from './hooks/useTerminalSize.js';
import {
ShellExecutionService,
writeToStdout,
enableMouseEvents,
disableMouseEvents,
} from '@google/gemini-cli-core';
import { type ExtensionManager } from '../config/extension-manager.js';
import {
WARNING_PROMPT_DURATION_MS,
Expand Down
3 changes: 2 additions & 1 deletion packages/cli/src/ui/AppContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@ import {
type ConfirmationRequest,
type PermissionConfirmationRequest,
type QuotaStats,
MessageType,
StreamingState,
} from './types.js';
import { checkPermissions } from './hooks/atCommandProcessor.js';
import { MessageType, StreamingState } from './types.js';
import { ToolActionsProvider } from './contexts/ToolActionsContext.js';
import {
type StartupWarning,
Expand Down
6 changes: 4 additions & 2 deletions packages/cli/src/ui/IdeIntegrationNudge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@

import type { IdeInfo } from '@google/gemini-cli-core';
import { Box, Text } from 'ink';
import type { RadioSelectItem } from './components/shared/RadioButtonSelect.js';
import { RadioButtonSelect } from './components/shared/RadioButtonSelect.js';
import {
type RadioSelectItem,
RadioButtonSelect,
} from './components/shared/RadioButtonSelect.js';
import { useKeypress } from './hooks/useKeypress.js';
import { theme } from './semantic-colors.js';

Expand Down
Loading