refactor: rename gemini-code to gemini-cli (#822)
This commit is contained in:
parent
d6cf4d5b0b
commit
18d6a11c04
|
@ -24,7 +24,7 @@ steps:
|
||||||
|
|
||||||
- name: 'us-west1-docker.pkg.dev/gemini-code-dev/gemini-code-containers/gemini-code-builder'
|
- name: 'us-west1-docker.pkg.dev/gemini-code-dev/gemini-code-containers/gemini-code-builder'
|
||||||
entrypoint: 'npm'
|
entrypoint: 'npm'
|
||||||
args: ['publish', '--tag=head', '--dry-run', '--workspace=@gemini-code/cli']
|
args: ['publish', '--tag=head', '--dry-run', '--workspace=@gemini-cli/cli']
|
||||||
|
|
||||||
options:
|
options:
|
||||||
defaultLogsBucketBehavior: REGIONAL_USER_OWNED_BUCKET
|
defaultLogsBucketBehavior: REGIONAL_USER_OWNED_BUCKET
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
.env
|
.env
|
||||||
.env~
|
.env~
|
||||||
|
|
||||||
# gemini-code settings
|
# gemini-cli settings
|
||||||
.gemini/
|
.gemini/
|
||||||
!gemini/config.yaml
|
!gemini/config.yaml
|
||||||
|
|
||||||
|
|
2
.npmrc
2
.npmrc
|
@ -1 +1 @@
|
||||||
@gemini-code:registry=https://us-west1-npm.pkg.dev/gemini-code-dev/gemini-code/
|
@gemini-cli:registry=https://us-west1-npm.pkg.dev/gemini-code-dev/gemini-code/
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
"type": "node",
|
"type": "node",
|
||||||
// fix source mapping when debugging in sandbox using global installation
|
// fix source mapping when debugging in sandbox using global installation
|
||||||
// note this does not interfere when remoteRoot is also ${workspaceFolder}/packages
|
// note this does not interfere when remoteRoot is also ${workspaceFolder}/packages
|
||||||
"remoteRoot": "/usr/local/share/npm-global/lib/node_modules/@gemini-code",
|
"remoteRoot": "/usr/local/share/npm-global/lib/node_modules/@gemini-cli",
|
||||||
"localRoot": "${workspaceFolder}/packages"
|
"localRoot": "${workspaceFolder}/packages"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -34,11 +34,11 @@ ENV PATH=$PATH:/usr/local/share/npm-global/bin
|
||||||
USER node
|
USER node
|
||||||
|
|
||||||
# install gemini-cli and clean up
|
# install gemini-cli and clean up
|
||||||
COPY packages/cli/dist/gemini-code-cli-*.tgz /usr/local/share/npm-global/gemini-code-cli.tgz
|
COPY packages/cli/dist/gemini-cli-cli-*.tgz /usr/local/share/npm-global/gemini-cli-cli.tgz
|
||||||
COPY packages/core/dist/gemini-code-core-*.tgz /usr/local/share/npm-global/gemini-code-core.tgz
|
COPY packages/core/dist/gemini-cli-core-*.tgz /usr/local/share/npm-global/gemini-cli-core.tgz
|
||||||
RUN npm install -g /usr/local/share/npm-global/gemini-code-cli.tgz /usr/local/share/npm-global/gemini-code-core.tgz \
|
RUN npm install -g /usr/local/share/npm-global/gemini-cli-cli.tgz /usr/local/share/npm-global/gemini-cli-core.tgz \
|
||||||
&& npm cache clean --force \
|
&& npm cache clean --force \
|
||||||
&& rm -f /usr/local/share/npm-global/gemini-code-{cli,core}.tgz
|
&& rm -f /usr/local/share/npm-global/gemini-cli-{cli,core}.tgz
|
||||||
|
|
||||||
# default entrypoint when none specified
|
# default entrypoint when none specified
|
||||||
CMD ["gemini"]
|
CMD ["gemini"]
|
||||||
|
|
|
@ -874,11 +874,11 @@
|
||||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@gemini-code/cli": {
|
"node_modules/@gemini-cli/cli": {
|
||||||
"resolved": "packages/cli",
|
"resolved": "packages/cli",
|
||||||
"link": true
|
"link": true
|
||||||
},
|
},
|
||||||
"node_modules/@gemini-code/core": {
|
"node_modules/@gemini-cli/core": {
|
||||||
"resolved": "packages/core",
|
"resolved": "packages/core",
|
||||||
"link": true
|
"link": true
|
||||||
},
|
},
|
||||||
|
@ -10320,10 +10320,10 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"packages/cli": {
|
"packages/cli": {
|
||||||
"name": "@gemini-code/cli",
|
"name": "@gemini-cli/cli",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@gemini-code/core": "0.1.0",
|
"@gemini-cli/core": "0.1.0",
|
||||||
"diff": "^7.0.0",
|
"diff": "^7.0.0",
|
||||||
"dotenv": "^16.4.7",
|
"dotenv": "^16.4.7",
|
||||||
"highlight.js": "^11.11.1",
|
"highlight.js": "^11.11.1",
|
||||||
|
@ -10388,7 +10388,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"packages/core": {
|
"packages/core": {
|
||||||
"name": "@gemini-code/core",
|
"name": "@gemini-cli/core",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@google/genai": "^1.0.1",
|
"@google/genai": "^1.0.1",
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"name": "@gemini-code/cli",
|
"name": "@gemini-cli/cli",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"description": "Gemini CLI",
|
"description": "Gemini CLI",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
@ -19,7 +19,7 @@
|
||||||
"typecheck": "tsc --noEmit",
|
"typecheck": "tsc --noEmit",
|
||||||
"prerelease:version": "node ../../scripts/bind_package_version.js",
|
"prerelease:version": "node ../../scripts/bind_package_version.js",
|
||||||
"prerelease:deps": "node ../../scripts/bind_package_dependencies.js",
|
"prerelease:deps": "node ../../scripts/bind_package_dependencies.js",
|
||||||
"prepublishOnly": "npm publish --workspace=@gemini-code/core",
|
"prepublishOnly": "npm publish --workspace=@gemini-cli/core",
|
||||||
"prepack": "npm run build"
|
"prepack": "npm run build"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
|
@ -29,7 +29,7 @@
|
||||||
"sandboxImageUri": "gemini-cli-sandbox"
|
"sandboxImageUri": "gemini-cli-sandbox"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@gemini-code/core": "0.1.0",
|
"@gemini-cli/core": "0.1.0",
|
||||||
"diff": "^7.0.0",
|
"diff": "^7.0.0",
|
||||||
"dotenv": "^16.4.7",
|
"dotenv": "^16.4.7",
|
||||||
"highlight.js": "^11.11.1",
|
"highlight.js": "^11.11.1",
|
||||||
|
|
|
@ -8,11 +8,11 @@ import { describe, it, expect, beforeEach, vi, afterEach } from 'vitest';
|
||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import { tmpdir } from 'os';
|
import { tmpdir } from 'os';
|
||||||
import { Config, ConfigParameters } from '@gemini-code/core';
|
import { Config, ConfigParameters } from '@gemini-cli/core';
|
||||||
|
|
||||||
// Mock file discovery service and tool registry
|
// Mock file discovery service and tool registry
|
||||||
vi.mock('@gemini-code/core', async () => {
|
vi.mock('@gemini-cli/core', async () => {
|
||||||
const actual = await vi.importActual('@gemini-code/core');
|
const actual = await vi.importActual('@gemini-cli/core');
|
||||||
return {
|
return {
|
||||||
...actual,
|
...actual,
|
||||||
FileDiscoveryService: vi.fn().mockImplementation(() => ({
|
FileDiscoveryService: vi.fn().mockImplementation(() => ({
|
||||||
|
|
|
@ -10,7 +10,7 @@ import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
|
||||||
import * as os from 'os';
|
import * as os from 'os';
|
||||||
import { loadCliConfig } from './config.js';
|
import { loadCliConfig } from './config.js';
|
||||||
import { Settings } from './settings.js';
|
import { Settings } from './settings.js';
|
||||||
import * as ServerConfig from '@gemini-code/core';
|
import * as ServerConfig from '@gemini-cli/core';
|
||||||
|
|
||||||
const MOCK_HOME_DIR = '/mock/home/user';
|
const MOCK_HOME_DIR = '/mock/home/user';
|
||||||
|
|
||||||
|
@ -28,9 +28,9 @@ vi.mock('read-package-up', () => ({
|
||||||
),
|
),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
vi.mock('@gemini-code/core', async () => {
|
vi.mock('@gemini-cli/core', async () => {
|
||||||
const actualServer =
|
const actualServer =
|
||||||
await vi.importActual<typeof ServerConfig>('@gemini-code/core');
|
await vi.importActual<typeof ServerConfig>('@gemini-cli/core');
|
||||||
return {
|
return {
|
||||||
...actualServer,
|
...actualServer,
|
||||||
loadEnvironment: vi.fn(),
|
loadEnvironment: vi.fn(),
|
||||||
|
|
|
@ -14,7 +14,7 @@ import {
|
||||||
setGeminiMdFilename as setServerGeminiMdFilename,
|
setGeminiMdFilename as setServerGeminiMdFilename,
|
||||||
getCurrentGeminiMdFilename,
|
getCurrentGeminiMdFilename,
|
||||||
ApprovalMode,
|
ApprovalMode,
|
||||||
} from '@gemini-code/core';
|
} from '@gemini-cli/core';
|
||||||
import { Settings } from './settings.js';
|
import { Settings } from './settings.js';
|
||||||
import { getEffectiveModel } from '../utils/modelCheck.js';
|
import { getEffectiveModel } from '../utils/modelCheck.js';
|
||||||
import { getCliVersion } from '../utils/version.js';
|
import { getCliVersion } from '../utils/version.js';
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import { homedir } from 'os';
|
import { homedir } from 'os';
|
||||||
import { MCPServerConfig, getErrorMessage } from '@gemini-code/core';
|
import { MCPServerConfig, getErrorMessage } from '@gemini-cli/core';
|
||||||
import stripJsonComments from 'strip-json-comments';
|
import stripJsonComments from 'strip-json-comments';
|
||||||
import { DefaultLight } from '../ui/themes/default-light.js';
|
import { DefaultLight } from '../ui/themes/default-light.js';
|
||||||
import { DefaultDark } from '../ui/themes/default.js';
|
import { DefaultDark } from '../ui/themes/default.js';
|
||||||
|
|
|
@ -28,7 +28,7 @@ import {
|
||||||
ShellTool,
|
ShellTool,
|
||||||
WebFetchTool,
|
WebFetchTool,
|
||||||
WebSearchTool,
|
WebSearchTool,
|
||||||
} from '@gemini-code/core';
|
} from '@gemini-cli/core';
|
||||||
|
|
||||||
export async function main() {
|
export async function main() {
|
||||||
// warn about deprecated environment variables
|
// warn about deprecated environment variables
|
||||||
|
|
|
@ -7,14 +7,14 @@
|
||||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||||
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
|
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
|
||||||
import { runNonInteractive } from './nonInteractiveCli.js';
|
import { runNonInteractive } from './nonInteractiveCli.js';
|
||||||
import { Config, GeminiClient, ToolRegistry } from '@gemini-code/core';
|
import { Config, GeminiClient, ToolRegistry } from '@gemini-cli/core';
|
||||||
import { GenerateContentResponse, Part, FunctionCall } from '@google/genai';
|
import { GenerateContentResponse, Part, FunctionCall } from '@google/genai';
|
||||||
|
|
||||||
// Mock dependencies
|
// Mock dependencies
|
||||||
vi.mock('@gemini-code/core', async () => {
|
vi.mock('@gemini-cli/core', async () => {
|
||||||
const actualCore =
|
const actualCore =
|
||||||
await vi.importActual<typeof import('@gemini-code/core')>(
|
await vi.importActual<typeof import('@gemini-cli/core')>(
|
||||||
'@gemini-code/core',
|
'@gemini-cli/core',
|
||||||
);
|
);
|
||||||
return {
|
return {
|
||||||
...actualCore,
|
...actualCore,
|
||||||
|
@ -108,7 +108,7 @@ describe('runNonInteractive', () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const { executeToolCall: mockCoreExecuteToolCall } = await import(
|
const { executeToolCall: mockCoreExecuteToolCall } = await import(
|
||||||
'@gemini-code/core'
|
'@gemini-cli/core'
|
||||||
);
|
);
|
||||||
vi.mocked(mockCoreExecuteToolCall).mockResolvedValue({
|
vi.mocked(mockCoreExecuteToolCall).mockResolvedValue({
|
||||||
callId: 'fc1',
|
callId: 'fc1',
|
||||||
|
@ -160,7 +160,7 @@ describe('runNonInteractive', () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const { executeToolCall: mockCoreExecuteToolCall } = await import(
|
const { executeToolCall: mockCoreExecuteToolCall } = await import(
|
||||||
'@gemini-code/core'
|
'@gemini-cli/core'
|
||||||
);
|
);
|
||||||
vi.mocked(mockCoreExecuteToolCall).mockResolvedValue({
|
vi.mocked(mockCoreExecuteToolCall).mockResolvedValue({
|
||||||
callId: 'fcError',
|
callId: 'fcError',
|
||||||
|
|
|
@ -9,7 +9,7 @@ import {
|
||||||
ToolCallRequestInfo,
|
ToolCallRequestInfo,
|
||||||
executeToolCall,
|
executeToolCall,
|
||||||
ToolRegistry,
|
ToolRegistry,
|
||||||
} from '@gemini-code/core';
|
} from '@gemini-cli/core';
|
||||||
import {
|
import {
|
||||||
Content,
|
Content,
|
||||||
Part,
|
Part,
|
||||||
|
|
|
@ -13,7 +13,7 @@ import {
|
||||||
ApprovalMode,
|
ApprovalMode,
|
||||||
ToolRegistry,
|
ToolRegistry,
|
||||||
AccessibilitySettings,
|
AccessibilitySettings,
|
||||||
} from '@gemini-code/core';
|
} from '@gemini-cli/core';
|
||||||
import { LoadedSettings, SettingsFile, Settings } from '../config/settings.js';
|
import { LoadedSettings, SettingsFile, Settings } from '../config/settings.js';
|
||||||
import process from 'node:process';
|
import process from 'node:process';
|
||||||
|
|
||||||
|
@ -65,9 +65,9 @@ interface MockServerConfig {
|
||||||
getAccessibility: Mock<() => AccessibilitySettings>;
|
getAccessibility: Mock<() => AccessibilitySettings>;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mock @gemini-code/core and its Config class
|
// Mock @gemini-cli/core and its Config class
|
||||||
vi.mock('@gemini-code/core', async (importOriginal) => {
|
vi.mock('@gemini-cli/core', async (importOriginal) => {
|
||||||
const actualCore = await importOriginal<typeof import('@gemini-code/core')>();
|
const actualCore = await importOriginal<typeof import('@gemini-cli/core')>();
|
||||||
const ConfigClassMock = vi
|
const ConfigClassMock = vi
|
||||||
.fn()
|
.fn()
|
||||||
.mockImplementation((optionsPassedToConstructor) => {
|
.mockImplementation((optionsPassedToConstructor) => {
|
||||||
|
|
|
@ -45,7 +45,7 @@ import {
|
||||||
type Config,
|
type Config,
|
||||||
getCurrentGeminiMdFilename,
|
getCurrentGeminiMdFilename,
|
||||||
ApprovalMode,
|
ApprovalMode,
|
||||||
} from '@gemini-code/core';
|
} from '@gemini-cli/core';
|
||||||
import { useLogger } from './hooks/useLogger.js';
|
import { useLogger } from './hooks/useLogger.js';
|
||||||
import { StreamingContext } from './contexts/StreamingContext.js';
|
import { StreamingContext } from './contexts/StreamingContext.js';
|
||||||
import { useGitBranchName } from './hooks/useGitBranchName.js';
|
import { useGitBranchName } from './hooks/useGitBranchName.js';
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Box, Text } from 'ink';
|
import { Box, Text } from 'ink';
|
||||||
import { Colors } from '../colors.js';
|
import { Colors } from '../colors.js';
|
||||||
import { ApprovalMode } from '@gemini-code/core';
|
import { ApprovalMode } from '@gemini-cli/core';
|
||||||
|
|
||||||
interface AutoAcceptIndicatorProps {
|
interface AutoAcceptIndicatorProps {
|
||||||
approvalMode: ApprovalMode;
|
approvalMode: ApprovalMode;
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Text } from 'ink';
|
import { Text } from 'ink';
|
||||||
import { Colors } from '../colors.js';
|
import { Colors } from '../colors.js';
|
||||||
import { type MCPServerConfig } from '@gemini-code/core';
|
import { type MCPServerConfig } from '@gemini-cli/core';
|
||||||
|
|
||||||
interface ContextSummaryDisplayProps {
|
interface ContextSummaryDisplayProps {
|
||||||
geminiMdFileCount: number;
|
geminiMdFileCount: number;
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Box, Text } from 'ink';
|
import { Box, Text } from 'ink';
|
||||||
import { Colors } from '../colors.js';
|
import { Colors } from '../colors.js';
|
||||||
import { shortenPath, tildeifyPath } from '@gemini-code/core';
|
import { shortenPath, tildeifyPath } from '@gemini-cli/core';
|
||||||
import { ConsoleSummaryDisplay } from './ConsoleSummaryDisplay.js';
|
import { ConsoleSummaryDisplay } from './ConsoleSummaryDisplay.js';
|
||||||
import process from 'node:process';
|
import process from 'node:process';
|
||||||
import { MemoryUsageDisplay } from './MemoryUsageDisplay.js';
|
import { MemoryUsageDisplay } from './MemoryUsageDisplay.js';
|
||||||
|
|
|
@ -17,7 +17,7 @@ import process from 'node:process';
|
||||||
import { useCompletion } from '../hooks/useCompletion.js';
|
import { useCompletion } from '../hooks/useCompletion.js';
|
||||||
import { isAtCommand, isSlashCommand } from '../utils/commandUtils.js';
|
import { isAtCommand, isSlashCommand } from '../utils/commandUtils.js';
|
||||||
import { SlashCommand } from '../hooks/slashCommandProcessor.js';
|
import { SlashCommand } from '../hooks/slashCommandProcessor.js';
|
||||||
import { Config } from '@gemini-code/core';
|
import { Config } from '@gemini-cli/core';
|
||||||
|
|
||||||
export interface InputPromptProps {
|
export interface InputPromptProps {
|
||||||
onSubmit: (value: string) => void;
|
onSubmit: (value: string) => void;
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Box, Text } from 'ink';
|
import { Box, Text } from 'ink';
|
||||||
import { Colors } from '../colors.js';
|
import { Colors } from '../colors.js';
|
||||||
import { type Config } from '@gemini-code/core';
|
import { type Config } from '@gemini-cli/core';
|
||||||
|
|
||||||
interface TipsProps {
|
interface TipsProps {
|
||||||
config: Config;
|
config: Config;
|
||||||
|
|
|
@ -13,7 +13,7 @@ import {
|
||||||
ToolConfirmationOutcome,
|
ToolConfirmationOutcome,
|
||||||
ToolExecuteConfirmationDetails,
|
ToolExecuteConfirmationDetails,
|
||||||
ToolMcpConfirmationDetails,
|
ToolMcpConfirmationDetails,
|
||||||
} from '@gemini-code/core';
|
} from '@gemini-cli/core';
|
||||||
import {
|
import {
|
||||||
RadioButtonSelect,
|
RadioButtonSelect,
|
||||||
RadioSelectItem,
|
RadioSelectItem,
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
import { describe, it, expect, vi, beforeEach, afterEach, Mock } from 'vitest';
|
import { describe, it, expect, vi, beforeEach, afterEach, Mock } from 'vitest';
|
||||||
import type { Mocked } from 'vitest';
|
import type { Mocked } from 'vitest';
|
||||||
import { handleAtCommand } from './atCommandProcessor.js';
|
import { handleAtCommand } from './atCommandProcessor.js';
|
||||||
import { Config, FileDiscoveryService } from '@gemini-code/core';
|
import { Config, FileDiscoveryService } from '@gemini-cli/core';
|
||||||
import { ToolCallStatus } from '../types.js';
|
import { ToolCallStatus } from '../types.js';
|
||||||
import { UseHistoryManagerReturn } from './useHistoryManager.js';
|
import { UseHistoryManagerReturn } from './useHistoryManager.js';
|
||||||
import * as fsPromises from 'fs/promises';
|
import * as fsPromises from 'fs/promises';
|
||||||
|
@ -52,8 +52,8 @@ vi.mock('fs/promises', async () => {
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
vi.mock('@gemini-code/core', async () => {
|
vi.mock('@gemini-cli/core', async () => {
|
||||||
const actual = await vi.importActual('@gemini-code/core');
|
const actual = await vi.importActual('@gemini-cli/core');
|
||||||
return {
|
return {
|
||||||
...actual,
|
...actual,
|
||||||
FileDiscoveryService: vi.fn(),
|
FileDiscoveryService: vi.fn(),
|
||||||
|
|
|
@ -12,7 +12,7 @@ import {
|
||||||
getErrorMessage,
|
getErrorMessage,
|
||||||
isNodeError,
|
isNodeError,
|
||||||
unescapePath,
|
unescapePath,
|
||||||
} from '@gemini-code/core';
|
} from '@gemini-cli/core';
|
||||||
import {
|
import {
|
||||||
HistoryItem,
|
HistoryItem,
|
||||||
IndividualToolCallDisplay,
|
IndividualToolCallDisplay,
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||||
import { act, renderHook } from '@testing-library/react';
|
import { act, renderHook } from '@testing-library/react';
|
||||||
import { useShellCommandProcessor } from './shellCommandProcessor.js';
|
import { useShellCommandProcessor } from './shellCommandProcessor.js';
|
||||||
import { type Config } from '@gemini-code/core';
|
import { type Config } from '@gemini-cli/core';
|
||||||
import { type PartListUnion } from '@google/genai';
|
import { type PartListUnion } from '@google/genai';
|
||||||
import { existsSync, readFileSync, unlinkSync } from 'fs';
|
import { existsSync, readFileSync, unlinkSync } from 'fs';
|
||||||
import type * as FsMod from 'fs';
|
import type * as FsMod from 'fs';
|
||||||
|
|
|
@ -8,7 +8,7 @@ import { spawn } from 'child_process';
|
||||||
import type { HistoryItemWithoutId } from '../types.js';
|
import type { HistoryItemWithoutId } from '../types.js';
|
||||||
import type { exec as ExecType } from 'child_process';
|
import type { exec as ExecType } from 'child_process';
|
||||||
import { useCallback } from 'react';
|
import { useCallback } from 'react';
|
||||||
import { Config } from '@gemini-code/core';
|
import { Config } from '@gemini-cli/core';
|
||||||
import { type PartListUnion } from '@google/genai';
|
import { type PartListUnion } from '@google/genai';
|
||||||
import { UseHistoryManagerReturn } from './useHistoryManager.js';
|
import { UseHistoryManagerReturn } from './useHistoryManager.js';
|
||||||
import crypto from 'crypto';
|
import crypto from 'crypto';
|
||||||
|
|
|
@ -60,7 +60,7 @@ import {
|
||||||
type Config,
|
type Config,
|
||||||
MCPServerStatus,
|
MCPServerStatus,
|
||||||
getMCPServerStatus,
|
getMCPServerStatus,
|
||||||
} from '@gemini-code/core';
|
} from '@gemini-cli/core';
|
||||||
|
|
||||||
import * as ShowMemoryCommandModule from './useShowMemoryCommand.js';
|
import * as ShowMemoryCommandModule from './useShowMemoryCommand.js';
|
||||||
import { GIT_COMMIT_INFO } from '../../generated/git-commit.js';
|
import { GIT_COMMIT_INFO } from '../../generated/git-commit.js';
|
||||||
|
@ -451,7 +451,7 @@ Add any other context about the problem here.
|
||||||
describe('/mcp command', () => {
|
describe('/mcp command', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
// Mock the core module with getMCPServerStatus
|
// Mock the core module with getMCPServerStatus
|
||||||
vi.mock('@gemini-code/core', async (importOriginal) => {
|
vi.mock('@gemini-cli/core', async (importOriginal) => {
|
||||||
const actual = await importOriginal();
|
const actual = await importOriginal();
|
||||||
return {
|
return {
|
||||||
...actual,
|
...actual,
|
||||||
|
|
|
@ -9,7 +9,7 @@ import { type PartListUnion } from '@google/genai';
|
||||||
import open from 'open';
|
import open from 'open';
|
||||||
import process from 'node:process';
|
import process from 'node:process';
|
||||||
import { UseHistoryManagerReturn } from './useHistoryManager.js';
|
import { UseHistoryManagerReturn } from './useHistoryManager.js';
|
||||||
import { Config, MCPServerStatus, getMCPServerStatus } from '@gemini-code/core';
|
import { Config, MCPServerStatus, getMCPServerStatus } from '@gemini-cli/core';
|
||||||
import { Message, MessageType, HistoryItemWithoutId } from '../types.js';
|
import { Message, MessageType, HistoryItemWithoutId } from '../types.js';
|
||||||
import { createShowMemoryAction } from './useShowMemoryCommand.js';
|
import { createShowMemoryAction } from './useShowMemoryCommand.js';
|
||||||
import { GIT_COMMIT_INFO } from '../../generated/git-commit.js';
|
import { GIT_COMMIT_INFO } from '../../generated/git-commit.js';
|
||||||
|
@ -114,7 +114,7 @@ export const useSlashCommandProcessor = (
|
||||||
{
|
{
|
||||||
name: 'help',
|
name: 'help',
|
||||||
altName: '?',
|
altName: '?',
|
||||||
description: 'for help on gemini-code',
|
description: 'for help on gemini-cli',
|
||||||
action: (_mainCommand, _subCommand, _args) => {
|
action: (_mainCommand, _subCommand, _args) => {
|
||||||
onDebugMessage('Opening help.');
|
onDebugMessage('Opening help.');
|
||||||
setShowHelp(true);
|
setShowHelp(true);
|
||||||
|
|
|
@ -20,14 +20,14 @@ import {
|
||||||
Config,
|
Config,
|
||||||
Config as ActualConfigType,
|
Config as ActualConfigType,
|
||||||
ApprovalMode,
|
ApprovalMode,
|
||||||
} from '@gemini-code/core';
|
} from '@gemini-cli/core';
|
||||||
import { useInput, type Key as InkKey } from 'ink';
|
import { useInput, type Key as InkKey } from 'ink';
|
||||||
|
|
||||||
vi.mock('ink');
|
vi.mock('ink');
|
||||||
|
|
||||||
vi.mock('@gemini-code/core', async () => {
|
vi.mock('@gemini-cli/core', async () => {
|
||||||
const actualServerModule = (await vi.importActual(
|
const actualServerModule = (await vi.importActual(
|
||||||
'@gemini-code/core',
|
'@gemini-cli/core',
|
||||||
)) as Record<string, unknown>;
|
)) as Record<string, unknown>;
|
||||||
return {
|
return {
|
||||||
...actualServerModule,
|
...actualServerModule,
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
import { useState, useEffect } from 'react';
|
import { useState, useEffect } from 'react';
|
||||||
import { useInput } from 'ink';
|
import { useInput } from 'ink';
|
||||||
import { ApprovalMode, type Config } from '@gemini-code/core';
|
import { ApprovalMode, type Config } from '@gemini-cli/core';
|
||||||
|
|
||||||
export interface UseAutoAcceptIndicatorArgs {
|
export interface UseAutoAcceptIndicatorArgs {
|
||||||
config: Config;
|
config: Config;
|
||||||
|
|
|
@ -9,12 +9,12 @@ import type { Mocked } from 'vitest';
|
||||||
import { renderHook, act } from '@testing-library/react';
|
import { renderHook, act } from '@testing-library/react';
|
||||||
import { useCompletion } from './useCompletion.js';
|
import { useCompletion } from './useCompletion.js';
|
||||||
import * as fs from 'fs/promises';
|
import * as fs from 'fs/promises';
|
||||||
import { FileDiscoveryService } from '@gemini-code/core';
|
import { FileDiscoveryService } from '@gemini-cli/core';
|
||||||
|
|
||||||
// Mock dependencies
|
// Mock dependencies
|
||||||
vi.mock('fs/promises');
|
vi.mock('fs/promises');
|
||||||
vi.mock('@gemini-code/core', async () => {
|
vi.mock('@gemini-cli/core', async () => {
|
||||||
const actual = await vi.importActual('@gemini-code/core');
|
const actual = await vi.importActual('@gemini-cli/core');
|
||||||
return {
|
return {
|
||||||
...actual,
|
...actual,
|
||||||
FileDiscoveryService: vi.fn(),
|
FileDiscoveryService: vi.fn(),
|
||||||
|
|
|
@ -13,7 +13,7 @@ import {
|
||||||
unescapePath,
|
unescapePath,
|
||||||
getErrorMessage,
|
getErrorMessage,
|
||||||
Config,
|
Config,
|
||||||
} from '@gemini-code/core';
|
} from '@gemini-cli/core';
|
||||||
import {
|
import {
|
||||||
MAX_SUGGESTIONS_TO_SHOW,
|
MAX_SUGGESTIONS_TO_SHOW,
|
||||||
Suggestion,
|
Suggestion,
|
||||||
|
|
|
@ -15,7 +15,7 @@ import {
|
||||||
TrackedExecutingToolCall,
|
TrackedExecutingToolCall,
|
||||||
TrackedCancelledToolCall,
|
TrackedCancelledToolCall,
|
||||||
} from './useReactToolScheduler.js';
|
} from './useReactToolScheduler.js';
|
||||||
import { Config } from '@gemini-code/core';
|
import { Config } from '@gemini-cli/core';
|
||||||
import { Part, PartListUnion } from '@google/genai';
|
import { Part, PartListUnion } from '@google/genai';
|
||||||
import { UseHistoryManagerReturn } from './useHistoryManager.js';
|
import { UseHistoryManagerReturn } from './useHistoryManager.js';
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ const MockedGeminiClientClass = vi.hoisted(() =>
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
vi.mock('@gemini-code/core', async (importOriginal) => {
|
vi.mock('@gemini-cli/core', async (importOriginal) => {
|
||||||
const actualCoreModule = (await importOriginal()) as any;
|
const actualCoreModule = (await importOriginal()) as any;
|
||||||
return {
|
return {
|
||||||
...(actualCoreModule || {}),
|
...(actualCoreModule || {}),
|
||||||
|
|
|
@ -18,7 +18,7 @@ import {
|
||||||
MessageSenderType,
|
MessageSenderType,
|
||||||
ToolCallRequestInfo,
|
ToolCallRequestInfo,
|
||||||
logUserPrompt,
|
logUserPrompt,
|
||||||
} from '@gemini-code/core';
|
} from '@gemini-cli/core';
|
||||||
import { type PartListUnion } from '@google/genai';
|
import { type PartListUnion } from '@google/genai';
|
||||||
import {
|
import {
|
||||||
StreamingState,
|
StreamingState,
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { useState, useEffect } from 'react';
|
import { useState, useEffect } from 'react';
|
||||||
import { Logger } from '@gemini-code/core';
|
import { Logger } from '@gemini-cli/core';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Hook to manage the logger instance.
|
* Hook to manage the logger instance.
|
||||||
|
|
|
@ -21,7 +21,7 @@ import {
|
||||||
ToolCall,
|
ToolCall,
|
||||||
Status as CoreStatus,
|
Status as CoreStatus,
|
||||||
logToolCall,
|
logToolCall,
|
||||||
} from '@gemini-code/core';
|
} from '@gemini-cli/core';
|
||||||
import { useCallback, useState, useMemo } from 'react';
|
import { useCallback, useState, useMemo } from 'react';
|
||||||
import {
|
import {
|
||||||
HistoryItemToolGroup,
|
HistoryItemToolGroup,
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Message, MessageType } from '../types.js';
|
import { Message, MessageType } from '../types.js';
|
||||||
import { Config } from '@gemini-code/core';
|
import { Config } from '@gemini-cli/core';
|
||||||
|
|
||||||
export function createShowMemoryAction(
|
export function createShowMemoryAction(
|
||||||
config: Config | null,
|
config: Config | null,
|
||||||
|
|
|
@ -24,7 +24,7 @@ import {
|
||||||
ToolCall, // Import from core
|
ToolCall, // Import from core
|
||||||
Status as ToolCallStatusType,
|
Status as ToolCallStatusType,
|
||||||
ApprovalMode, // Import from core
|
ApprovalMode, // Import from core
|
||||||
} from '@gemini-code/core';
|
} from '@gemini-cli/core';
|
||||||
import {
|
import {
|
||||||
HistoryItemWithoutId,
|
HistoryItemWithoutId,
|
||||||
ToolCallStatus,
|
ToolCallStatus,
|
||||||
|
@ -32,8 +32,8 @@ import {
|
||||||
} from '../types.js';
|
} from '../types.js';
|
||||||
|
|
||||||
// Mocks
|
// Mocks
|
||||||
vi.mock('@gemini-code/core', async () => {
|
vi.mock('@gemini-cli/core', async () => {
|
||||||
const actual = await vi.importActual('@gemini-code/core');
|
const actual = await vi.importActual('@gemini-cli/core');
|
||||||
return {
|
return {
|
||||||
...actual,
|
...actual,
|
||||||
ToolRegistry: vi.fn(),
|
ToolRegistry: vi.fn(),
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
import {
|
import {
|
||||||
ToolCallConfirmationDetails,
|
ToolCallConfirmationDetails,
|
||||||
ToolResultDisplay,
|
ToolResultDisplay,
|
||||||
} from '@gemini-code/core';
|
} from '@gemini-cli/core';
|
||||||
|
|
||||||
// Only defining the state enum needed by the UI
|
// Only defining the state enum needed by the UI
|
||||||
export enum StreamingState {
|
export enum StreamingState {
|
||||||
|
|
|
@ -7,9 +7,9 @@
|
||||||
import fs from 'fs/promises';
|
import fs from 'fs/promises';
|
||||||
import os from 'os';
|
import os from 'os';
|
||||||
import { join as pathJoin } from 'node:path';
|
import { join as pathJoin } from 'node:path';
|
||||||
import { getErrorMessage } from '@gemini-code/core';
|
import { getErrorMessage } from '@gemini-cli/core';
|
||||||
|
|
||||||
const warningsFilePath = pathJoin(os.tmpdir(), 'gemini-code-cli-warnings.txt');
|
const warningsFilePath = pathJoin(os.tmpdir(), 'gemini-cli-warnings.txt');
|
||||||
|
|
||||||
export async function getStartupWarnings(): Promise<string[]> {
|
export async function getStartupWarnings(): Promise<string[]> {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -2,5 +2,5 @@ Nested package template. Either fill this out with "backend" functionality or cr
|
||||||
|
|
||||||
To use this package from another dependent package in this monorepo:
|
To use this package from another dependent package in this monorepo:
|
||||||
|
|
||||||
1. Add `"@gemini-code/core"` to the dependent package's `package.json`
|
1. Add `"@gemini-cli/core"` to the dependent package's `package.json`
|
||||||
1. Import a dependency by calling `import { } from "@gemini-code/core"`
|
1. Import a dependency by calling `import { } from "@gemini-cli/core"`
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"name": "@gemini-code/core",
|
"name": "@gemini-cli/core",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"description": "Gemini CLI Server",
|
"description": "Gemini CLI Server",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
import { randomUUID } from 'crypto';
|
import { randomUUID } from 'crypto';
|
||||||
|
|
||||||
export const SERVICE_NAME = 'gemini-code';
|
export const SERVICE_NAME = 'gemini-cli';
|
||||||
export const sessionId = randomUUID();
|
export const sessionId = randomUUID();
|
||||||
|
|
||||||
export const EVENT_USER_PROMPT = 'gemini_code.user_prompt';
|
export const EVENT_USER_PROMPT = 'gemini_code.user_prompt';
|
||||||
|
|
|
@ -60,15 +60,15 @@ fi
|
||||||
|
|
||||||
# prepare global installation files for prod builds
|
# prepare global installation files for prod builds
|
||||||
# pack cli
|
# pack cli
|
||||||
echo "packing @gemini-code/cli ..."
|
echo "packing @gemini-cli/cli ..."
|
||||||
rm -f packages/cli/dist/gemini-code-cli-*.tgz
|
rm -f packages/cli/dist/gemini-cli-cli-*.tgz
|
||||||
npm pack -w @gemini-code/cli --pack-destination ./packages/cli/dist &>/dev/null
|
npm pack -w @gemini-cli/cli --pack-destination ./packages/cli/dist &>/dev/null
|
||||||
# pack core
|
# pack core
|
||||||
echo "packing @gemini-code/core ..."
|
echo "packing @gemini-cli/core ..."
|
||||||
rm -f packages/core/dist/gemini-code-core-*.tgz
|
rm -f packages/core/dist/gemini-cli-core-*.tgz
|
||||||
npm pack -w @gemini-code/core --pack-destination ./packages/core/dist &>/dev/null
|
npm pack -w @gemini-cli/core --pack-destination ./packages/core/dist &>/dev/null
|
||||||
# give node user (used during installation, see Dockerfile) access to these files
|
# give node user (used during installation, see Dockerfile) access to these files
|
||||||
chmod 755 packages/*/dist/gemini-code-*.tgz
|
chmod 755 packages/*/dist/gemini-cli-*.tgz
|
||||||
|
|
||||||
# redirect build output to /dev/null unless VERBOSE is set
|
# redirect build output to /dev/null unless VERBOSE is set
|
||||||
BUILD_STDOUT="/dev/null"
|
BUILD_STDOUT="/dev/null"
|
||||||
|
|
|
@ -17,7 +17,7 @@ const filesToWatch = [
|
||||||
path.join(cliPackageDir, 'tsconfig.json'),
|
path.join(cliPackageDir, 'tsconfig.json'),
|
||||||
]; // Specific files within the CLI package
|
]; // Specific files within the CLI package
|
||||||
const buildDir = path.join(cliPackageDir, 'dist'); // Build output directory within the CLI package
|
const buildDir = path.join(cliPackageDir, 'dist'); // Build output directory within the CLI package
|
||||||
const warningsFilePath = path.join(os.tmpdir(), 'gemini-code-cli-warnings.txt'); // Temp file for warnings
|
const warningsFilePath = path.join(os.tmpdir(), 'gemini-cli-warnings.txt'); // Temp file for warnings
|
||||||
// ---------------------
|
// ---------------------
|
||||||
|
|
||||||
function getMtime(filePath) {
|
function getMtime(filePath) {
|
||||||
|
|
|
@ -41,7 +41,7 @@ while getopts "i" opt; do
|
||||||
done
|
done
|
||||||
shift $((OPTIND - 1))
|
shift $((OPTIND - 1))
|
||||||
|
|
||||||
IMAGE=gemini-code-sandbox
|
IMAGE=gemini-cli-sandbox
|
||||||
CMD=$(scripts/sandbox_command.sh)
|
CMD=$(scripts/sandbox_command.sh)
|
||||||
|
|
||||||
# list all containers running on sandbox image
|
# list all containers running on sandbox image
|
||||||
|
@ -61,7 +61,7 @@ elif [[ "${1:-}" =~ ^[0-9]+$ ]]; then
|
||||||
else
|
else
|
||||||
# exit if no sandbox is running
|
# exit if no sandbox is running
|
||||||
if [ ${#sandboxes[@]} -eq 0 ]; then
|
if [ ${#sandboxes[@]} -eq 0 ]; then
|
||||||
echo "No sandboxes found. Are you running gemini-code with sandboxing enabled?"
|
echo "No sandboxes found. Are you running gemini-cli with sandboxing enabled?"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
# exit if multiple sandboxes are running
|
# exit if multiple sandboxes are running
|
||||||
|
|
Loading…
Reference in New Issue