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/integration-tests/stdin-context.test.ts | integration-tests/stdin-context.test.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { describe, it, expect, beforeEach, afterEach } from 'vitest';
import { TestRig, printDebugInfo, validateModelOutput } from './test-helper.js';
describe.skip('stdin context', () => {
let rig: TestRig;
beforeEach(() => ... | 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/integration-tests/utf-bom-encoding.test.ts | integration-tests/utf-bom-encoding.test.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { describe, it, expect, beforeEach, afterEach } from 'vitest';
import { writeFileSync, readFileSync } from 'node:fs';
import { join, resolve } from 'node:path';
import { TestRig } from './test-helper.js';
// BOM encoders
co... | 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/integration-tests/context-compress-interactive.test.ts | integration-tests/context-compress-interactive.test.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { expect, describe, it, beforeEach, afterEach } from 'vitest';
import { TestRig } from './test-helper.js';
import { join } from 'node:path';
describe('Interactive Mode', () => {
let rig: TestRig;
beforeEach(() => {
... | 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/integration-tests/test-helper.ts | integration-tests/test-helper.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { expect } from 'vitest';
import { execSync, spawn } from 'node:child_process';
import { mkdirSync, writeFileSync, readFileSync } from 'node:fs';
import { join, dirname } from 'node:path';
import { fileURLToPath } from 'node... | 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/integration-tests/globalSetup.ts | integration-tests/globalSetup.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
// Unset NO_COLOR environment variable to ensure consistent theme behavior between local and CI test runs
if (process.env['NO_COLOR'] !== undefined) {
delete process.env['NO_COLOR'];
}
import { mkdir, readdir, rm } from 'node:fs... | 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/integration-tests/flicker.test.ts | integration-tests/flicker.test.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { describe, it, expect, beforeEach, afterEach } from 'vitest';
import { TestRig } from './test-helper.js';
import { join } from 'node:path';
describe('Flicker Detector', () => {
let rig: TestRig;
beforeEach(() => {
... | 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/integration-tests/file-system-interactive.test.ts | integration-tests/file-system-interactive.test.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { expect, describe, it, beforeEach, afterEach } from 'vitest';
import { TestRig } from './test-helper.js';
describe('Interactive file system', () => {
let rig: TestRig;
beforeEach(() => {
rig = new TestRig();
});... | 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/integration-tests/write_file.test.ts | integration-tests/write_file.test.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
import {
TestRig,
createToolCallErrorMessage,
printDebugInfo,
validateModelOutput,
} from './test-helper.js';
describe('write_file', () => {
let r... | 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/integration-tests/replace.test.ts | integration-tests/replace.test.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { describe, it, expect, beforeEach, afterEach } from 'vitest';
import { TestRig } from './test-helper.js';
describe('replace', () => {
let rig: TestRig;
beforeEach(() => {
rig = new TestRig();
});
afterEach(as... | 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/a2a-server/vitest.config.ts | packages/a2a-server/vitest.config.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
/// <reference types="vitest" />
import { defineConfig } from 'vitest/config';
export default defineConfig({
test: {
include: ['**/*.{test,spec}.?(c|m)[jt]s?(x)'],
exclude: ['**/node_modules/**', '**/dist/**'],
globa... | 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/a2a-server/index.ts | packages/a2a-server/index.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
export * from './src/index.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/a2a-server/src/types.ts | packages/a2a-server/src/types.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import type {
MCPServerStatus,
ToolConfirmationOutcome,
} from '@google/gemini-cli-core';
import type { TaskState } from '@a2a-js/sdk';
// Interfaces and enums for the CoderAgent protocol.
export enum CoderAgentEvent {
/**
... | 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/a2a-server/src/index.ts | packages/a2a-server/src/index.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
export * from './agent/executor.js';
export * from './http/app.js';
export * from './types.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/a2a-server/src/commands/init.test.ts | packages/a2a-server/src/commands/init.test.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { describe, it, expect, vi, beforeEach } from 'vitest';
import { InitCommand } from './init.js';
import { performInit } from '@google/gemini-cli-core';
import * as fs from 'node:fs';
import * as path from 'node:path';
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/a2a-server/src/commands/init.ts | packages/a2a-server/src/commands/init.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 { CoderAgentEvent, type AgentSettings } from '../types.js';
import { performInit } from '@google/gemini-cli-core';
import type {
Command,
CommandContext,
... | 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/a2a-server/src/commands/command-registry.test.ts | packages/a2a-server/src/commands/command-registry.test.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { describe, it, expect, vi, beforeEach } from 'vitest';
import type { Command } from './types.js';
describe('CommandRegistry', () => {
const mockListExtensionsCommandInstance: Command = {
name: 'extensions list',
... | 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/a2a-server/src/commands/command-registry.ts | packages/a2a-server/src/commands/command-registry.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { debugLogger } from '@google/gemini-cli-core';
import { ExtensionsCommand } from './extensions.js';
import { InitCommand } from './init.js';
import { RestoreCommand } from './restore.js';
import type { Command } from './typ... | 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/a2a-server/src/commands/extensions.ts | packages/a2a-server/src/commands/extensions.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { listExtensions } from '@google/gemini-cli-core';
import type {
Command,
CommandContext,
CommandExecutionResponse,
} from './types.js';
export class ExtensionsCommand implements Command {
readonly name = '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/a2a-server/src/commands/restore.ts | packages/a2a-server/src/commands/restore.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import {
getCheckpointInfoList,
getToolCallDataSchema,
isNodeError,
performRestore,
} from '@google/gemini-cli-core';
import * as fs from 'node:fs/promises';
import * as path from 'node:path';
import type {
Command,
Com... | 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/a2a-server/src/commands/extensions.test.ts | packages/a2a-server/src/commands/extensions.test.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { describe, it, expect, vi } from 'vitest';
import { ExtensionsCommand, ListExtensionsCommand } from './extensions.js';
import type { CommandContext } from './types.js';
const mockListExtensions = vi.hoisted(() => 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/a2a-server/src/commands/types.ts | packages/a2a-server/src/commands/types.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import type { ExecutionEventBus, AgentExecutor } from '@a2a-js/sdk/server';
import type { Config, GitService } from '@google/gemini-cli-core';
export interface CommandContext {
config: Config;
git?: GitService;
agentExecutor... | 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/a2a-server/src/commands/restore.test.ts | packages/a2a-server/src/commands/restore.test.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { describe, it, expect, vi, beforeEach } from 'vitest';
import { RestoreCommand, ListCheckpointsCommand } from './restore.js';
import type { CommandContext } from './types.js';
import type { Config } from '@google/gemini-cli... | 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/a2a-server/src/utils/executor_utils.ts | packages/a2a-server/src/utils/executor_utils.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import type { Message } from '@a2a-js/sdk';
import type { ExecutionEventBus } from '@a2a-js/sdk/server';
import { v4 as uuidv4 } from 'uuid';
import { CoderAgentEvent } from '../types.js';
import type { StateChange } from '../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/a2a-server/src/utils/logger.ts | packages/a2a-server/src/utils/logger.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import winston from 'winston';
const logger = winston.createLogger({
level: 'info',
format: winston.format.combine(
// First, add a timestamp to the log info object
winston.format.timestamp({
format: 'YYYY-MM-DD ... | 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/a2a-server/src/utils/testing_utils.ts | packages/a2a-server/src/utils/testing_utils.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import type {
Task as SDKTask,
TaskStatusUpdateEvent,
SendStreamingMessageSuccessResponse,
} from '@a2a-js/sdk';
import {
ApprovalMode,
DEFAULT_GEMINI_MODEL,
DEFAULT_TRUNCATE_TOOL_OUTPUT_LINES,
DEFAULT_TRUNCATE_TOOL_O... | 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/a2a-server/src/persistence/gcs.ts | packages/a2a-server/src/persistence/gcs.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { Storage } from '@google-cloud/storage';
import { gzipSync, gunzipSync } from 'node:zlib';
import * as tar from 'tar';
import * as fse from 'fs-extra';
import { promises as fsPromises, createReadStream } from 'node:fs';
imp... | 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/a2a-server/src/persistence/gcs.test.ts | packages/a2a-server/src/persistence/gcs.test.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { Storage } from '@google-cloud/storage';
import * as fse from 'fs-extra';
import * as tar from 'tar';
import { gzipSync, gunzipSync } from 'node:zlib';
import { v4 as uuidv4 } from 'uuid';
import type { Task as SDKTask } fr... | 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/a2a-server/src/config/config.ts | packages/a2a-server/src/config/config.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 * as dotenv from 'dotenv';
import type { TelemetryTarget } from '@google/gemini-cli-core';
import {
AuthType,
Config,
... | 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/a2a-server/src/config/settings.test.ts | packages/a2a-server/src/config/settings.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';
import * as path from 'node:path';
import * as os from 'node:os';
import { loadSettings, USER_SETTINGS_PATH } from './settings... | 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/a2a-server/src/config/extension.ts | packages/a2a-server/src/config/extension.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
// Copied exactly from packages/cli/src/config/extension.ts, last PR #1026
import {
GEMINI_DIR,
type MCPServerConfig,
type ExtensionInstallMetadata,
type GeminiCLIExtension,
} from '@google/gemini-cli-core';
import * as fs... | 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/a2a-server/src/config/settings.ts | packages/a2a-server/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 } from 'node:os';
import type { MCPServerConfig } from '@google/gemini-cli-core';
import {
debugLogger,
GEMINI_DIR,
getErrorMessage,
type T... | 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/a2a-server/src/agent/executor.ts | packages/a2a-server/src/agent/executor.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import type { Message, Task as SDKTask } from '@a2a-js/sdk';
import type {
TaskStore,
AgentExecutor,
AgentExecutionEvent,
RequestContext,
ExecutionEventBus,
} from '@a2a-js/sdk/server';
import type { ToolCallRequestInfo, ... | 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/a2a-server/src/agent/task.ts | packages/a2a-server/src/agent/task.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import {
CoreToolScheduler,
type GeminiClient,
GeminiEventType,
ToolConfirmationOutcome,
ApprovalMode,
getAllMCPServerStatuses,
MCPServerStatus,
isNodeError,
parseAndFormatApiError,
safeLiteralReplace,
DEFAULT... | 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/a2a-server/src/agent/task.test.ts | packages/a2a-server/src/agent/task.test.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import {
describe,
it,
expect,
vi,
beforeEach,
afterEach,
type Mock,
} from 'vitest';
import { Task } from './task.js';
import {
GeminiEventType,
type Config,
type ToolCallRequestInfo,
type GitService,
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/a2a-server/src/http/endpoints.test.ts | packages/a2a-server/src/http/endpoints.test.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { describe, it, expect, beforeAll, afterAll, vi } from 'vitest';
import request from 'supertest';
import type express from 'express';
import * as fs from 'node:fs';
import * as path from 'node:path';
import * as os from 'nod... | 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/a2a-server/src/http/server.ts | packages/a2a-server/src/http/server.ts | #!/usr/bin/env node
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import * as url from 'node:url';
import * as path from 'node:path';
import { logger } from '../utils/logger.js';
import { main } from './app.js';
// Check if the module is the main script being run
const isMa... | 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/a2a-server/src/http/app.test.ts | packages/a2a-server/src/http/app.test.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import type { Config } from '@google/gemini-cli-core';
import {
GeminiEventType,
ApprovalMode,
type ToolCallConfirmationDetails,
} from '@google/gemini-cli-core';
import type {
TaskStatusUpdateEvent,
SendStreamingMessageS... | 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/a2a-server/src/http/requestStorage.ts | packages/a2a-server/src/http/requestStorage.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import type express from 'express';
import { AsyncLocalStorage } from 'node:async_hooks';
export const requestStorage = new AsyncLocalStorage<{ req: express.Request }>();
| 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/a2a-server/src/http/app.ts | packages/a2a-server/src/http/app.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import express from 'express';
import type { AgentCard, Message } from '@a2a-js/sdk';
import type { TaskStore } from '@a2a-js/sdk/server';
import {
DefaultRequestHandler,
InMemoryTaskStore,
DefaultExecutionEventBus,
type A... | 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/test-utils/vitest.config.ts | packages/test-utils/vitest.config.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { defineConfig } from 'vitest/config';
export default defineConfig({
test: {
reporters: ['default', 'junit'],
silent: true,
outputFile: {
junit: 'junit.xml',
},
poolOptions: {
threads: {
... | 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/test-utils/index.ts | packages/test-utils/index.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
export * from './src/file-system-test-helpers.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/test-utils/src/file-system-test-helpers.ts | packages/test-utils/src/file-system-test-helpers.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 * as os from 'node:os';
/**
* Defines the structure of a virtual file system to be created for testing.
* Keys are file or directory names, and 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/test-utils/src/index.ts | packages/test-utils/src/index.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
export * from './file-system-test-helpers.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/vscode-ide-companion/src/open-files-manager.ts | packages/vscode-ide-companion/src/open-files-manager.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import * as vscode from 'vscode';
import type {
File,
IdeContext,
} from '@google/gemini-cli-core/src/ide/types.js';
export const MAX_FILES = 10;
const MAX_SELECTED_TEXT_LENGTH = 16384; // 16 KiB limit
/**
* Keeps track of t... | 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/vscode-ide-companion/src/ide-server.ts | packages/vscode-ide-companion/src/ide-server.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import * as vscode from 'vscode';
import {
CloseDiffRequestSchema,
IdeContextNotificationSchema,
OpenDiffRequestSchema,
} from '@google/gemini-cli-core/src/ide/types.js';
import { isInitializeRequest } from '@modelcontextprot... | 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/vscode-ide-companion/src/open-files-manager.test.ts | packages/vscode-ide-companion/src/open-files-manager.test.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import * as vscode from 'vscode';
import { OpenFilesManager, MAX_FILES } from './open-files-manager.js';
vi.mock('vscode', () => ({
EventEmitter: 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/vscode-ide-companion/src/diff-manager.ts | packages/vscode-ide-companion/src/diff-manager.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import {
IdeDiffAcceptedNotificationSchema,
IdeDiffRejectedNotificationSchema,
} from '@google/gemini-cli-core/src/ide/types.js';
import { type JSONRPCNotification } from '@modelcontextprotocol/sdk/types.js';
import * as path 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/vscode-ide-companion/src/extension.ts | packages/vscode-ide-companion/src/extension.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import * as vscode from 'vscode';
import { IDEServer } from './ide-server.js';
import semver from 'semver';
import { DiffContentProvider, DiffManager } from './diff-manager.js';
import { createLogger } from './utils/logger.js';
imp... | 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/vscode-ide-companion/src/extension.test.ts | packages/vscode-ide-companion/src/extension.test.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import * as vscode from 'vscode';
import { activate } from './extension.js';
import {
IDE_DEFINITIONS,
detectIdeFromEnv,
} 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/vscode-ide-companion/src/ide-server.test.ts | packages/vscode-ide-companion/src/ide-server.test.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import type * as vscode from 'vscode';
import * as fs from 'node:fs/promises';
import type * as os from 'node:os';
import * as path from 'node:path';
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/vscode-ide-companion/src/utils/logger.ts | packages/vscode-ide-companion/src/utils/logger.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import * as vscode from 'vscode';
export function createLogger(
context: vscode.ExtensionContext,
logger: vscode.OutputChannel,
) {
return (message: string) => {
const isDevMode =
context.extensionMode === vscode.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/core/vitest.config.ts | packages/core/vitest.config.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { defineConfig } from 'vitest/config';
export default defineConfig({
test: {
reporters: ['default', 'junit'],
timeout: 30000,
silent: true,
setupFiles: ['./test-setup.ts'],
outputFile: {
junit: '... | 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/core/test-setup.ts | packages/core/test-setup.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
// Unset NO_COLOR environment variable to ensure consistent theme behavior between local and CI test runs
if (process.env.NO_COLOR !== undefined) {
delete process.env.NO_COLOR;
}
import { setSimulate429 } from './src/utils/testU... | 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/core/index.ts | packages/core/index.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
export * from './src/index.js';
export { Storage } from './src/config/storage.js';
export {
DEFAULT_GEMINI_MODEL,
DEFAULT_GEMINI_MODEL_AUTO,
DEFAULT_GEMINI_FLASH_MODEL,
DEFAULT_GEMINI_FLASH_LITE_MODEL,
DEFAULT_GEMINI_EMBE... | 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/core/src/index.test.ts | packages/core/src/index.test.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { describe, it, expect } from 'vitest';
describe('placeholder tests', () => {
it('should pass', () => {
expect(true).toBe(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/core/src/index.ts | packages/core/src/index.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
// Export config
export * from './config/config.js';
export * from './config/defaultModelConfigs.js';
export * from './config/models.js';
export * from './output/types.js';
export * from './output/json-formatter.js';
export * 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/core/src/services/modelConfigService.test.ts | packages/core/src/services/modelConfigService.test.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { describe, it, expect } from 'vitest';
import type { ModelConfigServiceConfig } from './modelConfigService.js';
import { ModelConfigService } from './modelConfigService.js';
describe('ModelConfigService', () => {
it('sho... | 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/core/src/services/environmentSanitization.test.ts | packages/core/src/services/environmentSanitization.test.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { describe, expect, it } from 'vitest';
import {
ALWAYS_ALLOWED_ENVIRONMENT_VARIABLES,
NEVER_ALLOWED_ENVIRONMENT_VARIABLES,
NEVER_ALLOWED_NAME_PATTERNS,
NEVER_ALLOWED_VALUE_PATTERNS,
sanitizeEnvironment,
} 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/core/src/services/fileDiscoveryService.test.ts | packages/core/src/services/fileDiscoveryService.test.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { describe, it, expect, beforeEach, afterEach } from 'vitest';
import * as fs from 'node:fs/promises';
import * as os from 'node:os';
import * as path from 'node:path';
import { FileDiscoveryService } from './fileDiscoverySe... | 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/core/src/services/fileSystemService.test.ts | packages/core/src/services/fileSystemService.test.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest';
import fs from 'node:fs/promises';
import { StandardFileSystemService } from './fileSystemService.js';
vi.mock('fs/promises');
describe('StandardFileSystem... | 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/core/src/services/modelConfigService.ts | packages/core/src/services/modelConfigService.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import type { GenerateContentConfig } from '@google/genai';
// The primary key for the ModelConfig is the model string. However, we also
// support a secondary key to limit the override scope, typically an agent name.
export inter... | 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/core/src/services/contextManager.test.ts | packages/core/src/services/contextManager.test.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { describe, it, expect, vi, beforeEach } from 'vitest';
import { ContextManager } from './contextManager.js';
import * as memoryDiscovery from '../utils/memoryDiscovery.js';
import type { Config } from '../config/config.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/core/src/services/loopDetectionService.test.ts | packages/core/src/services/loopDetectionService.test.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import type { Content } from '@google/genai';
import type { Config } from '../config/config.js';
import type { GeminiClient } from '../core/client.js';
impor... | 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/core/src/services/shellExecutionService.test.ts | packages/core/src/services/shellExecutionService.test.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import {
vi,
describe,
it,
expect,
beforeEach,
afterEach,
type Mock,
} from 'vitest';
import EventEmitter from 'node:events';
import type { Readable } from 'node:stream';
import { type ChildProcess } from 'node:child_... | 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/core/src/services/chatCompressionService.test.ts | packages/core/src/services/chatCompressionService.test.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
import {
ChatCompressionService,
findCompressSplitPoint,
modelStringToModelConfigAlias,
} from './chatCompressionService.js';
import type { Content, Ge... | 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/core/src/services/fileDiscoveryService.ts | packages/core/src/services/fileDiscoveryService.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import type { GitIgnoreFilter } from '../utils/gitIgnoreParser.js';
import type { GeminiIgnoreFilter } from '../utils/geminiIgnoreParser.js';
import { GitIgnoreParser } from '../utils/gitIgnoreParser.js';
import { GeminiIgnoreParse... | 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/core/src/services/contextManager.ts | packages/core/src/services/contextManager.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import {
loadGlobalMemory,
loadEnvironmentMemory,
loadJitSubdirectoryMemory,
concatenateInstructions,
} from '../utils/memoryDiscovery.js';
import type { Config } from '../config/config.js';
import { coreEvents, CoreEvent }... | 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/core/src/services/sessionSummaryService.test.ts | packages/core/src/services/sessionSummaryService.test.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
import { SessionSummaryService } from './sessionSummaryService.js';
import type { BaseLlmClient } from '../core/baseLlmClient.js';
import type { MessageRecor... | 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/core/src/services/gitService.test.ts | packages/core/src/services/gitService.test.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import {
describe,
it,
expect,
vi,
beforeEach,
afterEach,
type Mock,
} from 'vitest';
import { GitService } from './gitService.js';
import { Storage } from '../config/storage.js';
import * as path from 'node:path';
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/core/src/services/sessionSummaryService.ts | packages/core/src/services/sessionSummaryService.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import type { MessageRecord } from './chatRecordingService.js';
import type { BaseLlmClient } from '../core/baseLlmClient.js';
import { partListUnionToString } from '../core/geminiRequest.js';
import { debugLogger } from '../utils/... | 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/core/src/services/modelConfig.golden.test.ts | packages/core/src/services/modelConfig.golden.test.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { describe, it, expect } from 'vitest';
import * as fs from 'node:fs/promises';
import * as path from 'node:path';
import { ModelConfigService } from './modelConfigService.js';
import { DEFAULT_MODEL_CONFIGS } from '../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/core/src/services/chatRecordingService.ts | packages/core/src/services/chatRecordingService.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { type Config } from '../config/config.js';
import { type Status } from '../core/coreToolScheduler.js';
import { type ThoughtSummary } from '../utils/thoughtUtils.js';
import { getProjectHash } from '../utils/paths.js';
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/core/src/services/loopDetectionService.ts | packages/core/src/services/loopDetectionService.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import type { Content } from '@google/genai';
import { createHash } from 'node:crypto';
import type { ServerGeminiStreamEvent } from '../core/turn.js';
import { GeminiEventType } from '../core/turn.js';
import {
logLoopDetected,
... | 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/core/src/services/chatCompressionService.ts | packages/core/src/services/chatCompressionService.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import type { Content } from '@google/genai';
import type { Config } from '../config/config.js';
import type { GeminiChat } from '../core/geminiChat.js';
import { type ChatCompressionInfo, CompressionStatus } from '../core/turn.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/core/src/services/sessionSummaryUtils.ts | packages/core/src/services/sessionSummaryUtils.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import type { Config } from '../config/config.js';
import { SessionSummaryService } from './sessionSummaryService.js';
import { BaseLlmClient } from '../core/baseLlmClient.js';
import { debugLogger } from '../utils/debugLogger.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/core/src/services/fileSystemService.ts | packages/core/src/services/fileSystemService.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import fs from 'node:fs/promises';
/**
* Interface for file system operations that may be delegated to different implementations
*/
export interface FileSystemService {
/**
* Read text content from a file
*
* @param 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/core/src/services/modelConfig.integration.test.ts | packages/core/src/services/modelConfig.integration.test.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { describe, it, expect } from 'vitest';
import { ModelConfigService } from './modelConfigService.js';
import type { ModelConfigServiceConfig } from './modelConfigService.js';
// This test suite is designed to validate the 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/core/src/services/shellExecutionService.ts | packages/core/src/services/shellExecutionService.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import stripAnsi from 'strip-ansi';
import type { PtyImplementation } from '../utils/getPty.js';
import { getPty } from '../utils/getPty.js';
import { spawn as cpSpawn } from 'node:child_process';
import { TextDecoder } from 'node:... | 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/core/src/services/modelConfigServiceTestUtils.ts | packages/core/src/services/modelConfigServiceTestUtils.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import type { ResolvedModelConfig } from '../services/modelConfigService.js';
/**
* Creates a ResolvedModelConfig with sensible defaults, allowing overrides.
*/
export const makeResolvedModelConfig = (
model: string,
overrid... | 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/core/src/services/sessionSummaryUtils.test.ts | packages/core/src/services/sessionSummaryUtils.test.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
import { generateSummary, getPreviousSession } from './sessionSummaryUtils.js';
import type { Config } from '../config/config.js';
import type { ContentGener... | 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/core/src/services/chatRecordingService.test.ts | packages/core/src/services/chatRecordingService.test.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import type { MockInstance } from 'vitest';
import { expect, it, describe, vi, beforeEach, afterEach } from 'vitest';
import fs from 'node:fs';
import path from 'node:path';
import { randomUUID } from 'node:crypto';
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/core/src/services/gitService.ts | packages/core/src/services/gitService.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 { isNodeError } from '../utils/errors.js';
import { spawnAsync } from '../utils/shell-utils.js';
import type { SimpleGit } from 'simple-git';
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/core/src/services/environmentSanitization.ts | packages/core/src/services/environmentSanitization.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
export type EnvironmentSanitizationConfig = {
allowedEnvironmentVariables: string[];
blockedEnvironmentVariables: string[];
enableEnvironmentVariableRedaction: boolean;
};
export function sanitizeEnvironment(
processEnv: N... | 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/core/src/tools/write-todos.test.ts | packages/core/src/tools/write-todos.test.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { describe, expect, it } from 'vitest';
import { WriteTodosTool, type WriteTodosToolParams } from './write-todos.js';
describe('WriteTodosTool', () => {
const tool = new WriteTodosTool();
const signal = new AbortControl... | 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/core/src/tools/tool-registry.test.ts | packages/core/src/tools/tool-registry.test.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
/* eslint-disable @typescript-eslint/no-explicit-any */
import type { Mocked, MockInstance } from 'vitest';
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
import type { ConfigParameters } from '../config/... | 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/core/src/tools/read-many-files.ts | packages/core/src/tools/read-many-files.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import type { MessageBus } from '../confirmation-bus/message-bus.js';
import type { ToolInvocation, ToolResult } from './tools.js';
import { BaseDeclarativeTool, BaseToolInvocation, Kind } from './tools.js';
import { getErrorMessag... | 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/core/src/tools/edit.ts | packages/core/src/tools/edit.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 Diff from 'diff';
import type {
ToolCallConfirmationDetails,
ToolEditConfirmationDetails,
ToolInvocation,
ToolLocation,
ToolResult,
} from './t... | 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/core/src/tools/activate-skill.test.ts | packages/core/src/tools/activate-skill.test.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { describe, it, expect, vi, beforeEach } from 'vitest';
import { ActivateSkillTool } from './activate-skill.js';
import type { Config } from '../config/config.js';
import type { MessageBus } from '../confirmation-bus/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/core/src/tools/memoryTool.ts | packages/core/src/tools/memoryTool.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import type { ToolEditConfirmationDetails, ToolResult } from './tools.js';
import {
BaseDeclarativeTool,
BaseToolInvocation,
Kind,
ToolConfirmationOutcome,
} from './tools.js';
import type { FunctionDeclaration } from '@goo... | 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/core/src/tools/web-search.ts | packages/core/src/tools/web-search.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import type { MessageBus } from '../confirmation-bus/message-bus.js';
import { WEB_SEARCH_TOOL_NAME } from './tool-names.js';
import type { GroundingMetadata } from '@google/genai';
import type { ToolInvocation, ToolResult } 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/core/src/tools/glob.test.ts | packages/core/src/tools/glob.test.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import type { GlobToolParams, GlobPath } from './glob.js';
import { GlobTool, sortFileEntries } from './glob.js';
import { partListUnionToString } from '../core/geminiRequest.js';
import path from 'node:path';
import fs from 'node:... | 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/core/src/tools/mcp-tool.ts | packages/core/src/tools/mcp-tool.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { safeJsonStringify } from '../utils/safeJsonStringify.js';
import type {
ToolCallConfirmationDetails,
ToolInvocation,
ToolMcpConfirmationDetails,
ToolResult,
} from './tools.js';
import {
BaseDeclarativeTool,
Ba... | 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/core/src/tools/mcp-tool.test.ts | packages/core/src/tools/mcp-tool.test.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
/* eslint-disable @typescript-eslint/no-explicit-any */
import type { Mocked } from 'vitest';
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
import { safeJsonStringify } from '../utils/safeJsonStringify.j... | 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/core/src/tools/read-many-files.test.ts | packages/core/src/tools/read-many-files.test.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { vi, describe, it, expect, beforeEach, afterEach } from 'vitest';
import type { Mock } from 'vitest';
import { mockControl } from '../__mocks__/fs/promises.js';
import { ReadManyFilesTool } from './read-many-files.js';
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/core/src/tools/confirmation-policy.test.ts | packages/core/src/tools/confirmation-policy.test.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
/* eslint-disable @typescript-eslint/no-explicit-any */
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
import { EditTool } from './edit.js';
import { SmartEditTool } from './smart-edit.js';
import { Writ... | 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/core/src/tools/smart-edit.ts | packages/core/src/tools/smart-edit.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 crypto from 'node:crypto';
import * as Diff from 'diff';
import {
BaseDeclarativeTool,
BaseToolInvocation,
Kind,
type ToolCallConfirmationDetails... | 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/core/src/tools/tool-error.ts | packages/core/src/tools/tool-error.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
/**
* A type-safe enum for tool-related errors.
*
* Error types are categorized as:
* - Recoverable: LLM can self-correct (e.g., invalid params, file not found)
* - Fatal: System-level issues that prevent continued execution (... | 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/core/src/tools/tool-names.test.ts | packages/core/src/tools/tool-names.test.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { describe, it, expect } from 'vitest';
import {
isValidToolName,
ALL_BUILTIN_TOOL_NAMES,
DISCOVERED_TOOL_PREFIX,
LS_TOOL_NAME,
} from './tool-names.js';
describe('tool-names', () => {
describe('isValidToolName', ... | 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/core/src/tools/tools.ts | packages/core/src/tools/tools.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import type { FunctionDeclaration, PartListUnion } from '@google/genai';
import { ToolErrorType } from './tool-error.js';
import type { DiffUpdateResult } from '../ide/ide-client.js';
import type { ShellExecutionConfig } from '../s... | 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/core/src/tools/shell.ts | packages/core/src/tools/shell.ts | /**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import fs from 'node:fs';
import path from 'node:path';
import os, { EOL } from 'node:os';
import crypto from 'node:crypto';
import type { Config } from '../config/config.js';
import { debugLogger } from '../index.js';
import { Too... | typescript | Apache-2.0 | d3c206c6770d320953dff80c01d555ad64df5b8b | 2026-01-04T15:25:31.833747Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.