fix: prepublish changes to package names (#1420)

This commit is contained in:
Brandon Keiji 2025-06-25 05:41:11 -07:00 committed by GitHub
parent a3c46c0d31
commit f6c36f75e3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
67 changed files with 129 additions and 122 deletions

View File

@ -41,7 +41,7 @@ options:
substitutions: substitutions:
_REVISION: '0' _REVISION: '0'
_SANDBOX_IMAGE_REGISTRY: 'us-west1-docker.pkg.dev/gemini-code-dev/gemini-code-containers' _SANDBOX_IMAGE_REGISTRY: 'us-west1-docker.pkg.dev/gemini-code-dev/gemini-cli'
_SANDBOX_IMAGE_NAME: 'gemini-cli-sandbox' _SANDBOX_IMAGE_NAME: 'sandbox-ci'
_NPM_PUBLISH_TAG: 'head' _NPM_PUBLISH_TAG: 'head'
_CONTAINER_TOOL: 'docker' _CONTAINER_TOOL: 'docker'

View File

@ -24,7 +24,8 @@ 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-cli/cli'] args:
['publish', '--tag=head', '--dry-run', '--workspace=@google/gemini-cli']
options: options:
defaultLogsBucketBehavior: REGIONAL_USER_OWNED_BUCKET defaultLogsBucketBehavior: REGIONAL_USER_OWNED_BUCKET

2
.npmrc
View File

@ -1 +1 @@
@gemini-cli:registry=https://us-west1-npm.pkg.dev/gemini-code-dev/gemini-code/ @google:registry=https://wombat-dressing-room.appspot.com

View File

@ -40,11 +40,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-cli-cli-*.tgz /usr/local/share/npm-global/gemini-cli-cli.tgz COPY packages/cli/dist/google-gemini-cli-*.tgz /usr/local/share/npm-global/gemini-cli.tgz
COPY packages/core/dist/gemini-cli-core-*.tgz /usr/local/share/npm-global/gemini-cli-core.tgz COPY packages/core/dist/google-gemini-cli-core-*.tgz /usr/local/share/npm-global/gemini-core.tgz
RUN npm install -g /usr/local/share/npm-global/gemini-cli-cli.tgz /usr/local/share/npm-global/gemini-cli-core.tgz \ RUN npm install -g /usr/local/share/npm-global/gemini-cli.tgz /usr/local/share/npm-global/gemini-core.tgz \
&& npm cache clean --force \ && npm cache clean --force \
&& rm -f /usr/local/share/npm-global/gemini-cli-{cli,core}.tgz && rm -f /usr/local/share/npm-global/gemini-{cli,core}.tgz
# default entrypoint when none specified # default entrypoint when none specified
CMD ["gemini"] CMD ["gemini"]

View File

@ -16,7 +16,7 @@ This is the recommended way for end-users to install Gemini CLI. It involves dow
```bash ```bash
# Install the CLI globally # Install the CLI globally
npm install -g @gemini-cli/cli npm install -g @google/gemini-cli
# Now you can run the CLI from anywhere # Now you can run the CLI from anywhere
gemini gemini
@ -25,7 +25,7 @@ This is the recommended way for end-users to install Gemini CLI. It involves dow
- **NPX execution:** - **NPX execution:**
```bash ```bash
# Execute the latest version from NPM without a global install # Execute the latest version from NPM without a global install
npx @gemini-cli/cli npx @google/gemini-cli
``` ```
--- ---
@ -88,8 +88,8 @@ The execution methods described above are made possible by the following archite
Gemini CLI project is a monorepo that publishes two core packages to the NPM registry: Gemini CLI project is a monorepo that publishes two core packages to the NPM registry:
- `@gemini-cli/core`: The backend, handling logic and tool execution. - `@google/gemini-cli-core`: The backend, handling logic and tool execution.
- `@gemini-cli/cli`: The user-facing frontend. - `@google/gemini-cli`: The user-facing frontend.
These packages are used when performing the standard installation and when running Gemini CLI from the source. These packages are used when performing the standard installation and when running Gemini CLI from the source.
@ -97,7 +97,7 @@ These packages are used when performing the standard installation and when runni
There are two distinct build processes used, depending on the distribution channel: There are two distinct build processes used, depending on the distribution channel:
- **NPM publication:** For publishing to the NPM registry, the TypeScript source code in `@gemini-cli/core` and `@gemini-cli/cli` is transpiled into standard JavaScript using the TypeScript Compiler (`tsc`). The resulting `dist/` directory is what gets published in the NPM package. This is a standard approach for TypeScript libraries. - **NPM publication:** For publishing to the NPM registry, the TypeScript source code in `@google/gemini-cli-core` and `@google/gemini-cli` is transpiled into standard JavaScript using the TypeScript Compiler (`tsc`). The resulting `dist/` directory is what gets published in the NPM package. This is a standard approach for TypeScript libraries.
- **GitHub `npx` execution:** When running the latest version of Gemini CLI directly from GitHub, a different process is triggered by the `prepare` script in `package.json`. This script uses `esbuild` to bundle the entire application and its dependencies into a single, self-contained JavaScript file. This bundle is created on-the-fly on the user's machine and is not checked into the repository. - **GitHub `npx` execution:** When running the latest version of Gemini CLI directly from GitHub, a different process is triggered by the `prepare` script in `package.json`. This script uses `esbuild` to bundle the entire application and its dependencies into a single, self-contained JavaScript file. This bundle is created on-the-fly on the user's machine and is not checked into the repository.

View File

@ -6,7 +6,7 @@ This guide provides solutions to common issues and debugging tips.
- **Q: How do I update Gemini CLI to the latest version?** - **Q: How do I update Gemini CLI to the latest version?**
- A: If installed globally via npm, update Gemini CLI using the command `npm install -g @gemini-cli/cli@latest`. If run from source, pull the latest changes from the repository and rebuild using `npm run build`. - A: If installed globally via npm, update Gemini CLI using the command `npm install -g @google/gemini-cli@latest`. If run from source, pull the latest changes from the repository and rebuild using `npm run build`.
- **Q: Where are Gemini CLI configuration files stored?** - **Q: Where are Gemini CLI configuration files stored?**

10
package-lock.json generated
View File

@ -875,11 +875,11 @@
"node": "^18.18.0 || ^20.9.0 || >=21.1.0" "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
} }
}, },
"node_modules/@gemini-cli/cli": { "node_modules/@google/gemini-cli": {
"resolved": "packages/cli", "resolved": "packages/cli",
"link": true "link": true
}, },
"node_modules/@gemini-cli/core": { "node_modules/@google/gemini-cli-core": {
"resolved": "packages/core", "resolved": "packages/core",
"link": true "link": true
}, },
@ -11597,10 +11597,10 @@
} }
}, },
"packages/cli": { "packages/cli": {
"name": "@gemini-cli/cli", "name": "@google/gemini-cli",
"version": "0.1.0", "version": "0.1.0",
"dependencies": { "dependencies": {
"@gemini-cli/core": "file:../core", "@google/gemini-cli-core": "file:../core",
"@types/update-notifier": "^6.0.8", "@types/update-notifier": "^6.0.8",
"command-exists": "^1.2.9", "command-exists": "^1.2.9",
"diff": "^7.0.0", "diff": "^7.0.0",
@ -11670,7 +11670,7 @@
} }
}, },
"packages/core": { "packages/core": {
"name": "@gemini-cli/core", "name": "@google/gemini-cli-core",
"version": "0.1.0", "version": "0.1.0",
"dependencies": { "dependencies": {
"@google/genai": "^1.4.0", "@google/genai": "^1.4.0",

View File

@ -1,5 +1,5 @@
{ {
"name": "gemini-cli", "name": "@google/gemini-cli",
"version": "0.1.0", "version": "0.1.0",
"type": "module", "type": "module",
"workspaces": [ "workspaces": [

View File

@ -1,5 +1,5 @@
{ {
"name": "@gemini-cli/cli", "name": "@google/gemini-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-cli/core", "prepublishOnly": "npm publish --workspace=@google/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-cli/core": "file:../core", "@google/gemini-cli-core": "0.1.0",
"@types/update-notifier": "^6.0.8", "@types/update-notifier": "^6.0.8",
"command-exists": "^1.2.9", "command-exists": "^1.2.9",
"diff": "^7.0.0", "diff": "^7.0.0",

View File

@ -4,7 +4,7 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import { AuthType } from '@gemini-cli/core'; import { AuthType } from '@google/gemini-cli-core';
import { loadEnvironment } from './config.js'; import { loadEnvironment } from './config.js';
export const validateAuthMethod = (authMethod: string): string | null => { export const validateAuthMethod = (authMethod: string): string | null => {

View File

@ -12,7 +12,7 @@ import {
Config, Config,
ConfigParameters, ConfigParameters,
ContentGeneratorConfig, ContentGeneratorConfig,
} from '@gemini-cli/core'; } from '@google/gemini-cli-core';
const TEST_CONTENT_GENERATOR_CONFIG: ContentGeneratorConfig = { const TEST_CONTENT_GENERATOR_CONFIG: ContentGeneratorConfig = {
apiKey: 'test-key', apiKey: 'test-key',
@ -21,8 +21,8 @@ const TEST_CONTENT_GENERATOR_CONFIG: ContentGeneratorConfig = {
}; };
// Mock file discovery service and tool registry // Mock file discovery service and tool registry
vi.mock('@gemini-cli/core', async () => { vi.mock('@google/gemini-cli-core', async () => {
const actual = await vi.importActual('@gemini-cli/core'); const actual = await vi.importActual('@google/gemini-cli-core');
return { return {
...actual, ...actual,
FileDiscoveryService: vi.fn().mockImplementation(() => ({ FileDiscoveryService: vi.fn().mockImplementation(() => ({

View File

@ -9,7 +9,7 @@ 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 { Extension } from './extension.js'; import { Extension } from './extension.js';
import * as ServerConfig from '@gemini-cli/core'; import * as ServerConfig from '@google/gemini-cli-core';
vi.mock('os', async (importOriginal) => { vi.mock('os', async (importOriginal) => {
const actualOs = await importOriginal<typeof os>(); const actualOs = await importOriginal<typeof os>();
@ -29,9 +29,10 @@ vi.mock('read-package-up', () => ({
), ),
})); }));
vi.mock('@gemini-cli/core', async () => { vi.mock('@google/gemini-cli-core', async () => {
const actualServer = const actualServer = await vi.importActual<typeof ServerConfig>(
await vi.importActual<typeof ServerConfig>('@gemini-cli/core'); '@google/gemini-cli-core',
);
return { return {
...actualServer, ...actualServer,
loadEnvironment: vi.fn(), loadEnvironment: vi.fn(),

View File

@ -18,7 +18,7 @@ import {
DEFAULT_GEMINI_EMBEDDING_MODEL, DEFAULT_GEMINI_EMBEDDING_MODEL,
FileDiscoveryService, FileDiscoveryService,
TelemetryTarget, TelemetryTarget,
} from '@gemini-cli/core'; } from '@google/gemini-cli-core';
import { Settings } from './settings.js'; import { Settings } from './settings.js';
import { Extension } from './extension.js'; import { Extension } from './extension.js';

View File

@ -4,7 +4,7 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import { MCPServerConfig } from '@gemini-cli/core'; import { MCPServerConfig } from '@google/gemini-cli-core';
import * as fs from 'fs'; import * as fs from 'fs';
import * as path from 'path'; import * as path from 'path';
import * as os from 'os'; import * as os from 'os';

View File

@ -4,7 +4,7 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import { SandboxConfig } from '@gemini-cli/core'; import { SandboxConfig } from '@google/gemini-cli-core';
import commandExists from 'command-exists'; import commandExists from 'command-exists';
import * as os from 'node:os'; import * as os from 'node:os';
import { getPackageJson } from '../utils/package.js'; import { getPackageJson } from '../utils/package.js';

View File

@ -13,7 +13,7 @@ import {
BugCommandSettings, BugCommandSettings,
TelemetrySettings, TelemetrySettings,
AuthType, AuthType,
} from '@gemini-cli/core'; } from '@google/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';

View File

@ -33,7 +33,7 @@ import {
sessionId, sessionId,
logUserPrompt, logUserPrompt,
AuthType, AuthType,
} from '@gemini-cli/core'; } from '@google/gemini-cli-core';
import { validateAuthMethod } from './config/auth.js'; import { validateAuthMethod } from './config/auth.js';
import { setMaxSizedBoxDebugging } from './ui/components/shared/MaxSizedBox.js'; import { setMaxSizedBoxDebugging } from './ui/components/shared/MaxSizedBox.js';

View File

@ -7,15 +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-cli/core'; import { Config, GeminiClient, ToolRegistry } from '@google/gemini-cli-core';
import { GenerateContentResponse, Part, FunctionCall } from '@google/genai'; import { GenerateContentResponse, Part, FunctionCall } from '@google/genai';
// Mock dependencies // Mock dependencies
vi.mock('@gemini-cli/core', async () => { vi.mock('@google/gemini-cli-core', async () => {
const actualCore = const actualCore = await vi.importActual<
await vi.importActual<typeof import('@gemini-cli/core')>( typeof import('@google/gemini-cli-core')
'@gemini-cli/core', >('@google/gemini-cli-core');
);
return { return {
...actualCore, ...actualCore,
GeminiClient: vi.fn(), GeminiClient: vi.fn(),
@ -110,7 +109,7 @@ describe('runNonInteractive', () => {
}; };
const { executeToolCall: mockCoreExecuteToolCall } = await import( const { executeToolCall: mockCoreExecuteToolCall } = await import(
'@gemini-cli/core' '@google/gemini-cli-core'
); );
vi.mocked(mockCoreExecuteToolCall).mockResolvedValue({ vi.mocked(mockCoreExecuteToolCall).mockResolvedValue({
callId: 'fc1', callId: 'fc1',
@ -163,7 +162,7 @@ describe('runNonInteractive', () => {
}; };
const { executeToolCall: mockCoreExecuteToolCall } = await import( const { executeToolCall: mockCoreExecuteToolCall } = await import(
'@gemini-cli/core' '@google/gemini-cli-core'
); );
vi.mocked(mockCoreExecuteToolCall).mockResolvedValue({ vi.mocked(mockCoreExecuteToolCall).mockResolvedValue({
callId: 'fcError', callId: 'fcError',

View File

@ -11,7 +11,7 @@ import {
ToolRegistry, ToolRegistry,
shutdownTelemetry, shutdownTelemetry,
isTelemetrySdkInitialized, isTelemetrySdkInitialized,
} from '@gemini-cli/core'; } from '@google/gemini-cli-core';
import { import {
Content, Content,
Part, Part,

View File

@ -14,7 +14,7 @@ import {
ToolRegistry, ToolRegistry,
AccessibilitySettings, AccessibilitySettings,
SandboxConfig, SandboxConfig,
} from '@gemini-cli/core'; } from '@google/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';
@ -68,9 +68,10 @@ interface MockServerConfig {
getAllGeminiMdFilenames: Mock<() => string[]>; getAllGeminiMdFilenames: Mock<() => string[]>;
} }
// Mock @gemini-cli/core and its Config class // Mock @google/gemini-cli-core and its Config class
vi.mock('@gemini-cli/core', async (importOriginal) => { vi.mock('@google/gemini-cli-core', async (importOriginal) => {
const actualCore = await importOriginal<typeof import('@gemini-cli/core')>(); const actualCore =
await importOriginal<typeof import('@google/gemini-cli-core')>();
const ConfigClassMock = vi const ConfigClassMock = vi
.fn() .fn()
.mockImplementation((optionsPassedToConstructor) => { .mockImplementation((optionsPassedToConstructor) => {

View File

@ -54,7 +54,7 @@ import {
ApprovalMode, ApprovalMode,
isEditorAvailable, isEditorAvailable,
EditorType, EditorType,
} from '@gemini-cli/core'; } from '@google/gemini-cli-core';
import { validateAuthMethod } from '../config/auth.js'; import { validateAuthMethod } from '../config/auth.js';
import { useLogger } from './hooks/useLogger.js'; import { useLogger } from './hooks/useLogger.js';
import { StreamingContext } from './contexts/StreamingContext.js'; import { StreamingContext } from './contexts/StreamingContext.js';

View File

@ -8,7 +8,7 @@ import { render } from 'ink-testing-library';
import { describe, it, expect, vi } from 'vitest'; import { describe, it, expect, vi } from 'vitest';
import { AuthDialog } from './AuthDialog.js'; import { AuthDialog } from './AuthDialog.js';
import { LoadedSettings, SettingScope } from '../../config/settings.js'; import { LoadedSettings, SettingScope } from '../../config/settings.js';
import { AuthType } from '@gemini-cli/core'; import { AuthType } from '@google/gemini-cli-core';
describe('AuthDialog', () => { describe('AuthDialog', () => {
const wait = (ms = 50) => new Promise((resolve) => setTimeout(resolve, ms)); const wait = (ms = 50) => new Promise((resolve) => setTimeout(resolve, ms));

View File

@ -9,7 +9,7 @@ import { Box, Text, useInput } from 'ink';
import { Colors } from '../colors.js'; import { Colors } from '../colors.js';
import { RadioButtonSelect } from './shared/RadioButtonSelect.js'; import { RadioButtonSelect } from './shared/RadioButtonSelect.js';
import { LoadedSettings, SettingScope } from '../../config/settings.js'; import { LoadedSettings, SettingScope } from '../../config/settings.js';
import { AuthType } from '@gemini-cli/core'; import { AuthType } from '@google/gemini-cli-core';
import { validateAuthMethod } from '../../config/auth.js'; import { validateAuthMethod } from '../../config/auth.js';
interface AuthDialogProps { interface AuthDialogProps {

View File

@ -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-cli/core'; import { ApprovalMode } from '@google/gemini-cli-core';
interface AutoAcceptIndicatorProps { interface AutoAcceptIndicatorProps {
approvalMode: ApprovalMode; approvalMode: ApprovalMode;

View File

@ -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-cli/core'; import { type MCPServerConfig } from '@google/gemini-cli-core';
interface ContextSummaryDisplayProps { interface ContextSummaryDisplayProps {
geminiMdFileCount: number; geminiMdFileCount: number;

View File

@ -14,7 +14,7 @@ import {
} from '../editors/editorSettingsManager.js'; } from '../editors/editorSettingsManager.js';
import { RadioButtonSelect } from './shared/RadioButtonSelect.js'; import { RadioButtonSelect } from './shared/RadioButtonSelect.js';
import { LoadedSettings, SettingScope } from '../../config/settings.js'; import { LoadedSettings, SettingScope } from '../../config/settings.js';
import { EditorType, isEditorAvailable } from '@gemini-cli/core'; import { EditorType, isEditorAvailable } from '@google/gemini-cli-core';
interface EditorDialogProps { interface EditorDialogProps {
onSelect: (editorType: EditorType | undefined, scope: SettingScope) => void; onSelect: (editorType: EditorType | undefined, scope: SettingScope) => void;

View File

@ -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, tokenLimit } from '@gemini-cli/core'; import { shortenPath, tildeifyPath, tokenLimit } from '@google/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';

View File

@ -18,7 +18,7 @@ import { Box } from 'ink';
import { AboutBox } from './AboutBox.js'; import { AboutBox } from './AboutBox.js';
import { StatsDisplay } from './StatsDisplay.js'; import { StatsDisplay } from './StatsDisplay.js';
import { SessionSummaryDisplay } from './SessionSummaryDisplay.js'; import { SessionSummaryDisplay } from './SessionSummaryDisplay.js';
import { Config } from '@gemini-cli/core'; import { Config } from '@google/gemini-cli-core';
interface HistoryItemDisplayProps { interface HistoryItemDisplayProps {
item: HistoryItem; item: HistoryItem;

View File

@ -7,7 +7,7 @@
import { render } from 'ink-testing-library'; import { render } from 'ink-testing-library';
import { InputPrompt, InputPromptProps } from './InputPrompt.js'; import { InputPrompt, InputPromptProps } from './InputPrompt.js';
import type { TextBuffer } from './shared/text-buffer.js'; import type { TextBuffer } from './shared/text-buffer.js';
import { Config } from '@gemini-cli/core'; import { Config } from '@google/gemini-cli-core';
import { vi } from 'vitest'; import { vi } from 'vitest';
import { useShellHistory } from '../hooks/useShellHistory.js'; import { useShellHistory } from '../hooks/useShellHistory.js';
import { useCompletion } from '../hooks/useCompletion.js'; import { useCompletion } from '../hooks/useCompletion.js';

View File

@ -18,7 +18,7 @@ import { useShellHistory } from '../hooks/useShellHistory.js';
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-cli/core'; import { Config } from '@google/gemini-cli-core';
export interface InputPromptProps { export interface InputPromptProps {
buffer: TextBuffer; buffer: TextBuffer;

View File

@ -4,7 +4,7 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import { ThoughtSummary } from '@gemini-cli/core'; import { ThoughtSummary } from '@google/gemini-cli-core';
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';

View File

@ -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-cli/core'; import { type Config } from '@google/gemini-cli-core';
interface TipsProps { interface TipsProps {
config: Config; config: Config;

View File

@ -7,7 +7,7 @@
import { render } from 'ink-testing-library'; import { render } from 'ink-testing-library';
import { describe, it, expect, vi } from 'vitest'; import { describe, it, expect, vi } from 'vitest';
import { ToolConfirmationMessage } from './ToolConfirmationMessage.js'; import { ToolConfirmationMessage } from './ToolConfirmationMessage.js';
import { ToolCallConfirmationDetails } from '@gemini-cli/core'; import { ToolCallConfirmationDetails } from '@google/gemini-cli-core';
describe('ToolConfirmationMessage', () => { describe('ToolConfirmationMessage', () => {
it('should not display urls if prompt and url are the same', () => { it('should not display urls if prompt and url are the same', () => {

View File

@ -14,7 +14,7 @@ import {
ToolExecuteConfirmationDetails, ToolExecuteConfirmationDetails,
ToolMcpConfirmationDetails, ToolMcpConfirmationDetails,
Config, Config,
} from '@gemini-cli/core'; } from '@google/gemini-cli-core';
import { import {
RadioButtonSelect, RadioButtonSelect,
RadioSelectItem, RadioSelectItem,

View File

@ -10,7 +10,7 @@ import { IndividualToolCallDisplay, ToolCallStatus } from '../../types.js';
import { ToolMessage } from './ToolMessage.js'; import { ToolMessage } from './ToolMessage.js';
import { ToolConfirmationMessage } from './ToolConfirmationMessage.js'; import { ToolConfirmationMessage } from './ToolConfirmationMessage.js';
import { Colors } from '../../colors.js'; import { Colors } from '../../colors.js';
import { Config } from '@gemini-cli/core'; import { Config } from '@google/gemini-cli-core';
interface ToolGroupMessageProps { interface ToolGroupMessageProps {
groupId: number; groupId: number;

View File

@ -11,7 +11,7 @@ import os from 'os';
import pathMod from 'path'; import pathMod from 'path';
import { useState, useCallback, useEffect, useMemo } from 'react'; import { useState, useCallback, useEffect, useMemo } from 'react';
import stringWidth from 'string-width'; import stringWidth from 'string-width';
import { unescapePath } from '@gemini-cli/core'; import { unescapePath } from '@google/gemini-cli-core';
import { toCodePoints, cpLen, cpSlice } from '../../utils/textUtils.js'; import { toCodePoints, cpLen, cpSlice } from '../../utils/textUtils.js';
export type Direction = export type Direction =

View File

@ -8,7 +8,7 @@ import {
allowEditorTypeInSandbox, allowEditorTypeInSandbox,
checkHasEditorType, checkHasEditorType,
type EditorType, type EditorType,
} from '@gemini-cli/core'; } from '@google/gemini-cli-core';
export interface EditorDisplay { export interface EditorDisplay {
name: string; name: string;

View File

@ -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-cli/core'; import { Config, FileDiscoveryService } from '@google/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-cli/core', async () => { vi.mock('@google/gemini-cli-core', async () => {
const actual = await vi.importActual('@gemini-cli/core'); const actual = await vi.importActual('@google/gemini-cli-core');
return { return {
...actual, ...actual,
FileDiscoveryService: vi.fn(), FileDiscoveryService: vi.fn(),

View File

@ -12,7 +12,7 @@ import {
getErrorMessage, getErrorMessage,
isNodeError, isNodeError,
unescapePath, unescapePath,
} from '@gemini-cli/core'; } from '@google/gemini-cli-core';
import { import {
HistoryItem, HistoryItem,
IndividualToolCallDisplay, IndividualToolCallDisplay,

View File

@ -7,7 +7,7 @@
import { act, renderHook } from '@testing-library/react'; import { act, renderHook } from '@testing-library/react';
import { vi } from 'vitest'; import { vi } from 'vitest';
import { useShellCommandProcessor } from './shellCommandProcessor'; import { useShellCommandProcessor } from './shellCommandProcessor';
import { Config, GeminiClient } from '@gemini-cli/core'; import { Config, GeminiClient } from '@google/gemini-cli-core';
import * as fs from 'fs'; import * as fs from 'fs';
import EventEmitter from 'events'; import EventEmitter from 'events';
@ -22,7 +22,7 @@ vi.mock('os', () => ({
platform: () => 'linux', platform: () => 'linux',
tmpdir: () => '/tmp', tmpdir: () => '/tmp',
})); }));
vi.mock('@gemini-cli/core'); vi.mock('@google/gemini-cli-core');
vi.mock('../utils/textUtils.js', () => ({ vi.mock('../utils/textUtils.js', () => ({
isBinary: vi.fn(), isBinary: vi.fn(),
})); }));

View File

@ -8,7 +8,7 @@ import { spawn } from 'child_process';
import { StringDecoder } from 'string_decoder'; import { StringDecoder } from 'string_decoder';
import type { HistoryItemWithoutId } from '../types.js'; import type { HistoryItemWithoutId } from '../types.js';
import { useCallback } from 'react'; import { useCallback } from 'react';
import { Config, GeminiClient } from '@gemini-cli/core'; import { Config, GeminiClient } from '@google/gemini-cli-core';
import { type PartListUnion } from '@google/genai'; import { type PartListUnion } from '@google/genai';
import { formatMemoryUsage } from '../utils/formatters.js'; import { formatMemoryUsage } from '../utils/formatters.js';
import { isBinary } from '../utils/textUtils.js'; import { isBinary } from '../utils/textUtils.js';

View File

@ -68,7 +68,7 @@ import {
getMCPDiscoveryState, getMCPDiscoveryState,
getMCPServerStatus, getMCPServerStatus,
GeminiClient, GeminiClient,
} from '@gemini-cli/core'; } from '@google/gemini-cli-core';
import { useSessionStats } from '../contexts/SessionContext.js'; import { useSessionStats } from '../contexts/SessionContext.js';
import { LoadedSettings } from '../../config/settings.js'; import { LoadedSettings } from '../../config/settings.js';
@ -712,7 +712,7 @@ Add any other context about the problem here.
describe('/mcp command', () => { describe('/mcp command', () => {
beforeEach(() => { beforeEach(() => {
// Mock the core module with getMCPServerStatus and getMCPDiscoveryState // Mock the core module with getMCPServerStatus and getMCPDiscoveryState
vi.mock('@gemini-cli/core', async (importOriginal) => { vi.mock('@google/gemini-cli-core', async (importOriginal) => {
const actual = await importOriginal(); const actual = await importOriginal();
return { return {
...actual, ...actual,

View File

@ -18,7 +18,7 @@ import {
MCPServerStatus, MCPServerStatus,
getMCPDiscoveryState, getMCPDiscoveryState,
getMCPServerStatus, getMCPServerStatus,
} from '@gemini-cli/core'; } from '@google/gemini-cli-core';
import { useSessionStats } from '../contexts/SessionContext.js'; import { useSessionStats } from '../contexts/SessionContext.js';
import { import {
Message, Message,

View File

@ -11,7 +11,7 @@ import {
Config, Config,
clearCachedCredentialFile, clearCachedCredentialFile,
getErrorMessage, getErrorMessage,
} from '@gemini-cli/core'; } from '@google/gemini-cli-core';
async function performAuthFlow(authMethod: AuthType, config: Config) { async function performAuthFlow(authMethod: AuthType, config: Config) {
await config.refreshAuth(authMethod); await config.refreshAuth(authMethod);

View File

@ -20,14 +20,14 @@ import {
Config, Config,
Config as ActualConfigType, Config as ActualConfigType,
ApprovalMode, ApprovalMode,
} from '@gemini-cli/core'; } from '@google/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-cli/core', async () => { vi.mock('@google/gemini-cli-core', async () => {
const actualServerModule = (await vi.importActual( const actualServerModule = (await vi.importActual(
'@gemini-cli/core', '@google/gemini-cli-core',
)) as Record<string, unknown>; )) as Record<string, unknown>;
return { return {
...actualServerModule, ...actualServerModule,

View File

@ -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-cli/core'; import { ApprovalMode, type Config } from '@google/gemini-cli-core';
export interface UseAutoAcceptIndicatorArgs { export interface UseAutoAcceptIndicatorArgs {
config: Config; config: Config;

View File

@ -9,13 +9,13 @@ 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-cli/core'; import { FileDiscoveryService } from '@google/gemini-cli-core';
import { glob } from 'glob'; import { glob } from 'glob';
// Mock dependencies // Mock dependencies
vi.mock('fs/promises'); vi.mock('fs/promises');
vi.mock('@gemini-cli/core', async () => { vi.mock('@google/gemini-cli-core', async () => {
const actual = await vi.importActual('@gemini-cli/core'); const actual = await vi.importActual('@google/gemini-cli-core');
return { return {
...actual, ...actual,
FileDiscoveryService: vi.fn(), FileDiscoveryService: vi.fn(),

View File

@ -15,7 +15,7 @@ import {
getErrorMessage, getErrorMessage,
Config, Config,
FileDiscoveryService, FileDiscoveryService,
} from '@gemini-cli/core'; } from '@google/gemini-cli-core';
import { import {
MAX_SUGGESTIONS_TO_SHOW, MAX_SUGGESTIONS_TO_SHOW,
Suggestion, Suggestion,

View File

@ -22,10 +22,10 @@ import {
type EditorType, type EditorType,
checkHasEditorType, checkHasEditorType,
allowEditorTypeInSandbox, allowEditorTypeInSandbox,
} from '@gemini-cli/core'; } from '@google/gemini-cli-core';
vi.mock('@gemini-cli/core', async () => { vi.mock('@google/gemini-cli-core', async () => {
const actual = await vi.importActual('@gemini-cli/core'); const actual = await vi.importActual('@google/gemini-cli-core');
return { return {
...actual, ...actual,
checkHasEditorType: vi.fn(() => true), checkHasEditorType: vi.fn(() => true),

View File

@ -11,7 +11,7 @@ import {
allowEditorTypeInSandbox, allowEditorTypeInSandbox,
checkHasEditorType, checkHasEditorType,
EditorType, EditorType,
} from '@gemini-cli/core'; } from '@google/gemini-cli-core';
interface UseEditorSettingsReturn { interface UseEditorSettingsReturn {
isEditorDialogOpen: boolean; isEditorDialogOpen: boolean;

View File

@ -16,7 +16,7 @@ import {
TrackedExecutingToolCall, TrackedExecutingToolCall,
TrackedCancelledToolCall, TrackedCancelledToolCall,
} from './useReactToolScheduler.js'; } from './useReactToolScheduler.js';
import { Config, EditorType, AuthType } from '@gemini-cli/core'; import { Config, EditorType, AuthType } from '@google/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';
import { HistoryItem, MessageType, StreamingState } from '../types.js'; import { HistoryItem, MessageType, StreamingState } from '../types.js';
@ -42,7 +42,7 @@ const MockedUserPromptEvent = vi.hoisted(() =>
vi.fn().mockImplementation(() => {}), vi.fn().mockImplementation(() => {}),
); );
vi.mock('@gemini-cli/core', async (importOriginal) => { vi.mock('@google/gemini-cli-core', async (importOriginal) => {
const actualCoreModule = (await importOriginal()) as any; const actualCoreModule = (await importOriginal()) as any;
return { return {
...actualCoreModule, ...actualCoreModule,

View File

@ -24,7 +24,7 @@ import {
ThoughtSummary, ThoughtSummary,
UnauthorizedError, UnauthorizedError,
UserPromptEvent, UserPromptEvent,
} from '@gemini-cli/core'; } from '@google/gemini-cli-core';
import { type Part, type PartListUnion } from '@google/genai'; import { type Part, type PartListUnion } from '@google/genai';
import { import {
StreamingState, StreamingState,

View File

@ -5,7 +5,7 @@
*/ */
import { useState, useEffect } from 'react'; import { useState, useEffect } from 'react';
import { sessionId, Logger } from '@gemini-cli/core'; import { sessionId, Logger } from '@google/gemini-cli-core';
/** /**
* Hook to manage the logger instance. * Hook to manage the logger instance.

View File

@ -21,7 +21,7 @@ import {
ToolCall, ToolCall,
Status as CoreStatus, Status as CoreStatus,
EditorType, EditorType,
} from '@gemini-cli/core'; } from '@google/gemini-cli-core';
import { useCallback, useState, useMemo } from 'react'; import { useCallback, useState, useMemo } from 'react';
import { import {
HistoryItemToolGroup, HistoryItemToolGroup,

View File

@ -7,7 +7,7 @@
import { useState, useEffect, useCallback } from 'react'; import { useState, useEffect, useCallback } from 'react';
import * as fs from 'fs/promises'; import * as fs from 'fs/promises';
import * as path from 'path'; import * as path from 'path';
import { isNodeError, getProjectTempDir } from '@gemini-cli/core'; import { isNodeError, getProjectTempDir } from '@google/gemini-cli-core';
const HISTORY_FILE = 'shell_history'; const HISTORY_FILE = 'shell_history';
const MAX_HISTORY_LENGTH = 100; const MAX_HISTORY_LENGTH = 100;

View File

@ -5,7 +5,7 @@
*/ */
import { Message, MessageType } from '../types.js'; import { Message, MessageType } from '../types.js';
import { Config } from '@gemini-cli/core'; import { Config } from '@google/gemini-cli-core';
import { LoadedSettings } from '../../config/settings.js'; import { LoadedSettings } from '../../config/settings.js';
export function createShowMemoryAction( export function createShowMemoryAction(

View File

@ -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-cli/core'; } from '@google/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-cli/core', async () => { vi.mock('@google/gemini-cli-core', async () => {
const actual = await vi.importActual('@gemini-cli/core'); const actual = await vi.importActual('@google/gemini-cli-core');
return { return {
...actual, ...actual,
ToolRegistry: vi.fn(), ToolRegistry: vi.fn(),

View File

@ -7,7 +7,7 @@
import { import {
ToolCallConfirmationDetails, ToolCallConfirmationDetails,
ToolResultDisplay, ToolResultDisplay,
} from '@gemini-cli/core'; } from '@google/gemini-cli-core';
import { CumulativeStats } from './contexts/SessionContext.js'; import { CumulativeStats } from './contexts/SessionContext.js';
// Only defining the state enum needed by the UI // Only defining the state enum needed by the UI

View File

@ -6,7 +6,7 @@
import { describe, it, expect } from 'vitest'; import { describe, it, expect } from 'vitest';
import { parseAndFormatApiError } from './errorParsing.js'; import { parseAndFormatApiError } from './errorParsing.js';
import { AuthType, StructuredError } from '@gemini-cli/core'; import { AuthType, StructuredError } from '@google/gemini-cli-core';
describe('parseAndFormatApiError', () => { describe('parseAndFormatApiError', () => {
const enterpriseMessage = 'upgrade to a plan with higher limits'; const enterpriseMessage = 'upgrade to a plan with higher limits';

View File

@ -4,7 +4,7 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import { AuthType, StructuredError } from '@gemini-cli/core'; import { AuthType, StructuredError } from '@google/gemini-cli-core';
const RATE_LIMIT_ERROR_MESSAGE_GOOGLE = const RATE_LIMIT_ERROR_MESSAGE_GOOGLE =
'\nPlease wait and try again later. To increase your limits, upgrade to a plan with higher limits, or use /auth to switch to using a paid API key from AI Studio at https://aistudio.google.com/apikey'; '\nPlease wait and try again later. To increase your limits, upgrade to a plan with higher limits, or use /auth to switch to using a paid API key from AI Studio at https://aistudio.google.com/apikey';

View File

@ -6,7 +6,7 @@
import { promises as fs } from 'fs'; import { promises as fs } from 'fs';
import { join } from 'path'; import { join } from 'path';
import { getProjectTempDir } from '@gemini-cli/core'; import { getProjectTempDir } from '@google/gemini-cli-core';
export async function cleanupCheckpoints() { export async function cleanupCheckpoints() {
const tempDir = getProjectTempDir(process.cwd()); const tempDir = getProjectTempDir(process.cwd());

View File

@ -15,7 +15,7 @@ import {
SETTINGS_DIRECTORY_NAME, SETTINGS_DIRECTORY_NAME,
} from '../config/settings.js'; } from '../config/settings.js';
import { promisify } from 'util'; import { promisify } from 'util';
import { SandboxConfig } from '@gemini-cli/core'; import { SandboxConfig } from '@google/gemini-cli-core';
const execAsync = promisify(exec); const execAsync = promisify(exec);

View File

@ -7,10 +7,10 @@
import { describe, it, expect, vi, beforeEach } from 'vitest'; import { describe, it, expect, vi, beforeEach } from 'vitest';
import { getStartupWarnings } from './startupWarnings.js'; import { getStartupWarnings } from './startupWarnings.js';
import * as fs from 'fs/promises'; import * as fs from 'fs/promises';
import { getErrorMessage } from '@gemini-cli/core'; import { getErrorMessage } from '@google/gemini-cli-core';
vi.mock('fs/promises'); vi.mock('fs/promises');
vi.mock('@gemini-cli/core', async (importOriginal) => { vi.mock('@google/gemini-cli-core', async (importOriginal) => {
const actual = await importOriginal(); const actual = await importOriginal();
return { return {
...actual, ...actual,

View File

@ -7,7 +7,7 @@
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-cli/core'; import { getErrorMessage } from '@google/gemini-cli-core';
const warningsFilePath = pathJoin(os.tmpdir(), 'gemini-cli-warnings.txt'); const warningsFilePath = pathJoin(os.tmpdir(), 'gemini-cli-warnings.txt');

View File

@ -1,11 +1,11 @@
{ {
"name": "@gemini-cli/core", "name": "@google/gemini-cli-core",
"version": "0.1.0", "version": "0.1.0",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@gemini-cli/core", "name": "@google/gemini-cli-core",
"version": "0.1.0", "version": "0.1.0",
"dependencies": { "dependencies": {
"@google/genai": "^1.4.0", "@google/genai": "^1.4.0",

View File

@ -1,5 +1,5 @@
{ {
"name": "@gemini-cli/core", "name": "@google/gemini-cli-core",
"version": "0.1.0", "version": "0.1.0",
"description": "Gemini CLI Server", "description": "Gemini CLI Server",
"type": "module", "type": "module",

View File

@ -77,18 +77,23 @@ if (!argv.s) {
execSync('npm run build --workspaces', { stdio: 'inherit' }); execSync('npm run build --workspaces', { stdio: 'inherit' });
} }
console.log('packing @gemini-cli/cli ...'); console.log('packing @google/gemini-cli ...');
const cliPackageDir = join('packages', 'cli'); const cliPackageDir = join('packages', 'cli');
rmSync(join(cliPackageDir, 'dist', 'gemini-cli-cli-*.tgz'), { force: true }); rmSync(join(cliPackageDir, 'dist', 'google-gemini-cli-*.tgz'), { force: true });
execSync(`npm pack -w @gemini-cli/cli --pack-destination ./packages/cli/dist`, {
stdio: 'ignore',
});
console.log('packing @gemini-cli/core ...');
const corePackageDir = join('packages', 'core');
rmSync(join(corePackageDir, 'dist', 'gemini-cli-core-*.tgz'), { force: true });
execSync( execSync(
`npm pack -w @gemini-cli/core --pack-destination ./packages/core/dist`, `npm pack -w @google/gemini-cli --pack-destination ./packages/cli/dist`,
{
stdio: 'ignore',
},
);
console.log('packing @google/gemini-cli-core ...');
const corePackageDir = join('packages', 'core');
rmSync(join(corePackageDir, 'dist', 'google-gemini-cli-core-*.tgz'), {
force: true,
});
execSync(
`npm pack -w @google/gemini-cli-core --pack-destination ./packages/core/dist`,
{ stdio: 'ignore' }, { stdio: 'ignore' },
); );
@ -97,11 +102,11 @@ const packageVersion = JSON.parse(
).version; ).version;
chmodSync( chmodSync(
join(cliPackageDir, 'dist', `gemini-cli-cli-${packageVersion}.tgz`), join(cliPackageDir, 'dist', `google-gemini-cli-${packageVersion}.tgz`),
0o755, 0o755,
); );
chmodSync( chmodSync(
join(corePackageDir, 'dist', `gemini-cli-core-${packageVersion}.tgz`), join(corePackageDir, 'dist', `google-gemini-cli-core-${packageVersion}.tgz`),
0o755, 0o755,
); );