repo
stringlengths
7
64
file_url
stringlengths
81
338
file_path
stringlengths
5
257
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:25:31
2026-01-05 01:50:38
truncated
bool
2 classes
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/utils/commands.ts
packages/cli/src/utils/commands.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { type SlashCommand } from '../ui/commands/types.js'; export type ParsedSlashCommand = { commandToExecute: SlashCommand | undefined; args: string; canonicalPath: string[]; }; /** * Parses a raw slash command string ...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/utils/terminalTheme.ts
packages/cli/src/utils/terminalTheme.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { type TerminalBackgroundColor, terminalCapabilityManager, } from '../ui/utils/terminalCapabilityManager.js'; import { themeManager, DEFAULT_THEME } from '../ui/themes/theme-manager.js'; import { pickDefaultThemeName } f...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/utils/settingsUtils.ts
packages/cli/src/utils/settingsUtils.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import type { Settings, LoadedSettings, LoadableSettingScope, } from '../config/settings.js'; import type { SettingDefinition, SettingsSchema, SettingsType, SettingsValue, } from '../config/settingsSchema.js'; import ...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/utils/resolvePath.test.ts
packages/cli/src/utils/resolvePath.test.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { describe, it, expect, vi, beforeEach } from 'vitest'; import * as os from 'node:os'; import * as path from 'node:path'; import { resolvePath } from './resolvePath.js'; vi.mock('node:os', () => ({ homedir: vi.fn(), })); ...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/utils/dialogScopeUtils.test.ts
packages/cli/src/utils/dialogScopeUtils.test.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { describe, it, expect, vi, beforeEach } from 'vitest'; import { SettingScope } from '../config/settings.js'; import type { LoadedSettings } from '../config/settings.js'; import { getScopeItems, getScopeMessageForSetting...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/utils/persistentState.ts
packages/cli/src/utils/persistentState.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { Storage, debugLogger } from '@google/gemini-cli-core'; import * as fs from 'node:fs'; import * as path from 'node:path'; const STATE_FILENAME = 'state.json'; interface PersistentStateData { defaultBannerShownCount?: Re...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/utils/math.ts
packages/cli/src/utils/math.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ /** * Linearly interpolates between two values. * * @param start The start value. * @param end The end value. * @param t The interpolation amount (typically between 0 and 1). */ export const lerp = (start: number, end: number...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/utils/errors.ts
packages/cli/src/utils/errors.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import type { Config } from '@google/gemini-cli-core'; import { OutputFormat, JsonFormatter, StreamJsonFormatter, JsonStreamEventType, uiTelemetryService, parseAndFormatApiError, FatalTurnLimitedError, FatalCancella...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/utils/envVarResolver.test.ts
packages/cli/src/utils/envVarResolver.test.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { describe, it, expect, beforeEach, afterEach } from 'vitest'; import { resolveEnvVarsInString, resolveEnvVarsInObject, } from './envVarResolver.js'; describe('resolveEnvVarsInString', () => { let originalEnv: NodeJS....
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/utils/sandbox.test.ts
packages/cli/src/utils/sandbox.test.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { vi, describe, it, expect, beforeEach, afterEach } from 'vitest'; import { spawn, exec, execSync } from 'node:child_process'; import os from 'node:os'; import fs from 'node:fs'; import { start_sandbox } from './sandbox.js';...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/utils/settingsUtils.test.ts
packages/cli/src/utils/settingsUtils.test.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { describe, it, expect } from 'vitest'; import { // Schema utilities getSettingsByCategory, getSettingDefinition, requiresRestart, getDefaultValue, getRestartRequiredSettings, getEffectiveValue, getAllSetting...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
true
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/utils/windowTitle.ts
packages/cli/src/utils/windowTitle.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ /** * Computes the window title for the Gemini CLI application. * * @param folderName - The name of the current folder/workspace to display in the title * @returns The computed window title, either from CLI_TITLE environment va...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/utils/errors.test.ts
packages/cli/src/utils/errors.test.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { vi, type MockInstance, describe, it, expect, beforeEach, afterEach, } from 'vitest'; import type { Config } from '@google/gemini-cli-core'; import { OutputFormat, FatalInputError, debugLogger, coreEve...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/utils/commands.test.ts
packages/cli/src/utils/commands.test.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { describe, it, expect } from 'vitest'; import { parseSlashCommand } from './commands.js'; import { CommandKind, type SlashCommand } from '../ui/commands/types.js'; // Mock command structure for testing const mockCommands: ...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/utils/updateEventEmitter.test.ts
packages/cli/src/utils/updateEventEmitter.test.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { describe, it, expect, vi } from 'vitest'; import { updateEventEmitter } from './updateEventEmitter.js'; describe('updateEventEmitter', () => { it('should allow registering and emitting events', () => { const callbac...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/utils/installationInfo.test.ts
packages/cli/src/utils/installationInfo.test.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { vi, describe, it, expect, beforeEach, afterEach } from 'vitest'; import { getInstallationInfo, PackageManager } from './installationInfo.js'; import * as fs from 'node:fs'; import * as path from 'node:path'; import * as ch...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/utils/sessionCleanup.ts
packages/cli/src/utils/sessionCleanup.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import * as fs from 'node:fs/promises'; import * as path from 'node:path'; import { debugLogger, type Config } from '@google/gemini-cli-core'; import type { Settings, SessionRetentionSettings } from '../config/settings.js'; import ...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/utils/persistentState.test.ts
packages/cli/src/utils/persistentState.test.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { describe, it, expect, vi, beforeEach } from 'vitest'; import * as fs from 'node:fs'; import * as path from 'node:path'; import { Storage, debugLogger } from '@google/gemini-cli-core'; import { PersistentState } from './per...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/utils/resolvePath.ts
packages/cli/src/utils/resolvePath.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import * as os from 'node:os'; import * as path from 'node:path'; export function resolvePath(p: string): string { if (!p) { return ''; } let expandedPath = p; if (p.toLowerCase().startsWith('%userprofile%')) { exp...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/utils/commentJson.ts
packages/cli/src/utils/commentJson.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import * as fs from 'node:fs'; import { parse, stringify } from 'comment-json'; import { coreEvents } from '@google/gemini-cli-core'; /** * Type representing an object that may contain Symbol keys for comments. */ type Commented...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/utils/readStdin.test.ts
packages/cli/src/utils/readStdin.test.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { vi, describe, expect, it, beforeEach, afterEach } from 'vitest'; import { readStdin } from './readStdin.js'; import { debugLogger } from '@google/gemini-cli-core'; vi.mock('@google/gemini-cli-core', () => ({ debugLogger...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/utils/gitUtils.ts
packages/cli/src/utils/gitUtils.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { debugLogger } from '@google/gemini-cli-core'; import { execSync } from 'node:child_process'; import { ProxyAgent } from 'undici'; /** * Checks if a directory is within a git repository hosted on GitHub. * @returns true ...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/utils/checks.ts
packages/cli/src/utils/checks.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ /* Fail to compile on unexpected values. */ export function assumeExhaustive(_value: never): void {} /** * Throws an exception on unexpected values. * * A common use case is switch statements: * switch(enumValue) { * case E...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/utils/gitUtils.test.ts
packages/cli/src/utils/gitUtils.test.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { vi, describe, expect, it, afterEach, beforeEach } from 'vitest'; import * as child_process from 'node:child_process'; import { isGitHubRepository, getGitRepoRoot, getLatestGitHubRelease, getGitHubRepoInfo, } from '...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/utils/processUtils.ts
packages/cli/src/utils/processUtils.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { runExitCleanup } from './cleanup.js'; /** * Exit code used to signal that the CLI should be relaunched. */ export const RELAUNCH_EXIT_CODE = 199; /** * Exits the process with a special code to signal that the parent p...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/utils/windowTitle.test.ts
packages/cli/src/utils/windowTitle.test.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { describe, it, expect, vi, beforeEach } from 'vitest'; import { computeWindowTitle } from './windowTitle.js'; describe('computeWindowTitle', () => { let originalEnv: NodeJS.ProcessEnv; beforeEach(() => { originalE...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/utils/sessionCleanup.test.ts
packages/cli/src/utils/sessionCleanup.test.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'; import * as fs from 'node:fs/promises'; import * as path from 'node:path'; import { SESSION_FILE_PREFIX, type Config, debugLogger, } from '@google/gemi...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
true
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/utils/sandboxUtils.test.ts
packages/cli/src/utils/sandboxUtils.test.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { vi, describe, it, expect, beforeEach, afterEach } from 'vitest'; import os from 'node:os'; import fs from 'node:fs'; import { readFile } from 'node:fs/promises'; import { getContainerPath, parseImageName, ports, en...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/utils/sessionCleanup.integration.test.ts
packages/cli/src/utils/sessionCleanup.integration.test.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { describe, it, expect, vi } from 'vitest'; import { cleanupExpiredSessions } from './sessionCleanup.js'; import type { Settings } from '../config/settings.js'; import { SESSION_FILE_PREFIX, type Config, debugLogger, }...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/utils/userStartupWarnings.ts
packages/cli/src/utils/userStartupWarnings.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import fs from 'node:fs/promises'; import * as os from 'node:os'; import path from 'node:path'; type WarningCheck = { id: string; check: (workspaceRoot: string) => Promise<string | null>; }; // Individual warning checks const...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/utils/readStdin_safety.test.ts
packages/cli/src/utils/readStdin_safety.test.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { vi, describe, expect, it, beforeEach, afterEach } from 'vitest'; import { readStdin } from './readStdin.js'; import { EventEmitter } from 'node:events'; // Mock debugLogger to avoid clutter vi.mock('@google/gemini-cli-cor...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/utils/startupWarnings.ts
packages/cli/src/utils/startupWarnings.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import fs from 'node:fs/promises'; import os from 'node:os'; import { join as pathJoin } from 'node:path'; import { getErrorMessage } from '@google/gemini-cli-core'; const warningsFilePath = pathJoin(os.tmpdir(), 'gemini-cli-warni...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/utils/relaunch.test.ts
packages/cli/src/utils/relaunch.test.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { vi, describe, it, expect, beforeEach, afterEach, type MockInstance, } from 'vitest'; import { EventEmitter } from 'node:events'; import { RELAUNCH_EXIT_CODE } from './processUtils.js'; import type { ChildProc...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/utils/sessions.ts
packages/cli/src/utils/sessions.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { ChatRecordingService, generateSummary, writeToStderr, writeToStdout, type Config, } from '@google/gemini-cli-core'; import { formatRelativeTime, SessionSelector, type SessionInfo, } from './sessionUtils.js'...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/utils/installationInfo.ts
packages/cli/src/utils/installationInfo.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { debugLogger, isGitRepository } from '@google/gemini-cli-core'; import * as fs from 'node:fs'; import * as path from 'node:path'; import * as childProcess from 'node:child_process'; import process from 'node:process'; expo...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/utils/handleAutoUpdate.ts
packages/cli/src/utils/handleAutoUpdate.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import type { UpdateObject } from '../ui/utils/updateCheck.js'; import type { LoadedSettings } from '../config/settings.js'; import { getInstallationInfo, PackageManager } from './installationInfo.js'; import { updateEventEmitter }...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/utils/cleanup.ts
packages/cli/src/utils/cleanup.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { promises as fs } from 'node:fs'; import { join } from 'node:path'; import { Storage, shutdownTelemetry, isTelemetrySdkInitialized, } from '@google/gemini-cli-core'; import type { Config } from '@google/gemini-cli-cor...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/utils/commentJson.test.ts
packages/cli/src/utils/commentJson.test.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest'; import * as fs from 'node:fs'; import * as path from 'node:path'; import * as os from 'node:os'; import { updateSettingsFilePreservingFormat } from './commen...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/utils/deepMerge.test.ts
packages/cli/src/utils/deepMerge.test.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { describe, it, expect } from 'vitest'; import { customDeepMerge } from './deepMerge.js'; import { MergeStrategy } from '../config/settingsSchema.js'; describe('customDeepMerge', () => { it('should merge simple objects', ...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/utils/dialogScopeUtils.ts
packages/cli/src/utils/dialogScopeUtils.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import type { LoadableSettingScope, LoadedSettings, } from '../config/settings.js'; import { isLoadableSettingScope, SettingScope } from '../config/settings.js'; import { settingExistsInScope } from './settingsUtils.js'; /** ...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/utils/sessions.test.ts
packages/cli/src/utils/sessions.test.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'; import type { Config } from '@google/gemini-cli-core'; import { ChatRecordingService } from '@google/gemini-cli-core'; import { listSessions, deleteSession }...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/utils/startupWarnings.test.ts
packages/cli/src/utils/startupWarnings.test.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { describe, it, expect, vi, beforeEach } from 'vitest'; import { getStartupWarnings } from './startupWarnings.js'; import * as fs from 'node:fs/promises'; import { getErrorMessage } from '@google/gemini-cli-core'; vi.mock('...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/utils/sandboxUtils.ts
packages/cli/src/utils/sandboxUtils.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import os from 'node:os'; import fs from 'node:fs'; import { readFile } from 'node:fs/promises'; import { quote } from 'shell-quote'; import { debugLogger, GEMINI_DIR } from '@google/gemini-cli-core'; export const LOCAL_DEV_SANDBO...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/utils/updateEventEmitter.ts
packages/cli/src/utils/updateEventEmitter.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { EventEmitter } from 'node:events'; /** * A shared event emitter for application-wide communication * between decoupled parts of the CLI. */ export const updateEventEmitter = new EventEmitter();
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/utils/checks.test.ts
packages/cli/src/utils/checks.test.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { describe, it, expect } from 'vitest'; import { checkExhaustive, assumeExhaustive } from './checks.js'; describe('checks', () => { describe('checkExhaustive', () => { it('should throw an error with default message', ...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/utils/spawnWrapper.ts
packages/cli/src/utils/spawnWrapper.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { spawn } from 'node:child_process'; export const spawnWrapper = spawn;
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/utils/userStartupWarnings.test.ts
packages/cli/src/utils/userStartupWarnings.test.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'; import { getUserStartupWarnings } from './userStartupWarnings.js'; import * as os from 'node:os'; import fs from 'node:fs/promises'; import path from 'node:p...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/utils/handleAutoUpdate.test.ts
packages/cli/src/utils/handleAutoUpdate.test.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import type { Mock } from 'vitest'; import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'; import { getInstallationInfo, PackageManager } from './installationInfo.js'; import { updateEventEmitter } from './update...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/utils/deepMerge.ts
packages/cli/src/utils/deepMerge.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { MergeStrategy } from '../config/settingsSchema.js'; export type Mergeable = | string | number | boolean | null | undefined | object | Mergeable[]; export type MergeableObject = Record<string, Mergeable>; f...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/utils/readStdin.ts
packages/cli/src/utils/readStdin.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { debugLogger } from '@google/gemini-cli-core'; export async function readStdin(): Promise<string> { const MAX_STDIN_SIZE = 8 * 1024 * 1024; // 8MB return new Promise((resolve, reject) => { let data = ''; let to...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/utils/envVarResolver.ts
packages/cli/src/utils/envVarResolver.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ /** * Resolves environment variables in a string. * Replaces $VAR_NAME and ${VAR_NAME} with their corresponding environment variable values. * If the environment variable is not defined, the original placeholder is preserved. *...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/utils/events.ts
packages/cli/src/utils/events.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import type { ExtensionEvents, McpClient } from '@google/gemini-cli-core'; import { EventEmitter } from 'node:events'; export enum AppEvent { OpenDebugConsole = 'open-debug-console', OauthDisplayMessage = 'oauth-display-messag...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/utils/relaunch.ts
packages/cli/src/utils/relaunch.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { spawn } from 'node:child_process'; import { RELAUNCH_EXIT_CODE } from './processUtils.js'; import { writeToStderr } from '@google/gemini-cli-core'; export async function relaunchOnExitCode(runner: () => Promise<number>) {...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/utils/processUtils.test.ts
packages/cli/src/utils/processUtils.test.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { vi } from 'vitest'; import { RELAUNCH_EXIT_CODE, relaunchApp } from './processUtils.js'; import * as cleanup from './cleanup.js'; describe('processUtils', () => { const processExit = vi .spyOn(process, 'exit') ....
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/utils/sessionUtils.test.ts
packages/cli/src/utils/sessionUtils.test.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { describe, it, expect, beforeEach, afterEach } from 'vitest'; import { SessionSelector, extractFirstUserMessage, formatRelativeTime, hasUserOrAssistantMessage, SessionError, } from './sessionUtils.js'; import type...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/utils/cleanup.test.ts
packages/cli/src/utils/cleanup.test.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { vi, describe, it, expect, beforeEach } from 'vitest'; import { promises as fs } from 'node:fs'; import * as path from 'node:path'; vi.mock('@google/gemini-cli-core', () => ({ Storage: vi.fn().mockImplementation(() => ({...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/utils/sandbox.ts
packages/cli/src/utils/sandbox.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { exec, execSync, spawn, type ChildProcess } from 'node:child_process'; import os from 'node:os'; import path from 'node:path'; import fs from 'node:fs'; import { fileURLToPath } from 'node:url'; import { quote, parse } from...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/test-utils/render.test.tsx
packages/cli/src/test-utils/render.test.tsx
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { describe, it, expect, vi } from 'vitest'; import { useState, useEffect } from 'react'; import { Text } from 'ink'; import { renderHook, render } from './render.js'; import { waitFor } from './async.js'; describe('render',...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/test-utils/createExtension.ts
packages/cli/src/test-utils/createExtension.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import * as fs from 'node:fs'; import * as path from 'node:path'; import { type MCPServerConfig, type ExtensionInstallMetadata, } from '@google/gemini-cli-core'; import { EXTENSIONS_CONFIG_FILENAME, INSTALL_METADATA_FILENAM...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/test-utils/mockCommandContext.test.ts
packages/cli/src/test-utils/mockCommandContext.test.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { vi, describe, it, expect } from 'vitest'; import { createMockCommandContext } from './mockCommandContext.js'; describe('createMockCommandContext', () => { it('should return a valid CommandContext object with default moc...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/test-utils/customMatchers.ts
packages/cli/src/test-utils/customMatchers.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ /// <reference types="vitest/globals" /> /** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import type { Assertion } from 'vitest'; import { expect } from 'vitest'; import type { TextBuffer }...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/test-utils/mockCommandContext.ts
packages/cli/src/test-utils/mockCommandContext.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { vi } from 'vitest'; import type { CommandContext } from '../ui/commands/types.js'; import type { LoadedSettings } from '../config/settings.js'; import type { GitService } from '@google/gemini-cli-core'; import type { Sessi...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/test-utils/async.ts
packages/cli/src/test-utils/async.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { act } from 'react'; // The waitFor from vitest doesn't properly wrap in act(), so we have to // implement our own like the one in @testing-library/react // or @testing-library/react-native // The version of waitFor from v...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/test-utils/render.tsx
packages/cli/src/test-utils/render.tsx
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { render as inkRender } from 'ink-testing-library'; import { Box } from 'ink'; import type React from 'react'; import { vi } from 'vitest'; import { act, useState } from 'react'; import { LoadedSettings, type Settings } from...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/patches/is-in-ci.ts
packages/cli/src/patches/is-in-ci.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ // This is a replacement for the `is-in-ci` package that always returns false. // We are doing this to avoid the issue where `ink` does not render the UI // when it detects that it is running in a CI environment. // This is safe be...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/core/auth.test.ts
packages/cli/src/core/auth.test.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { describe, it, expect, vi, beforeEach } from 'vitest'; import { performInitialAuth } from './auth.js'; import { type Config } from '@google/gemini-cli-core'; vi.mock('@google/gemini-cli-core', () => ({ AuthType: { OA...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/core/auth.ts
packages/cli/src/core/auth.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { type AuthType, type Config, getErrorMessage, } from '@google/gemini-cli-core'; /** * Handles the initial authentication flow. * @param config The application config. * @param authType The selected auth type. * @...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/core/initializer.ts
packages/cli/src/core/initializer.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { IdeClient, IdeConnectionEvent, IdeConnectionType, logIdeConnection, type Config, StartSessionEvent, logCliConfiguration, startupProfiler, } from '@google/gemini-cli-core'; import { type LoadedSettings } fro...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/core/initializer.test.ts
packages/cli/src/core/initializer.test.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { describe, it, expect, vi, beforeEach } from 'vitest'; import { initializeApp } from './initializer.js'; import { IdeClient, logIdeConnection, logCliConfiguration, type Config, } from '@google/gemini-cli-core'; impo...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/core/theme.test.ts
packages/cli/src/core/theme.test.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { describe, it, expect, vi, beforeEach } from 'vitest'; import { validateTheme } from './theme.js'; import { themeManager } from '../ui/themes/theme-manager.js'; import { type LoadedSettings } from '../config/settings.js'; ...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/core/theme.ts
packages/cli/src/core/theme.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { themeManager } from '../ui/themes/theme-manager.js'; import { type LoadedSettings } from '../config/settings.js'; /** * Validates the configured theme. * @param settings The loaded application settings. * @returns An e...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/config/config.integration.test.ts
packages/cli/src/config/config.integration.test.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, it, vi, } from 'vitest'; import * as fs from 'node:fs'; import * as path from 'node:path'; import { tmpdir } from 'node:os'; import type { Confi...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/config/config.ts
packages/cli/src/config/config.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import yargs from 'yargs/yargs'; import { hideBin } from 'yargs/helpers'; import process from 'node:process'; import { mcpCommand } from '../commands/mcp.js'; import { extensionsCommand } from '../commands/extensions.js'; import { ...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/config/settings_validation_warning.test.ts
packages/cli/src/config/settings_validation_warning.test.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ /// <reference types="vitest/globals" /> import { describe, it, expect, vi, beforeEach, type Mock } from 'vitest'; import * as fs from 'node:fs'; const mockCoreEvents = vi.hoisted(() => ({ emitFeedback: vi.fn(), emitConsoleLo...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/config/keyBindings.test.ts
packages/cli/src/config/keyBindings.test.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { describe, it, expect } from 'vitest'; import type { KeyBindingConfig } from './keyBindings.js'; import { Command, commandCategories, commandDescriptions, defaultKeyBindings, } from './keyBindings.js'; describe('ke...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/config/settingsSchema.ts
packages/cli/src/config/settingsSchema.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ // -------------------------------------------------------------------------- // IMPORTANT: After adding or updating settings, run `npm run docs:settings` // to regenerate the settings reference in `docs/get-started/configuration.m...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
true
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/config/extension-manager.ts
packages/cli/src/config/extension-manager.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import * as fs from 'node:fs'; import * as path from 'node:path'; import * as os from 'node:os'; import { stat } from 'node:fs/promises'; import chalk from 'chalk'; import { ExtensionEnablementManager } from './extensions/extension...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/config/auth.test.ts
packages/cli/src/config/auth.test.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { AuthType } from '@google/gemini-cli-core'; import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; import { validateAuthMethod } from './auth.js'; vi.mock('./settings.js', () => ({ loadEnvironment: vi....
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/config/policy-engine.integration.test.ts
packages/cli/src/config/policy-engine.integration.test.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { describe, it, expect, vi } from 'vitest'; import { ApprovalMode, PolicyDecision, PolicyEngine, } from '@google/gemini-cli-core'; import { createPolicyEngineConfig } from './policy.js'; import type { Settings } from '...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/config/sandboxConfig.test.ts
packages/cli/src/config/sandboxConfig.test.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { getPackageJson } from '@google/gemini-cli-core'; import commandExists from 'command-exists'; import * as os from 'node:os'; import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; import { loadSandboxConf...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/config/trustedFolders.ts
packages/cli/src/config/trustedFolders.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import * as fs from 'node:fs'; import * as path from 'node:path'; import { homedir } from 'node:os'; import { FatalConfigError, getErrorMessage, isWithinRoot, ideContextStore, GEMINI_DIR, } from '@google/gemini-cli-core';...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/config/settingPaths.test.ts
packages/cli/src/config/settingPaths.test.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { describe, it, expect } from 'vitest'; import { SettingPaths } from './settingPaths.js'; describe('SettingPaths', () => { it('should have the correct structure', () => { expect(SettingPaths).toEqual({ General: ...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/config/settings.test.ts
packages/cli/src/config/settings.test.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ /// <reference types="vitest/globals" /> // Mock 'os' first. import * as osActual from 'node:os'; // Import for type info for the mock factory vi.mock('os', async (importOriginal) => { const actualOs = await importOriginal<type...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
true
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/config/settings_repro.test.ts
packages/cli/src/config/settings_repro.test.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ /// <reference types="vitest/globals" /> // Mock 'os' first. import * as osActual from 'node:os'; vi.mock('os', async (importOriginal) => { const actualOs = await importOriginal<typeof osActual>(); return { ...actualOs, ...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/config/settings-validation.test.ts
packages/cli/src/config/settings-validation.test.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ /// <reference types="vitest/globals" /> import { describe, it, expect } from 'vitest'; import { validateSettings, formatValidationError, settingsZodSchema, } from './settings-validation.js'; import { z } from 'zod'; descri...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/config/auth.ts
packages/cli/src/config/auth.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { AuthType } from '@google/gemini-cli-core'; import { loadEnvironment, loadSettings } from './settings.js'; export function validateAuthMethod(authMethod: string): string | null { loadEnvironment(loadSettings().merged); ...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/config/settings-validation.ts
packages/cli/src/config/settings-validation.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { z } from 'zod'; import { getSettingsSchema, type SettingDefinition, type SettingCollectionDefinition, SETTINGS_SCHEMA_DEFINITIONS, } from './settingsSchema.js'; // Helper to build Zod schema from the JSON-schema-l...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/config/extension.ts
packages/cli/src/config/extension.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import type { MCPServerConfig, ExtensionInstallMetadata, } from '@google/gemini-cli-core'; import * as fs from 'node:fs'; import * as path from 'node:path'; import { INSTALL_METADATA_FILENAME } from './extensions/variables.js';...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/config/trustedFolders.test.ts
packages/cli/src/config/trustedFolders.test.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import * as osActual from 'node:os'; import { FatalConfigError, ideContextStore } from '@google/gemini-cli-core'; import { describe, it, expect, vi, beforeEach, afterEach, type Mocked, type Mock, } from 'vitest'; im...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/config/sandboxConfig.ts
packages/cli/src/config/sandboxConfig.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { getPackageJson, type SandboxConfig, FatalSandboxError, } from '@google/gemini-cli-core'; import commandExists from 'command-exists'; import * as os from 'node:os'; import type { Settings } from './settings.js'; impor...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/config/settings.ts
packages/cli/src/config/settings.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import * as fs from 'node:fs'; import * as path from 'node:path'; import { homedir, platform } from 'node:os'; import * as dotenv from 'dotenv'; import process from 'node:process'; import { debugLogger, FatalConfigError, GEMI...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/config/settingPaths.ts
packages/cli/src/config/settingPaths.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ export const SettingPaths = { General: { PreferredEditor: 'general.preferredEditor', }, } as const;
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/config/keyBindings.ts
packages/cli/src/config/keyBindings.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ /** * Command enum for all available keyboard shortcuts */ export enum Command { // Basic bindings RETURN = 'return', ESCAPE = 'escape', // Cursor movement HOME = 'home', END = 'end', // Text deletion KILL_LINE_...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/config/settingsSchema.test.ts
packages/cli/src/config/settingsSchema.test.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { describe, it, expect } from 'vitest'; import { getSettingsSchema, SETTINGS_SCHEMA_DEFINITIONS, type SettingCollectionDefinition, type SettingDefinition, type Settings, type SettingsSchema, } from './settingsSch...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/config/policy.ts
packages/cli/src/config/policy.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { type PolicyEngineConfig, type ApprovalMode, type PolicyEngine, type MessageBus, type PolicySettings, createPolicyEngineConfig as createCorePolicyEngineConfig, createPolicyUpdater as createCorePolicyUpdater, }...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/config/extension.test.ts
packages/cli/src/config/extension.test.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { vi, type MockedFunction, describe, it, expect, beforeEach, afterEach, afterAll, } from 'vitest'; import * as fs from 'node:fs'; import * as os from 'node:os'; import * as path from 'node:path'; import { t...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
true
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/config/config.test.ts
packages/cli/src/config/config.test.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'; import * as os from 'node:os'; import * as path from 'node:path'; import { DEFAULT_FILE_FILTERING_OPTIONS, OutputFormat, SHELL_TOOL_NAME, WRITE_FILE_...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
true
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/config/extensions/variables.test.ts
packages/cli/src/config/extensions/variables.test.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { expect, describe, it } from 'vitest'; import { hydrateString, recursivelyHydrateStrings, validateVariables, type VariableContext, } from './variables.js'; describe('validateVariables', () => { it('should not thr...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/config/extensions/variables.ts
packages/cli/src/config/extensions/variables.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import * as path from 'node:path'; import { type VariableSchema, VARIABLE_SCHEMA } from './variableSchema.js'; import { GEMINI_DIR } from '@google/gemini-cli-core'; export const EXTENSIONS_DIRECTORY_NAME = path.join(GEMINI_DIR, 'e...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false
google-gemini/gemini-cli
https://github.com/google-gemini/gemini-cli/blob/d3c206c6770d320953dff80c01d555ad64df5b8b/packages/cli/src/config/extensions/consent.ts
packages/cli/src/config/extensions/consent.ts
/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { debugLogger } from '@google/gemini-cli-core'; import type { ConfirmationRequest } from '../../ui/types.js'; import { escapeAnsiCtrlCodes } from '../../ui/utils/textUtils.js'; import type { ExtensionConfig } from '../exten...
typescript
Apache-2.0
d3c206c6770d320953dff80c01d555ad64df5b8b
2026-01-04T15:25:31.833747Z
false